diff options
author | tpashkin <tpashkin@yandex-team.ru> | 2022-02-10 16:46:41 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:41 +0300 |
commit | 5475379a04e37df30085bd1724f1c57e3f40996f (patch) | |
tree | 95d77e29785a3bd5be6260b1c9d226a551376ecf /contrib/libs/openssl/crypto/evp/evp_enc.c | |
parent | c3d34b9b40eb534dfd2c549342274f3d61844688 (diff) | |
download | ydb-5475379a04e37df30085bd1724f1c57e3f40996f.tar.gz |
Restoring authorship annotation for <tpashkin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/openssl/crypto/evp/evp_enc.c')
-rw-r--r-- | contrib/libs/openssl/crypto/evp/evp_enc.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/contrib/libs/openssl/crypto/evp/evp_enc.c b/contrib/libs/openssl/crypto/evp/evp_enc.c index e3c165d48e..720b532df2 100644 --- a/contrib/libs/openssl/crypto/evp/evp_enc.c +++ b/contrib/libs/openssl/crypto/evp/evp_enc.c @@ -16,8 +16,8 @@ #include <openssl/rand.h> #include <openssl/rand_drbg.h> #include <openssl/engine.h> -#include "crypto/evp.h" -#include "evp_local.h" +#include "crypto/evp.h" +#include "evp_local.h" int EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *c) { @@ -306,17 +306,17 @@ static int evp_EncryptDecryptUpdate(EVP_CIPHER_CTX *ctx, bl = ctx->cipher->block_size; - /* - * CCM mode needs to know about the case where inl == 0 && in == NULL - it - * means the plaintext/ciphertext length is 0 - */ - if (inl < 0 - || (inl == 0 - && EVP_CIPHER_mode(ctx->cipher) != EVP_CIPH_CCM_MODE)) { - *outl = 0; - return inl == 0; - } - + /* + * CCM mode needs to know about the case where inl == 0 && in == NULL - it + * means the plaintext/ciphertext length is 0 + */ + if (inl < 0 + || (inl == 0 + && EVP_CIPHER_mode(ctx->cipher) != EVP_CIPH_CCM_MODE)) { + *outl = 0; + return inl == 0; + } + 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)) { @@ -478,17 +478,17 @@ int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, if (EVP_CIPHER_CTX_test_flags(ctx, EVP_CIPH_FLAG_LENGTH_BITS)) cmpl = (cmpl + 7) / 8; - /* - * CCM mode needs to know about the case where inl == 0 - it means the - * plaintext/ciphertext length is 0 - */ - if (inl < 0 - || (inl == 0 - && EVP_CIPHER_mode(ctx->cipher) != EVP_CIPH_CCM_MODE)) { - *outl = 0; - return inl == 0; - } - + /* + * CCM mode needs to know about the case where inl == 0 - it means the + * plaintext/ciphertext length is 0 + */ + if (inl < 0 + || (inl == 0 + && EVP_CIPHER_mode(ctx->cipher) != EVP_CIPH_CCM_MODE)) { + *outl = 0; + return inl == 0; + } + if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) { if (b == 1 && is_partially_overlapping(out, in, cmpl)) { EVPerr(EVP_F_EVP_DECRYPTUPDATE, EVP_R_PARTIALLY_OVERLAPPING); |