Latest update.
This commit is contained in:
+9
-9
@@ -30,10 +30,10 @@
|
||||
#include "crypto/dh.h"
|
||||
#include "dh_local.h"
|
||||
|
||||
#ifndef FIPS_MODE
|
||||
#ifndef FIPS_MODULE
|
||||
static int dh_builtin_genparams(DH *ret, int prime_len, int generator,
|
||||
BN_GENCB *cb);
|
||||
#endif /* FIPS_MODE */
|
||||
#endif /* FIPS_MODULE */
|
||||
|
||||
int dh_generate_ffc_parameters(DH *dh, int type, int pbits,
|
||||
int qbits, EVP_MD *md, BN_GENCB *cb)
|
||||
@@ -47,7 +47,7 @@ int dh_generate_ffc_parameters(DH *dh, int type, int pbits,
|
||||
qbits = (pbits >= 2048 ? SHA256_DIGEST_LENGTH :
|
||||
SHA_DIGEST_LENGTH) * 8;
|
||||
}
|
||||
#ifndef FIPS_MODE
|
||||
#ifndef FIPS_MODULE
|
||||
if (type == DH_PARAMGEN_TYPE_FIPS_186_2)
|
||||
ret = ffc_params_FIPS186_2_generate(dh->libctx, &dh->params,
|
||||
FFC_PARAM_TYPE_DH,
|
||||
@@ -96,7 +96,7 @@ int dh_get_named_group_uid_from_size(int pbits)
|
||||
return nid;
|
||||
}
|
||||
|
||||
#ifdef FIPS_MODE
|
||||
#ifdef FIPS_MODULE
|
||||
|
||||
static int dh_gen_named_group(OPENSSL_CTX *libctx, DH *ret, int prime_len)
|
||||
{
|
||||
@@ -116,12 +116,12 @@ static int dh_gen_named_group(OPENSSL_CTX *libctx, DH *ret, int prime_len)
|
||||
DH_free(dh);
|
||||
return ok;
|
||||
}
|
||||
#endif /* FIPS_MODE */
|
||||
#endif /* FIPS_MODULE */
|
||||
|
||||
int DH_generate_parameters_ex(DH *ret, int prime_len, int generator,
|
||||
BN_GENCB *cb)
|
||||
{
|
||||
#ifdef FIPS_MODE
|
||||
#ifdef FIPS_MODULE
|
||||
if (generator != 2)
|
||||
return 0;
|
||||
return dh_gen_named_group(ret->libctx, ret, prime_len);
|
||||
@@ -129,10 +129,10 @@ int DH_generate_parameters_ex(DH *ret, int prime_len, int generator,
|
||||
if (ret->meth->generate_params)
|
||||
return ret->meth->generate_params(ret, prime_len, generator, cb);
|
||||
return dh_builtin_genparams(ret, prime_len, generator, cb);
|
||||
#endif /* FIPS_MODE */
|
||||
#endif /* FIPS_MODULE */
|
||||
}
|
||||
|
||||
#ifndef FIPS_MODE
|
||||
#ifndef FIPS_MODULE
|
||||
/*-
|
||||
* We generate DH parameters as follows
|
||||
* find a prime p which is prime_len bits long,
|
||||
@@ -238,4 +238,4 @@ static int dh_builtin_genparams(DH *ret, int prime_len, int generator,
|
||||
BN_CTX_free(ctx);
|
||||
return ok;
|
||||
}
|
||||
#endif /* FIPS_MODE */
|
||||
#endif /* FIPS_MODULE */
|
||||
Reference in New Issue
Block a user