diff options
author | Matt Caswell <matt@openssl.org> | 2016-03-07 10:17:27 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-03-07 21:42:09 +0000 |
commit | 44ab2dfdf9dc519e6d081646119bdda3ddfd9e85 (patch) | |
tree | 095745778b1f9d426d382e8ee7e0633613a0a273 /crypto/evp | |
parent | e2d5183d7cd5479d7c63ba524b3ddc4abd707dba (diff) |
Rename EVP_CIPHER_CTX_cipher_data to EVP_CIPHER_CTX_get_cipher_data
We had the function EVP_CIPHER_CTX_cipher_data which is newly added for
1.1.0. As we now also need an EVP_CIPHER_CTX_set_cipher_data it makes
more sense for the former to be called EVP_CIPHER_CTX_get_cipher_data.
Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'crypto/evp')
-rw-r--r-- | crypto/evp/e_aes_cbc_hmac_sha1.c | 2 | ||||
-rw-r--r-- | crypto/evp/e_aes_cbc_hmac_sha256.c | 2 | ||||
-rw-r--r-- | crypto/evp/e_camellia.c | 3 | ||||
-rw-r--r-- | crypto/evp/e_des.c | 30 | ||||
-rw-r--r-- | crypto/evp/e_rc4.c | 2 | ||||
-rw-r--r-- | crypto/evp/e_rc4_hmac_md5.c | 2 | ||||
-rw-r--r-- | crypto/evp/evp_lib.c | 2 |
7 files changed, 24 insertions, 19 deletions
diff --git a/crypto/evp/e_aes_cbc_hmac_sha1.c b/crypto/evp/e_aes_cbc_hmac_sha1.c index 6dca2675ee..6f95f4b53b 100644 --- a/crypto/evp/e_aes_cbc_hmac_sha1.c +++ b/crypto/evp/e_aes_cbc_hmac_sha1.c @@ -116,7 +116,7 @@ void aesni256_cbc_sha1_dec(const void *inp, void *out, size_t blocks, const AES_KEY *key, unsigned char iv[16], SHA_CTX *ctx, const void *in0); -# define data(ctx) ((EVP_AES_HMAC_SHA1 *)EVP_CIPHER_CTX_cipher_data(ctx)) +# define data(ctx) ((EVP_AES_HMAC_SHA1 *)EVP_CIPHER_CTX_get_cipher_data(ctx)) static int aesni_cbc_hmac_sha1_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *inkey, diff --git a/crypto/evp/e_aes_cbc_hmac_sha256.c b/crypto/evp/e_aes_cbc_hmac_sha256.c index f55a5a04ba..66f536cacf 100644 --- a/crypto/evp/e_aes_cbc_hmac_sha256.c +++ b/crypto/evp/e_aes_cbc_hmac_sha256.c @@ -112,7 +112,7 @@ int aesni_cbc_sha256_enc(const void *inp, void *out, size_t blocks, const AES_KEY *key, unsigned char iv[16], SHA256_CTX *ctx, const void *in0); -# define data(ctx) ((EVP_AES_HMAC_SHA256 *)EVP_CIPHER_CTX_cipher_data(ctx)) +# define data(ctx) ((EVP_AES_HMAC_SHA256 *)EVP_CIPHER_CTX_get_cipher_data(ctx)) static int aesni_cbc_hmac_sha256_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *inkey, diff --git a/crypto/evp/e_camellia.c b/crypto/evp/e_camellia.c index 8ebd226762..0d9f7f1951 100644 --- a/crypto/evp/e_camellia.c +++ b/crypto/evp/e_camellia.c @@ -121,7 +121,8 @@ static int cmll_t4_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, const unsigned char *iv, int enc) { int ret, mode, bits; - EVP_CAMELLIA_KEY *dat = (EVP_CAMELLIA_KEY *) EVP_CIPHER_CTX_cipher_data(ctx); + EVP_CAMELLIA_KEY *dat = + (EVP_CAMELLIA_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx); mode = EVP_CIPHER_CTX_mode(ctx); bits = EVP_CIPHER_CTX_key_length(ctx) * 8; diff --git a/crypto/evp/e_des.c b/crypto/evp/e_des.c index 1afd917cdc..ebdaadf6d6 100644 --- a/crypto/evp/e_des.c +++ b/crypto/evp/e_des.c @@ -105,7 +105,7 @@ static int des_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, { BLOCK_CIPHER_ecb_loop() DES_ecb_encrypt((DES_cblock *)(in + i), (DES_cblock *)(out + i), - EVP_CIPHER_CTX_cipher_data(ctx), + EVP_CIPHER_CTX_get_cipher_data(ctx), EVP_CIPHER_CTX_encrypting(ctx)); return 1; } @@ -116,7 +116,7 @@ static int des_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, while (inl >= EVP_MAXCHUNK) { int num = EVP_CIPHER_CTX_num(ctx); DES_ofb64_encrypt(in, out, (long)EVP_MAXCHUNK, - EVP_CIPHER_CTX_cipher_data(ctx), + EVP_CIPHER_CTX_get_cipher_data(ctx), (DES_cblock *)EVP_CIPHER_CTX_iv_noconst(ctx), &num); EVP_CIPHER_CTX_set_num(ctx, num); inl -= EVP_MAXCHUNK; @@ -125,7 +125,8 @@ static int des_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, } if (inl) { int num = EVP_CIPHER_CTX_num(ctx); - DES_ofb64_encrypt(in, out, (long)inl, EVP_CIPHER_CTX_cipher_data(ctx), + DES_ofb64_encrypt(in, out, (long)inl, + EVP_CIPHER_CTX_get_cipher_data(ctx), (DES_cblock *)EVP_CIPHER_CTX_iv_noconst(ctx), &num); EVP_CIPHER_CTX_set_num(ctx, num); } @@ -135,7 +136,7 @@ static int des_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, static int des_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) { - EVP_DES_KEY *dat = (EVP_DES_KEY *) EVP_CIPHER_CTX_cipher_data(ctx); + EVP_DES_KEY *dat = (EVP_DES_KEY *) EVP_CIPHER_CTX_get_cipher_data(ctx); if (dat->stream.cbc != NULL) { (*dat->stream.cbc) (in, out, inl, &dat->ks.ks, @@ -144,7 +145,7 @@ static int des_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, } while (inl >= EVP_MAXCHUNK) { DES_ncbc_encrypt(in, out, (long)EVP_MAXCHUNK, - EVP_CIPHER_CTX_cipher_data(ctx), + EVP_CIPHER_CTX_get_cipher_data(ctx), (DES_cblock *)EVP_CIPHER_CTX_iv_noconst(ctx), EVP_CIPHER_CTX_encrypting(ctx)); inl -= EVP_MAXCHUNK; @@ -152,7 +153,8 @@ static int des_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, out += EVP_MAXCHUNK; } if (inl) - DES_ncbc_encrypt(in, out, (long)inl, EVP_CIPHER_CTX_cipher_data(ctx), + DES_ncbc_encrypt(in, out, (long)inl, + EVP_CIPHER_CTX_get_cipher_data(ctx), (DES_cblock *)EVP_CIPHER_CTX_iv_noconst(ctx), EVP_CIPHER_CTX_encrypting(ctx)); return 1; @@ -164,7 +166,7 @@ static int des_cfb64_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, while (inl >= EVP_MAXCHUNK) { int num = EVP_CIPHER_CTX_num(ctx); DES_cfb64_encrypt(in, out, (long)EVP_MAXCHUNK, - EVP_CIPHER_CTX_cipher_data(ctx), + EVP_CIPHER_CTX_get_cipher_data(ctx), (DES_cblock *)EVP_CIPHER_CTX_iv_noconst(ctx), &num, EVP_CIPHER_CTX_encrypting(ctx)); EVP_CIPHER_CTX_set_num(ctx, num); @@ -174,7 +176,8 @@ static int des_cfb64_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, } if (inl) { int num = EVP_CIPHER_CTX_num(ctx); - DES_cfb64_encrypt(in, out, (long)inl, EVP_CIPHER_CTX_cipher_data(ctx), + DES_cfb64_encrypt(in, out, (long)inl, + EVP_CIPHER_CTX_get_cipher_data(ctx), (DES_cblock *)EVP_CIPHER_CTX_iv_noconst(ctx), &num, EVP_CIPHER_CTX_encrypting(ctx)); EVP_CIPHER_CTX_set_num(ctx, num); @@ -198,7 +201,7 @@ static int des_cfb1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, while (inl && inl >= chunk) { for (n = 0; n < chunk * 8; ++n) { c[0] = (in[n / 8] & (1 << (7 - n % 8))) ? 0x80 : 0; - DES_cfb_encrypt(c, d, 1, 1, EVP_CIPHER_CTX_cipher_data(ctx), + DES_cfb_encrypt(c, d, 1, 1, EVP_CIPHER_CTX_get_cipher_data(ctx), (DES_cblock *)EVP_CIPHER_CTX_iv_noconst(ctx), EVP_CIPHER_CTX_encrypting(ctx)); out[n / 8] = @@ -220,7 +223,7 @@ static int des_cfb8_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, { while (inl >= EVP_MAXCHUNK) { DES_cfb_encrypt(in, out, 8, (long)EVP_MAXCHUNK, - EVP_CIPHER_CTX_cipher_data(ctx), + EVP_CIPHER_CTX_get_cipher_data(ctx), (DES_cblock *)EVP_CIPHER_CTX_iv_noconst(ctx), EVP_CIPHER_CTX_encrypting(ctx)); inl -= EVP_MAXCHUNK; @@ -228,7 +231,8 @@ static int des_cfb8_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, out += EVP_MAXCHUNK; } if (inl) - DES_cfb_encrypt(in, out, 8, (long)inl, EVP_CIPHER_CTX_cipher_data(ctx), + DES_cfb_encrypt(in, out, 8, (long)inl, + EVP_CIPHER_CTX_get_cipher_data(ctx), (DES_cblock *)EVP_CIPHER_CTX_iv_noconst(ctx), EVP_CIPHER_CTX_encrypting(ctx)); return 1; @@ -250,7 +254,7 @@ static int des_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, const unsigned char *iv, int enc) { DES_cblock *deskey = (DES_cblock *)key; - EVP_DES_KEY *dat = (EVP_DES_KEY *) EVP_CIPHER_CTX_cipher_data(ctx); + EVP_DES_KEY *dat = (EVP_DES_KEY *) EVP_CIPHER_CTX_get_cipher_data(ctx); dat->stream.cbc = NULL; # if defined(SPARC_DES_CAPABLE) @@ -264,7 +268,7 @@ static int des_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, } } # endif - DES_set_key_unchecked(deskey, EVP_CIPHER_CTX_cipher_data(ctx)); + DES_set_key_unchecked(deskey, EVP_CIPHER_CTX_get_cipher_data(ctx)); return 1; } diff --git a/crypto/evp/e_rc4.c b/crypto/evp/e_rc4.c index ab3cc908ea..be6b6a0d66 100644 --- a/crypto/evp/e_rc4.c +++ b/crypto/evp/e_rc4.c @@ -73,7 +73,7 @@ typedef struct { RC4_KEY ks; /* working key */ } EVP_RC4_KEY; -# define data(ctx) ((EVP_RC4_KEY *)EVP_CIPHER_CTX_cipher_data(ctx)) +# define data(ctx) ((EVP_RC4_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx)) static int rc4_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, const unsigned char *iv, int enc); diff --git a/crypto/evp/e_rc4_hmac_md5.c b/crypto/evp/e_rc4_hmac_md5.c index 05596e42da..ded3090eb4 100644 --- a/crypto/evp/e_rc4_hmac_md5.c +++ b/crypto/evp/e_rc4_hmac_md5.c @@ -81,7 +81,7 @@ typedef struct { void rc4_md5_enc(RC4_KEY *key, const void *in0, void *out, MD5_CTX *ctx, const void *inp, size_t blocks); -# define data(ctx) ((EVP_RC4_HMAC_MD5 *)EVP_CIPHER_CTX_cipher_data(ctx)) +# define data(ctx) ((EVP_RC4_HMAC_MD5 *)EVP_CIPHER_CTX_get_cipher_data(ctx)) static int rc4_hmac_md5_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *inkey, diff --git a/crypto/evp/evp_lib.c b/crypto/evp/evp_lib.c index 7135381a21..bc24d5a765 100644 --- a/crypto/evp/evp_lib.c +++ b/crypto/evp/evp_lib.c @@ -256,7 +256,7 @@ void EVP_CIPHER_CTX_set_app_data(EVP_CIPHER_CTX *ctx, void *data) ctx->app_data = data; } -void *EVP_CIPHER_CTX_cipher_data(const EVP_CIPHER_CTX *ctx) +void *EVP_CIPHER_CTX_get_cipher_data(const EVP_CIPHER_CTX *ctx) { return ctx->cipher_data; } |