OE30 and OE31 changes external to FIPS module for NetBSD builds

This commit is contained in:
kaleb-himes
2021-11-10 15:16:21 -07:00
parent b2ba6f94af
commit 6bb86cf4da
3 changed files with 21 additions and 2 deletions

View File

@ -218,6 +218,21 @@
#include <wolfssl/wolfcrypt/async.h>
#endif
#ifdef HAVE_FIPS
#include <wolfssl/wolfcrypt/fips_test.h>
static void myFipsCb(int ok, int err, const char* hash)
{
printf("in my Fips callback, ok = %d, err = %d\n", ok, err);
printf("message = %s\n", wc_GetErrorString(err));
printf("hash = %s\n", hash);
if (err == IN_CORE_FIPS_E) {
printf("In core integrity hash check failure, copy above hash\n");
printf("into verifyCore[] in fips_test.c and rebuild\n");
}
}
#endif
#ifdef WOLFSSL_STATIC_MEMORY
static WOLFSSL_HEAP_HINT* HEAP_HINT;
@ -2127,6 +2142,10 @@ int benchmark_test(void *args)
printf(" wolfSSL version %s\n", LIBWOLFSSL_VERSION_STRING);
printf("------------------------------------------------------------------------------\n");
#ifdef HAVE_FIPS
wolfCrypt_SetCb_fips(myFipsCb);
#endif
ret = benchmark_init();
if (ret != 0)
EXIT_TEST(ret);

View File

@ -10187,7 +10187,7 @@ int wc_OBJ_sn2nid(const char *sn)
sn = "SECP256R1";
/* OpenSSL allows lowercase curve names */
for (i = 0; i < (int)(sizeof(curveName) - 1) && *sn; i++) {
curveName[i] = (char)XTOUPPER(*sn++);
curveName[i] = (char)XTOUPPER((unsigned int) *sn++);
}
curveName[i] = '\0';
/* find based on name and return NID */

View File

@ -3695,7 +3695,7 @@ const WOLFSSL_EVP_MD *wolfSSL_EVP_get_digestbyname(const char *name)
const struct s_ent *ent;
for (i = 0; i < sizeof(nameUpper) && name[i] != '\0'; i++) {
nameUpper[i] = (char)XTOUPPER(name[i]);
nameUpper[i] = (char)XTOUPPER((unsigned int) name[i]);
}
if (i < sizeof(nameUpper))
nameUpper[i] = '\0';