Add wrapper functions for buffer and original IV access
Added functions for accessing the buffer and original IV. This hides the changes introduced in OpenSSL 1.1.
This commit is contained in:
parent
a47d4c40f5
commit
322fae8326
@ -21,5 +21,7 @@ MXS_BEGIN_DECLS
|
||||
|
||||
EVP_CIPHER_CTX* mxs_evp_cipher_ctx_alloc();
|
||||
void mxs_evp_cipher_ctx_free(EVP_CIPHER_CTX* ctx);
|
||||
uint8_t* mxs_evp_cipher_ctx_buf(EVP_CIPHER_CTX* ctx);
|
||||
uint8_t* mxs_evp_cipher_ctx_oiv(EVP_CIPHER_CTX* ctx);
|
||||
|
||||
MXS_END_DECLS
|
||||
|
@ -35,3 +35,21 @@ void mxs_evp_cipher_ctx_free(EVP_CIPHER_CTX* ctx)
|
||||
MXS_FREE(ctx);
|
||||
#endif
|
||||
}
|
||||
|
||||
uint8_t* mxs_evp_cipher_ctx_buf(EVP_CIPHER_CTX* ctx)
|
||||
{
|
||||
#ifdef OPENSSL_1_1
|
||||
return (uint8_t*)EVP_CIPHER_CTX_buf_noconst(ctx);
|
||||
#else
|
||||
return (uint8_t*)ctx->buf;
|
||||
#endif
|
||||
}
|
||||
|
||||
uint8_t* mxs_evp_cipher_ctx_oiv(EVP_CIPHER_CTX* ctx)
|
||||
{
|
||||
#ifdef OPENSSL_1_1
|
||||
return (uint8_t*)EVP_CIPHER_CTX_original_iv(ctx);
|
||||
#else
|
||||
return (uint8_t*)ctx->oiv;
|
||||
#endif
|
||||
}
|
||||
|
@ -2874,9 +2874,9 @@ static GWBUF *blr_aes_crypt(ROUTER_INSTANCE *router,
|
||||
if (size - outlen > 0)
|
||||
{
|
||||
if (!blr_aes_create_tail_for_cbc(out_ptr + 4 + outlen,
|
||||
buffer + outlen,
|
||||
mxs_evp_cipher_ctx_buf(ctx),
|
||||
size - outlen,
|
||||
iv,
|
||||
mxs_evp_cipher_ctx_oiv(ctx),
|
||||
router->encryption.key_value,
|
||||
router->encryption.key_len))
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user