Skip to contentSkip to conversation

Bluetooth: zero kpp input for key generation

PATCH New Marcel Holtmann 1 participant 1 message Apr 30, 2017

Subsystems (2)
lore
Share & tools
lore

Marcel Holtmann

author maintainer
#0 lore raw

PATCH 1/1 Bluetooth: zero kpp input for key generation

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")

---
 net/bluetooth/ecdh_helper.c | 1 +
 1 file changed, 1 insertion(+)
net/bluetooth/ecdh_helper.c +1 -0
index 579684bfc322..2a65ca3fa8fa 100644
@@ -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);
Signature · 1 line
2.9.3