mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-29 18:27:29 +02:00
OE30 and OE31 changes external to FIPS module for NetBSD builds
This commit is contained in:
@ -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);
|
||||
|
@ -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 */
|
||||
|
@ -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';
|
||||
|
Reference in New Issue
Block a user