Bluetooth: zero kpp input for key generation
authorMarcel Holtmann <marcel@holtmann.org>
Sun, 30 Apr 2017 13:51:40 +0000 (06:51 -0700)
committerJohan Hedberg <johan.hedberg@intel.com>
Sun, 30 Apr 2017 13:52:39 +0000 (16:52 +0300)
When generating new ECDH keys with kpp, the shared secret input needs to
be set to NULL. Fix this by including kpp_request_set_input call.

Fixes: 58771c1c ("Bluetooth: convert smp and selftest to crypto kpp
API")
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
net/bluetooth/ecdh_helper.c

index 579684bfc3224f51b1131fea4b87ce6e02626ba9..2a65ca3fa8fab262bc844490bc80f8c9e4191c50 100644 (file)
@@ -191,6 +191,7 @@ bool generate_ecdh_keys(u8 public_key[64], u8 private_key[32])
                        goto free_all;
 
                sg_init_one(&dst, tmp, 64);
+               kpp_request_set_input(req, NULL, 0);
                kpp_request_set_output(req, &dst, 64);
                kpp_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG,
                                         ecdh_complete, &result);