diff options
author | tb <> | 2021-11-23 09:53:45 +0000 |
---|---|---|
committer | tb <> | 2021-11-23 09:53:45 +0000 |
commit | 2bdbde31a4bf50cc95d94889220a599f78e08415 (patch) | |
tree | 5e429d1afd381c8d54d537c18f1cf9324c1671e0 /src/lib | |
parent | e84146785972a59918292f70718066fc8f2d51f2 (diff) | |
download | openbsd-2bdbde31a4bf50cc95d94889220a599f78e08415.tar.gz openbsd-2bdbde31a4bf50cc95d94889220a599f78e08415.tar.bz2 openbsd-2bdbde31a4bf50cc95d94889220a599f78e08415.zip |
In DH_set0_pqg() also set dh->length if q is set to match what OpenSSL do.
ok inoguchi jsing
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libcrypto/dh/dh_lib.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/libcrypto/dh/dh_lib.c b/src/lib/libcrypto/dh/dh_lib.c index 446bc65aa2..a66ed1f5bf 100644 --- a/src/lib/libcrypto/dh/dh_lib.c +++ b/src/lib/libcrypto/dh/dh_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: dh_lib.c,v 1.32 2018/05/02 15:48:38 tb Exp $ */ | 1 | /* $OpenBSD: dh_lib.c,v 1.33 2021/11/23 09:53:45 tb Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -273,6 +273,7 @@ DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g) | |||
273 | if (q != NULL) { | 273 | if (q != NULL) { |
274 | BN_free(dh->q); | 274 | BN_free(dh->q); |
275 | dh->q = q; | 275 | dh->q = q; |
276 | dh->length = BN_num_bits(dh->q); | ||
276 | } | 277 | } |
277 | if (g != NULL) { | 278 | if (g != NULL) { |
278 | BN_free(dh->g); | 279 | BN_free(dh->g); |