diff options
Diffstat (limited to 'src/lib/libcrypto/dh/dh.h')
-rw-r--r-- | src/lib/libcrypto/dh/dh.h | 41 |
1 files changed, 28 insertions, 13 deletions
diff --git a/src/lib/libcrypto/dh/dh.h b/src/lib/libcrypto/dh/dh.h index 10475ac4b3..849309a489 100644 --- a/src/lib/libcrypto/dh/dh.h +++ b/src/lib/libcrypto/dh/dh.h | |||
@@ -77,8 +77,6 @@ | |||
77 | # define OPENSSL_DH_MAX_MODULUS_BITS 10000 | 77 | # define OPENSSL_DH_MAX_MODULUS_BITS 10000 |
78 | #endif | 78 | #endif |
79 | 79 | ||
80 | #define OPENSSL_DH_FIPS_MIN_MODULUS_BITS 1024 | ||
81 | |||
82 | #define DH_FLAG_CACHE_MONT_P 0x01 | 80 | #define DH_FLAG_CACHE_MONT_P 0x01 |
83 | #define DH_FLAG_NO_EXP_CONSTTIME 0x02 /* new with 0.9.7h; the built-in DH | 81 | #define DH_FLAG_NO_EXP_CONSTTIME 0x02 /* new with 0.9.7h; the built-in DH |
84 | * implementation now uses constant time | 82 | * implementation now uses constant time |
@@ -159,7 +157,6 @@ struct dh_st | |||
159 | this for backward compatibility: */ | 157 | this for backward compatibility: */ |
160 | #define DH_CHECK_P_NOT_STRONG_PRIME DH_CHECK_P_NOT_SAFE_PRIME | 158 | #define DH_CHECK_P_NOT_STRONG_PRIME DH_CHECK_P_NOT_SAFE_PRIME |
161 | 159 | ||
162 | #define DHparams_dup(x) ASN1_dup_of_const(DH,i2d_DHparams,d2i_DHparams,x) | ||
163 | #define d2i_DHparams_fp(fp,x) (DH *)ASN1_d2i_fp((char *(*)())DH_new, \ | 160 | #define d2i_DHparams_fp(fp,x) (DH *)ASN1_d2i_fp((char *(*)())DH_new, \ |
164 | (char *(*)())d2i_DHparams,(fp),(unsigned char **)(x)) | 161 | (char *(*)())d2i_DHparams,(fp),(unsigned char **)(x)) |
165 | #define i2d_DHparams_fp(fp,x) ASN1_i2d_fp(i2d_DHparams,(fp), \ | 162 | #define i2d_DHparams_fp(fp,x) ASN1_i2d_fp(i2d_DHparams,(fp), \ |
@@ -167,12 +164,9 @@ struct dh_st | |||
167 | #define d2i_DHparams_bio(bp,x) ASN1_d2i_bio_of(DH,DH_new,d2i_DHparams,bp,x) | 164 | #define d2i_DHparams_bio(bp,x) ASN1_d2i_bio_of(DH,DH_new,d2i_DHparams,bp,x) |
168 | #define i2d_DHparams_bio(bp,x) ASN1_i2d_bio_of_const(DH,i2d_DHparams,bp,x) | 165 | #define i2d_DHparams_bio(bp,x) ASN1_i2d_bio_of_const(DH,i2d_DHparams,bp,x) |
169 | 166 | ||
170 | const DH_METHOD *DH_OpenSSL(void); | 167 | DH *DHparams_dup(DH *); |
171 | 168 | ||
172 | #ifdef OPENSSL_FIPS | 169 | const DH_METHOD *DH_OpenSSL(void); |
173 | DH * FIPS_dh_new(void); | ||
174 | void FIPS_dh_free(DH *dh); | ||
175 | #endif | ||
176 | 170 | ||
177 | void DH_set_default_method(const DH_METHOD *meth); | 171 | void DH_set_default_method(const DH_METHOD *meth); |
178 | const DH_METHOD *DH_get_default_method(void); | 172 | const DH_METHOD *DH_get_default_method(void); |
@@ -212,6 +206,18 @@ int DHparams_print(BIO *bp, const DH *x); | |||
212 | int DHparams_print(char *bp, const DH *x); | 206 | int DHparams_print(char *bp, const DH *x); |
213 | #endif | 207 | #endif |
214 | 208 | ||
209 | #define EVP_PKEY_CTX_set_dh_paramgen_prime_len(ctx, len) \ | ||
210 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \ | ||
211 | EVP_PKEY_CTRL_DH_PARAMGEN_PRIME_LEN, len, NULL) | ||
212 | |||
213 | #define EVP_PKEY_CTX_set_dh_paramgen_generator(ctx, gen) \ | ||
214 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \ | ||
215 | EVP_PKEY_CTRL_DH_PARAMGEN_GENERATOR, gen, NULL) | ||
216 | |||
217 | #define EVP_PKEY_CTRL_DH_PARAMGEN_PRIME_LEN (EVP_PKEY_ALG_CTRL + 1) | ||
218 | #define EVP_PKEY_CTRL_DH_PARAMGEN_GENERATOR (EVP_PKEY_ALG_CTRL + 2) | ||
219 | |||
220 | |||
215 | /* BEGIN ERROR CODES */ | 221 | /* BEGIN ERROR CODES */ |
216 | /* The following lines are auto generated by the script mkerr.pl. Any changes | 222 | /* The following lines are auto generated by the script mkerr.pl. Any changes |
217 | * made after this point may be overwritten when the script is next run. | 223 | * made after this point may be overwritten when the script is next run. |
@@ -222,22 +228,31 @@ void ERR_load_DH_strings(void); | |||
222 | 228 | ||
223 | /* Function codes. */ | 229 | /* Function codes. */ |
224 | #define DH_F_COMPUTE_KEY 102 | 230 | #define DH_F_COMPUTE_KEY 102 |
225 | #define DH_F_DHPARAMS_PRINT 100 | ||
226 | #define DH_F_DHPARAMS_PRINT_FP 101 | 231 | #define DH_F_DHPARAMS_PRINT_FP 101 |
227 | #define DH_F_DH_BUILTIN_GENPARAMS 106 | 232 | #define DH_F_DH_BUILTIN_GENPARAMS 106 |
228 | #define DH_F_DH_COMPUTE_KEY 107 | ||
229 | #define DH_F_DH_GENERATE_KEY 108 | ||
230 | #define DH_F_DH_GENERATE_PARAMETERS 109 | ||
231 | #define DH_F_DH_NEW_METHOD 105 | 233 | #define DH_F_DH_NEW_METHOD 105 |
234 | #define DH_F_DH_PARAM_DECODE 107 | ||
235 | #define DH_F_DH_PRIV_DECODE 110 | ||
236 | #define DH_F_DH_PRIV_ENCODE 111 | ||
237 | #define DH_F_DH_PUB_DECODE 108 | ||
238 | #define DH_F_DH_PUB_ENCODE 109 | ||
239 | #define DH_F_DO_DH_PRINT 100 | ||
232 | #define DH_F_GENERATE_KEY 103 | 240 | #define DH_F_GENERATE_KEY 103 |
233 | #define DH_F_GENERATE_PARAMETERS 104 | 241 | #define DH_F_GENERATE_PARAMETERS 104 |
242 | #define DH_F_PKEY_DH_DERIVE 112 | ||
243 | #define DH_F_PKEY_DH_KEYGEN 113 | ||
234 | 244 | ||
235 | /* Reason codes. */ | 245 | /* Reason codes. */ |
236 | #define DH_R_BAD_GENERATOR 101 | 246 | #define DH_R_BAD_GENERATOR 101 |
247 | #define DH_R_BN_DECODE_ERROR 109 | ||
248 | #define DH_R_BN_ERROR 106 | ||
249 | #define DH_R_DECODE_ERROR 104 | ||
237 | #define DH_R_INVALID_PUBKEY 102 | 250 | #define DH_R_INVALID_PUBKEY 102 |
238 | #define DH_R_KEY_SIZE_TOO_SMALL 104 | 251 | #define DH_R_KEYS_NOT_SET 108 |
239 | #define DH_R_MODULUS_TOO_LARGE 103 | 252 | #define DH_R_MODULUS_TOO_LARGE 103 |
253 | #define DH_R_NO_PARAMETERS_SET 107 | ||
240 | #define DH_R_NO_PRIVATE_VALUE 100 | 254 | #define DH_R_NO_PRIVATE_VALUE 100 |
255 | #define DH_R_PARAMETER_ENCODING_ERROR 105 | ||
241 | 256 | ||
242 | #ifdef __cplusplus | 257 | #ifdef __cplusplus |
243 | } | 258 | } |