diff options
author | Shane Lontis <shane.lontis@oracle.com> | 2020-01-31 08:18:46 +1000 |
---|---|---|
committer | Shane Lontis <shane.lontis@oracle.com> | 2020-01-31 08:18:46 +1000 |
commit | ca2bf555cd64bc9624af1259ce3cd27f95a5763e (patch) | |
tree | e02beb157e56973ada62c679cb7b3b8756e86dfe /include | |
parent | cd624ccd41ac3ac779c1c7a7a1e63427ce9588dd (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 'include')
-rw-r--r-- | include/crypto/bn_dh.h | 9 | ||||
-rw-r--r-- | include/crypto/dh.h | 1 | ||||
-rw-r--r-- | include/internal/ffc.h | 1 | ||||
-rw-r--r-- | include/openssl/dh.h | 4 | ||||
-rw-r--r-- | include/openssl/obj_mac.h | 18 |
5 files changed, 30 insertions, 3 deletions
diff --git a/include/crypto/bn_dh.h b/include/crypto/bn_dh.h index 9077234250..2864fb3319 100644 --- a/include/crypto/bn_dh.h +++ b/include/crypto/bn_dh.h @@ -1,5 +1,5 @@ /* - * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2015-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -22,3 +22,10 @@ extern const BIGNUM _bignum_ffdhe4096_p; extern const BIGNUM _bignum_ffdhe6144_p; extern const BIGNUM _bignum_ffdhe8192_p; extern const BIGNUM _bignum_const_2; + +extern const BIGNUM _bignum_modp_1536_p; +extern const BIGNUM _bignum_modp_2048_p; +extern const BIGNUM _bignum_modp_3072_p; +extern const BIGNUM _bignum_modp_4096_p; +extern const BIGNUM _bignum_modp_6144_p; +extern const BIGNUM _bignum_modp_8192_p; diff --git a/include/crypto/dh.h b/include/crypto/dh.h index b1f37c6018..1e856101f3 100644 --- a/include/crypto/dh.h +++ b/include/crypto/dh.h @@ -15,3 +15,4 @@ int dh_compute_key(OPENSSL_CTX *ctx, unsigned char *key, const BIGNUM *pub_key, int dh_compute_key_padded(OPENSSL_CTX *ctx, unsigned char *key, const BIGNUM *pub_key, DH *dh); FFC_PARAMS *dh_get0_params(DH *dh); +int dh_get0_nid(const DH *dh); diff --git a/include/internal/ffc.h b/include/internal/ffc.h index 56703fb2e8..1ec980f9d0 100644 --- a/include/internal/ffc.h +++ b/include/internal/ffc.h @@ -31,6 +31,7 @@ typedef struct ffc_params_st { size_t seedlen; /* Required for FIPS186_4 validation of p and q */ int pcounter; + int nid; /* The identity of a named group */ } FFC_PARAMS; diff --git a/include/openssl/dh.h b/include/openssl/dh.h index 1e39e86a33..ebcbc15505 100644 --- a/include/openssl/dh.h +++ b/include/openssl/dh.h @@ -171,9 +171,9 @@ DH *DH_get_1024_160(void); DH *DH_get_2048_224(void); DH *DH_get_2048_256(void); -/* Named parameters, currently RFC7919 */ +/* Named parameters, currently RFC7919 and RFC3526 */ DH *DH_new_by_nid(int nid); -int DH_get_nid(const DH *dh); +int DH_get_nid(DH *dh); # ifndef OPENSSL_NO_CMS /* RFC2631 KDF */ diff --git a/include/openssl/obj_mac.h b/include/openssl/obj_mac.h index 5d7611bc25..0e564ac6d2 100644 --- a/include/openssl/obj_mac.h +++ b/include/openssl/obj_mac.h @@ -5165,6 +5165,24 @@ #define SN_ffdhe8192 "ffdhe8192" #define NID_ffdhe8192 1130 +#define SN_modp_1536 "modp_1536" +#define NID_modp_1536 1212 + +#define SN_modp_2048 "modp_2048" +#define NID_modp_2048 1213 + +#define SN_modp_3072 "modp_3072" +#define NID_modp_3072 1214 + +#define SN_modp_4096 "modp_4096" +#define NID_modp_4096 1215 + +#define SN_modp_6144 "modp_6144" +#define NID_modp_6144 1216 + +#define SN_modp_8192 "modp_8192" +#define NID_modp_8192 1217 + #define SN_ISO_UA "ISO-UA" #define NID_ISO_UA 1150 #define OBJ_ISO_UA OBJ_member_body,804L |