diff --git a/cpp/Cipher/MGLCipherHostObject.cpp b/cpp/Cipher/MGLCipherHostObject.cpp index 5153ac7d..bc3306b4 100644 --- a/cpp/Cipher/MGLCipherHostObject.cpp +++ b/cpp/Cipher/MGLCipherHostObject.cpp @@ -603,7 +603,7 @@ bool MGLCipherHostObject::InitAuthenticated(const char *cipher_type, int iv_len, #if OPENSSL_VERSION_MAJOR >= 3 // TODO: not sure where kind_ comes from in next line, but as we bump // OpenSSL version we will need to look at Node.js code and figure it out. - if (mode == EVP_CIPH_CCM_MODE && kind_ == kDecipher && + if (mode == EVP_CIPH_CCM_MODE && !isCipher_ && EVP_default_properties_is_fips_enabled(nullptr)) { #else if (mode == EVP_CIPH_CCM_MODE && !isCipher_ && FIPS_mode()) {