Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1803215ybg; Sat, 19 Oct 2019 02:51:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqwTSIxKDY/YkpfaInhKPth9skrO+LEG9BOVGEIcGon0cqx+xO7JSKJONEianLTRCGP2qqRV X-Received: by 2002:a50:ed84:: with SMTP id h4mr13982596edr.124.1571478673793; Sat, 19 Oct 2019 02:51:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1571478673; cv=pass; d=google.com; s=arc-20160816; b=vFogsarsGIfImU3Yh890sJH5JEtg/omYChfPXIb6WI/80u5nAu3GM06fuDBnu5cpPu 5Nxk/PK03OdpEa9A3dZrEOUZFVXwushaoNC35UnTuS9Sfkx3y5ZBvBJZ3CKDz4WzRX0B zdpxMjELwWWvrhKR7dCuan8Io+iLqjXFuXGVP0sWoGtv+KZl7eRHGrJdf/XneYtBRlTZ WKGXrjA3GD+yK2HdfaouHrEsa/K+HA60denTmxQDJ6iuCGRLNTzqFrpUlVdvDyGeuUqF CELDlACkm92afsU/0dBrHU31i3B3wAr4REp+lRBb0xmWxaKax4N19e4k71llFgtKRl6T yzKQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=O2QQ0H5T4+u5WdjO6sdauXSnM8vpvekzG14MyJdnDbI=; b=fHyaRlUtp9B4YdFLt3B/i6Ys0oHiXQiIqGHHjYzUlUrgid/Q/30QS3fgZcB1oOc4no QJCFSxUizrfnayR+gK1ev4/fa27gfTyN1xxCdJ1IoKNbWBBxclWyQZmLj/9Cfj/qNXdQ gXm+278ebV2cc0l8ZMTpyk8ys3WvsmYMQ75N61v5TsUpB9Xl876M/UYpeMQA9MxswNah exPJ2BGkeZOwPMtSKBGEfoO603ssZmJm2+kY6SZddTn7TSwY8RediGEJMnGsHjnbfHgV bbOXAuyR6wByZoUhGS5gB4ZSuP4L237PEBSXGBz++ZBD8FtmGsrfS3j6XOSnjw0V/wV8 ks/A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=AcuiVfBB; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id va9si4998405ejb.126.2019.10.19.02.50.48; Sat, 19 Oct 2019 02:51:13 -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=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=AcuiVfBB; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725933AbfJSBKO (ORCPT + 99 others); Fri, 18 Oct 2019 21:10:14 -0400 Received: from mga14.intel.com ([192.55.52.115]:31464 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725911AbfJSBKO (ORCPT ); Fri, 18 Oct 2019 21:10:14 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Oct 2019 18:10:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,313,1566889200"; d="scan'208";a="202865846" Received: from orsmsx107.amr.corp.intel.com ([10.22.240.5]) by FMSMGA003.fm.intel.com with ESMTP; 18 Oct 2019 18:10:13 -0700 Received: from orsmsx125.amr.corp.intel.com (10.22.240.125) by ORSMSX107.amr.corp.intel.com (10.22.240.5) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 18 Oct 2019 18:10:13 -0700 Received: from ORSEDG001.ED.cps.intel.com (10.7.248.4) by ORSMSX125.amr.corp.intel.com (10.22.240.125) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 18 Oct 2019 18:10:13 -0700 Received: from NAM01-BY2-obe.outbound.protection.outlook.com (104.47.34.57) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 18 Oct 2019 18:10:13 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aDx3+B8336b6opcLt7/hdOdX9OGrnm0Ucnmce5sIXrC/s1CDOJ9hCx+t1fWDCmp5zBYuOgF5bSgjyiPXV1thyNrcLP+ZM4cHaYFMTfBPv2osBxf+tulbRYMoeh1CeHAs1mOg13K5di0XFcr0NkVDFG7N+mquCmHXaH13JBI78PJ1rcwZQtWSt5EZpygZTpd1GhZDHbg97FPqrhcuk2Br2ckprvl4+XIeb385xTWmgo8gnwPIR723v0NJbN3+6c+gctrtm/1ibCcwBN8kAzAEpT/8+tGdsFxCKHz3zHZyyiNIam8RUV8MIphGLaR6BH1nj4VpzUC3YUefG2eA4lYsQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=O2QQ0H5T4+u5WdjO6sdauXSnM8vpvekzG14MyJdnDbI=; b=ODChkv8fa2JV2lzO+SfRBNN0xxjCDLMqNzViB4Zycg2GLkT/7BIkJZSG+8zUj4VuHm2jgNPBe41HAv6KfhMeRzXcLCd3T0v7B1d7D24b1kNCAGexAiX/YmPmS1/IRN1pCMyG2khrHLWUJJuoqPPZrn3KLOcwA8l3hbt8KXHp6SL6Xgq1+i7bnk48BCLdfY82v/b1a8RDKzAVJk4KTuZJOXxp5/LdEmpm5OWfEt9VVHSXnKv7L+2zmxkWrnv+TUZ8+7V36QCWQM7VMFFo2y2kj7fFwh9e1WYaPXH3l/pVUFeT9CM1+mvAmJ5nPTPmfX0jRjbv8LTRy2jZtVJb9rOu+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=O2QQ0H5T4+u5WdjO6sdauXSnM8vpvekzG14MyJdnDbI=; b=AcuiVfBBP4aqsQmccnSRMpabPcgAkz/DcKeeWOX+Ye4WZiuNKIvPSqinyNWy6oa7/AkxwchmZ0eeNM2wPYJqzBiAkDo6gq+fI1kxayydEmi+6viJXRYRWl7FUiTSH1DHLHUYHK9PnewfPIUhDqHdh/AygcwKSVh9KJbzDJDwq+0= Received: from CY4PR1101MB2262.namprd11.prod.outlook.com (10.172.76.7) by CY4PR1101MB2230.namprd11.prod.outlook.com (10.172.78.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.16; Sat, 19 Oct 2019 01:10:11 +0000 Received: from CY4PR1101MB2262.namprd11.prod.outlook.com ([fe80::c6d:ebf:5ae2:7501]) by CY4PR1101MB2262.namprd11.prod.outlook.com ([fe80::c6d:ebf:5ae2:7501%10]) with mapi id 15.20.2367.019; Sat, 19 Oct 2019 01:10:11 +0000 From: "Gix, Brian" To: "Stotland, Inga" CC: "linux-bluetooth@vger.kernel.org" Subject: Re: [PATCH BlueZ v2] mesh: Implement AddAppKey and AddNetKey methods Thread-Topic: [PATCH BlueZ v2] mesh: Implement AddAppKey and AddNetKey methods Thread-Index: AQHVhTWYGxXg31ZFE0aQYNWO0w5pZqdhKXuA Date: Sat, 19 Oct 2019 01:10:10 +0000 Message-ID: References: <20191017215500.9185-1-inga.stotland@intel.com> In-Reply-To: <20191017215500.9185-1-inga.stotland@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=brian.gix@intel.com; x-originating-ip: [97.126.75.253] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b8c7d31a-1c3c-41ad-6116-08d7543116e1 x-ms-traffictypediagnostic: CY4PR1101MB2230: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5516; x-forefront-prvs: 01952C6E96 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(376002)(396003)(346002)(136003)(39860400002)(366004)(199004)(189003)(26005)(91956017)(66556008)(25786009)(64756008)(66946007)(102836004)(14444005)(446003)(33656002)(486006)(66476007)(66066001)(256004)(76176011)(186003)(76116006)(476003)(2616005)(11346002)(66446008)(6506007)(53546011)(71190400001)(2906002)(86362001)(7736002)(305945005)(36756003)(6116002)(3846002)(71200400001)(37006003)(316002)(99286004)(5660300002)(6636002)(6512007)(81166006)(478600001)(6486002)(6862004)(6436002)(8676002)(8936002)(4326008)(14454004)(229853002)(6246003)(81156014);DIR:OUT;SFP:1102;SCL:1;SRVR:CY4PR1101MB2230;H:CY4PR1101MB2262.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: esrPENIlNeLJiGBdZyFaBub9dwyQiMp//3jz1eE68TtAbCG1hzCvGVljdnX3R7Gwa75bCZs7obhVxp30v+qb1X0no+e2edl2YotEgvxzl8IRO9qHo5cOBoZ28uqz/kQd6R0Rsu2Fhw0ffwJFyQbgfMheArlO7JtyEH19LI6nYoJi45VyVrNQ3A03LiBSse1qTYPczett8MjgWqLka/XgfDoouQpSzWb2G3IaFbjVE72I5r0OkgMeDtbVzKJE0eRSRIK8V+WGtERPemsJaym8U6rAoxGKuWGS/H9QDzZutDTePYahSnAG0I25/GY65NWA8qbQutJcye63qKzZHLIiCPT4oblnki5/NJjhqMXJ6DFnCQXsOoeIH60wzVQsxNyRJwHblbMW7RsMWjd4JsFMC4Nf1tNb8sLvpJFKgq5EaJs= Content-Type: text/plain; charset="utf-8" Content-ID: Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: b8c7d31a-1c3c-41ad-6116-08d7543116e1 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Oct 2019 01:10:10.6016 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: RMVuQfDcnC/P5J4zy8YgXoUmimsbVQ11mFHzI4l9Jho2su1GB2TgCzlo7dE5hqVknoNB01NNVAf+7h/58kbmpg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1101MB2230 X-OriginatorOrg: intel.com Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org QXBwbGllZC4NCg0KPiBPbiBPY3QgMTcsIDIwMTksIGF0IDI6NTUgUE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ZW50X3BhdGgsIGVsZV9wYXRoKTsNCj4gKyAgICBpZiAoIWVsZSkNCj4gKyAg ICAgICAgcmV0dXJuIGRidXNfZXJyb3IobXNnLCBNRVNIX0VSUk9SX05PVF9GT1VORCwNCj4gKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAiRWxlbWVudCBub3QgZm91bmQiKTsNCj4gKw0KPiAr ICAgIHNyYyA9IG5vZGVfZ2V0X3ByaW1hcnkobm9kZSkgKyBlbGUtPmlkeDsNCj4gKw0KPiArICAg IGlmICgha2V5cmluZ19nZXRfbmV0X2tleShub2RlLCBzdWJfaWR4LCAma2V5KSkNCj4gKyAgICAg ICAgcmV0dXJuIGRidXNfZXJyb3IobXNnLCBNRVNIX0VSUk9SX05PVF9GT1VORCwNCj4gKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAiTmV0S2V5IG5vdCBmb3VuZCIpOw0KPiArDQo+ICsgICAg aWYgKCF1cGRhdGUpIHsNCj4gKyAgICAgICAgbF9wdXRfYmUxNihPUF9ORVRLRVlfQURELCBkYXRh KTsNCj4gKw0KPiArICAgICAgICBpZiAoa2V5LnBoYXNlICE9IEtFWV9SRUZSRVNIX1BIQVNFX1RX TykNCj4gKyAgICAgICAgICAgIG1lbWNweShkYXRhICsgNCwga2V5Lm9sZF9rZXksIDE2KTsNCj4g KyAgICAgICAgZWxzZQ0KPiArICAgICAgICAgICAgbWVtY3B5KGRhdGEgKyA0LCBrZXkubmV3X2tl eSwgMTYpOw0KPiArICAgIH0gZWxzZSB7DQo+ICsgICAgICAgIGlmIChrZXkucGhhc2UgIT0gS0VZ X1JFRlJFU0hfUEhBU0VfT05FKQ0KPiArICAgICAgICAgICAgcmV0dXJuIGRidXNfZXJyb3IobXNn LCBNRVNIX0VSUk9SX0ZBSUxFRCwNCj4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiQ2Fu bm90IHVwZGF0ZSIpOw0KPiArICAgICAgICBsX3B1dF9iZTE2KE9QX05FVEtFWV9VUER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GT1VORCwNCj4gKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAiQXBwS2V5IG5vdCBmb3VuZCIpOw0KPiArDQo+ICsgICAgaWYgKCFrZXlyaW5n X2dldF9uZXRfa2V5KG5vZGUsIGFwcF9rZXkubmV0X2lkeCwgJm5ldF9rZXkpKSB7DQo+ICsgICAg ICAgIHJldHVybiBkYnVzX2Vycm9yKG1zZywgTUVTSF9FUlJPUl9OT1RfRk9VTkQsDQo+ICsgICAg ICAgICAgICAgICAgICAgICAgICAiQm91bmQgTmV0S2V5IG5vdCBmb3VuZCIpOw0KPiArICAgIH0N Cj4gKw0KPiArICAgIGlmICghdXBkYXRlKSB7DQo+ICsgICAgICAgIGRhdGFbMF0gPSBPUF9BUFBL RVlfQUREOw0KPiArICAgICAgICBpZiAobmV0X2tleS5waGFzZSAhPSBLRVlfUkVGUkVTSF9QSEFT RV9UV08pDQo+ICsgICAgICAgICAgICBtZW1jcHkoZGF0YSArIDQsIGFwcF9rZXkub2xkX2tleSwg MTYpOw0KPiArICAgICAgICBlbHNlDQo+ICsgICAgICAgICAgICBtZW1jcHkoZGF0YSArIDQsIGFw cF9rZXkubmV3X2tleSwgMTYpOw0KPiArICAgIH0gZWxzZSB7DQo+ICsgICAgICAgIGlmIChuZXRf a2V5LnBoYXNlICE9IEtFWV9SRUZSRVNIX1BIQVNFX09ORSkNCj4gKyAgICAgICAgICAgIHJldHVy biBkYnVzX2Vycm9yKG1zZywgTUVTSF9FUlJPUl9GQUlMRUQsDQo+ICsgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIkNhbm5vdCB1cGRhdGUiKTsNCj4gKyAgICAgICAgZGF0YVswXSA9IE9QX0FQ UEtFWV9VUERBVEU7DQo+ICsgICAgICAgIG1lbWNweShkYXRhICsgNCwgYXBwX2tleS5uZXdfa2V5 LCAxNik7DQo+ICsgICAgfQ0KPiArDQo+ICsgICAgLyogUGFjayBib3VuZCBOZXRLZXkgYW5kIEFw cEtleSBpbnRvIDMgb2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hIik7DQo+ICsgICAgbF9k YnVzX2ludGVyZmFjZV9tZXRob2QoaWZhY2UsICJBZGROZXRLZXkiLCAwLCBhZGRfbmV0a2V5X2Nh bGwsICIiLA0KPiArICAgICAgICAgICAgICAgICAgICAib3FxcWIiLCAiZWxlbWVudF9wYXRoIiwg ImRlc3RpbmF0aW9uIiwNCj4gKyAgICAgICAgICAgICAgICAgICAgInN1Ym5ldF9pbmRleCIsICJu ZXRfaW5kZXgiLCAidXBkYXRlIik7DQo+ICsgICAgbF9kYnVzX2ludGVyZmFjZV9tZXRob2QoaWZh Y2UsICJBZGRBcHBLZXkiLCAwLCBhZGRfYXBwa2V5X2NhbGwsICIiLA0KPiArICAgICAgICAgICAg ICAgICAgICAib3FxcWIiLCAiZWxlbWVudF9wYXRoIiwgImRlc3RpbmF0aW9uIiwNCj4gKyAgICAg ICAgICAgICAgICAgICAgImFwcF9pbmRleCIsICJuZXRfaW5kZXgiLCAidXBkYXRlIik7DQo+ICAg IGxfZGJ1c19pbnRlcmZhY2VfbWV0aG9kKGlmYWNlLCAiUHVibGlzaCIsIDAsIHB1Ymxpc2hfY2Fs bCwgIiIsICJvcWF5IiwNCj4gICAgICAgICAgICAgICAgICAgICJlbGVtZW50X3BhdGgiLCAibW9k ZWxfaWQiLCAiZGF0YSIpOw0KPiAgICBsX2RidXNfaW50ZXJmYWNlX21ldGhvZChpZmFjZSwgIlZl bmRvclB1Ymxpc2giLCAwLCB2ZW5kb3JfcHVibGlzaF9jYWxsLA0KPiAtLSANCj4gMi4yMS4wDQo+ IA0K