diff options
author | Shane Lontis <shane.lontis@oracle.com> | 2021-03-09 14:46:05 +1000 |
---|---|---|
committer | Shane Lontis <shane.lontis@oracle.com> | 2021-03-18 17:52:38 +1000 |
commit | 6d7776892f571cb438563d65d5d252e0245cd57e (patch) | |
tree | 5f46dd637e7da4ec0f3f4af5d1e3c598d851aaf6 /crypto/evp/evp_enc.c | |
parent | 4e17fb006187c1b745eb72474efb3ad797e2a4dc (diff) |
Add ossl_is_partially_overlapping symbol
Partial fix for #12964
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14473)
Diffstat (limited to 'crypto/evp/evp_enc.c')
-rw-r--r-- | crypto/evp/evp_enc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crypto/evp/evp_enc.c b/crypto/evp/evp_enc.c index eb174c2d9f..c3d2b97594 100644 --- a/crypto/evp/evp_enc.c +++ b/crypto/evp/evp_enc.c @@ -476,7 +476,7 @@ int EVP_DecryptInit_ex2(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, # define PTRDIFF_T size_t #endif -int is_partially_overlapping(const void *ptr1, const void *ptr2, int len) +int ossl_is_partially_overlapping(const void *ptr1, const void *ptr2, int len) { PTRDIFF_T diff = (PTRDIFF_T)ptr1-(PTRDIFF_T)ptr2; /* @@ -503,7 +503,7 @@ static int evp_EncryptDecryptUpdate(EVP_CIPHER_CTX *ctx, if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) { /* If block size > 1 then the cipher will have to do this check */ - if (bl == 1 && is_partially_overlapping(out, in, cmpl)) { + if (bl == 1 && ossl_is_partially_overlapping(out, in, cmpl)) { ERR_raise(ERR_LIB_EVP, EVP_R_PARTIALLY_OVERLAPPING); return 0; } @@ -520,7 +520,7 @@ static int evp_EncryptDecryptUpdate(EVP_CIPHER_CTX *ctx, *outl = 0; return inl == 0; } - if (is_partially_overlapping(out + ctx->buf_len, in, cmpl)) { + if (ossl_is_partially_overlapping(out + ctx->buf_len, in, cmpl)) { ERR_raise(ERR_LIB_EVP, EVP_R_PARTIALLY_OVERLAPPING); return 0; } @@ -785,7 +785,7 @@ int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, cmpl = (cmpl + 7) / 8; if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) { - if (b == 1 && is_partially_overlapping(out, in, cmpl)) { + if (b == 1 && ossl_is_partially_overlapping(out, in, cmpl)) { ERR_raise(ERR_LIB_EVP, EVP_R_PARTIALLY_OVERLAPPING); return 0; } @@ -812,7 +812,7 @@ int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, if (ctx->final_used) { /* see comment about PTRDIFF_T comparison above */ if (((PTRDIFF_T)out == (PTRDIFF_T)in) - || is_partially_overlapping(out, in, b)) { + || ossl_is_partially_overlapping(out, in, b)) { ERR_raise(ERR_LIB_EVP, EVP_R_PARTIALLY_OVERLAPPING); return 0; } |