diff options
author | Tudor Ambarus <tudor.ambarus@microchip.com> | 2017-09-28 17:14:55 +0300 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2017-10-06 21:35:47 +0300 |
commit | c0153b0b901a16663ff91504fea25fb51d57cc29 (patch) | |
tree | c67d9808af8d276eaa5f92a021ae17d129cd5124 /net/bluetooth/ecdh_helper.h | |
parent | 168ed65483a1777c2570f4c0a4a64e20a823cf25 (diff) | |
download | linux-c0153b0b901a16663ff91504fea25fb51d57cc29.tar.xz |
Bluetooth: let the crypto subsystem generate the ecc privkey
That Bluetooth SMP knows about the private key is pointless, since the
detection of debug key usage is actually via the public key portion.
With this patch, the Bluetooth SMP will stop keeping a copy of the
ecdh private key and will let the crypto subsystem to generate and
handle the ecdh private key, potentially benefiting of hardware
ecc private key generation and retention.
The loop that tries to generate a correct private key is now removed and
we trust the crypto subsystem to generate a correct private key. This
backup logic should be done in crypto, if really needed.
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/ecdh_helper.h')
-rw-r--r-- | net/bluetooth/ecdh_helper.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/net/bluetooth/ecdh_helper.h b/net/bluetooth/ecdh_helper.h index 50e6676aebf5..a6f8d03d4aaf 100644 --- a/net/bluetooth/ecdh_helper.h +++ b/net/bluetooth/ecdh_helper.h @@ -23,7 +23,8 @@ #include <crypto/kpp.h> #include <linux/types.h> -int compute_ecdh_secret(struct crypto_kpp *tfm, const u8 pub_a[64], - const u8 priv_b[32], u8 secret[32]); -int generate_ecdh_keys(struct crypto_kpp *tfm, u8 public_key[64], - u8 private_key[32]); +int compute_ecdh_secret(struct crypto_kpp *tfm, const u8 pair_public_key[64], + u8 secret[32]); +int set_ecdh_privkey(struct crypto_kpp *tfm, const u8 *private_key); +int generate_ecdh_public_key(struct crypto_kpp *tfm, u8 public_key[64]); +int generate_ecdh_keys(struct crypto_kpp *tfm, u8 public_key[64]); |