From patchwork Fri Jan 20 19:47:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Gix X-Patchwork-Id: 13110467 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 85261C38A23 for ; Fri, 20 Jan 2023 19:47:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229747AbjATTrn (ORCPT ); Fri, 20 Jan 2023 14:47:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbjATTrm (ORCPT ); Fri, 20 Jan 2023 14:47:42 -0500 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 226F6872B0 for ; Fri, 20 Jan 2023 11:47:41 -0800 (PST) Received: by mail-pl1-x630.google.com with SMTP id z13so6239324plg.6 for ; Fri, 20 Jan 2023 11:47:41 -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=dy7i0Yi6nKZvHJHgIejbM0IyDspiYWXVYMqmGr/TI7fake3GIOsDBS7edMLHQOrL0a YALpqsoq6PPtfJKIPcxznmrakF1k99q0x9kkZr3akAM/fFNpxWcK4DVjlJlYSOglIu0W M6Fy5QJXtlOkzmNPeKxgBb9Wm9Vzqi7/zYh77oTsOUfkCbG0ukkEaFaCDxx1XuSvF79b rqCa/KSmHZMVo6I5NC1ZHM62IkZbpNuKfl2XUPExTL+7Fmq8JFsR9nItBKQ0m/mJmakL ti5Jlr3AAjnOM2pmfEldtbqAKgoQM3HjFRoqjRsnIZifJ8yOGaNA1W0Annls2aomAIgk oU3g== 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=n/zli0we6m4ALwIM38oI/4CPlER4aNRi55CzJtsCCZqnvQHqcEpAfTqGn2j/Qd7loU ep1Qe0hx9yVSG+X4BNqi1E1doJASPOwVYDrEoS7CHwU11RpjKqHkx46cfM39MRg08lcW sL19ZM5MnLlud1U19sHp8xfPbBkWKj68Pw8LyxTzpGQkkpohljK/S/rpUj1OWg3AYcVo IV6hC5aWTj2/VZAQBrs7fxuqvl2a6DU5HoXPY7hr9luzqsEWW07tDRAolPIELKFtLAtu Y/YskJOUuhx7ezWA7MWU8eXTKpLipeEFYGwhNKIosFXysrpW+LEyGSCsAGKy3BQHn1WC 5iog== X-Gm-Message-State: AFqh2koUlbVgdtbBz29k3h1KRxazQOHTybGxIFnt6PPYJW2W35dZZpU7 E+9+JDbzjSezd35qo66KgTu3U7xLS51X7g== X-Google-Smtp-Source: AMrXdXugVYSRK33mLZYhiBKEXE0gYOldsew6ya/V9BsEz3hSDZvdgm9Gd2H+ybYCKHspCKyXYsBdBQ== X-Received: by 2002:a17:903:543:b0:194:6110:9fe1 with SMTP id jo3-20020a170903054300b0019461109fe1mr14939059plb.4.1674244060145; Fri, 20 Jan 2023 11:47:40 -0800 (PST) Received: from fedora.. (174-21-24-126.tukw.qwest.net. [174.21.24.126]) by smtp.gmail.com with ESMTPSA id y13-20020a17090322cd00b001896af10ca7sm5149967plg.134.2023.01.20.11.47.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Jan 2023 11:47:39 -0800 (PST) From: Brian Gix To: linux-bluetooth@vger.kernel.org Cc: Brian Gix Subject: [PATCH BlueZ v2 04/11] mesh: Rename parameter list per crypto usage Date: Fri, 20 Jan 2023 11:47:24 -0800 Message-Id: <20230120194731.90065-5-brian.gix@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230120194731.90065-1-brian.gix@gmail.com> References: <20230120194731.90065-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],