File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed
Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 8282#include <wolfssl/wolfcrypt/random.h>
8383#include <wolfssl/wolfcrypt/pwdbased.h>
8484#ifdef HAVE_WOLFSSL_WOLFCRYPT_KDF_H
85- #include <wolfssl/wolfcrypt/kdf.h>
85+ #include <wolfssl/wolfcrypt/kdf.h>
86+ #endif
87+ #ifdef HAVE_FIPS
88+ #include <wolfssl/wolfcrypt/fips_test.h>
8689#endif
8790
8891/* The DES3-CBC code won't compile unless wolfCrypt has support for it. */
Original file line number Diff line number Diff line change @@ -1311,6 +1311,23 @@ static const ECDSA_METHOD *we_ecdsa(void)
13111311#endif
13121312#endif /* WE_HAVE_ECDSA */
13131313
1314+ #ifdef HAVE_FIPS
1315+ static void we_fips_cb (int ok , int err , const char * hash )
1316+ {
1317+ printf ("*******************************************\n" );
1318+ printf ("we_fips_cb: ok = %d, err = %d\n" , ok , err );
1319+ printf ("error message = %s\n" , wc_GetErrorString (err ));
1320+ printf ("hash = %s\n" , hash );
1321+
1322+ if (err == IN_CORE_FIPS_E ) {
1323+ printf ("FIPS module integrity check failure. Copy above hash value "
1324+ "into verifyCore[] in wolfSSL's (NOT wolfEngine) fips_test.c "
1325+ "and rebuild wolfSSL.\n" );
1326+ }
1327+ printf ("*******************************************\n" );
1328+ }
1329+ #endif
1330+
13141331/**
13151332 * Bind the wolfengine into an engine object.
13161333 *
@@ -1324,6 +1341,10 @@ int wolfengine_bind(ENGINE *e, const char *id)
13241341
13251342 WOLFENGINE_ENTER (WE_LOG_ENGINE , "wolfengine_bind" );
13261343
1344+ #ifdef HAVE_FIPS
1345+ wolfCrypt_SetCb_fips (we_fips_cb );
1346+ #endif
1347+
13271348 if ((id != NULL ) &&
13281349 (XSTRNCMP (id , wolfengine_id , XSTRLEN (wolfengine_id )) != 0 )) {
13291350 ret = 0 ;
You can’t perform that action at this time.
0 commit comments