You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by sc...@apache.org on 2017/01/03 16:41:24 UTC
svn commit: r1777158 -
/santuario/xml-security-cpp/trunk/xsec/enc/OpenSSL/OpenSSLCryptoSymmetricKey.cpp
Author: scantor
Date: Tue Jan 3 16:41:24 2017
New Revision: 1777158
URL: http://svn.apache.org/viewvc?rev=1777158&view=rev
Log:
OpenSSL 1.1 compatibility - Fix GCM issue due to CipherInit API change.
Modified:
santuario/xml-security-cpp/trunk/xsec/enc/OpenSSL/OpenSSLCryptoSymmetricKey.cpp
Modified: santuario/xml-security-cpp/trunk/xsec/enc/OpenSSL/OpenSSLCryptoSymmetricKey.cpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/enc/OpenSSL/OpenSSLCryptoSymmetricKey.cpp?rev=1777158&r1=1777157&r2=1777158&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/enc/OpenSSL/OpenSSLCryptoSymmetricKey.cpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/enc/OpenSSL/OpenSSLCryptoSymmetricKey.cpp Tue Jan 3 16:41:24 2017
@@ -222,10 +222,10 @@ int OpenSSLCryptoSymmetricKey::decryptCt
}
// We have everything, so we can fully init.
- EVP_CipherInit(mp_ctx, EVP_aes_128_gcm(), NULL, NULL, 0);
+ EVP_CipherInit_ex(mp_ctx, EVP_aes_128_gcm(), NULL, NULL, NULL, 0);
EVP_CIPHER_CTX_ctrl(mp_ctx, EVP_CTRL_GCM_SET_IVLEN, 12, NULL);
EVP_CIPHER_CTX_ctrl(mp_ctx, EVP_CTRL_GCM_SET_TAG, 16, (void*)m_tagBuf.rawBuffer());
- EVP_CipherInit(mp_ctx, NULL, m_keyBuf.rawBuffer(), iv, 0);
+ EVP_CipherInit_ex(mp_ctx, NULL, NULL, m_keyBuf.rawBuffer(), iv, 0);
}
#endif
else if (m_keyMode == MODE_ECB) {
@@ -274,10 +274,10 @@ int OpenSSLCryptoSymmetricKey::decryptCt
}
// We have everything, so we can fully init.
- EVP_CipherInit(mp_ctx, EVP_aes_192_gcm(), NULL, NULL, 0);
+ EVP_CipherInit_ex(mp_ctx, EVP_aes_192_gcm(), NULL, NULL, NULL, 0);
EVP_CIPHER_CTX_ctrl(mp_ctx, EVP_CTRL_GCM_SET_IVLEN, 12, NULL);
EVP_CIPHER_CTX_ctrl(mp_ctx, EVP_CTRL_GCM_SET_TAG, 16, (void*)m_tagBuf.rawBuffer());
- EVP_CipherInit(mp_ctx, NULL, m_keyBuf.rawBuffer(), iv, 0);
+ EVP_CipherInit_ex(mp_ctx, NULL, NULL, m_keyBuf.rawBuffer(), iv, 0);
}
#endif
@@ -327,10 +327,10 @@ int OpenSSLCryptoSymmetricKey::decryptCt
}
// We have everything, so we can fully init.
- EVP_CipherInit(mp_ctx, EVP_aes_256_gcm(), NULL, NULL, 0);
+ EVP_CipherInit_ex(mp_ctx, EVP_aes_256_gcm(), NULL, NULL, NULL, 0);
EVP_CIPHER_CTX_ctrl(mp_ctx, EVP_CTRL_GCM_SET_IVLEN, 12, NULL);
EVP_CIPHER_CTX_ctrl(mp_ctx, EVP_CTRL_GCM_SET_TAG, 16, (void*)m_tagBuf.rawBuffer());
- EVP_CipherInit(mp_ctx, NULL, m_keyBuf.rawBuffer(), iv, 0);
+ EVP_CipherInit_ex(mp_ctx, NULL, NULL, m_keyBuf.rawBuffer(), iv, 0);
}
#endif