From patchwork Mon Jan 30 23:52:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Gix X-Patchwork-Id: 13122055 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 5C7BDC54EAA for ; Mon, 30 Jan 2023 23:52:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230087AbjA3XwX (ORCPT ); Mon, 30 Jan 2023 18:52:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229503AbjA3XwX (ORCPT ); Mon, 30 Jan 2023 18:52:23 -0500 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9FA72F795 for ; Mon, 30 Jan 2023 15:52:21 -0800 (PST) Received: by mail-pj1-x1033.google.com with SMTP id cl23-20020a17090af69700b0022c745bfdc3so6150400pjb.3 for ; Mon, 30 Jan 2023 15:52:21 -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=vPnHCmRMLf6IgFM07niQU0RihdYqnsg77B8pitYt8tE=; b=Wn2QhN9nUKxyFPtresmAdYvZ0QL5QD7Kp33BXt3FIJiOb8Q2bmkKwmUUrpPsUkvssZ ZvW0ZDRuYZYuVi4U5GDFXQPNYNByEbqTAHy91oVCbq+Nv+V1wAgb9G1BbBvjjFuoZXYB eMraKLjjajPbFF0BaApnMvSlXG0/8ZUTLC2rNt9KDAZK4siaojjxpPRLu9bQsWUmX094 /qQS3MLSidf3tI6AJIcrU6iiRIszUx63CS7QjsHZKGG6jy5ToB9fkPXMr5fbup7Z8dWQ 3SVYKmXU0e1MPKzvp/3VpiotHdOZEUbwqicbVJugKF7yu0PtHovCYLa6NlGSg7CUBnra 54Gw== 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=vPnHCmRMLf6IgFM07niQU0RihdYqnsg77B8pitYt8tE=; b=kjEnAQEiHrjH2HaJcYSgD35uPGp+YtrJHVxOpA4drewv4SQ+EJ8zv2rKnvPk41i6JD oPsrLUPbAjqe4ymkYVLoNfybfAHASNJhM5H32fcaGcGkVk23pay+qRBhRTp2gLOTomoK /zlkT8q5AaBl6x2Z9Ig6Qza5mE0/cx01HcfI5kUgWl0bVIYTlRTamDXOhtwGfsZj+RIj dHnCznnfkCle8HEg0d2TC0Cy6A4cXOlHqS45lmB5dxJhkMB3r2hkMJscu8bgqoGYmRAr WFbbnb3iQBdPmxWVNv6dYk/cgZhuaFXg4Lwl+zt5FD3efgM3UNDB2Is5GjSLw+ZOUUW9 OQHQ== X-Gm-Message-State: AO0yUKXouAeMVLF9Ayry6fcTZytQf/5rvdYE3EsOmtKwGLZ0ayfeFbdN FtV78owIw91EhlZVSbFELscu5Ixzw3YHOQ== X-Google-Smtp-Source: AK7set+iffpWeRPdGfrBW31LbY6bIadAAmldbaXMQQybX6uo/8wPsPCLq53U41VV6Jq7kAzZLrMe1Q== X-Received: by 2002:a17:90b:3b4a:b0:230:a94:d030 with SMTP id ot10-20020a17090b3b4a00b002300a94d030mr1472531pjb.23.1675122740603; Mon, 30 Jan 2023 15:52:20 -0800 (PST) Received: from fedora.. (97-126-124-199.tukw.qwest.net. [97.126.124.199]) by smtp.gmail.com with ESMTPSA id t191-20020a6381c8000000b004e8f7f23c4bsm2663948pgd.76.2023.01.30.15.52.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Jan 2023 15:52:20 -0800 (PST) From: Brian Gix To: linux-bluetooth@vger.kernel.org Cc: brian.gix@intel.com, inga.stotland@intel.com Subject: [PATCH BlueZ v5 04/14] mesh: Rename parameter list per crypto usage Date: Mon, 30 Jan 2023 15:52:00 -0800 Message-Id: <20230130235210.94385-5-brian.gix@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230130235210.94385-1-brian.gix@gmail.com> References: <20230130235210.94385-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],