File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 2121
2222#include <wolfengine/we_internal.h>
2323#include <wolfengine/we_wolfengine.h>
24+ #if defined(HAVE_FIPS_VERSION ) && HAVE_FIPS_VERSION == 5
25+ #include <wolfssl/wolfcrypt/fips_test.h>
26+ #endif
2427
2528#ifdef WE_NO_OPENSSL_MALLOC
2629#if OPENSSL_VERSION_NUMBER >= 0x10100000L
@@ -798,6 +801,23 @@ static int wolfengine_init(ENGINE *e)
798801 wc_SetSeed_Cb (wc_GenerateSeed );
799802#endif
800803 ret = we_init_random ();
804+ #if defined(HAVE_FIPS_VERSION ) && HAVE_FIPS_VERSION == 5 && \
805+ defined(WE_HAVE_ECC )
806+ #if defined(WE_HAVE_ECDH )
807+ if (ret == 1 ) {
808+ if (wc_RunCast_fips (FIPS_CAST_ECC_PRIMITIVE_Z ) != 0 ) {
809+ ret = 0 ;
810+ }
811+ }
812+ #endif /* WE_HAVE_ECDH */
813+ #if defined(WE_HAVE_ECDSA )
814+ if (ret == 1 ) {
815+ if (wc_RunCast_fips (FIPS_CAST_ECDSA ) != 0 ) {
816+ ret = 0 ;
817+ }
818+ }
819+ #endif /* WE_HAVE_ECDSA */
820+ #endif /* HAVE_FIPS_VERSION && WE_HAVE_ECC */
801821#endif
802822#ifdef WE_HAVE_SHA1
803823 if (ret == 1 ) {
You can’t perform that action at this time.
0 commit comments