diff options
author | Richard Levitte <levitte@openssl.org> | 2015-12-18 17:01:28 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2016-01-12 13:52:22 +0100 |
commit | 6435f0f6c6093e8e1dfb7b32c2a1a0cc646ba66d (patch) | |
tree | 444ba1661bcef4661ae6d390969833b533f6cf96 /crypto/evp/e_xcbc_d.c | |
parent | 135727abe0bfbb6ff85b92244fd67e3e831a6ee3 (diff) |
Adapt builtin cipher implementations to opaque EVP_CIPHER
They all stop including evp_locl.h, so we also take care of their
adaptation to opaque EVP_CIPHER_CTX, as was promised in an earlier
commit.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/evp/e_xcbc_d.c')
-rw-r--r-- | crypto/evp/e_xcbc_d.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/crypto/evp/e_xcbc_d.c b/crypto/evp/e_xcbc_d.c index 31a944e4f2..1da331d995 100644 --- a/crypto/evp/e_xcbc_d.c +++ b/crypto/evp/e_xcbc_d.c @@ -63,7 +63,7 @@ # include <openssl/evp.h> # include <openssl/objects.h> -# include "evp_locl.h" +# include "internal/evp_int.h" # include <openssl/des.h> static int desx_cbc_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, @@ -77,7 +77,7 @@ typedef struct { DES_cblock outw; } DESX_CBC_KEY; -# define data(ctx) ((DESX_CBC_KEY *)(ctx)->cipher_data) +# define data(ctx) EVP_C_DATA(DESX_CBC_KEY,ctx) static const EVP_CIPHER d_xcbc_cipher = { NID_desx_cbc, @@ -115,16 +115,18 @@ static int desx_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, { while (inl >= EVP_MAXCHUNK) { DES_xcbc_encrypt(in, out, (long)EVP_MAXCHUNK, &data(ctx)->ks, - (DES_cblock *)&(ctx->iv[0]), - &data(ctx)->inw, &data(ctx)->outw, ctx->encrypt); + (DES_cblock *)EVP_CIPHER_CTX_iv_noconst(ctx), + &data(ctx)->inw, &data(ctx)->outw, + EVP_CIPHER_CTX_encrypting(ctx)); inl -= EVP_MAXCHUNK; in += EVP_MAXCHUNK; out += EVP_MAXCHUNK; } if (inl) DES_xcbc_encrypt(in, out, (long)inl, &data(ctx)->ks, - (DES_cblock *)&(ctx->iv[0]), - &data(ctx)->inw, &data(ctx)->outw, ctx->encrypt); + (DES_cblock *)EVP_CIPHER_CTX_iv_noconst(ctx), + &data(ctx)->inw, &data(ctx)->outw, + EVP_CIPHER_CTX_encrypting(ctx)); return 1; } #endif |