X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fopenssl%2Fcipher.c;h=45d101df7daa742948e4e538981ffd2131e2ca87;hb=2c6b2d70e6640f39563ad7bb0aa0ba87f883848c;hp=d51ec0d5cedd696b75a2d47cdad8472163d08642;hpb=f6e87ab476a0faf8b124ecaaa27f967d825e6457;p=tinc diff --git a/src/openssl/cipher.c b/src/openssl/cipher.c index d51ec0d5..45d101df 100644 --- a/src/openssl/cipher.c +++ b/src/openssl/cipher.c @@ -149,7 +149,7 @@ bool cipher_encrypt(cipher_t *cipher, const void *indata, size_t inlen, void *ou int len, pad; if(EVP_EncryptInit_ex(cipher->ctx, NULL, NULL, NULL, NULL) - && EVP_EncryptUpdate(cipher->ctx, (unsigned char *)outdata, &len, indata, inlen) + && EVP_EncryptUpdate(cipher->ctx, (unsigned char *)outdata, &len, indata, (int)inlen) && EVP_EncryptFinal_ex(cipher->ctx, (unsigned char *)outdata + len, &pad)) { if(outlen) { *outlen = len + pad; @@ -160,7 +160,7 @@ bool cipher_encrypt(cipher_t *cipher, const void *indata, size_t inlen, void *ou } else { int len; - if(EVP_EncryptUpdate(cipher->ctx, outdata, &len, indata, inlen)) { + if(EVP_EncryptUpdate(cipher->ctx, outdata, &len, indata, (int)inlen)) { if(outlen) { *outlen = len; } @@ -178,7 +178,7 @@ bool cipher_decrypt(cipher_t *cipher, const void *indata, size_t inlen, void *ou int len, pad; if(EVP_DecryptInit_ex(cipher->ctx, NULL, NULL, NULL, NULL) - && EVP_DecryptUpdate(cipher->ctx, (unsigned char *)outdata, &len, indata, inlen) + && EVP_DecryptUpdate(cipher->ctx, (unsigned char *)outdata, &len, indata, (int)inlen) && EVP_DecryptFinal_ex(cipher->ctx, (unsigned char *)outdata + len, &pad)) { if(outlen) { *outlen = len + pad; @@ -189,7 +189,7 @@ bool cipher_decrypt(cipher_t *cipher, const void *indata, size_t inlen, void *ou } else { int len; - if(EVP_EncryptUpdate(cipher->ctx, outdata, &len, indata, inlen)) { + if(EVP_DecryptUpdate(cipher->ctx, outdata, &len, indata, (int)inlen)) { if(outlen) { *outlen = len; }