Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1307221ybi; Wed, 17 Jul 2019 12:57:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqxBDuuLZHKjUPiA3GrqIMiYCDCW6RbXIbUDDkqJkpMQATtZt4k4Yq8eP7oBG7rt+dwYAIkJ X-Received: by 2002:a17:902:b582:: with SMTP id a2mr46055177pls.128.1563393446410; Wed, 17 Jul 2019 12:57:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563393446; cv=none; d=google.com; s=arc-20160816; b=CfocdJ9pSYJztH67rdy3OCD3r+yHOY8SAhO+meYj3115dsjXPLNOsgMZCkgka3mqmm 5LTCmt74xMLdo+lrmQvhJC8z1zKCni9rlcAuzeevsmst7YE+5TFkaY+0jkyiIJW71v++ 8Pp051uWfIUeHjKZ0kLnOWqE49tgh+dHydjsUDHbIjwNKxiyjA8EHY9lr0o/jqDpcQY0 AiPGXyJ/6lwBWiibKk9J32WZovCYkYIHIy72CS7aGWMbGvzHKNJvH6iB+NZFCxCgHuY/ 0up98XCYi4ExXrSmXXPBv/jxvBWrwHI4NwLtO7olnriNEGU81TAkyogk/aSCa3rz1n9c nQIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=aBrxeytKOurZQ+nCGd8l34FcDLimTqnxqGL9K+vrwnQ=; b=v2Cfk5MpzuTwSlIcXY4ZV2zq9AC/qHu35Qf65moOXmeSqU4hxNn1zxNxEyX7m5CjSB 0eRmLr2aRKc4D+hjRJq3e3GqWtFUnP0wPdCfCMS0aJsyJxYxclyaHibHGNnnAf/A4V+r zacTESzrEXi5aOen/3Gm9pT9mfNjpGqNgWHqqhJm1R5pn1+rP0kwy9BnRH7VbhVJvlNL kp40BgATJRZUTyyqFPX7jN+436qQvB9z7LqrNyHq7QpIeeqnBryloUyaPKSTsVKi/OvH W2JHuZl+LXyz13PWJj05cVioBqRo/ZF1IgV1FwZZUehJepE0oenrifdyy1LfSoQVwJzm nezA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@silvair-com.20150623.gappssmtp.com header.s=20150623 header.b=NbRN3keU; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h1si17771121pls.183.2019.07.17.12.57.09; Wed, 17 Jul 2019 12:57:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@silvair-com.20150623.gappssmtp.com header.s=20150623 header.b=NbRN3keU; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726917AbfGQTxg (ORCPT + 99 others); Wed, 17 Jul 2019 15:53:36 -0400 Received: from mail-lf1-f47.google.com ([209.85.167.47]:39950 "EHLO mail-lf1-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726063AbfGQTxg (ORCPT ); Wed, 17 Jul 2019 15:53:36 -0400 Received: by mail-lf1-f47.google.com with SMTP id b17so17419709lff.7 for ; Wed, 17 Jul 2019 12:53:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silvair-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=aBrxeytKOurZQ+nCGd8l34FcDLimTqnxqGL9K+vrwnQ=; b=NbRN3keUi93ecBfT0n444K69uHp+cz7V0/qwgdB3FcNIOBFiRNjA0DtAu5OOhj4kxB +b85YaR/2BlDgXtdi0jl/OSOQcjH9fqYjmhG2KRkmsUNgYq5Mzz5ALkxVENsjsB6tBgW SneXQgHnVgJIlJuH5bis6Ty1J/Fu2TabOtiAzps0vUlE+6hqJZx0vMywichk7diGk0zR dF/ZjFPbFw0f1tbBfuZ8S7UTLsW757HfV7p7f/5TA6MdQ5alEh9OYQtfN5nzt+rJ+gu8 5DI2UzSi9UgCbq+9lmHX/LnbF/DSRDPQVhNGPHSutROJwgRwuuJeW+DzboP5nr8VDVT3 cKpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=aBrxeytKOurZQ+nCGd8l34FcDLimTqnxqGL9K+vrwnQ=; b=Je/EYVsW6HkhOC7kWCvxLqZPLskwsdPO/Q3KAGjU6E6q7YA1a+SPkzbH/FbfGOha49 Zr095HCRuGx27lira7VXUOZAsY+nagxwe8SMH0mzTkAAvre0EJOUzL/2wAW6fu3tZ1Mm O1lJ1G/a1S/9+dNKDHOWsOYDQoUVgYe0gTFoWY22Ms/noaPMuBe6ZMUUteHH0zAEWtOT 2PD6uWCACVl/yStGpJUUuKvhoQMisrwMEhM7Tg26/ERsAjVjz/JBMl4O3A1eom33W5yk g2zb4DkOqHq8ND6UHy+oaNxjVJNNEBFKTxKpBXDXpURytbJeqS05isBTPU8Qr19LD8bc 7EJw== X-Gm-Message-State: APjAAAW2gOTudl3OO4rnMbs1kObdeVc1RuSYt4S4NM/+OhP/FxNr9/g4 RED+4qv333OqBNpl4LJz5FEa7s3lzGk= X-Received: by 2002:a19:c1cc:: with SMTP id r195mr18450054lff.95.1563393214329; Wed, 17 Jul 2019 12:53:34 -0700 (PDT) Received: from kynes.internet.domowy (apn-77-112-37-101.dynamic.gprs.plus.pl. [77.112.37.101]) by smtp.gmail.com with ESMTPSA id 2sm4643181lji.94.2019.07.17.12.53.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Jul 2019 12:53:33 -0700 (PDT) From: =?UTF-8?q?Micha=C5=82=20Lowas-Rzechonek?= To: linux-bluetooth@vger.kernel.org Subject: [RFC BlueZ 0/2] Use composition data to validate app against the node Date: Wed, 17 Jul 2019 21:53:26 +0200 Message-Id: <20190717195328.16322-1-michal.lowas-rzechonek@silvair.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This patchset streamlines app validation by creating a temporary node during Join, CreateNetwork and ImportLocalNode calls and then comparing temporary composition data with one generated for already existing node. In case of Attach call, the temporary node is simply added to the list. TODO: Composition data generation needs to validate node structure, checking that: - primary element exists - mandatory models are where they should be - there are no gaps in element indexes - ... possibly a few more things MichaƂ Lowas-Rzechonek (2): mesh: Keep model list sorted and unique mesh: Validate application by comparing composition data mesh/cfgmod-server.c | 14 +- mesh/mesh-defs.h | 2 + mesh/node.c | 453 ++++++++++++++++++------------------------- 3 files changed, 198 insertions(+), 271 deletions(-) -- 2.22.0