Skip to content

Commit b146c4e

Browse files
committed
Add SM3 in wolfSSL_HmacCopy
1 parent dc421a0 commit b146c4e

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/ssl_crypto.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1606,6 +1606,20 @@ int wolfSSL_HmacCopy(Hmac* dst, Hmac* src)
16061606
#endif /* WOLFSSL_NO_SHA3_512 */
16071607
#endif /* WOLFSSL_SHA3 */
16081608

1609+
#ifdef WOLFSSL_SM3
1610+
case WC_SM3:
1611+
rc = wc_Sm3Copy(&src->hash.sm3, &dst->hash.sm3);
1612+
#ifdef WOLFSSL_HMAC_COPY_HASH
1613+
if (rc == 0) {
1614+
rc = wc_Sm3Copy(&src->i_hash.sm3, &dst->i_hash.sm3);
1615+
}
1616+
if (rc == 0) {
1617+
rc = wc_Sm3Copy(&src->o_hash.sm3, &dst->o_hash.sm3);
1618+
}
1619+
#endif
1620+
break;
1621+
#endif /* WOLFSSL_SM3 */
1622+
16091623
default:
16101624
/* Digest algorithm not supported. */
16111625
rc = BAD_FUNC_ARG;

0 commit comments

Comments
 (0)