mirror of
https://github.com/QuasarApp/openssl.git
synced 2025-05-15 02:49:39 +00:00
Flag to allow use of DSA_METHOD in FIPS mode.
This commit is contained in:
parent
fcdf1d3fc7
commit
6fa6e3e2df
@ -88,6 +88,13 @@
|
|||||||
* be used for all exponents.
|
* be used for all exponents.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* If this flag is set external DSA_METHOD callbacks are allowed in FIPS mode
|
||||||
|
* it is then the applications responsibility to ensure the external method
|
||||||
|
* is compliant.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define DSA_FLAG_FIPS_EXTERNAL_METHOD_ALLOW 0x04
|
||||||
|
|
||||||
#if defined(OPENSSL_FIPS)
|
#if defined(OPENSSL_FIPS)
|
||||||
#define FIPS_DSA_SIZE_T int
|
#define FIPS_DSA_SIZE_T int
|
||||||
#endif
|
#endif
|
||||||
|
@ -72,7 +72,8 @@
|
|||||||
DSA_SIG * DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa)
|
DSA_SIG * DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa)
|
||||||
{
|
{
|
||||||
#ifdef OPENSSL_FIPS
|
#ifdef OPENSSL_FIPS
|
||||||
if(FIPS_mode() && !FIPS_dsa_check(dsa))
|
if(FIPS_mode() && !FIPS_dsa_check(dsa)
|
||||||
|
&& !(dsa->flags & DSA_FLAG_FIPS_EXTERNAL_METHOD_ALLOW))
|
||||||
return NULL;
|
return NULL;
|
||||||
#endif
|
#endif
|
||||||
return dsa->meth->dsa_do_sign(dgst, dlen, dsa);
|
return dsa->meth->dsa_do_sign(dgst, dlen, dsa);
|
||||||
@ -96,7 +97,8 @@ int DSA_sign(int type, const unsigned char *dgst, int dlen, unsigned char *sig,
|
|||||||
int DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp)
|
int DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp)
|
||||||
{
|
{
|
||||||
#ifdef OPENSSL_FIPS
|
#ifdef OPENSSL_FIPS
|
||||||
if(FIPS_mode() && !FIPS_dsa_check(dsa))
|
if(FIPS_mode() && !FIPS_dsa_check(dsa)
|
||||||
|
&& !(dsa->flags & DSA_FLAG_FIPS_EXTERNAL_METHOD_ALLOW))
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
return dsa->meth->dsa_sign_setup(dsa, ctx_in, kinvp, rp);
|
return dsa->meth->dsa_sign_setup(dsa, ctx_in, kinvp, rp);
|
||||||
|
@ -74,7 +74,8 @@ int DSA_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig,
|
|||||||
DSA *dsa)
|
DSA *dsa)
|
||||||
{
|
{
|
||||||
#ifdef OPENSSL_FIPS
|
#ifdef OPENSSL_FIPS
|
||||||
if(FIPS_mode() && !FIPS_dsa_check(dsa))
|
if(FIPS_mode() && !FIPS_dsa_check(dsa)
|
||||||
|
&& !(dsa->flags & DSA_FLAG_FIPS_EXTERNAL_METHOD_ALLOW))
|
||||||
return -1;
|
return -1;
|
||||||
#endif
|
#endif
|
||||||
return dsa->meth->dsa_do_verify(dgst, dgst_len, sig, dsa);
|
return dsa->meth->dsa_do_verify(dgst, dgst_len, sig, dsa);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user