Skip to content

Commit ecee3f1

Browse files
committed
Next attempt to fix bug #80368
Apparently treating LibreSSL as OpenSSL 1.1 is not just something we did in our code, it's something that upstream LibreSSL claims, despite not actually being compatible. Duh. Check for EVP_CIPH_OCB_MODE instead, which should reliably determine support...
1 parent 5e15c9c commit ecee3f1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ext/openssl/openssl.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6496,8 +6496,9 @@ static void php_openssl_load_cipher_mode(struct php_openssl_cipher_mode *mode, c
64966496
int cipher_mode = EVP_CIPHER_mode(cipher_type);
64976497
memset(mode, 0, sizeof(struct php_openssl_cipher_mode));
64986498
switch (cipher_mode) {
6499-
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
6500-
/* Note: While OpenSSL 1.1 supports OCB mode, LibreSSL does not support it. */
6499+
#ifdef EVP_CIPH_OCB_MODE
6500+
/* Since OpenSSL 1.1, all AEAD ciphers use a common framework. We check for
6501+
* EVP_CIPH_OCB_MODE, because LibreSSL does not support it. */
65016502
case EVP_CIPH_GCM_MODE:
65026503
case EVP_CIPH_OCB_MODE:
65036504
case EVP_CIPH_CCM_MODE:

0 commit comments

Comments
 (0)