summaryrefslogtreecommitdiffstats
path: root/src/crypto/cipher/aes128_ctr/openssl
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2017-05-19 19:36:24 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2017-05-19 19:36:24 +0200
commit8505374ee208d51a39e7b22846f9b781b9ccb452 (patch)
tree158aa2ee00bc579ee69a53af690a12565ff47609 /src/crypto/cipher/aes128_ctr/openssl
parent0ea846deb63e157b75527112c78443a144fd9220 (diff)
downloadfastd-8505374ee208d51a39e7b22846f9b781b9ccb452.tar
fastd-8505374ee208d51a39e7b22846f9b781b9ccb452.zip
cipher: aes128-ctr: openssl: fix compatiblity with OpenSSL 1.1
Diffstat (limited to 'src/crypto/cipher/aes128_ctr/openssl')
-rw-r--r--src/crypto/cipher/aes128_ctr/openssl/aes128_ctr_openssl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/crypto/cipher/aes128_ctr/openssl/aes128_ctr_openssl.c b/src/crypto/cipher/aes128_ctr/openssl/aes128_ctr_openssl.c
index 7a2b565..c44427f 100644
--- a/src/crypto/cipher/aes128_ctr/openssl/aes128_ctr_openssl.c
+++ b/src/crypto/cipher/aes128_ctr/openssl/aes128_ctr_openssl.c
@@ -47,7 +47,7 @@ static fastd_cipher_state_t * aes128_ctr_init(const uint8_t *key) {
fastd_cipher_state_t *state = fastd_new(fastd_cipher_state_t);
state->aes = EVP_CIPHER_CTX_new();
- EVP_EncryptInit(state->aes, EVP_aes_128_ctr(), (const unsigned char *)key, NULL);
+ EVP_EncryptInit_ex(state->aes, EVP_aes_128_ctr(), NULL, (const unsigned char *)key, NULL);
return state;
}
@@ -56,7 +56,7 @@ static fastd_cipher_state_t * aes128_ctr_init(const uint8_t *key) {
static bool aes128_ctr_crypt(const fastd_cipher_state_t *state, fastd_block128_t *out, const fastd_block128_t *in, size_t len, const uint8_t *iv) {
int clen, clen2;
- if (!EVP_EncryptInit(state->aes, NULL, NULL, iv))
+ if (!EVP_EncryptInit_ex(state->aes, NULL, NULL, NULL, iv))
return false;
if (!EVP_EncryptUpdate(state->aes, (unsigned char *)out, &clen, (const unsigned char *)in, len))