aboutsummaryrefslogtreecommitdiffstats
path: root/src/engine/openssl/ossl_bc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/openssl/ossl_bc.cpp')
-rw-r--r--src/engine/openssl/ossl_bc.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/engine/openssl/ossl_bc.cpp b/src/engine/openssl/ossl_bc.cpp
index d419f56be..b3b509c36 100644
--- a/src/engine/openssl/ossl_bc.cpp
+++ b/src/engine/openssl/ossl_bc.cpp
@@ -123,7 +123,7 @@ void EVP_BlockCipher::decrypt_n(const byte in[], byte out[],
*/
void EVP_BlockCipher::key_schedule(const byte key[], size_t length)
{
- secure_vector<byte> full_key(key, length);
+ secure_vector<byte> full_key(key, key + length);
if(cipher_name == "TripleDES" && length == 16)
{
@@ -141,8 +141,8 @@ void EVP_BlockCipher::key_schedule(const byte key[], size_t length)
EVP_CIPHER_CTX_ctrl(&decrypt, EVP_CTRL_SET_RC2_KEY_BITS, length*8, 0);
}
- EVP_EncryptInit_ex(&encrypt, 0, 0, full_key.begin(), 0);
- EVP_DecryptInit_ex(&decrypt, 0, 0, full_key.begin(), 0);
+ EVP_EncryptInit_ex(&encrypt, 0, 0, &full_key[0], 0);
+ EVP_DecryptInit_ex(&decrypt, 0, 0, &full_key[0], 0);
}
/*