summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* ecdh_cms_encrypt: simplify handling of pkeytb2024-04-171-15/+6
| | | | | | | The pkey is only used in one scope. i2o allocates if passed a pointer to NULL, so use that to drop two unnecessary local variables. ok jsing
* Transfer ownership before setting unused bitstb2024-04-171-2/+4
| | | | | | | This looks like a use after free, but setting the unused bits to 0 can't actually fail. ok jsing
* Turn ecdh_cms_encrypt() into single exittb2024-04-171-7/+7
| | | | | | Also use ret instead of rv. ok jsing
* Fix error check in ecdh_cms_encrypt()tb2024-04-171-2/+2
| | | | | | | | ASN1_TYPE_get() returns V_ASN1_* constants. Checking the return for NID_undef instead means that we actually check for V_ASN1_EOC, which makes absolutely no sense here. Clearly V_ASN1_UNDEF was intended. ok jsing
* Avoid NULL dereference in EVP_PKEY_paramgen()tb2024-04-171-6/+8
| | | | | | | | If EVP_PKEY_new() returns NULL, it would be passed to the paramgen() pmeth which would typically dereference it. This is identical to a recent change in keygen(). ok jsing
* Invert BN_BITS2 handling in bn_bin2bn_cbs() and bn_hex2bn_cbs().jsing2024-04-161-11/+11
| | | | | | This results in simpler code. Suggested by tb@ during review.
* Rewrite BN_bin2bn() using CBS.jsing2024-04-161-35/+58
| | | | ok tb@
* Provide bn_expand_bytes().jsing2024-04-162-2/+16
| | | | | | This will be used in an upcoming change. ok tb@
* Rename bn_expand() to bn_expand_bits().jsing2024-04-163-10/+7
| | | | | | | Also change the bits type from int to size_t, since that's what the callers are passing and we can avoid unnecessary input validation. ok tb@
* sorttb2024-04-161-1/+1
|
* Include the correct headertb2024-04-151-2/+2
|
* crank libcrypto major after symbol removaltb2024-04-151-1/+1
|
* Bye, bye, OPENSSL_str{,n}casecmp()tb2024-04-153-25/+1
| | | | ok jsing
* And a pile of TS ASN.1 stuff becomes internal-only, tootb2024-04-152-19/+10
| | | | ok jsing
* X509_NAME_ENTRIES_it and X509_NAME_INTERNAL_it go internaltb2024-04-152-5/+3
| | | | | | It's always good to see something called internal in the public API. ok jsing
* And here go {,EC}DSA_SIG_ittb2024-04-153-6/+4
| | | | ok jsing
* DHparam_it becomes static, tootb2024-04-152-3/+2
| | | | ok jsing
* More X9.62 stuff was never used outside of ec_asn1.ctb2024-04-152-43/+5
| | | | | | We only need the ASN.1 items. ok jsing
* EC_PRIVATEKEY becomes internal-only, tootb2024-04-152-15/+10
| | | | ok jsing
* Unexport the ECPKPARAMETERS APItb2024-04-153-19/+12
| | | | ok jsing
* Make ECPARAMETERS_{new,free,it} internal-onlytb2024-04-152-8/+5
| | | | ok jsing
* Move BIO_CONNECT_{new,free}() to internal-onlytb2024-04-152-7/+5
| | | | ok jsing
* Remove ASN1_time_clamp_not_after() from Symbols.listtb2024-04-151-1/+0
| | | | | | | This was only ever semi-public and libtls no longer uses it since it was switched to the BoringSSL POSIX time API. ok jsing
* Prevent negative zero from being created via BN bit functions.jsing2024-04-151-1/+7
| | | | | | | | | | | | Both BN_clear_bit() and BN_mask_bits() can create zero values - in both cases ensure that the negative sign is correctly handled if the value becomes zero. Thanks to Guido Vranken for providing a reproducer. Fixes oss-fuzz #67901 ok tb@
* Fix indenttb2024-04-141-3/+3
| | | | pointed out by jsing
* Delete a few more GOST remnantstb2024-04-141-21/+1
| | | | | | | | When I unifdefed GOST support, the tree wasn't fully unlocked, so I didn't want to touch a public header. All this code is in #ifndef OPENSSL_NO_GOST, which we define. ok jsing
* Remove documentation of no longer available APItb2024-04-141-85/+4
|
* Error check X509_ALGOR_set0() in {dsa,ec}_pkey_ctrl()tb2024-04-132-7/+16
| | | | | | | | | | These are four versions of near identical code: PKCS#7 and CMS controls for DSA and EC. The checks are rather incomplete and should probably be merged somehow (see the Ed25519 version in ecx_methods(). For now, only replace X509_ALGOR_set0() with its internal by_nid() version and, while there, spell NULL correctly. ok jca
* Unwrap a line for consistency with other copy-pasted versionstb2024-04-131-3/+2
|
* bio_enc: various basic cleanuptb2024-04-121-64/+67
| | | | | | | | Call a BIO bio rather than bi, a, or b; don't cast when assigning from or to a (void *). Drop loads of silly redundant parentheses, use better order of variable declarations. No change in the generated assembly
* Garbage collect various *_init() pmethstb2024-04-123-53/+24
| | | | | | | | It's unclear whether the functions these support were ever really used for anything else than kicking off an overenginerred state machine. ok jsing
* Fix a potential NULL-deref in EVP_PKEY_keygen()tb2024-04-121-6/+8
| | | | | | | After a EVP_PKEY_new() failure, a NULL pointer would be passed to the keygen pmeth, which could result in tears. ok beck jsing
* Remove parentheses after returntb2024-04-111-40/+40
| | | | | This file was very undecided what style to choose and often changed its mind in the middle of a function. No change in the generated assembly.
* Rework internal tm_to_*() converterstb2024-04-111-69/+66
| | | | | | | | | | | | Make them static. Don't make them allocate if passed a NULL ASN1_TIME to avoid leaks. This currently means that we accept a NULL and succeed. That's very ugly but better than what we have now. Simplify ASN1_TIME_set_string_internal() accordingly and allocate an ASN1_TIME at the API boundary of ASN1_TIME_adj_internal() and of ASN1_TIME_to_generalized_time(). ok beck (after a lot of squealing and distress)
* Re-guard the crypto_malloc macros.beck2024-04-101-1/+3
| | | | | | accidentally not included in crypto.h commit requested and ok tb@
* Remove the prototype of BN_gcd_nonct()tb2024-04-101-2/+1
|
* Hide deprecated functions in ec.hbeck2024-04-105-12/+31
| | | | | | use LCRYPTO_UNUSED and remove the LIBRESSL_INTERNAL guard ok tb@
* Hide deprecated functions in evp.hbeck2024-04-105-14/+19
| | | | | | use LCRYPTO_UNUSED and remove the LIBRESSL_INTERNAL guard around them. ok tb@
* Add HMAC_init and HMAC_CTX_reset to Symbols.namespace.beck2024-04-101-0/+2
| | | | ok tb@
* Hide symbols in bn.hbeck2024-04-106-19/+21
| | | | | | | Mark them LCRYPTO_UNUSED appropriately and remove the LIBRESSL_INTERNAL guards around them ok tb@
* Hide a couple of LCRYPTO_UNUSED in asn1.hbeck2024-04-104-10/+8
| | | | | | and remove the LIBRESSL_INTERNAL guards around them ok tb@
* Add RC2 symbols to Symbols.namespace.beck2024-04-101-0/+7
| | | | | | These got missed when they were hidden ok tb@
* Finish hiding symbols in rand.hbeck2024-04-105-6/+34
| | | | | This removes the LIBRESSL_INTERNAL guards and marks the functions within as LCRYPTO_UNUSED
* Finish Hiding symbols in crypto.hbeck2024-04-109-18/+101
| | | | | | | | | | | | | crypto.h already had the symbols not hidden behind LIBRESSL_INTERNAL hidden - This now picks up the reset of them marking them as LCRYPTO_UNUSED, and removes the LIBRESSL_INTERNAL guard. These symbols will now be hidden, but if we use them inside the library in a namespaced build we will get a deprecation warning. use outside the library will be as with any other hidden symbol, so fine. ok tb@
* Add a comment on abuse of EXFLAG_INVALIDtb2024-04-091-1/+8
| | | | | | | We added things we probably shouldn't have, and so did BoringSSL and OpenSSL. Terrible API is terrible. discussed with jsing
* Add hidden conf.h, missed in an earlier committb2024-04-091-0/+74
|
* Hide symbols in conf.hbeck2024-04-097-6/+96
| | | | | | This guentherizes the public symbols from conf.h ok tb@
* Plug leaks in ASN1_TIME_set_string_internal()tb2024-04-091-6/+17
| | | | | | | | | | This API can be called with s == NULL, in which case the tm_to_*() functions helpfully allocate a new s and then leak. This is a rather ugly fix to make portable ASAN regress happy again, the better fix will be to rewrite the tm_to_*() functions and adjust their callers. That is more intrusive and will be done in a later pass. ok bcook jsing
* Hide public symbols in x509.hbeck2024-04-0924-23/+606
| | | | | | | This picks up most of the remaining public symbols in x509.h ok tb@
* Hide public symbols in evp.hbeck2024-04-0947-45/+1121
| | | | | | largely mechanically done by the guentherizer 9000 ok tb@