dtls cid: address reviewer's comments

This commit is contained in:
Marco Oliverio
2024-10-01 06:45:37 +00:00
parent 9dccd66a3a
commit 7e69c2049b
2 changed files with 10 additions and 2 deletions

View File

@ -4850,7 +4850,7 @@ int wolfSSL_GetVersion(const WOLFSSL* ssl)
if (ssl == NULL) if (ssl == NULL)
return BAD_FUNC_ARG; return BAD_FUNC_ARG;
if (ssl->version.major == SSLv3_MAJOR || ssl->version.major == DTLS_MAJOR) { if (ssl->version.major == SSLv3_MAJOR) {
switch (ssl->version.minor) { switch (ssl->version.minor) {
case SSLv3_MINOR : case SSLv3_MINOR :
return WOLFSSL_SSLV3; return WOLFSSL_SSLV3;
@ -4862,6 +4862,13 @@ int wolfSSL_GetVersion(const WOLFSSL* ssl)
return WOLFSSL_TLSV1_2; return WOLFSSL_TLSV1_2;
case TLSv1_3_MINOR : case TLSv1_3_MINOR :
return WOLFSSL_TLSV1_3; return WOLFSSL_TLSV1_3;
default:
break;
}
}
#ifdef WOLFSSL_DTLS
if (ssl->version.major == DTLS_MAJOR) {
switch (ssl->version.minor) {
case DTLS_MINOR : case DTLS_MINOR :
return WOLFSSL_DTLSV1; return WOLFSSL_DTLSV1;
case DTLSv1_2_MINOR : case DTLSv1_2_MINOR :
@ -4872,6 +4879,7 @@ int wolfSSL_GetVersion(const WOLFSSL* ssl)
break; break;
} }
} }
#endif /* WOLFSSL_DTLS */
return VERSION_ERROR; return VERSION_ERROR;
} }

View File

@ -913,8 +913,8 @@ static int Hmac_OuterHash(Hmac* hmac, unsigned char* mac)
(word32)digestSz); (word32)digestSz);
if (ret == 0) if (ret == 0)
ret = wc_HashFinal(&hash, hashType, mac); ret = wc_HashFinal(&hash, hashType, mac);
wc_HashFree(&hash, hashType);
} }
wc_HashFree(&hash, hashType);
return ret; return ret;
} }