Skip to content

Commit 9ed0018

Browse files
authored
Merge pull request #6980 from gojimmypi/SM-cipher-type-PR
Fix evp SM cipherType check
2 parents 06dcc11 + 16dba37 commit 9ed0018

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/ssl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14690,7 +14690,7 @@ int AddSessionToCache(WOLFSSL_CTX* ctx, WOLFSSL_SESSION* addSession,
1469014690
cacheSession->ticketNonce.data = cacheSession->ticketNonce.dataStatic;
1469114691
cacheSession->ticketNonce.len = 0;
1469214692
}
14693-
#endif /* WOFLSSL_TLS13 && WOLFSSL_TICKET_NONCE_MALLOC && FIPS_VERSION_GE(5,3)*/
14693+
#endif /* WOLFSSL_TLS13 && WOLFSSL_TICKET_NONCE_MALLOC && FIPS_VERSION_GE(5,3)*/
1469414694
#endif
1469514695
#ifdef SESSION_CERTS
1469614696
if (overwrite &&

wolfcrypt/src/evp.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5992,8 +5992,8 @@ void wolfSSL_EVP_init(void)
59925992
}
59935993
else
59945994
#endif /* HAVE_CHACHA && HAVE_POLY1305 */
5995-
#if defined(WOFLSSL_SM4_GCM)
5996-
if (ctx->cipherType == WOLFSSL_SM4_GCM) {
5995+
#if defined(WOLFSSL_SM4_GCM)
5996+
if (ctx->cipherType == SM4_GCM_TYPE) {
59975997
if ((arg <= 0) || (arg > SM4_BLOCK_SIZE) || (ptr == NULL)) {
59985998
break;
59995999
}
@@ -6005,8 +6005,8 @@ void wolfSSL_EVP_init(void)
60056005
}
60066006
else
60076007
#endif
6008-
#if defined(WOFLSSL_SM4_CCM)
6009-
if (ctx->cipherType == WOLFSSL_SM4_CCM) {
6008+
#if defined(WOLFSSL_SM4_CCM)
6009+
if (ctx->cipherType == SM4_CCM_TYPE) {
60106010
if ((arg <= 0) || (arg > SM4_BLOCK_SIZE) || (ptr == NULL)) {
60116011
break;
60126012
}
@@ -6040,15 +6040,15 @@ void wolfSSL_EVP_init(void)
60406040
else
60416041
#endif /* HAVE_CHACHA && HAVE_POLY1305 */
60426042
#if defined(WOLFSSL_SM4_GCM)
6043-
if (ctx->cipherType == WOLFSSL_SM4_GCM) {
6043+
if (ctx->cipherType == SM4_GCM_TYPE) {
60446044
if (arg <= 0 || arg > SM4_BLOCK_SIZE) {
60456045
break;
60466046
}
60476047
}
60486048
else
60496049
#endif
60506050
#if defined(WOLFSSL_SM4_CCM)
6051-
if (ctx->cipherType == WOLFSSL_SM4_CCM) {
6051+
if (ctx->cipherType == SM4_CCM_TYPE) {
60526052
if (arg <= 0 || arg > SM4_BLOCK_SIZE) {
60536053
break;
60546054
}

0 commit comments

Comments
 (0)