diff --git a/src/crypto/crypto_openssl.c b/src/crypto/crypto_openssl.c index e1fcf471c..08c98aff4 100644 --- a/src/crypto/crypto_openssl.c +++ b/src/crypto/crypto_openssl.c @@ -434,7 +434,7 @@ void * dh5_init(struct wpabuf **priv, struct wpabuf **publ) if (DH_generate_key(dh) != 1) goto err; - publen = BN_num_bytes(dh->p); + publen = BN_num_bytes(dh->pub_key); pubkey = wpabuf_alloc(publen); if (pubkey == NULL) goto err;