Skip to content

Commit f9d6a03

Browse files
committed
fix: add CFB128 and OFB cases to wolfSSL_EVP_get_cipherbynid
The iv_length test used EVP_get_cipherbynid(NID_aes_128_cfb128) which returned NULL because the switch had no CFB128 or OFB cases, causing a segfault in EVP_CIPHER_iv_length(NULL).
1 parent 58d3d84 commit f9d6a03

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

wolfcrypt/src/evp.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5674,6 +5674,34 @@ const WOLFSSL_EVP_CIPHER *wolfSSL_EVP_get_cipherbynid(int id)
56745674
return wolfSSL_EVP_aes_256_ccm();
56755675
#endif
56765676
#endif
5677+
#ifdef WOLFSSL_AES_OFB
5678+
#ifdef WOLFSSL_AES_128
5679+
case WC_NID_aes_128_ofb:
5680+
return wolfSSL_EVP_aes_128_ofb();
5681+
#endif
5682+
#ifdef WOLFSSL_AES_192
5683+
case WC_NID_aes_192_ofb:
5684+
return wolfSSL_EVP_aes_192_ofb();
5685+
#endif
5686+
#ifdef WOLFSSL_AES_256
5687+
case WC_NID_aes_256_ofb:
5688+
return wolfSSL_EVP_aes_256_ofb();
5689+
#endif
5690+
#endif /* WOLFSSL_AES_OFB */
5691+
#ifdef WOLFSSL_AES_CFB
5692+
#ifdef WOLFSSL_AES_128
5693+
case WC_NID_aes_128_cfb128:
5694+
return wolfSSL_EVP_aes_128_cfb128();
5695+
#endif
5696+
#ifdef WOLFSSL_AES_192
5697+
case WC_NID_aes_192_cfb128:
5698+
return wolfSSL_EVP_aes_192_cfb128();
5699+
#endif
5700+
#ifdef WOLFSSL_AES_256
5701+
case WC_NID_aes_256_cfb128:
5702+
return wolfSSL_EVP_aes_256_cfb128();
5703+
#endif
5704+
#endif /* WOLFSSL_AES_CFB */
56775705
#endif
56785706

56795707
#ifdef HAVE_ARIA

0 commit comments

Comments
 (0)