diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2010-01-26 14:29:06 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2010-01-26 14:29:06 +0000 |
commit | e92f9f45e87fb1ceae7cefa5d3d7fbb40dadf1f1 (patch) | |
tree | 0cd91016733248f5fb0368cd2ba0f7366a5ed9b1 /crypto | |
parent | 8c02119e391a6b723da94ade51a7bf085130fc55 (diff) |
Add flags functions which were added to 0.9.8 for fips but not 1.0.0 and
later.
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/evp/evp.h | 4 | ||||
-rw-r--r-- | crypto/evp/evp_lib.c | 15 | ||||
-rw-r--r-- | crypto/hmac/hmac.c | 6 | ||||
-rw-r--r-- | crypto/hmac/hmac.h | 1 |
4 files changed, 26 insertions, 0 deletions
diff --git a/crypto/evp/evp.h b/crypto/evp/evp.h index f17730b5e2..9064164941 100644 --- a/crypto/evp/evp.h +++ b/crypto/evp/evp.h @@ -521,6 +521,10 @@ __owur 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); + __owur int EVP_EncryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, const unsigned char *key, const unsigned char *iv); __owur 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 bbb340f209..eedf0a574d 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); __owur int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx); +void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags); #ifdef __cplusplus } |