diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-11-29 05:33:12 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-11-29 05:35:49 +0100 |
commit | 61349d3d273aa23935b0c413c5885005db2669db (patch) | |
tree | 9cbc05acb31476d45b48d4a51e9edca19328b8e8 /src/crypto/cipher/aes128_ctr | |
parent | c13fe36e4c0730037ae75d51f7f052d916486aac (diff) | |
download | fastd-61349d3d273aa23935b0c413c5885005db2669db.tar fastd-61349d3d273aa23935b0c413c5885005db2669db.zip |
Compile with -std=c99 and restructure some code to ensure there is no invalid aliasing (hopefully)
Diffstat (limited to 'src/crypto/cipher/aes128_ctr')
-rw-r--r-- | src/crypto/cipher/aes128_ctr/openssl/aes128_ctr_openssl.c | 6 |
1 files changed, 3 insertions, 3 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 37ed95c..6917333 100644 --- a/src/crypto/cipher/aes128_ctr/openssl/aes128_ctr_openssl.c +++ b/src/crypto/cipher/aes128_ctr/openssl/aes128_ctr_openssl.c @@ -41,7 +41,7 @@ static fastd_cipher_state_t* aes128_ctr_init_state(fastd_context_t *ctx UNUSED, fastd_cipher_state_t *state = malloc(sizeof(fastd_cipher_state_t)); state->aes = EVP_CIPHER_CTX_new(); - EVP_EncryptInit(state->aes, EVP_aes_128_ctr(), (const void*)key, NULL); + EVP_EncryptInit(state->aes, EVP_aes_128_ctr(), (const unsigned char*)key, NULL); return state; } @@ -52,10 +52,10 @@ static bool aes128_ctr_crypt(fastd_context_t *ctx UNUSED, const fastd_cipher_sta if (!EVP_EncryptInit(state->aes, NULL, NULL, iv)) return false; - if (!EVP_EncryptUpdate(state->aes, (void*)out, &clen, (const void*)in, len)) + if (!EVP_EncryptUpdate(state->aes, (unsigned char*)out, &clen, (const unsigned char*)in, len)) return false; - if (!EVP_EncryptFinal(state->aes, ((void*)out) + clen, &clen2)) + if (!EVP_EncryptFinal(state->aes, ((unsigned char*)out) + clen, &clen2)) return false; if ((size_t)(clen+clen2) != len) |