Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3859926pxb; Mon, 8 Feb 2021 01:49:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJw3T90/3hDKbLacAsJhYpsWygIXQrlLGG3TUE65P14w0mfchCuDHrRYx96WSP08IEdEjQtU X-Received: by 2002:a17:906:4349:: with SMTP id z9mr681929ejm.471.1612777753170; Mon, 08 Feb 2021 01:49:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612777753; cv=none; d=google.com; s=arc-20160816; b=prTPLFdUNQfOFZ6oFgtBNbQpBHR2VmliUpIn9Gm6vrnhYwutOa+gLgvLLjmERz/uTB csvDKTDiCDprH/mGn5VQJTDwoSaQ/7nTltys0w4DZickheiA1X+PdtIJtAhrSjkeCn3m ICzDCkl/0Zo2nJBSGMS3k2Sl1kV8rTozXUIh8Zk3G7IGb4UNw1n+CthuSo5HUZBjqTxg HUOlVej+2X7GJecvNG6/tDfiUqdWCNNLrYcmoCmSjOp8i89xMuP42qO2ungzAx1HLB9j Jq1/Z2C8CH/g7IMg6G6EEPP8z6bAy2Gt8Uuu1X7YVt1XJLF5v/fJE0Y/M/PnTzXdDuQk +M7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=SsMZCX25YX8rLvqaV9+RFyfJEs5AM3VExnUKxno/2KQ=; b=GvLRp5PKtNGkZXqhEknWKEnhVgXzgCPEOHCEttHnwdyck5VZMhxd3SUkHFsdGFO4mk KT/WReH4eIKFMMJcR3uGAoOlph5YWDcYO5iII1OdlIGZ3Q+obszKi2JeQmoUxyDIplBD MoRz0i+NzgqLPpPqgIaTiAmWVfem9mcDUak9U8An7JeiXFtd4bv6P40tmXdn9ZFAiCm7 DD3xM+bwebU3bMov4rWwnvuyVs9muhFdd6L1f3+gufav+J0Os5X3iHGLA26WiAP2RO17 Acb06WzZz/AxHVFNzIijor40YhtOqMqH5IZuusZFpRe78odM1kc/H9ekqyhOD26d+0cR FYig== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b15si11573520edk.399.2021.02.08.01.48.38; Mon, 08 Feb 2021 01:49:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231699AbhBHJpz (ORCPT + 99 others); Mon, 8 Feb 2021 04:45:55 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:12491 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231863AbhBHJmk (ORCPT ); Mon, 8 Feb 2021 04:42:40 -0500 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4DZ1GJ0fpGzjKqr; Mon, 8 Feb 2021 17:40:08 +0800 (CST) Received: from localhost.localdomain (10.67.165.24) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.498.0; Mon, 8 Feb 2021 17:41:20 +0800 From: Meng Yu To: , , , , , CC: , , , , Subject: [PATCH v8 4/9] net/bluetooth: modify ECDH name in 'crypto_alloc_kpp' Date: Mon, 8 Feb 2021 17:38:52 +0800 Message-ID: <1612777137-51067-5-git-send-email-yumeng18@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1612777137-51067-1-git-send-email-yumeng18@huawei.com> References: <1612777137-51067-1-git-send-email-yumeng18@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.165.24] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Algorithm name of ECDH will be changed in crypto, so we modify its name when we call ECDH. Signed-off-by: Meng Yu Reviewed-by: Zaibo Xu --- net/bluetooth/ecdh_helper.c | 2 -- net/bluetooth/selftest.c | 2 +- net/bluetooth/smp.c | 6 +++--- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/net/bluetooth/ecdh_helper.c b/net/bluetooth/ecdh_helper.c index 3226fe0..989401f 100644 --- a/net/bluetooth/ecdh_helper.c +++ b/net/bluetooth/ecdh_helper.c @@ -126,8 +126,6 @@ int set_ecdh_privkey(struct crypto_kpp *tfm, const u8 private_key[32]) int err; struct ecdh p = {0}; - p.curve_id = ECC_CURVE_NIST_P256; - if (private_key) { tmp = kmalloc(32, GFP_KERNEL); if (!tmp) diff --git a/net/bluetooth/selftest.c b/net/bluetooth/selftest.c index f71c6fa..f49604d 100644 --- a/net/bluetooth/selftest.c +++ b/net/bluetooth/selftest.c @@ -205,7 +205,7 @@ static int __init test_ecdh(void) calltime = ktime_get(); - tfm = crypto_alloc_kpp("ecdh", 0, 0); + tfm = crypto_alloc_kpp("ecdh-nist-p256", 0, 0); if (IS_ERR(tfm)) { BT_ERR("Unable to create ECDH crypto context"); err = PTR_ERR(tfm); diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index c659c46..5de73de 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c @@ -1387,7 +1387,7 @@ static struct smp_chan *smp_chan_create(struct l2cap_conn *conn) goto zfree_smp; } - smp->tfm_ecdh = crypto_alloc_kpp("ecdh", 0, 0); + smp->tfm_ecdh = crypto_alloc_kpp("ecdh-nist-p256", 0, 0); if (IS_ERR(smp->tfm_ecdh)) { BT_ERR("Unable to create ECDH crypto context"); goto free_shash; @@ -3282,7 +3282,7 @@ static struct l2cap_chan *smp_add_cid(struct hci_dev *hdev, u16 cid) return ERR_CAST(tfm_cmac); } - tfm_ecdh = crypto_alloc_kpp("ecdh", 0, 0); + tfm_ecdh = crypto_alloc_kpp("ecdh-nist-p256", 0, 0); if (IS_ERR(tfm_ecdh)) { BT_ERR("Unable to create ECDH crypto context"); crypto_free_shash(tfm_cmac); @@ -3807,7 +3807,7 @@ int __init bt_selftest_smp(void) return PTR_ERR(tfm_cmac); } - tfm_ecdh = crypto_alloc_kpp("ecdh", 0, 0); + tfm_ecdh = crypto_alloc_kpp("ecdh-nist-p256", 0, 0); if (IS_ERR(tfm_ecdh)) { BT_ERR("Unable to create ECDH crypto context"); crypto_free_shash(tfm_cmac); -- 2.8.1