From: tb Date: Tue, 23 Nov 2021 09:53:45 +0000 (+0000) Subject: In DH_set0_pqg() also set dh->length if q is set to match what OpenSSL do. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=1085073b2b4e1e5fdfac7b06368632e1ec8cd662;p=openbsd In DH_set0_pqg() also set dh->length if q is set to match what OpenSSL do. ok inoguchi jsing --- diff --git a/lib/libcrypto/dh/dh_lib.c b/lib/libcrypto/dh/dh_lib.c index 446bc65aa28..a66ed1f5bf0 100644 --- a/lib/libcrypto/dh/dh_lib.c +++ b/lib/libcrypto/dh/dh_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dh_lib.c,v 1.32 2018/05/02 15:48:38 tb Exp $ */ +/* $OpenBSD: dh_lib.c,v 1.33 2021/11/23 09:53:45 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -273,6 +273,7 @@ DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g) if (q != NULL) { BN_free(dh->q); dh->q = q; + dh->length = BN_num_bits(dh->q); } if (g != NULL) { BN_free(dh->g);