From 4d819dea87a0fb9308461c46e1bed0c36389d632 Mon Sep 17 00:00:00 2001 From: Chris Conlon Date: Fri, 7 Nov 2014 17:19:11 -0700 Subject: [PATCH 1/3] fix hashType warning on Linux --- ctaocrypt/src/asn.c | 4 ++-- cyassl/ctaocrypt/asn_public.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ctaocrypt/src/asn.c b/ctaocrypt/src/asn.c index ef0389625..614134b94 100644 --- a/ctaocrypt/src/asn.c +++ b/ctaocrypt/src/asn.c @@ -2894,9 +2894,9 @@ word32 EncodeSignature(byte* out, const byte* digest, word32 digSz, int hashOID) } -int GetCTC_HashOID(int hashType) +int GetCTC_HashOID(int type) { - switch (hashType) { + switch (type) { #ifdef CYASSL_MD2 case MD2: return MD2h; diff --git a/cyassl/ctaocrypt/asn_public.h b/cyassl/ctaocrypt/asn_public.h index 405d95368..4650abb7f 100644 --- a/cyassl/ctaocrypt/asn_public.h +++ b/cyassl/ctaocrypt/asn_public.h @@ -184,7 +184,7 @@ CYASSL_API int SetDatesBuffer(Cert*, const byte*, int); /* DER encode signature */ CYASSL_API word32 EncodeSignature(byte* out, const byte* digest, word32 digSz, int hashOID); -CYASSL_API int GetCTC_HashOID(int hashType); +CYASSL_API int GetCTC_HashOID(int type); #ifdef __cplusplus } /* extern "C" */ From 81fd594c9f4370c975aac5d4f0badaeca814e9ef Mon Sep 17 00:00:00 2001 From: toddouska Date: Fri, 7 Nov 2014 16:23:19 -0800 Subject: [PATCH 2/3] add fips get status functions --- cyassl/ctaocrypt/fips_test.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cyassl/ctaocrypt/fips_test.h b/cyassl/ctaocrypt/fips_test.h index e40a19964..0ad9c6285 100644 --- a/cyassl/ctaocrypt/fips_test.h +++ b/cyassl/ctaocrypt/fips_test.h @@ -30,17 +30,20 @@ extern "C" { #endif -/* Known Answer Test string inputs are hex */ - +/* Known Answer Test string inputs are hex, internal */ CYASSL_LOCAL int DoKnownAnswerTests(char*); -/* Power on self test failure callback */ +/* FIPS 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); +/* Public get status functions */ +CYASSL_API int wolfCrypt_GetStatus_fips(void); +CYASSL_API const char* wolfCrypt_GetCoreHash_fips(void); + #ifdef __cplusplus } /* extern "C" */ From eda2103dc3b9b067f30cb29b38e7f3e44e0fc747 Mon Sep 17 00:00:00 2001 From: toddouska Date: Fri, 7 Nov 2014 16:43:32 -0800 Subject: [PATCH 3/3] add size check to fips core hash gen --- cyassl/ctaocrypt/fips_test.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cyassl/ctaocrypt/fips_test.h b/cyassl/ctaocrypt/fips_test.h index 0ad9c6285..b492a4fd7 100644 --- a/cyassl/ctaocrypt/fips_test.h +++ b/cyassl/ctaocrypt/fips_test.h @@ -31,7 +31,7 @@ #endif /* Known Answer Test string inputs are hex, internal */ -CYASSL_LOCAL int DoKnownAnswerTests(char*); +CYASSL_LOCAL int DoKnownAnswerTests(char*, int); /* FIPS failure callback */