mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-03 20:54:41 +02:00
add fips pos cb for fail codes, generated hash
This commit is contained in:
@@ -70,6 +70,9 @@
|
|||||||
#ifdef HAVE_PKCS7
|
#ifdef HAVE_PKCS7
|
||||||
#include <cyassl/ctaocrypt/pkcs7.h>
|
#include <cyassl/ctaocrypt/pkcs7.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_FIPS
|
||||||
|
#include <cyassl/ctaocrypt/fips_test.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
/* 4996 warning to use MS extensions e.g., strcpy_s instead of strncpy */
|
/* 4996 warning to use MS extensions e.g., strcpy_s instead of strncpy */
|
||||||
@@ -207,6 +210,16 @@ typedef struct func_args {
|
|||||||
} func_args;
|
} func_args;
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef HAVE_FIPS
|
||||||
|
|
||||||
|
static void myFipsCb(int ok, int err, const char* hash)
|
||||||
|
{
|
||||||
|
printf("in my Fips callback, ok = %d, err = %d\n", ok, err);
|
||||||
|
printf("hash = %s\n", hash);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* HAVE_FIPS */
|
||||||
|
|
||||||
|
|
||||||
int ctaocrypt_test(void* args)
|
int ctaocrypt_test(void* args)
|
||||||
{
|
{
|
||||||
@@ -214,6 +227,10 @@ int ctaocrypt_test(void* args)
|
|||||||
|
|
||||||
((func_args*)args)->return_code = -1; /* error state */
|
((func_args*)args)->return_code = -1; /* error state */
|
||||||
|
|
||||||
|
#ifdef HAVE_FIPS
|
||||||
|
wolfCrypt_SetCb_fips(myFipsCb);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !defined(NO_BIG_INT)
|
#if !defined(NO_BIG_INT)
|
||||||
if (CheckCtcSettings() != 1)
|
if (CheckCtcSettings() != 1)
|
||||||
return err_sys("Build vs runtime math mismatch\n", -1234);
|
return err_sys("Build vs runtime math mismatch\n", -1234);
|
||||||
|
@@ -32,7 +32,14 @@
|
|||||||
|
|
||||||
/* Known Answer Test string inputs are hex */
|
/* Known Answer Test string inputs are hex */
|
||||||
|
|
||||||
CYASSL_LOCAL int DoKnownAnswerTests(void);
|
CYASSL_LOCAL int DoKnownAnswerTests(char*);
|
||||||
|
|
||||||
|
|
||||||
|
/* Power on self test failure callback */
|
||||||
|
typedef void(*wolfCrypt_fips_cb)(int ok, int err, const char* hash);
|
||||||
|
|
||||||
|
/* Public set function */
|
||||||
|
CYASSL_API int wolfCrypt_SetCb_fips(wolfCrypt_fips_cb cbf);
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
Reference in New Issue
Block a user