From: Dr. Stephen Henson Date: Tue, 26 Jan 2010 14:33:52 +0000 (+0000) Subject: Add flags functions which were added to 0.9.8 for fips but not 1.0.0 and X-Git-Tag: OpenSSL_1_0_0~84 X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff_plain;h=704d33b347684aa15bcedc043116718b1386d5f4 Add flags functions which were added to 0.9.8 for fips but not 1.0.0 and later. --- diff --git a/crypto/evp/evp.h b/crypto/evp/evp.h index 60a947af50..35e7847342 100644 --- a/crypto/evp/evp.h +++ b/crypto/evp/evp.h @@ -521,6 +521,10 @@ int EVP_BytesToKey(const EVP_CIPHER *type,const EVP_MD *md, const unsigned char *salt, const unsigned char *data, int datal, int count, unsigned char *key,unsigned char *iv); +void EVP_CIPHER_CTX_set_flags(EVP_CIPHER_CTX *ctx, int flags); +void EVP_CIPHER_CTX_clear_flags(EVP_CIPHER_CTX *ctx, int flags); +int EVP_CIPHER_CTX_test_flags(const EVP_CIPHER_CTX *ctx,int flags); + int EVP_EncryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, const unsigned char *key, const unsigned char *iv); int EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, ENGINE *impl, diff --git a/crypto/evp/evp_lib.c b/crypto/evp/evp_lib.c index 218af7166e..40951a04f0 100644 --- a/crypto/evp/evp_lib.c +++ b/crypto/evp/evp_lib.c @@ -295,3 +295,18 @@ int EVP_MD_CTX_test_flags(const EVP_MD_CTX *ctx, int flags) { return (ctx->flags & flags); } + +void EVP_CIPHER_CTX_set_flags(EVP_CIPHER_CTX *ctx, int flags) + { + ctx->flags |= flags; + } + +void EVP_CIPHER_CTX_clear_flags(EVP_CIPHER_CTX *ctx, int flags) + { + ctx->flags &= ~flags; + } + +int EVP_CIPHER_CTX_test_flags(const EVP_CIPHER_CTX *ctx, int flags) + { + return (ctx->flags & flags); + } diff --git a/crypto/hmac/hmac.c b/crypto/hmac/hmac.c index 8c2e36ee7c..45015fe754 100644 --- a/crypto/hmac/hmac.c +++ b/crypto/hmac/hmac.c @@ -209,3 +209,9 @@ unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len, return NULL; } +void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags) + { + EVP_MD_CTX_set_flags(&ctx->i_ctx, flags); + EVP_MD_CTX_set_flags(&ctx->o_ctx, flags); + EVP_MD_CTX_set_flags(&ctx->md_ctx, flags); + } diff --git a/crypto/hmac/hmac.h b/crypto/hmac/hmac.h index bf51476421..1be0022190 100644 --- a/crypto/hmac/hmac.h +++ b/crypto/hmac/hmac.h @@ -101,6 +101,7 @@ unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len, unsigned int *md_len); int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx); +void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags); #ifdef __cplusplus } diff --git a/util/libeay.num b/util/libeay.num index 30ed68db7a..bd47028d1b 100755 --- a/util/libeay.num +++ b/util/libeay.num @@ -2843,7 +2843,7 @@ FIPS_selftest_failed 3284 NOEXIST::FUNCTION: sk_is_sorted 3285 EXIST::FUNCTION: X509_check_ca 3286 EXIST::FUNCTION: private_idea_set_encrypt_key 3287 NOEXIST::FUNCTION: -HMAC_CTX_set_flags 3288 NOEXIST::FUNCTION: +HMAC_CTX_set_flags 3288 EXIST::FUNCTION:HMAC private_SHA_Init 3289 NOEXIST::FUNCTION: private_CAST_set_key 3290 NOEXIST::FUNCTION: private_RIPEMD160_Init 3291 NOEXIST::FUNCTION: @@ -3660,7 +3660,7 @@ ENGINE_load_ssl_client_cert 4046 EXIST::FUNCTION:ENGINE ENGINE_load_capi 4047 EXIST::FUNCTION:ENGINE,STATIC_ENGINE OPENSSL_isservice 4048 EXIST::FUNCTION: FIPS_dsa_sig_decode 4049 NOEXIST::FUNCTION: -EVP_CIPHER_CTX_clear_flags 4050 NOEXIST::FUNCTION: +EVP_CIPHER_CTX_clear_flags 4050 EXIST::FUNCTION: FIPS_rand_status 4051 NOEXIST::FUNCTION: FIPS_rand_set_key 4052 NOEXIST::FUNCTION: CRYPTO_set_mem_info_functions 4053 NOEXIST::FUNCTION: @@ -3669,7 +3669,7 @@ int_ERR_set_state_func 4055 NOEXIST::FUNCTION: int_EVP_MD_set_engine_callbacks 4056 NOEXIST::FUNCTION: int_CRYPTO_set_do_dynlock_callback 4057 NOEXIST::FUNCTION: FIPS_rng_stick 4058 NOEXIST::FUNCTION: -EVP_CIPHER_CTX_set_flags 4059 NOEXIST::FUNCTION: +EVP_CIPHER_CTX_set_flags 4059 EXIST::FUNCTION: BN_X931_generate_prime_ex 4060 NOEXIST::FUNCTION: FIPS_selftest_check 4061 NOEXIST::FUNCTION: FIPS_rand_set_dt 4062 NOEXIST::FUNCTION: @@ -3679,7 +3679,7 @@ RSA_X931_derive_ex 4065 NOEXIST::FUNCTION: FIPS_rsa_new 4066 NOEXIST::FUNCTION: FIPS_rand_bytes 4067 NOEXIST::FUNCTION: fips_cipher_test 4068 NOEXIST::FUNCTION: -EVP_CIPHER_CTX_test_flags 4069 NOEXIST::FUNCTION: +EVP_CIPHER_CTX_test_flags 4069 EXIST::FUNCTION: CRYPTO_malloc_debug_init 4070 NOEXIST::FUNCTION: CRYPTO_dbg_push_info 4071 NOEXIST::FUNCTION: FIPS_corrupt_rsa_keygen 4072 NOEXIST::FUNCTION: