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 3362BC25B50 for ; Mon, 23 Jan 2023 19:49:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232933AbjAWTtF (ORCPT ); Mon, 23 Jan 2023 14:49:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232944AbjAWTs6 (ORCPT ); Mon, 23 Jan 2023 14:48:58 -0500 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CEF13250D for ; Mon, 23 Jan 2023 11:48:47 -0800 (PST) Received: by mail-pj1-x102a.google.com with SMTP id n20-20020a17090aab9400b00229ca6a4636so15429668pjq.0 for ; Mon, 23 Jan 2023 11:48:47 -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=NZkBE/NGUv7Kn/6b+MumG7nxfuN5fr9QXVJWhFiyXYbXBpcIYhhl6/m6xaVcqIfWLe fbUpynnY/JWhFG5+tXTPCXQfOPdOxmmjQ75HhYwyh6Et0NTcvMe/bMAMsksnN5nHAFms djlB/o6pxbdoovJYwD3soHWekOoto8r4MnhWgGGJ/HVP9JiFmAdaT/+e1vG13cwYuSHz QULvenSTd7WWssuDuv7U6olCi4fDVBRq+6mYN+puZbBfNYAn6X/lVAYqdOAftVFawI/N NFPjUooImez3ntJ4EZeT2/dTAkYimVxwDTDpK2dkdf/zdQxZTdUv9oGyH9mdnxN+Q8Wf l1kg== 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=OWxIUikXiMi4TqJSuXe81Ajzw+QKoLl3a/u9jiEY6eZeFbkrgDmloTK5ciRIE56FAe JMFiaqLWqOiHrVcfhoUKx/ODmZ50xI+OPeY+Po97pSfyd6D6llD6KZpxwxyxbbf934TC sk1690URpWjHMWsFDPyxnOpQWreMJYWHpUBGAlfyjeZcV9WvCdCCuqXf/t+62puuJoUA CH6YMS7arSAJ1oW0S37TrFkcWxsrh68+f+XSZS2mu8WBTs5bthrTPjC/n/FB3yRSf0P6 +/dIai4Ef8bcmkYlarwRZ+QbUygFdfzM+WpdXqGjZQaNBNi2Hm55w90Z6CLQYn1TyXKX MNJQ== X-Gm-Message-State: AFqh2kofYG7tmIDcFr16+bSApSFwFrSVLQo7yp/2TuS57rcqyUgjc0Rg JMWUXN/Vv758cFUtuT3cZBG+6qdQ0vb/kg== X-Google-Smtp-Source: AMrXdXuVGM8yzTVaOxtWE2NI9pZkUFF3izDZEeNQQiTC4QP1aTRtFkm86YKtfAmKuTSibu7MbU5g7A== X-Received: by 2002:a17:902:c652:b0:195:f265:66da with SMTP id s18-20020a170902c65200b00195f26566damr10387979pls.9.1674503326103; Mon, 23 Jan 2023 11:48:46 -0800 (PST) Received: from fedora.. (97-126-124-199.tukw.qwest.net. [97.126.124.199]) by smtp.gmail.com with ESMTPSA id jj5-20020a170903048500b0017d97d13b18sm97068plb.65.2023.01.23.11.48.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 11:48:45 -0800 (PST) From: Brian Gix To: linux-bluetooth@vger.kernel.org Cc: brian.gix@intel.com Subject: [PATCH BlueZ v3 04/11] mesh: Rename parameter list per crypto usage Date: Mon, 23 Jan 2023 11:48:17 -0800 Message-Id: <20230123194824.257351-5-brian.gix@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230123194824.257351-1-brian.gix@gmail.com> References: <20230123194824.257351-1-brian.gix@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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], -- 2.39.1