summaryrefslogtreecommitdiffstats
path: root/crypto/dh/dh_lib.c
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2020-01-31 08:18:46 +1000
committerShane Lontis <shane.lontis@oracle.com>2020-01-31 08:18:46 +1000
commitca2bf555cd64bc9624af1259ce3cd27f95a5763e (patch)
treee02beb157e56973ada62c679cb7b3b8756e86dfe /crypto/dh/dh_lib.c
parentcd624ccd41ac3ac779c1c7a7a1e63427ce9588dd (diff)
Add support for DH 'modp' group parameters (RFC 3526)
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10897)
Diffstat (limited to 'crypto/dh/dh_lib.c')
-rw-r--r--crypto/dh/dh_lib.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/crypto/dh/dh_lib.c b/crypto/dh/dh_lib.c
index 2f5aa10401..f9fb1d9b71 100644
--- a/crypto/dh/dh_lib.c
+++ b/crypto/dh/dh_lib.c
@@ -191,6 +191,8 @@ int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g)
return 0;
ffc_params_set0_pqg(&dh->params, p, q, g);
+ dh->params.nid = NID_undef;
+ DH_get_nid(dh); /* Check if this is a named group and cache it */
if (q != NULL)
dh->length = BN_num_bits(q);
@@ -284,3 +286,7 @@ FFC_PARAMS *dh_get0_params(DH *dh)
{
return &dh->params;
}
+int dh_get0_nid(const DH *dh)
+{
+ return dh->params.nid;
+}