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 | |
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')
52 files changed, 239 insertions, 239 deletions
diff --git a/contrib/libs/openssl/crypto/evp/bio_md.c b/contrib/libs/openssl/crypto/evp/bio_md.c index fed4cf1eb1..1919874bf8 100644 --- a/contrib/libs/openssl/crypto/evp/bio_md.c +++ b/contrib/libs/openssl/crypto/evp/bio_md.c @@ -12,8 +12,8 @@ #include "internal/cryptlib.h" #include <openssl/buffer.h> #include <openssl/evp.h> -#include "crypto/evp.h" -#include "evp_local.h" +#include "crypto/evp.h" +#include "evp_local.h" #include "internal/bio.h" /* diff --git a/contrib/libs/openssl/crypto/evp/bio_ok.c b/contrib/libs/openssl/crypto/evp/bio_ok.c index 9610f3c1ef..722b2e2a15 100644 --- a/contrib/libs/openssl/crypto/evp/bio_ok.c +++ b/contrib/libs/openssl/crypto/evp/bio_ok.c @@ -76,7 +76,7 @@ #include "internal/bio.h" #include <openssl/evp.h> #include <openssl/rand.h> -#include "crypto/evp.h" +#include "crypto/evp.h" static int ok_write(BIO *h, const char *buf, int num); static int ok_read(BIO *h, char *buf, int size); diff --git a/contrib/libs/openssl/crypto/evp/c_allc.c b/contrib/libs/openssl/crypto/evp/c_allc.c index 22fdcc409c..dd6b36830f 100644 --- a/contrib/libs/openssl/crypto/evp/c_allc.c +++ b/contrib/libs/openssl/crypto/evp/c_allc.c @@ -10,7 +10,7 @@ #include <stdio.h> #include "internal/cryptlib.h" #include <openssl/evp.h> -#include "crypto/evp.h" +#include "crypto/evp.h" #include <openssl/pkcs12.h> #include <openssl/objects.h> diff --git a/contrib/libs/openssl/crypto/evp/c_alld.c b/contrib/libs/openssl/crypto/evp/c_alld.c index 16ac1b67f4..b5e4765055 100644 --- a/contrib/libs/openssl/crypto/evp/c_alld.c +++ b/contrib/libs/openssl/crypto/evp/c_alld.c @@ -10,7 +10,7 @@ #include <stdio.h> #include "internal/cryptlib.h" #include <openssl/evp.h> -#include "crypto/evp.h" +#include "crypto/evp.h" #include <openssl/pkcs12.h> #include <openssl/objects.h> diff --git a/contrib/libs/openssl/crypto/evp/cmeth_lib.c b/contrib/libs/openssl/crypto/evp/cmeth_lib.c index 272e48249e..b1f9551fed 100644 --- a/contrib/libs/openssl/crypto/evp/cmeth_lib.c +++ b/contrib/libs/openssl/crypto/evp/cmeth_lib.c @@ -10,8 +10,8 @@ #include <string.h> #include <openssl/evp.h> -#include "crypto/evp.h" -#include "evp_local.h" +#include "crypto/evp.h" +#include "evp_local.h" EVP_CIPHER *EVP_CIPHER_meth_new(int cipher_type, int block_size, int key_len) { diff --git a/contrib/libs/openssl/crypto/evp/digest.c b/contrib/libs/openssl/crypto/evp/digest.c index d1bfa274ca..c9ba501780 100644 --- a/contrib/libs/openssl/crypto/evp/digest.c +++ b/contrib/libs/openssl/crypto/evp/digest.c @@ -12,8 +12,8 @@ #include <openssl/objects.h> #include <openssl/evp.h> #include <openssl/engine.h> -#include "crypto/evp.h" -#include "evp_local.h" +#include "crypto/evp.h" +#include "evp_local.h" /* This call frees resources associated with the context */ int EVP_MD_CTX_reset(EVP_MD_CTX *ctx) diff --git a/contrib/libs/openssl/crypto/evp/e_aes.c b/contrib/libs/openssl/crypto/evp/e_aes.c index 2c2812fdf1..021f82fa9f 100644 --- a/contrib/libs/openssl/crypto/evp/e_aes.c +++ b/contrib/libs/openssl/crypto/evp/e_aes.c @@ -14,10 +14,10 @@ #include <string.h> #include <assert.h> #include <openssl/aes.h> -#include "crypto/evp.h" -#include "modes_local.h" +#include "crypto/evp.h" +#include "modes_local.h" #include <openssl/rand.h> -#include "evp_local.h" +#include "evp_local.h" #include "sanitizers.h" typedef struct { @@ -177,7 +177,7 @@ static void ctr64_inc(unsigned char *counter) # define HWAES_xts_decrypt aes_p8_xts_decrypt #endif -#if defined(OPENSSL_CPUID_OBJ) && ( \ +#if defined(OPENSSL_CPUID_OBJ) && ( \ ((defined(__i386) || defined(__i386__) || \ defined(_M_IX86)) && defined(OPENSSL_IA32_SSE2))|| \ defined(__x86_64) || defined(__x86_64__) || \ @@ -1130,7 +1130,7 @@ typedef struct { } icv; unsigned char k[32]; } kmac_param; - /* KMAC-AES parameter block - end */ + /* KMAC-AES parameter block - end */ union { unsigned long long g[2]; @@ -1433,7 +1433,7 @@ static int s390x_aes_ctr_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, (OPENSSL_s390xcap_P.kma[0] & \ S390X_CAPBIT(S390X_AES_256))) -/* iv + padding length for iv lengths != 12 */ +/* iv + padding length for iv lengths != 12 */ # define S390X_gcm_ivpadlen(i) ((((i) + 15) >> 4 << 4) + 16) /*- diff --git a/contrib/libs/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c b/contrib/libs/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c index 27c36b46e7..cdaabbd1f5 100644 --- a/contrib/libs/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c +++ b/contrib/libs/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c @@ -17,9 +17,9 @@ #include <openssl/aes.h> #include <openssl/sha.h> #include <openssl/rand.h> -#include "modes_local.h" -#include "crypto/evp.h" -#include "internal/constant_time.h" +#include "modes_local.h" +#include "crypto/evp.h" +#include "internal/constant_time.h" typedef struct { AES_KEY ks; @@ -33,7 +33,7 @@ typedef struct { #define NO_PAYLOAD_LENGTH ((size_t)-1) -#if defined(AESNI_ASM) && ( \ +#if defined(AESNI_ASM) && ( \ defined(__x86_64) || defined(__x86_64__) || \ defined(_M_AMD64) || defined(_M_X64) ) diff --git a/contrib/libs/openssl/crypto/evp/e_aes_cbc_hmac_sha256.c b/contrib/libs/openssl/crypto/evp/e_aes_cbc_hmac_sha256.c index cc622b6faa..3cfeacbc7e 100644 --- a/contrib/libs/openssl/crypto/evp/e_aes_cbc_hmac_sha256.c +++ b/contrib/libs/openssl/crypto/evp/e_aes_cbc_hmac_sha256.c @@ -18,9 +18,9 @@ #include <openssl/aes.h> #include <openssl/sha.h> #include <openssl/rand.h> -#include "modes_local.h" -#include "internal/constant_time.h" -#include "crypto/evp.h" +#include "modes_local.h" +#include "internal/constant_time.h" +#include "crypto/evp.h" typedef struct { AES_KEY ks; @@ -34,7 +34,7 @@ typedef struct { # define NO_PAYLOAD_LENGTH ((size_t)-1) -#if defined(AESNI_ASM) && ( \ +#if defined(AESNI_ASM) && ( \ defined(__x86_64) || defined(__x86_64__) || \ defined(_M_AMD64) || defined(_M_X64) ) @@ -947,4 +947,4 @@ const EVP_CIPHER *EVP_aes_256_cbc_hmac_sha256(void) { return NULL; } -#endif /* AESNI_ASM */ +#endif /* AESNI_ASM */ diff --git a/contrib/libs/openssl/crypto/evp/e_aria.c b/contrib/libs/openssl/crypto/evp/e_aria.c index 1cc6dd91a9..5193a6518f 100644 --- a/contrib/libs/openssl/crypto/evp/e_aria.c +++ b/contrib/libs/openssl/crypto/evp/e_aria.c @@ -14,10 +14,10 @@ # include <openssl/modes.h> # include <openssl/rand.h> # include <openssl/rand_drbg.h> -# include "crypto/aria.h" -# include "crypto/evp.h" -# include "modes_local.h" -# include "evp_local.h" +# include "crypto/aria.h" +# include "crypto/evp.h" +# include "modes_local.h" +# include "evp_local.h" /* ARIA subkey Structure */ typedef struct { @@ -709,11 +709,11 @@ static int aria_ccm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, CRYPTO_ccm128_aad(ccm, in, len); return len; } - - /* The tag must be set before actually decrypting data */ - if (!EVP_CIPHER_CTX_encrypting(ctx) && !cctx->tag_set) - return -1; - + + /* The tag must be set before actually decrypting data */ + if (!EVP_CIPHER_CTX_encrypting(ctx) && !cctx->tag_set) + return -1; + /* If not set length yet do it */ if (!cctx->len_set) { if (CRYPTO_ccm128_setiv(ccm, EVP_CIPHER_CTX_iv_noconst(ctx), diff --git a/contrib/libs/openssl/crypto/evp/e_bf.c b/contrib/libs/openssl/crypto/evp/e_bf.c index 9a065582c6..e1717686bb 100644 --- a/contrib/libs/openssl/crypto/evp/e_bf.c +++ b/contrib/libs/openssl/crypto/evp/e_bf.c @@ -11,7 +11,7 @@ #include "internal/cryptlib.h" #ifndef OPENSSL_NO_BF # include <openssl/evp.h> -# include "crypto/evp.h" +# include "crypto/evp.h" # include <openssl/objects.h> # include <openssl/blowfish.h> diff --git a/contrib/libs/openssl/crypto/evp/e_camellia.c b/contrib/libs/openssl/crypto/evp/e_camellia.c index f8c0198012..eeba3a7b2a 100644 --- a/contrib/libs/openssl/crypto/evp/e_camellia.c +++ b/contrib/libs/openssl/crypto/evp/e_camellia.c @@ -17,8 +17,8 @@ NON_EMPTY_TRANSLATION_UNIT # include <string.h> # include <assert.h> # include <openssl/camellia.h> -# include "crypto/evp.h" -# include "modes_local.h" +# include "crypto/evp.h" +# include "modes_local.h" static int camellia_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, const unsigned char *iv, int enc); diff --git a/contrib/libs/openssl/crypto/evp/e_cast.c b/contrib/libs/openssl/crypto/evp/e_cast.c index df9f445bd0..3117a17bb7 100644 --- a/contrib/libs/openssl/crypto/evp/e_cast.c +++ b/contrib/libs/openssl/crypto/evp/e_cast.c @@ -13,7 +13,7 @@ #ifndef OPENSSL_NO_CAST # include <openssl/evp.h> # include <openssl/objects.h> -# include "crypto/evp.h" +# include "crypto/evp.h" # include <openssl/cast.h> static int cast_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, diff --git a/contrib/libs/openssl/crypto/evp/e_chacha20_poly1305.c b/contrib/libs/openssl/crypto/evp/e_chacha20_poly1305.c index bdc406bb69..70009ef303 100644 --- a/contrib/libs/openssl/crypto/evp/e_chacha20_poly1305.c +++ b/contrib/libs/openssl/crypto/evp/e_chacha20_poly1305.c @@ -14,9 +14,9 @@ # include <openssl/evp.h> # include <openssl/objects.h> -# include "evp_local.h" -# include "crypto/evp.h" -# include "crypto/chacha.h" +# include "evp_local.h" +# include "crypto/evp.h" +# include "crypto/chacha.h" typedef struct { union { @@ -146,7 +146,7 @@ const EVP_CIPHER *EVP_chacha20(void) } # ifndef OPENSSL_NO_POLY1305 -# include "crypto/poly1305.h" +# include "crypto/poly1305.h" typedef struct { EVP_CHACHA_KEY key; diff --git a/contrib/libs/openssl/crypto/evp/e_des.c b/contrib/libs/openssl/crypto/evp/e_des.c index 6d6e919af6..848e6b6fd1 100644 --- a/contrib/libs/openssl/crypto/evp/e_des.c +++ b/contrib/libs/openssl/crypto/evp/e_des.c @@ -12,7 +12,7 @@ #ifndef OPENSSL_NO_DES # include <openssl/evp.h> # include <openssl/objects.h> -# include "crypto/evp.h" +# include "crypto/evp.h" # include <openssl/des.h> # include <openssl/rand.h> diff --git a/contrib/libs/openssl/crypto/evp/e_des3.c b/contrib/libs/openssl/crypto/evp/e_des3.c index 2a5597fee5..3b6e7ae301 100644 --- a/contrib/libs/openssl/crypto/evp/e_des3.c +++ b/contrib/libs/openssl/crypto/evp/e_des3.c @@ -12,10 +12,10 @@ #ifndef OPENSSL_NO_DES # include <openssl/evp.h> # include <openssl/objects.h> -# include "crypto/evp.h" +# include "crypto/evp.h" # include <openssl/des.h> # include <openssl/rand.h> -# include "evp_local.h" +# include "evp_local.h" typedef struct { union { diff --git a/contrib/libs/openssl/crypto/evp/e_idea.c b/contrib/libs/openssl/crypto/evp/e_idea.c index 1068378ddc..e32f02a0d8 100644 --- a/contrib/libs/openssl/crypto/evp/e_idea.c +++ b/contrib/libs/openssl/crypto/evp/e_idea.c @@ -13,7 +13,7 @@ #ifndef OPENSSL_NO_IDEA # include <openssl/evp.h> # include <openssl/objects.h> -# include "crypto/evp.h" +# include "crypto/evp.h" # include <openssl/idea.h> /* Can't use IMPLEMENT_BLOCK_CIPHER because IDEA_ecb_encrypt is different */ diff --git a/contrib/libs/openssl/crypto/evp/e_null.c b/contrib/libs/openssl/crypto/evp/e_null.c index 0725454a3a..d8f822add1 100644 --- a/contrib/libs/openssl/crypto/evp/e_null.c +++ b/contrib/libs/openssl/crypto/evp/e_null.c @@ -11,7 +11,7 @@ #include "internal/cryptlib.h" #include <openssl/evp.h> #include <openssl/objects.h> -#include "crypto/evp.h" +#include "crypto/evp.h" static int null_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, const unsigned char *iv, int enc); diff --git a/contrib/libs/openssl/crypto/evp/e_rc2.c b/contrib/libs/openssl/crypto/evp/e_rc2.c index 4d8a0ee4b0..473b336148 100644 --- a/contrib/libs/openssl/crypto/evp/e_rc2.c +++ b/contrib/libs/openssl/crypto/evp/e_rc2.c @@ -14,7 +14,7 @@ # include <openssl/evp.h> # include <openssl/objects.h> -# include "crypto/evp.h" +# include "crypto/evp.h" # include <openssl/rc2.h> static int rc2_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, diff --git a/contrib/libs/openssl/crypto/evp/e_rc4.c b/contrib/libs/openssl/crypto/evp/e_rc4.c index c24bc8fe59..8e288bbefd 100644 --- a/contrib/libs/openssl/crypto/evp/e_rc4.c +++ b/contrib/libs/openssl/crypto/evp/e_rc4.c @@ -16,7 +16,7 @@ # include <openssl/objects.h> # include <openssl/rc4.h> -# include "crypto/evp.h" +# include "crypto/evp.h" typedef struct { RC4_KEY ks; /* working key */ diff --git a/contrib/libs/openssl/crypto/evp/e_rc4_hmac_md5.c b/contrib/libs/openssl/crypto/evp/e_rc4_hmac_md5.c index 201ce44343..73b66946aa 100644 --- a/contrib/libs/openssl/crypto/evp/e_rc4_hmac_md5.c +++ b/contrib/libs/openssl/crypto/evp/e_rc4_hmac_md5.c @@ -19,7 +19,7 @@ # include <openssl/objects.h> # include <openssl/rc4.h> # include <openssl/md5.h> -# include "crypto/evp.h" +# include "crypto/evp.h" typedef struct { RC4_KEY ks; diff --git a/contrib/libs/openssl/crypto/evp/e_rc5.c b/contrib/libs/openssl/crypto/evp/e_rc5.c index c86e87b65a..ed7fa28b4e 100644 --- a/contrib/libs/openssl/crypto/evp/e_rc5.c +++ b/contrib/libs/openssl/crypto/evp/e_rc5.c @@ -13,9 +13,9 @@ #ifndef OPENSSL_NO_RC5 # include <openssl/evp.h> -# include "crypto/evp.h" +# include "crypto/evp.h" # include <openssl/objects.h> -# include "evp_local.h" +# include "evp_local.h" # include <openssl/rc5.h> static int r_32_12_16_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, diff --git a/contrib/libs/openssl/crypto/evp/e_seed.c b/contrib/libs/openssl/crypto/evp/e_seed.c index aeb2363bea..9acb9cb787 100644 --- a/contrib/libs/openssl/crypto/evp/e_seed.c +++ b/contrib/libs/openssl/crypto/evp/e_seed.c @@ -16,7 +16,7 @@ NON_EMPTY_TRANSLATION_UNIT # include <string.h> # include <assert.h> # include <openssl/seed.h> -# include "crypto/evp.h" +# include "crypto/evp.h" static int seed_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, const unsigned char *iv, int enc); diff --git a/contrib/libs/openssl/crypto/evp/e_sm4.c b/contrib/libs/openssl/crypto/evp/e_sm4.c index fce32794fc..77d86efe39 100644 --- a/contrib/libs/openssl/crypto/evp/e_sm4.c +++ b/contrib/libs/openssl/crypto/evp/e_sm4.c @@ -13,8 +13,8 @@ #ifndef OPENSSL_NO_SM4 # include <openssl/evp.h> # include <openssl/modes.h> -# include "crypto/sm4.h" -# include "crypto/evp.h" +# include "crypto/sm4.h" +# include "crypto/evp.h" typedef struct { SM4_KEY ks; diff --git a/contrib/libs/openssl/crypto/evp/e_xcbc_d.c b/contrib/libs/openssl/crypto/evp/e_xcbc_d.c index b730775422..111dee932b 100644 --- a/contrib/libs/openssl/crypto/evp/e_xcbc_d.c +++ b/contrib/libs/openssl/crypto/evp/e_xcbc_d.c @@ -14,7 +14,7 @@ # include <openssl/evp.h> # include <openssl/objects.h> -# include "crypto/evp.h" +# include "crypto/evp.h" # include <openssl/des.h> static int desx_cbc_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, diff --git a/contrib/libs/openssl/crypto/evp/encode.c b/contrib/libs/openssl/crypto/evp/encode.c index 85926434c3..4096ffac8d 100644 --- a/contrib/libs/openssl/crypto/evp/encode.c +++ b/contrib/libs/openssl/crypto/evp/encode.c @@ -11,8 +11,8 @@ #include <limits.h> #include "internal/cryptlib.h" #include <openssl/evp.h> -#include "evp_local.h" -#include "crypto/evp.h" +#include "evp_local.h" +#include "crypto/evp.h" static unsigned char conv_ascii2bin(unsigned char a, const unsigned char *table); 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); diff --git a/contrib/libs/openssl/crypto/evp/evp_err.c b/contrib/libs/openssl/crypto/evp/evp_err.c index 32ac0125de..bf229f7de6 100644 --- a/contrib/libs/openssl/crypto/evp/evp_err.c +++ b/contrib/libs/openssl/crypto/evp/evp_err.c @@ -213,7 +213,7 @@ static const ERR_STRING_DATA EVP_str_reasons[] = { "input not initialized"}, {ERR_PACK(ERR_LIB_EVP, 0, EVP_R_INVALID_DIGEST), "invalid digest"}, {ERR_PACK(ERR_LIB_EVP, 0, EVP_R_INVALID_FIPS_MODE), "invalid fips mode"}, - {ERR_PACK(ERR_LIB_EVP, 0, EVP_R_INVALID_IV_LENGTH), "invalid iv length"}, + {ERR_PACK(ERR_LIB_EVP, 0, EVP_R_INVALID_IV_LENGTH), "invalid iv length"}, {ERR_PACK(ERR_LIB_EVP, 0, EVP_R_INVALID_KEY), "invalid key"}, {ERR_PACK(ERR_LIB_EVP, 0, EVP_R_INVALID_KEY_LENGTH), "invalid key length"}, {ERR_PACK(ERR_LIB_EVP, 0, EVP_R_INVALID_OPERATION), "invalid operation"}, diff --git a/contrib/libs/openssl/crypto/evp/evp_lib.c b/contrib/libs/openssl/crypto/evp/evp_lib.c index 45cde0da8b..b5526a7f26 100644 --- a/contrib/libs/openssl/crypto/evp/evp_lib.c +++ b/contrib/libs/openssl/crypto/evp/evp_lib.c @@ -11,8 +11,8 @@ #include "internal/cryptlib.h" #include <openssl/evp.h> #include <openssl/objects.h> -#include "crypto/evp.h" -#include "evp_local.h" +#include "crypto/evp.h" +#include "evp_local.h" int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type) { diff --git a/contrib/libs/openssl/crypto/evp/evp_local.h b/contrib/libs/openssl/crypto/evp/evp_local.h index f1589d6828..020a6f4c00 100644 --- a/contrib/libs/openssl/crypto/evp/evp_local.h +++ b/contrib/libs/openssl/crypto/evp/evp_local.h @@ -1,68 +1,68 @@ -/* - * Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved. - * - * Licensed under the OpenSSL license (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution or at - * https://www.openssl.org/source/license.html - */ - -/* EVP_MD_CTX related stuff */ - -struct evp_md_ctx_st { - const EVP_MD *digest; - ENGINE *engine; /* functional reference if 'digest' is - * ENGINE-provided */ - unsigned long flags; - void *md_data; - /* Public key context for sign/verify */ - EVP_PKEY_CTX *pctx; - /* Update function: usually copied from EVP_MD */ - int (*update) (EVP_MD_CTX *ctx, const void *data, size_t count); -} /* EVP_MD_CTX */ ; - -struct evp_cipher_ctx_st { - const EVP_CIPHER *cipher; - ENGINE *engine; /* functional reference if 'cipher' is - * ENGINE-provided */ - int encrypt; /* encrypt or decrypt */ - int buf_len; /* number we have left */ - unsigned char oiv[EVP_MAX_IV_LENGTH]; /* original iv */ - unsigned char iv[EVP_MAX_IV_LENGTH]; /* working iv */ - unsigned char buf[EVP_MAX_BLOCK_LENGTH]; /* saved partial block */ - int num; /* used by cfb/ofb/ctr mode */ - /* FIXME: Should this even exist? It appears unused */ - void *app_data; /* application stuff */ - int key_len; /* May change for variable length cipher */ - unsigned long flags; /* Various flags */ - void *cipher_data; /* per EVP data */ - int final_used; - int block_mask; - unsigned char final[EVP_MAX_BLOCK_LENGTH]; /* possible final block */ -} /* EVP_CIPHER_CTX */ ; - -int PKCS5_v2_PBKDF2_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, - int passlen, ASN1_TYPE *param, - const EVP_CIPHER *c, const EVP_MD *md, - int en_de); - -struct evp_Encode_Ctx_st { - /* number saved in a partial encode/decode */ - int num; - /* - * The length is either the output line length (in input bytes) or the - * shortest input line length that is ok. Once decoding begins, the - * length is adjusted up each time a longer line is decoded - */ - int length; - /* data to encode */ - unsigned char enc_data[80]; - /* number read on current line */ - int line_num; - unsigned int flags; -}; - -typedef struct evp_pbe_st EVP_PBE_CTL; -DEFINE_STACK_OF(EVP_PBE_CTL) - -int is_partially_overlapping(const void *ptr1, const void *ptr2, int len); +/* + * Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* EVP_MD_CTX related stuff */ + +struct evp_md_ctx_st { + const EVP_MD *digest; + ENGINE *engine; /* functional reference if 'digest' is + * ENGINE-provided */ + unsigned long flags; + void *md_data; + /* Public key context for sign/verify */ + EVP_PKEY_CTX *pctx; + /* Update function: usually copied from EVP_MD */ + int (*update) (EVP_MD_CTX *ctx, const void *data, size_t count); +} /* EVP_MD_CTX */ ; + +struct evp_cipher_ctx_st { + const EVP_CIPHER *cipher; + ENGINE *engine; /* functional reference if 'cipher' is + * ENGINE-provided */ + int encrypt; /* encrypt or decrypt */ + int buf_len; /* number we have left */ + unsigned char oiv[EVP_MAX_IV_LENGTH]; /* original iv */ + unsigned char iv[EVP_MAX_IV_LENGTH]; /* working iv */ + unsigned char buf[EVP_MAX_BLOCK_LENGTH]; /* saved partial block */ + int num; /* used by cfb/ofb/ctr mode */ + /* FIXME: Should this even exist? It appears unused */ + void *app_data; /* application stuff */ + int key_len; /* May change for variable length cipher */ + unsigned long flags; /* Various flags */ + void *cipher_data; /* per EVP data */ + int final_used; + int block_mask; + unsigned char final[EVP_MAX_BLOCK_LENGTH]; /* possible final block */ +} /* EVP_CIPHER_CTX */ ; + +int PKCS5_v2_PBKDF2_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, + int passlen, ASN1_TYPE *param, + const EVP_CIPHER *c, const EVP_MD *md, + int en_de); + +struct evp_Encode_Ctx_st { + /* number saved in a partial encode/decode */ + int num; + /* + * The length is either the output line length (in input bytes) or the + * shortest input line length that is ok. Once decoding begins, the + * length is adjusted up each time a longer line is decoded + */ + int length; + /* data to encode */ + unsigned char enc_data[80]; + /* number read on current line */ + int line_num; + unsigned int flags; +}; + +typedef struct evp_pbe_st EVP_PBE_CTL; +DEFINE_STACK_OF(EVP_PBE_CTL) + +int is_partially_overlapping(const void *ptr1, const void *ptr2, int len); diff --git a/contrib/libs/openssl/crypto/evp/evp_pbe.c b/contrib/libs/openssl/crypto/evp/evp_pbe.c index 967203f373..62f8396f6d 100644 --- a/contrib/libs/openssl/crypto/evp/evp_pbe.c +++ b/contrib/libs/openssl/crypto/evp/evp_pbe.c @@ -12,7 +12,7 @@ #include <openssl/evp.h> #include <openssl/pkcs12.h> #include <openssl/x509.h> -#include "evp_local.h" +#include "evp_local.h" /* Password based encryption (PBE) functions */ diff --git a/contrib/libs/openssl/crypto/evp/evp_pkey.c b/contrib/libs/openssl/crypto/evp/evp_pkey.c index 586b74605c..68cc2018a0 100644 --- a/contrib/libs/openssl/crypto/evp/evp_pkey.c +++ b/contrib/libs/openssl/crypto/evp/evp_pkey.c @@ -12,9 +12,9 @@ #include "internal/cryptlib.h" #include <openssl/x509.h> #include <openssl/rand.h> -#include "crypto/asn1.h" -#include "crypto/evp.h" -#include "crypto/x509.h" +#include "crypto/asn1.h" +#include "crypto/evp.h" +#include "crypto/x509.h" /* Extract a private key from a PKCS8 structure */ diff --git a/contrib/libs/openssl/crypto/evp/m_md2.c b/contrib/libs/openssl/crypto/evp/m_md2.c index 1aec518523..a790b3ef68 100644 --- a/contrib/libs/openssl/crypto/evp/m_md2.c +++ b/contrib/libs/openssl/crypto/evp/m_md2.c @@ -18,7 +18,7 @@ # include <openssl/md2.h> # include <openssl/rsa.h> -#include "crypto/evp.h" +#include "crypto/evp.h" static int init(EVP_MD_CTX *ctx) { diff --git a/contrib/libs/openssl/crypto/evp/m_md4.c b/contrib/libs/openssl/crypto/evp/m_md4.c index 45d2cafee1..8cd2c7e697 100644 --- a/contrib/libs/openssl/crypto/evp/m_md4.c +++ b/contrib/libs/openssl/crypto/evp/m_md4.c @@ -17,7 +17,7 @@ # include <openssl/x509.h> # include <openssl/md4.h> # include <openssl/rsa.h> -# include "crypto/evp.h" +# include "crypto/evp.h" static int init(EVP_MD_CTX *ctx) { diff --git a/contrib/libs/openssl/crypto/evp/m_md5.c b/contrib/libs/openssl/crypto/evp/m_md5.c index d26b5a4d31..463b8423f1 100644 --- a/contrib/libs/openssl/crypto/evp/m_md5.c +++ b/contrib/libs/openssl/crypto/evp/m_md5.c @@ -17,7 +17,7 @@ # include <openssl/x509.h> # include <openssl/md5.h> # include <openssl/rsa.h> -# include "crypto/evp.h" +# include "crypto/evp.h" static int init(EVP_MD_CTX *ctx) { diff --git a/contrib/libs/openssl/crypto/evp/m_md5_sha1.c b/contrib/libs/openssl/crypto/evp/m_md5_sha1.c index eeec2b13e9..e2d042d218 100644 --- a/contrib/libs/openssl/crypto/evp/m_md5_sha1.c +++ b/contrib/libs/openssl/crypto/evp/m_md5_sha1.c @@ -15,7 +15,7 @@ # include <openssl/md5.h> # include <openssl/sha.h> # include "internal/cryptlib.h" -# include "crypto/evp.h" +# include "crypto/evp.h" # include <openssl/rsa.h> struct md5_sha1_ctx { diff --git a/contrib/libs/openssl/crypto/evp/m_mdc2.c b/contrib/libs/openssl/crypto/evp/m_mdc2.c index fffa751efd..47f9b7cbb9 100644 --- a/contrib/libs/openssl/crypto/evp/m_mdc2.c +++ b/contrib/libs/openssl/crypto/evp/m_mdc2.c @@ -17,7 +17,7 @@ # include <openssl/x509.h> # include <openssl/mdc2.h> # include <openssl/rsa.h> -# include "crypto/evp.h" +# include "crypto/evp.h" static int init(EVP_MD_CTX *ctx) { diff --git a/contrib/libs/openssl/crypto/evp/m_null.c b/contrib/libs/openssl/crypto/evp/m_null.c index 0847139df1..d11ee79ef7 100644 --- a/contrib/libs/openssl/crypto/evp/m_null.c +++ b/contrib/libs/openssl/crypto/evp/m_null.c @@ -12,7 +12,7 @@ #include <openssl/evp.h> #include <openssl/objects.h> #include <openssl/x509.h> -#include "crypto/evp.h" +#include "crypto/evp.h" static int init(EVP_MD_CTX *ctx) { diff --git a/contrib/libs/openssl/crypto/evp/m_ripemd.c b/contrib/libs/openssl/crypto/evp/m_ripemd.c index d93ad24fe5..00babc7d50 100644 --- a/contrib/libs/openssl/crypto/evp/m_ripemd.c +++ b/contrib/libs/openssl/crypto/evp/m_ripemd.c @@ -17,7 +17,7 @@ # include <openssl/objects.h> # include <openssl/x509.h> # include <openssl/rsa.h> -# include "crypto/evp.h" +# include "crypto/evp.h" static int init(EVP_MD_CTX *ctx) { diff --git a/contrib/libs/openssl/crypto/evp/m_sha1.c b/contrib/libs/openssl/crypto/evp/m_sha1.c index 22b9bbc7d8..4e719ecd65 100644 --- a/contrib/libs/openssl/crypto/evp/m_sha1.c +++ b/contrib/libs/openssl/crypto/evp/m_sha1.c @@ -14,8 +14,8 @@ #include <openssl/objects.h> #include <openssl/sha.h> #include <openssl/rsa.h> -#include "crypto/evp.h" -#include "crypto/sha.h" +#include "crypto/evp.h" +#include "crypto/sha.h" static int init(EVP_MD_CTX *ctx) { diff --git a/contrib/libs/openssl/crypto/evp/m_sha3.c b/contrib/libs/openssl/crypto/evp/m_sha3.c index 54c592a3cc..010f2c8350 100644 --- a/contrib/libs/openssl/crypto/evp/m_sha3.c +++ b/contrib/libs/openssl/crypto/evp/m_sha3.c @@ -12,8 +12,8 @@ #include <openssl/evp.h> #include <openssl/objects.h> -#include "crypto/evp.h" -#include "evp_local.h" +#include "crypto/evp.h" +#include "evp_local.h" size_t SHA3_absorb(uint64_t A[5][5], const unsigned char *inp, size_t len, size_t r); diff --git a/contrib/libs/openssl/crypto/evp/m_sigver.c b/contrib/libs/openssl/crypto/evp/m_sigver.c index 04643acc88..8e8365451b 100644 --- a/contrib/libs/openssl/crypto/evp/m_sigver.c +++ b/contrib/libs/openssl/crypto/evp/m_sigver.c @@ -12,8 +12,8 @@ #include <openssl/evp.h> #include <openssl/objects.h> #include <openssl/x509.h> -#include "crypto/evp.h" -#include "evp_local.h" +#include "crypto/evp.h" +#include "evp_local.h" static int update(EVP_MD_CTX *ctx, const void *data, size_t datalen) { diff --git a/contrib/libs/openssl/crypto/evp/m_wp.c b/contrib/libs/openssl/crypto/evp/m_wp.c index 5ce15d2d5e..e12661c1e5 100644 --- a/contrib/libs/openssl/crypto/evp/m_wp.c +++ b/contrib/libs/openssl/crypto/evp/m_wp.c @@ -16,7 +16,7 @@ # include <openssl/objects.h> # include <openssl/x509.h> # include <openssl/whrlpool.h> -# include "crypto/evp.h" +# include "crypto/evp.h" static int init(EVP_MD_CTX *ctx) { diff --git a/contrib/libs/openssl/crypto/evp/names.c b/contrib/libs/openssl/crypto/evp/names.c index 90c7b73b7a..fc7eaae1c5 100644 --- a/contrib/libs/openssl/crypto/evp/names.c +++ b/contrib/libs/openssl/crypto/evp/names.c @@ -10,9 +10,9 @@ #include <stdio.h> #include "internal/cryptlib.h" #include <openssl/evp.h> -#include "crypto/objects.h" +#include "crypto/objects.h" #include <openssl/x509.h> -#include "crypto/evp.h" +#include "crypto/evp.h" int EVP_add_cipher(const EVP_CIPHER *c) { diff --git a/contrib/libs/openssl/crypto/evp/p5_crpt.c b/contrib/libs/openssl/crypto/evp/p5_crpt.c index 6c5f45f733..d54de47ded 100644 --- a/contrib/libs/openssl/crypto/evp/p5_crpt.c +++ b/contrib/libs/openssl/crypto/evp/p5_crpt.c @@ -1,5 +1,5 @@ /* - * Copyright 1999-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1999-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -28,7 +28,7 @@ int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *cctx, const char *pass, int passlen, EVP_MD_CTX *ctx; unsigned char md_tmp[EVP_MAX_MD_SIZE]; unsigned char key[EVP_MAX_KEY_LENGTH], iv[EVP_MAX_IV_LENGTH]; - int i, ivl, kl; + int i, ivl, kl; PBEPARAM *pbe; int saltlen, iter; unsigned char *salt; @@ -48,19 +48,19 @@ int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *cctx, const char *pass, int passlen, return 0; } - ivl = EVP_CIPHER_iv_length(cipher); - if (ivl < 0 || ivl > 16) { - EVPerr(EVP_F_PKCS5_PBE_KEYIVGEN, EVP_R_INVALID_IV_LENGTH); - PBEPARAM_free(pbe); - return 0; - } - kl = EVP_CIPHER_key_length(cipher); - if (kl < 0 || kl > (int)sizeof(md_tmp)) { - EVPerr(EVP_F_PKCS5_PBE_KEYIVGEN, EVP_R_INVALID_KEY_LENGTH); - PBEPARAM_free(pbe); - return 0; - } - + ivl = EVP_CIPHER_iv_length(cipher); + if (ivl < 0 || ivl > 16) { + EVPerr(EVP_F_PKCS5_PBE_KEYIVGEN, EVP_R_INVALID_IV_LENGTH); + PBEPARAM_free(pbe); + return 0; + } + kl = EVP_CIPHER_key_length(cipher); + if (kl < 0 || kl > (int)sizeof(md_tmp)) { + EVPerr(EVP_F_PKCS5_PBE_KEYIVGEN, EVP_R_INVALID_KEY_LENGTH); + PBEPARAM_free(pbe); + return 0; + } + if (!pbe->iter) iter = 1; else @@ -86,7 +86,7 @@ int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *cctx, const char *pass, int passlen, if (!EVP_DigestUpdate(ctx, salt, saltlen)) goto err; PBEPARAM_free(pbe); - pbe = NULL; + pbe = NULL; if (!EVP_DigestFinal_ex(ctx, md_tmp, NULL)) goto err; mdsize = EVP_MD_size(md); @@ -100,8 +100,8 @@ int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *cctx, const char *pass, int passlen, if (!EVP_DigestFinal_ex(ctx, md_tmp, NULL)) goto err; } - memcpy(key, md_tmp, kl); - memcpy(iv, md_tmp + (16 - ivl), ivl); + memcpy(key, md_tmp, kl); + memcpy(iv, md_tmp + (16 - ivl), ivl); if (!EVP_CipherInit_ex(cctx, cipher, NULL, key, iv, en_de)) goto err; OPENSSL_cleanse(md_tmp, EVP_MAX_MD_SIZE); @@ -109,7 +109,7 @@ int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *cctx, const char *pass, int passlen, OPENSSL_cleanse(iv, EVP_MAX_IV_LENGTH); rv = 1; err: - PBEPARAM_free(pbe); + PBEPARAM_free(pbe); EVP_MD_CTX_free(ctx); return rv; } diff --git a/contrib/libs/openssl/crypto/evp/p5_crpt2.c b/contrib/libs/openssl/crypto/evp/p5_crpt2.c index 7f625b3d57..6bae87c8a9 100644 --- a/contrib/libs/openssl/crypto/evp/p5_crpt2.c +++ b/contrib/libs/openssl/crypto/evp/p5_crpt2.c @@ -13,7 +13,7 @@ # include <openssl/x509.h> # include <openssl/evp.h> # include <openssl/hmac.h> -# include "evp_local.h" +# include "evp_local.h" /* set this to print out info about the keygen algorithm */ /* #define OPENSSL_DEBUG_PKCS5V2 */ diff --git a/contrib/libs/openssl/crypto/evp/p_lib.c b/contrib/libs/openssl/crypto/evp/p_lib.c index 9f1a485a5b..a25e2dd7f7 100644 --- a/contrib/libs/openssl/crypto/evp/p_lib.c +++ b/contrib/libs/openssl/crypto/evp/p_lib.c @@ -21,8 +21,8 @@ #include <openssl/cmac.h> #include <openssl/engine.h> -#include "crypto/asn1.h" -#include "crypto/evp.h" +#include "crypto/asn1.h" +#include "crypto/evp.h" static void EVP_PKEY_free_it(EVP_PKEY *x); @@ -102,7 +102,7 @@ int EVP_PKEY_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from) int EVP_PKEY_missing_parameters(const EVP_PKEY *pkey) { - if (pkey != NULL && pkey->ameth && pkey->ameth->param_missing) + if (pkey != NULL && pkey->ameth && pkey->ameth->param_missing) return pkey->ameth->param_missing(pkey); return 0; } @@ -465,7 +465,7 @@ int EVP_PKEY_set1_RSA(EVP_PKEY *pkey, RSA *key) RSA *EVP_PKEY_get0_RSA(EVP_PKEY *pkey) { - if (pkey->type != EVP_PKEY_RSA && pkey->type != EVP_PKEY_RSA_PSS) { + if (pkey->type != EVP_PKEY_RSA && pkey->type != EVP_PKEY_RSA_PSS) { EVPerr(EVP_F_EVP_PKEY_GET0_RSA, EVP_R_EXPECTING_AN_RSA_KEY); return NULL; } @@ -540,9 +540,9 @@ EC_KEY *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey) int EVP_PKEY_set1_DH(EVP_PKEY *pkey, DH *key) { - int type = DH_get0_q(key) == NULL ? EVP_PKEY_DH : EVP_PKEY_DHX; - int ret = EVP_PKEY_assign(pkey, type, key); - + int type = DH_get0_q(key) == NULL ? EVP_PKEY_DH : EVP_PKEY_DHX; + int ret = EVP_PKEY_assign(pkey, type, key); + if (ret) DH_up_ref(key); return ret; diff --git a/contrib/libs/openssl/crypto/evp/p_sign.c b/contrib/libs/openssl/crypto/evp/p_sign.c index 0383294a87..1ecbd5422d 100644 --- a/contrib/libs/openssl/crypto/evp/p_sign.c +++ b/contrib/libs/openssl/crypto/evp/p_sign.c @@ -12,7 +12,7 @@ #include <openssl/evp.h> #include <openssl/objects.h> #include <openssl/x509.h> -#include "crypto/evp.h" +#include "crypto/evp.h" int EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, unsigned int *siglen, EVP_PKEY *pkey) diff --git a/contrib/libs/openssl/crypto/evp/p_verify.c b/contrib/libs/openssl/crypto/evp/p_verify.c index e27196f7c2..4c239a84cf 100644 --- a/contrib/libs/openssl/crypto/evp/p_verify.c +++ b/contrib/libs/openssl/crypto/evp/p_verify.c @@ -12,7 +12,7 @@ #include <openssl/evp.h> #include <openssl/objects.h> #include <openssl/x509.h> -#include "crypto/evp.h" +#include "crypto/evp.h" int EVP_VerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sigbuf, unsigned int siglen, EVP_PKEY *pkey) diff --git a/contrib/libs/openssl/crypto/evp/pmeth_fn.c b/contrib/libs/openssl/crypto/evp/pmeth_fn.c index 02f4093461..e3f22e2f36 100644 --- a/contrib/libs/openssl/crypto/evp/pmeth_fn.c +++ b/contrib/libs/openssl/crypto/evp/pmeth_fn.c @@ -12,7 +12,7 @@ #include "internal/cryptlib.h" #include <openssl/objects.h> #include <openssl/evp.h> -#include "crypto/evp.h" +#include "crypto/evp.h" #define M_check_autoarg(ctx, arg, arglen, err) \ if (ctx->pmeth->flags & EVP_PKEY_FLAG_AUTOARGLEN) { \ diff --git a/contrib/libs/openssl/crypto/evp/pmeth_gn.c b/contrib/libs/openssl/crypto/evp/pmeth_gn.c index 3ad6d5c7c7..76930a6b44 100644 --- a/contrib/libs/openssl/crypto/evp/pmeth_gn.c +++ b/contrib/libs/openssl/crypto/evp/pmeth_gn.c @@ -12,9 +12,9 @@ #include "internal/cryptlib.h" #include <openssl/objects.h> #include <openssl/evp.h> -#include "crypto/bn.h" -#include "crypto/asn1.h" -#include "crypto/evp.h" +#include "crypto/bn.h" +#include "crypto/asn1.h" +#include "crypto/evp.h" int EVP_PKEY_paramgen_init(EVP_PKEY_CTX *ctx) { diff --git a/contrib/libs/openssl/crypto/evp/pmeth_lib.c b/contrib/libs/openssl/crypto/evp/pmeth_lib.c index 603ccd8352..0010c95b53 100644 --- a/contrib/libs/openssl/crypto/evp/pmeth_lib.c +++ b/contrib/libs/openssl/crypto/evp/pmeth_lib.c @@ -13,8 +13,8 @@ #include <openssl/engine.h> #include <openssl/evp.h> #include <openssl/x509v3.h> -#include "crypto/asn1.h" -#include "crypto/evp.h" +#include "crypto/asn1.h" +#include "crypto/evp.h" #include "internal/numbers.h" typedef int sk_cmp_fn_type(const char *const *a, const char *const *b); @@ -642,21 +642,21 @@ void EVP_PKEY_meth_set_ctrl(EVP_PKEY_METHOD *pmeth, pmeth->ctrl_str = ctrl_str; } -void EVP_PKEY_meth_set_digestsign(EVP_PKEY_METHOD *pmeth, - int (*digestsign) (EVP_MD_CTX *ctx, unsigned char *sig, size_t *siglen, - const unsigned char *tbs, size_t tbslen)) -{ - pmeth->digestsign = digestsign; -} - -void EVP_PKEY_meth_set_digestverify(EVP_PKEY_METHOD *pmeth, - int (*digestverify) (EVP_MD_CTX *ctx, const unsigned char *sig, - size_t siglen, const unsigned char *tbs, - size_t tbslen)) -{ - pmeth->digestverify = digestverify; -} - +void EVP_PKEY_meth_set_digestsign(EVP_PKEY_METHOD *pmeth, + int (*digestsign) (EVP_MD_CTX *ctx, unsigned char *sig, size_t *siglen, + const unsigned char *tbs, size_t tbslen)) +{ + pmeth->digestsign = digestsign; +} + +void EVP_PKEY_meth_set_digestverify(EVP_PKEY_METHOD *pmeth, + int (*digestverify) (EVP_MD_CTX *ctx, const unsigned char *sig, + size_t siglen, const unsigned char *tbs, + size_t tbslen)) +{ + pmeth->digestverify = digestverify; +} + void EVP_PKEY_meth_set_check(EVP_PKEY_METHOD *pmeth, int (*check) (EVP_PKEY *pkey)) { @@ -849,23 +849,23 @@ void EVP_PKEY_meth_get_ctrl(const EVP_PKEY_METHOD *pmeth, *pctrl_str = pmeth->ctrl_str; } -void EVP_PKEY_meth_get_digestsign(EVP_PKEY_METHOD *pmeth, - int (**digestsign) (EVP_MD_CTX *ctx, unsigned char *sig, size_t *siglen, - const unsigned char *tbs, size_t tbslen)) -{ - if (digestsign) - *digestsign = pmeth->digestsign; -} - -void EVP_PKEY_meth_get_digestverify(EVP_PKEY_METHOD *pmeth, - int (**digestverify) (EVP_MD_CTX *ctx, const unsigned char *sig, - size_t siglen, const unsigned char *tbs, - size_t tbslen)) -{ - if (digestverify) - *digestverify = pmeth->digestverify; -} - +void EVP_PKEY_meth_get_digestsign(EVP_PKEY_METHOD *pmeth, + int (**digestsign) (EVP_MD_CTX *ctx, unsigned char *sig, size_t *siglen, + const unsigned char *tbs, size_t tbslen)) +{ + if (digestsign) + *digestsign = pmeth->digestsign; +} + +void EVP_PKEY_meth_get_digestverify(EVP_PKEY_METHOD *pmeth, + int (**digestverify) (EVP_MD_CTX *ctx, const unsigned char *sig, + size_t siglen, const unsigned char *tbs, + size_t tbslen)) +{ + if (digestverify) + *digestverify = pmeth->digestverify; +} + void EVP_PKEY_meth_get_check(const EVP_PKEY_METHOD *pmeth, int (**pcheck) (EVP_PKEY *pkey)) { |