Fix DH/DHX named groups to not overwrite the private key length.
[openssl.git] / crypto / dh / dh_group_params.c
index ff6d7cdd6649c5304263b2c8a167ddc88e2484eb..c71f4053da6c0c8683075ee2be6e6b4ceaa74701 100644 (file)
@@ -34,7 +34,6 @@ static DH *dh_param_init(OSSL_LIB_CTX *libctx, const DH_NAMED_GROUP *group)
 
     ossl_ffc_named_group_set_pqg(&dh->params, group);
     dh->params.nid = ossl_ffc_named_group_get_uid(group);
-    dh->length = BN_num_bits(dh->params.q);
     dh->dirty_cnt++;
     return dh;
 }
@@ -76,7 +75,6 @@ void ossl_dh_cache_named_group(DH *dh)
             dh->params.q = (BIGNUM *)ossl_ffc_named_group_get_q(group);
         /* cache the nid */
         dh->params.nid = ossl_ffc_named_group_get_uid(group);
-        dh->length = BN_num_bits(dh->params.q);
         dh->dirty_cnt++;
     }
 }