summaryrefslogtreecommitdiff
path: root/lib/libcrypto
AgeCommit message (Collapse)Author
2024-04-17Avoid NULL dereference in EVP_PKEY_paramgen()Theo Buehler
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
2024-04-16Invert BN_BITS2 handling in bn_bin2bn_cbs() and bn_hex2bn_cbs().Joel Sing
This results in simpler code. Suggested by tb@ during review.
2024-04-16Rewrite BN_bin2bn() using CBS.Joel Sing
ok tb@
2024-04-16Provide bn_expand_bytes().Joel Sing
This will be used in an upcoming change. ok tb@
2024-04-16Rename bn_expand() to bn_expand_bits().Joel Sing
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@
2024-04-16sortTheo Buehler
2024-04-15Include the correct headerTheo Buehler
2024-04-15crank libcrypto major after symbol removalTheo Buehler
2024-04-15Bye, bye, OPENSSL_str{,n}casecmp()Theo Buehler
ok jsing
2024-04-15And a pile of TS ASN.1 stuff becomes internal-only, tooTheo Buehler
ok jsing
2024-04-15X509_NAME_ENTRIES_it and X509_NAME_INTERNAL_it go internalTheo Buehler
It's always good to see something called internal in the public API. ok jsing
2024-04-15And here go {,EC}DSA_SIG_itTheo Buehler
ok jsing
2024-04-15DHparam_it becomes static, tooTheo Buehler
ok jsing
2024-04-15More X9.62 stuff was never used outside of ec_asn1.cTheo Buehler
We only need the ASN.1 items. ok jsing
2024-04-15EC_PRIVATEKEY becomes internal-only, tooTheo Buehler
ok jsing
2024-04-15Unexport the ECPKPARAMETERS APITheo Buehler
ok jsing
2024-04-15Make ECPARAMETERS_{new,free,it} internal-onlyTheo Buehler
ok jsing
2024-04-15Move BIO_CONNECT_{new,free}() to internal-onlyTheo Buehler
ok jsing
2024-04-15Remove ASN1_time_clamp_not_after() from Symbols.listTheo Buehler
This was only ever semi-public and libtls no longer uses it since it was switched to the BoringSSL POSIX time API. ok jsing
2024-04-15Prevent negative zero from being created via BN bit functions.Joel Sing
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@
2024-04-14Fix indentTheo Buehler
pointed out by jsing
2024-04-14Delete a few more GOST remnantsTheo Buehler
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
2024-04-14Remove documentation of no longer available APITheo Buehler
2024-04-13Error check X509_ALGOR_set0() in {dsa,ec}_pkey_ctrl()Theo Buehler
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
2024-04-13Unwrap a line for consistency with other copy-pasted versionsTheo Buehler
2024-04-12bio_enc: various basic cleanupTheo Buehler
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
2024-04-12Garbage collect various *_init() pmethsTheo Buehler
It's unclear whether the functions these support were ever really used for anything else than kicking off an overenginerred state machine. ok jsing
2024-04-12Fix a potential NULL-deref in EVP_PKEY_keygen()Theo Buehler
After a EVP_PKEY_new() failure, a NULL pointer would be passed to the keygen pmeth, which could result in tears. ok beck jsing
2024-04-11Remove parentheses after returnTheo Buehler
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.
2024-04-11Rework internal tm_to_*() convertersTheo Buehler
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)
2024-04-10Re-guard the crypto_malloc macros.Bob Beck
accidentally not included in crypto.h commit requested and ok tb@
2024-04-10Remove the prototype of BN_gcd_nonct()Theo Buehler
2024-04-10Hide deprecated functions in ec.hBob Beck
use LCRYPTO_UNUSED and remove the LIBRESSL_INTERNAL guard ok tb@
2024-04-10Hide deprecated functions in evp.hBob Beck
use LCRYPTO_UNUSED and remove the LIBRESSL_INTERNAL guard around them. ok tb@
2024-04-10Add HMAC_init and HMAC_CTX_reset to Symbols.namespace.Bob Beck
ok tb@
2024-04-10Hide symbols in bn.hBob Beck
Mark them LCRYPTO_UNUSED appropriately and remove the LIBRESSL_INTERNAL guards around them ok tb@
2024-04-10Hide a couple of LCRYPTO_UNUSED in asn1.hBob Beck
and remove the LIBRESSL_INTERNAL guards around them ok tb@
2024-04-10Add RC2 symbols to Symbols.namespace.Bob Beck
These got missed when they were hidden ok tb@
2024-04-10Finish hiding symbols in rand.hBob Beck
This removes the LIBRESSL_INTERNAL guards and marks the functions within as LCRYPTO_UNUSED
2024-04-10Finish Hiding symbols in crypto.hBob Beck
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@
2024-04-09Add a comment on abuse of EXFLAG_INVALIDTheo Buehler
We added things we probably shouldn't have, and so did BoringSSL and OpenSSL. Terrible API is terrible. discussed with jsing
2024-04-09Add hidden conf.h, missed in an earlier commitTheo Buehler
2024-04-09Hide symbols in conf.hBob Beck
This guentherizes the public symbols from conf.h ok tb@
2024-04-09Plug leaks in ASN1_TIME_set_string_internal()Theo Buehler
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
2024-04-09Hide public symbols in x509.hBob Beck
This picks up most of the remaining public symbols in x509.h ok tb@
2024-04-09Hide public symbols in evp.hBob Beck
largely mechanically done by the guentherizer 9000 ok tb@
2024-04-09Rename EVP_aes_XXX_cfb to EVP_aes_XXX_cfb128.Bob Beck
For consitency with everything else. ok tb@
2024-04-09Clean up Symbols.namespaceBob Beck
These did not get removed from here when they got removed from Symbols.list after a major bump. ok tb@
2024-04-08Remove notBefore and notAfter cacheing.Bob Beck
This cache was added because our time conversion used timegm() and gmtime() which aren't very cheap. These calls were noticably expensive when profiling things like rpki-client which do many X.509 validations. Now that we convert times using julien seconds from the unix epoch, BoringSSL style, instead of a julien days from a Byzantine date, we no longer use timegm() and gmtime(). Since the julien seconds calculaitons are cheap for conversion, we don't need to bother caching this, it doesn't have a noticable performance impact. While we are at this correct a bug where x509_verify_asn1_time_to_time_t was not NULL safe. Tested for performance regressions by tb@ and job@ ok tb@ job@
2024-04-08Make ASN1_TIME_set_string_X509 and ASN1_TIME_set_string match the man pageBob Beck
This makes it where people can't put dumb values in certs without trying harder, and changes the regress to test this. GENERALIZED times outside of the RFC5280 spec are required for OCSP but these should be constructed with the GENERALIZED time string setters. ok tb@