Skip to content

Commit 4b96833

Browse files
davidbenCQ bot account: commit-bot@chromium.org
authored andcommitted
Add a compatibility EVP_CIPH_OCB_MODE value.
Node references it these days. Also replace the no-op modes with negative numbers rather than zero. Stream ciphers like RC4 report a "mode" of zero, so code comparing the mode to a dummy value will get confused. (I came across nodejs/node#23635, though we'd have run into it sooner or later anyway. Better to just define the value and avoid ifdef proliferation.) Change-Id: I223f25663e138480ad83f35aa16f5218f1425563 Reviewed-on: https://boringssl-review.googlesource.com/c/32464 Reviewed-by: Adam Langley <agl@google.com> Commit-Queue: Adam Langley <agl@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
1 parent 0e15002 commit 4b96833

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

include/openssl/cipher.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,9 @@ OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_128_cfb128(void);
424424

425425
// The following flags do nothing and are included only to make it easier to
426426
// compile code with BoringSSL.
427-
#define EVP_CIPH_CCM_MODE 0
428-
#define EVP_CIPH_WRAP_MODE 0
427+
#define EVP_CIPH_CCM_MODE (-1)
428+
#define EVP_CIPH_OCB_MODE (-2)
429+
#define EVP_CIPH_WRAP_MODE (-3)
429430
#define EVP_CIPHER_CTX_FLAG_WRAP_ALLOW 0
430431

431432
// EVP_CIPHER_CTX_set_flags does nothing.

0 commit comments

Comments
 (0)