From patchwork Thu Jan 19 23:57:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Gix X-Patchwork-Id: 13108977 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF094C004D4 for ; Thu, 19 Jan 2023 23:58:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230166AbjASX6R (ORCPT ); Thu, 19 Jan 2023 18:58:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230117AbjASX6P (ORCPT ); Thu, 19 Jan 2023 18:58:15 -0500 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A0959FDCD for ; Thu, 19 Jan 2023 15:58:08 -0800 (PST) Received: by mail-pj1-x1034.google.com with SMTP id n20-20020a17090aab9400b00229ca6a4636so6621048pjq.0 for ; Thu, 19 Jan 2023 15:58:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6IbjGmvpVt2am6W6/Kww6kXKnPQ6CQRTRqXyvFQ8XB0=; b=Up5qblDm6JUfyQiZ15D0Ib7HkzGG2fYMxmKZeiTHvjtqtW5ZWRLEuWiXkdggOVoc5a jKLzUP0qULDv+SWHDc2U1b6e5nDRgKaC47YbhoaLuoTGn4rR5O9pPPUftUyiOxOAH1RS fV7y+JQD+5fQ1JRFeb3u4fzCAuhZfSACwVJXfBQOx4DCXELzd/qZdxj/jJeOm1L8jQ9I fqLLSKB/RV7pabQmXwiYQUtj37uv9CVqEBEbp9plJOSjTY374LRyHVhQ11WsMf9i3kth rK2jHHA5SzUrGXoMPFxIk0I7blbuLXtOH4hQfP+r7GHu/6LVvBYwQkRssVnSjSYlWEmw gbCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6IbjGmvpVt2am6W6/Kww6kXKnPQ6CQRTRqXyvFQ8XB0=; b=8M4I9FziVGZOjuaYiMOutHE+bq+WGXPDlfeUlSFGtuX4ZzXGM5cQZjwUdLGCt7K65q WWCP4qitjezFSOMb124iY2eeOWQ2o83x/dzeqo9cN01UsKYmTiPLNwHd6yCx+nbEQbZu KKumQGb6O8vdFb24dNGAsvcBLFAQY2kpgFTsXuFommds8y1sr+OOkR2hNfXKXs0PHCGP nn3j0KMvi9agvQCqfluhNHi7D4CNVmY6fCfjr4hNETjegUtXDai+C9kVsV3p3l4J/ZTa LKEmJ6MD1QXt/gw7wDR9KtYEAZcRx2bGF/3h/sWkO3pAVuxupt2HCM1ByhkKz4xrw4+0 gHLA== X-Gm-Message-State: AFqh2kqxz9+O7yV2Ww9Pe8jaCyeMWLzDB8MvuE9GRpLYjJ9dewz/r09w KjqeZyV+q/PefputfLCS7jVSroBGzg4BfQ== X-Google-Smtp-Source: AMrXdXuxaVet186JES4ZIh+fCEaaZPnxgxM8qwigtcfUODiaSDVaJD0m4SbNffizj1+gj6EU9t7T4Q== X-Received: by 2002:a17:902:d651:b0:194:bdcf:1ab8 with SMTP id y17-20020a170902d65100b00194bdcf1ab8mr7259468plh.37.1674172687137; Thu, 19 Jan 2023 15:58:07 -0800 (PST) Received: from fedora.. (97-113-173-242.tukw.qwest.net. [97.113.173.242]) by smtp.gmail.com with ESMTPSA id n10-20020a170902d2ca00b0019460c34839sm14826373plc.185.2023.01.19.15.58.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Jan 2023 15:58:06 -0800 (PST) From: Brian Gix To: linux-bluetooth@vger.kernel.org Cc: Brian Gix Subject: [PATCH BlueZ 04/12] mesh: Rename parameter list per crypto usage Date: Thu, 19 Jan 2023 15:57:47 -0800 Message-Id: <20230119235755.46002-5-brian.gix@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230119235755.46002-1-brian.gix@gmail.com> References: <20230119235755.46002-1-brian.gix@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Brian Gix The derived key generated by the "nkpk" salt and network master key is used to create Private Beacons as of Mesh Profile Specification v1.1 --- mesh/crypto.c | 4 ++-- mesh/crypto.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mesh/crypto.c b/mesh/crypto.c index 668d16877..3754cb012 100644 --- a/mesh/crypto.c +++ b/mesh/crypto.c @@ -251,9 +251,9 @@ bool mesh_crypto_nkbk(const uint8_t n[16], uint8_t beacon_key[16]) return crypto_128(n, "nkbk", beacon_key); } -bool mesh_crypto_nkpk(const uint8_t n[16], uint8_t proxy_key[16]) +bool mesh_crypto_nkpk(const uint8_t n[16], uint8_t private_key[16]) { - return crypto_128(n, "nkpk", proxy_key); + return crypto_128(n, "nkpk", private_key); } bool mesh_crypto_k3(const uint8_t n[16], uint8_t out64[8]) diff --git a/mesh/crypto.h b/mesh/crypto.h index c31abbbbd..55789886e 100644 --- a/mesh/crypto.h +++ b/mesh/crypto.h @@ -26,7 +26,7 @@ bool mesh_aes_ecb_one(const uint8_t key[16], const uint8_t plaintext[16], uint8_t encrypted[16]); bool mesh_crypto_nkik(const uint8_t network_key[16], uint8_t identity_key[16]); bool mesh_crypto_nkbk(const uint8_t network_key[16], uint8_t beacon_key[16]); -bool mesh_crypto_nkpk(const uint8_t network_key[16], uint8_t proxy_key[16]); +bool mesh_crypto_nkpk(const uint8_t network_key[16], uint8_t private_key[16]); bool mesh_crypto_identity(const uint8_t net_key[16], uint16_t addr, uint8_t id[16]); bool mesh_crypto_beacon_cmac(const uint8_t encryption_key[16],