openssl/crypto/pkcs12
Rich Salz f6c95e46c0 Add "origin" field to EVP_CIPHER, EVP_MD
Add a "where did this EVP_{CIPHER,MD} come from" flag: global, via fetch,
or via EVP_{CIPHER,MD}_meth_new.  Update EVP_{CIPHER,MD}_free to handle all
three origins. The flag is deliberately right before some function pointers,
so that compile-time failures (int/pointer) will occur, as opposed to
taking a bit in the existing "flags" field.  The "global variable" flag
is non-zero, so the default case of using OPENSSL_zalloc (for provider
ciphers), will do the right thing. Ref-counting is a no-op for
Make up_ref no-op for global MD and CIPHER objects

Deprecate EVP_MD_CTX_md().  Added EVP_MD_CTX_get0_md() (same semantics as
the deprecated function) and EVP_MD_CTX_get1_md().  Likewise, deprecate
EVP_CIPHER_CTX_cipher() in favor of EVP_CIPHER_CTX_get0_cipher(), and add
EVP_CIPHER_CTX_get1_CIPHER().

Refactor EVP_MD_free() and EVP_MD_meth_free() to call new common
evp_md_free_int() function.
Refactor EVP_CIPHER_free() and EVP_CIPHER_meth_free() to call new common
evp_cipher_free_int() function.

Also change some flags tests to explicit test == or != zero. E.g.,
        if (flags & x) --> if ((flags & x) != 0)
        if (!(flags & x)) --> if ((flags & x) == 0)
Only done for those lines where "get0_cipher" calls were made.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14193)
2021-04-18 10:03:07 +02:00
..
build.info Following the PKCS#12 update, update crypto/pkcs12/build.info as well 2016-02-08 20:20:43 +01:00
p12_add.c Update copyright year 2020-11-26 14:18:57 +00:00
p12_asn.c Reorganize local header files 2019-09-28 20:26:35 +02:00
p12_attr.c Update copyright year 2020-10-15 14:10:06 +01:00
p12_crpt.c Update copyright year 2020-11-26 14:18:57 +00:00
p12_crt.c Update copyright year 2021-03-11 13:27:36 +00:00
p12_decr.c Add "origin" field to EVP_CIPHER, EVP_MD 2021-04-18 10:03:07 +02:00
p12_init.c Update copyright year 2020-11-26 14:18:57 +00:00
p12_key.c Update copyright year 2021-03-11 13:27:36 +00:00
p12_kiss.c Update copyright year 2021-03-11 13:27:36 +00:00
p12_local.h Reorganize local header files 2019-09-28 20:26:35 +02:00
p12_mutl.c Add more negative checks for integers passed to OPENSSL_malloc(). 2021-04-16 12:10:08 +10:00
p12_npas.c Convert all {NAME}err() in crypto/ to their corresponding ERR_raise() call 2020-11-13 09:35:02 +01:00
p12_p8d.c Following the license change, modify the boilerplates in crypto/pkcs12/ 2018-12-06 15:11:42 +01:00
p12_p8e.c Update copyright year 2020-11-26 14:18:57 +00:00
p12_sbag.c Convert all {NAME}err() in crypto/ to their corresponding ERR_raise() call 2020-11-13 09:35:02 +01:00
p12_utl.c Add more negative checks for integers passed to OPENSSL_malloc(). 2021-04-16 12:10:08 +10:00
pk12err.c ERR: Rebuild all generated error headers and source files 2020-11-24 15:22:33 +01:00