OpenSSL: Fix public key length in DH group 5 operations

The length of the prime was used incorrectly and this resulted
in WPS DH operation failing whenever the public key ended up having
leading zeros (i.e., about every 1/256th time).
This commit is contained in:
Jouni Malinen 2010-06-26 21:03:25 -07:00 committed by Jouni Malinen
parent 41e650ae5c
commit cc91e07e57

View file

@ -434,7 +434,7 @@ void * dh5_init(struct wpabuf **priv, struct wpabuf **publ)
if (DH_generate_key(dh) != 1) if (DH_generate_key(dh) != 1)
goto err; goto err;
publen = BN_num_bytes(dh->p); publen = BN_num_bytes(dh->pub_key);
pubkey = wpabuf_alloc(publen); pubkey = wpabuf_alloc(publen);
if (pubkey == NULL) if (pubkey == NULL)
goto err; goto err;