summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Simplify HMAC_CTX_new()joshua2024-03-261-9/+2
| | | | | | | There is no need to call HMAC_CTX_init() as the memory has already been initialised to zero. ok tb
* Clean up EVP_DigestSignFinaljoshua2024-03-261-27/+31
| | | | ok jsing tb
* Reject setting invalid versions for certs, CRLs and CSRstb2024-03-263-3/+18
| | | | | | | | | | | | The toolkit aspect bites again. Lots of invalid CRLs and CSRs are produced because people neither read the RFCs nor does the toolkit check anything it is fed. Reviewers apparently also aren't capable of remembering that they have three copy-pasted versions of the same API and that adding a version check to one of the might suggest adding one for the other two. This requires ruby-openssl 20240326p0 to pass ok beck job jsing
* Remove now unnecessary do {} while (0);jsing2024-03-261-3/+1
|
* Inline HASH_MAKE_STRING.jsing2024-03-261-13/+12
| | | | No change to generated assembly.
* Remove PKCS5_pbe2_set_iv()tb2024-03-261-28/+9
| | | | | | | | | | This used to be a generalization of PKCS5_pbe2_set(). Its only caller was the latter, which always passes aiv == NULL and pbe_prf == -1. Thus, the iv would always be random and regarding the pbe_prf, it would always end up being NID_hmacWithSHA1 since the only ctrl grokking EVP_CTRL_PBE_PRF_NID was RC2's control, but only if PBE_PRF_TEST was defined, which it wasn't. ok jsing
* Reorder functions expanded from md32_common.h.jsing2024-03-261-103/+102
| | | | No functional change.
* Unifdef PBE_PRF_TESTtb2024-03-261-7/+1
| | | | | | This gets use of the last mention of EVP_CTRL_PBE_PRF_NID outside of evp.h ok jsing
* Expand HASH_* defines.jsing2024-03-261-26/+28
| | | | No change to generated assembly.
* Inline hash functions from md32_common.h.jsing2024-03-261-1/+102
| | | | No change to generated assembly.
* Reorder functions.jsing2024-03-261-13/+13
| | | | No functional change.
* Provide an optimised bn_subw() for amd64.jsing2024-03-261-3/+22
| | | | bn_subw() will be used more widely in an upcoming change.
* Clean up use of EVP_MD_CTX_{legacy_clear,cleanup} in EVP_SignFinaljoshua2024-03-261-6/+8
| | | | ok jsing@
* Stop including md32_common.h in md5.c and remove unused defines.jsing2024-03-261-17/+1
| | | | | | This is now no longer needed. ok tb@
* Clean up use of EVP_MD_CTX_{legacy_clear,cleanup} in EVP_VerifyFinaljoshua2024-03-261-6/+7
| | | | ok tb@
* Include stdint.h for uintptr_t.jsing2024-03-261-1/+2
|
* Add back x509_local.h for PBKDF2PARAMtb2024-03-261-1/+2
|
* PKCS5_pbe2_set_iv() can be local to p5_pbev2tb2024-03-262-6/+3
| | | | quoth the muppet "yes I know this is horrible!"
* Clean up use of EVP_MD_CTX_{legacy_clear,cleanup} in PKCS1_MGF1joshua2024-03-261-9/+14
| | | | ok tb@
* Clean up use of EVP_MD_CTX_{legacy_clear,cleanup} injoshua2024-03-261-19/+22
| | | | | | RSA_verify_PKCS1_PSS_mgf1 ok jsing@ tb@
* Clean up use of EVP_CIPHER_CTX_{legacy_clear,cleanup} in EVP_OpenInitjoshua2024-03-261-3/+3
| | | | ok tb@
* Demacro MD5 and improve data loading.jsing2024-03-261-116/+154
| | | | | | | Use static inline functions instead of macros and improve handling of aligned data. Also number rounds as per RFC 1321. ok tb@
* Mark internal functions as static.jsing2024-03-261-5/+5
|
* Move bn_montgomery_reduce() and drop prototype.jsing2024-03-261-73/+71
| | | | No functional change.
* Fix function guards.jsing2024-03-261-3/+3
|
* Garbage collect the unused verifyctx() and verifyctx_init()tb2024-03-262-23/+5
| | | | ok joshua jsing
* Change ts to only support one second precision.beck2024-03-263-84/+9
| | | | | | | | | | | | | RFC 3631 allows for sub second ASN1 GENERALIZED times, if you choose to support sub second time precison. It does not indicate that an implementation must support them. Supporting sub second timestamps is just silly and unrealistic, so set our maximum to one second of precision. We then simplify this code by removing some nasty eye-bleed that made artisinally hand crafted strings and jammed them into an ASN1_GENERALIZEDTIME. ok tb@, jsing@, with one second precision tested by kn@
* Clean up conf's module_init()tb2024-03-261-39/+27
| | | | | | | | | | Immediately error out when no name or value is passed instead of hiding this in a a combination of ternary operator and strdup error check. Use calloc(). Unindent some stupid, don't pretend this function can return anything but -1 and 1, turn the whole thing into single exit and call the now existing imodule_free() instead of handrolling it. ok jsing
* Rewrite HKDF_expand().jsing2024-03-251-38/+50
| | | | | | | Simplify overflow checking and length tracking, use a CBB to handle output and use HMAC_CTX_new() rather than having a HMAC_CTX on the stack. ok tb@
* Revert r1.13 since it currently breaks openssl-ruby regress tests.jsing2024-03-251-2/+2
| | | | ok tb@
* Inline sctx in EVP_DigestSignFinaljoshua2024-03-251-11/+8
| | | | ok tb@ jsing@
* Clean up use of EVP_MD_CTX_{legacy_clear,cleanup} in PKCS5_PBE_keyivgenjoshua2024-03-251-11/+12
| | | | ok tb@
* Error on setting an invalid CSR versionjob2024-03-251-2/+2
| | | | | | Reported by David Benjamin (BoringSSL) OK tb@
* Remove unneeded brackets from if statement in EVP_DigestSignFinaljoshua2024-03-251-3/+2
| | | | ok tb@
* Clean up use of EVP_MD_CTX_{legacy_clear,cleanup} in EVP_BytesToKeyjoshua2024-03-251-12/+14
| | | | ok tb@
* Fix time conversion that broke regress.beck2024-03-251-5/+5
| | | | ok tb@
* Move custom sigctx handling out of EVP_DigestSignFinaljoshua2024-03-251-13/+28
| | | | ok tb@
* Clean up EVP_CIPHER_CTX_{legacy_clear,cleanup} usage in evp/bio_enc.cjoshua2024-03-251-39/+49
| | | | | | | Additionally, this tidies up some surrounding code and replaces usage of free with freezero and malloc with calloc. ok tb@
* Final tweaks in x509_trs.c for nowtb2024-03-251-10/+11
| | | | looked over by jsing
* Kill X509_TRUSTtb2024-03-251-79/+31
| | | | | | | | After peeling off enough layers, the entire wacky abstraction turns out to be nothing but dispatching from a trust_id to a trust handler and passing the appropriate nid and the cert. ok beck jsing
* Clean up EVP_MD_CTX_{legacy_clear,cleanup}() usage in x509/x509_cmp.cjoshua2024-03-251-21/+25
| | | | ok tb@
* Add back trust member of X509_TRUST that I accidentally deletedtb2024-03-251-1/+2
|
* Const correct the trust handlerstb2024-03-251-8/+7
| | | | | | | The certificates no longer need to be modified since we cache the extensions up front. ok beck
* Pass the nid instead of the entire trust structuretb2024-03-251-10/+10
| | | | | | | This code is so ridiculously overengineered that it is an achievement even by early OpenSSL standards. ok beck
* Pull extension caching into X509_check_trust()tb2024-03-251-2/+7
| | | | | | This way the trust handlers can stop modifying the certificates. ok beck
* Remove unnecessary stat() calls from by_dirbeck2024-03-251-14/+15
| | | | | | | | | | | | | | | | | | | | | When searching for a CA or CRL file in by_dir, this stat() was used to short circuit attempting to open the file with X509_load_cert_file(). This was a deliberate TOCTOU introduced to avoid setting an error on the error stack, when what you really want to say is "we couldn't find a CA" and continue merrily on your way. As it so happens you really do not care why the load_file failed in any of these cases, it all boils down to "I can't find the CA or CRL". Instead we just omit the stat call, and clear the error stack if the load_file fails. The fact that you don't have a CA or CRL is caught later in the callers and is what you want, mimicing the non by_dir behaviour instead of possibly some bizzaro file system error. Based on a similar change in Boring. ok tb@
* Restore EVP_get_cipherbyname(NULL)/EVP_get_digestbyname(NULL) handlingjca2024-03-241-1/+7
| | | | | | | | | The previous implementation used the now defunct OBJ_NAME_get() which bailed out when passed a NULL argument. Difference spotted by the regress tests in ports/net/openvpn (regular openvpn use is fine but openvpn --show-ciphers/--show-digests crashes). ok tb@
* Convert libressl to use the BoringSSL style time conversionsbeck2024-03-242-43/+36
| | | | | | | | This gets rid of our last uses of timegm and gmtime in the library and things that ship with it. It includes a bit of refactoring in ocsp_cl.c to remove some obvious ugly. ok tb@
* Rename ax into auxtb2024-03-241-8/+7
|
* Drop redundant NULL checks around two for loopstb2024-03-241-15/+14
| | | | ok beck