Skip to content

Commit

Permalink
Next attempt to fix bug #80368
Browse files Browse the repository at this point in the history
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...
  • Loading branch information
nikic committed Nov 30, 2020
1 parent 5e15c9c commit ecee3f1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ext/openssl/openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -6496,8 +6496,9 @@ static void php_openssl_load_cipher_mode(struct php_openssl_cipher_mode *mode, c
int cipher_mode = EVP_CIPHER_mode(cipher_type);
memset(mode, 0, sizeof(struct php_openssl_cipher_mode));
switch (cipher_mode) {
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
/* Note: While OpenSSL 1.1 supports OCB mode, LibreSSL does not support it. */
#ifdef EVP_CIPH_OCB_MODE
/* Since OpenSSL 1.1, all AEAD ciphers use a common framework. We check for
* EVP_CIPH_OCB_MODE, because LibreSSL does not support it. */
case EVP_CIPH_GCM_MODE:
case EVP_CIPH_OCB_MODE:
case EVP_CIPH_CCM_MODE:
Expand Down

0 comments on commit ecee3f1

Please sign in to comment.