Skip to content

Commit fe5d418

Browse files
authored
Fix OpenSSL SIV mode compatibility with older OpenSSL (#21880)
1 parent bd78496 commit fe5d418

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

ext/openssl/openssl_backend_common.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1654,7 +1654,7 @@ void php_openssl_load_cipher_mode(struct php_openssl_cipher_mode *mode, const EV
16541654
switch (cipher_mode) {
16551655
case EVP_CIPH_GCM_MODE:
16561656
case EVP_CIPH_CCM_MODE:
1657-
/* We check for EVP_CIPH_SIV_MODE and EVP_CIPH_SIV_MODE, because LibreSSL does not support it. */
1657+
/* We check for EVP_CIPH_SIV_MODE and EVP_CIPH_SIV_MODE, because older OpenSSL and LibreSSL do not support them. */
16581658
#ifdef EVP_CIPH_SIV_MODE
16591659
case EVP_CIPH_SIV_MODE:
16601660
#endif
@@ -1667,7 +1667,9 @@ void php_openssl_load_cipher_mode(struct php_openssl_cipher_mode *mode, const EV
16671667
php_openssl_set_aead_flags(mode);
16681668
mode->set_tag_length_when_encrypting = cipher_mode == EVP_CIPH_CCM_MODE;
16691669
mode->is_single_run_aead = cipher_mode == EVP_CIPH_CCM_MODE;
1670+
#ifdef EVP_CIPH_SIV_MODE
16701671
mode->aad_supports_vector = cipher_mode == EVP_CIPH_SIV_MODE;
1672+
#endif
16711673
break;
16721674
#ifdef NID_chacha20_poly1305
16731675
default:

0 commit comments

Comments
 (0)