From 758665e347961789ab3b6905a72f9952ef9ab854 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Thu, 6 Aug 2020 17:49:55 -0500 Subject: [PATCH] Fix for TLS anonymous cipher and PKCS11 cast warnings. (author=dgarske) --- src/internal.c | 2 ++ wolfcrypt/src/wc_pkcs11.c | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/internal.c b/src/internal.c index e9a888bb1..2518621ae 100644 --- a/src/internal.c +++ b/src/internal.c @@ -18999,6 +18999,8 @@ const char* GetCipherAuthStr(char n[][MAX_SEGMENT_SZ]) { authStr = "SRP"; else if (XSTRNCMP(n1,"ECDSA",5) == 0) authStr = "ECDSA"; + else if (XSTRNCMP(n0,"ADH",3) == 0) + authStr = "None"; else authStr = "unknown"; diff --git a/wolfcrypt/src/wc_pkcs11.c b/wolfcrypt/src/wc_pkcs11.c index eb19558eb..f48e797c8 100644 --- a/wolfcrypt/src/wc_pkcs11.c +++ b/wolfcrypt/src/wc_pkcs11.c @@ -1061,8 +1061,8 @@ static int Pkcs11GetRsaPublicKey(RsaKey* key, Pkcs11Session* session, ret = WC_HW_E; if (ret == 0) { - modSz = tmpl[0].ulValueLen; - expSz = tmpl[1].ulValueLen; + modSz = (int)tmpl[0].ulValueLen; + expSz = (int)tmpl[1].ulValueLen; mod = (unsigned char*)XMALLOC(modSz, key->heap, DYNAMIC_TYPE_TMP_BUFFER); if (mod == NULL) @@ -1162,9 +1162,9 @@ static int Pkcs11RsaKeyGen(Pkcs11Session* session, wc_CryptoInfo* info) ret = Pkcs11GetRsaPublicKey(key, session, pubKey); if (pubKey != NULL_PTR) - ret = session->func->C_DestroyObject(session->handle, pubKey); + ret = (int)session->func->C_DestroyObject(session->handle, pubKey); if (ret != 0 && privKey != NULL_PTR) - ret = session->func->C_DestroyObject(session->handle, privKey); + ret = (int)session->func->C_DestroyObject(session->handle, privKey); return ret; }