Redirection of ECDSA, ECDH operations to FIPS module.

Also use FIPS EC methods unconditionally for now: might want to use them
only in FIPS mode or with a switch later.
This commit is contained in:
Dr. Stephen Henson
2011-06-06 15:39:17 +00:00
parent a6dc77822b
commit 6342b6e332
8 changed files with 67 additions and 2 deletions

View File

@@ -73,6 +73,9 @@
#include <openssl/engine.h>
#endif
#include <openssl/err.h>
#ifdef OPENSSL_FIPS
#include <openssl/fips.h>
#endif
const char ECDH_version[]="ECDH" OPENSSL_VERSION_PTEXT;
@@ -90,7 +93,14 @@ void ECDH_set_default_method(const ECDH_METHOD *meth)
const ECDH_METHOD *ECDH_get_default_method(void)
{
if(!default_ECDH_method)
default_ECDH_method = ECDH_OpenSSL();
{
#ifdef OPENSSL_FIPS
if (FIPS_mode())
default_ECDH_method = FIPS_ecdh_openssl();
else
#endif
default_ECDH_method = ECDH_OpenSSL();
}
return default_ECDH_method;
}