|
|
@ -45,7 +45,7 @@ static char *openssl_err_as_string (void) { |
|
|
|
/* ****************************************************** */ |
|
|
|
|
|
|
|
int aes_cbc_encrypt (unsigned char *out, const unsigned char *in, size_t in_len, |
|
|
|
const unsigned char *iv, aes_context_t *ctx) { |
|
|
|
unsigned char *iv, aes_context_t *ctx) { |
|
|
|
|
|
|
|
#ifdef HAVE_OPENSSL_1_1 |
|
|
|
int evp_len; |
|
|
@ -81,13 +81,14 @@ int aes_cbc_encrypt (unsigned char *out, const unsigned char *in, size_t in_len, |
|
|
|
&(ctx->enc_key), |
|
|
|
iv, |
|
|
|
AES_ENCRYPT); |
|
|
|
memset(iv, 0, AES_BLOCK_SIZE); |
|
|
|
#endif |
|
|
|
} |
|
|
|
|
|
|
|
/* ****************************************************** */ |
|
|
|
|
|
|
|
int aes_cbc_decrypt (unsigned char *out, const unsigned char *in, size_t in_len, |
|
|
|
const unsigned char *iv, aes_context_t *ctx) { |
|
|
|
unsigned char *iv, aes_context_t *ctx) { |
|
|
|
|
|
|
|
#ifdef HAVE_OPENSSL_1_1 |
|
|
|
int evp_len; |
|
|
@ -123,6 +124,7 @@ int aes_cbc_decrypt (unsigned char *out, const unsigned char *in, size_t in_len, |
|
|
|
&(ctx->dec_key), |
|
|
|
iv, |
|
|
|
AES_DECRYPT); |
|
|
|
memset(iv, 0, AES_BLOCK_SIZE); |
|
|
|
#endif |
|
|
|
|
|
|
|
return 0; |
|
|
|