summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto (follow)
Commit message (Collapse)AuthorAgeFilesLines
* 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@
* Rename EVP_aes_XXX_cfb to EVP_aes_XXX_cfb128.beck2024-04-091-4/+4
| | | | | | For consitency with everything else. ok tb@
* Clean up Symbols.namespacebeck2024-04-091-68/+0
| | | | | | | These did not get removed from here when they got removed from Symbols.list after a major bump. ok tb@
* Remove notBefore and notAfter cacheing.beck2024-04-084-63/+16
| | | | | | | | | | | | | | | | | | | | | | 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@
* Make ASN1_TIME_set_string_X509 and ASN1_TIME_set_string match the man pagebeck2024-04-081-26/+14
| | | | | | | | | | | 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@
* Rework CMS_add_simple_smimecap()tb2024-04-071-24/+43
| | | | | | | | | | | | | | | This is an API to add an OID attribute to the set of SMIMECapabilities. While attributes are complicated in general, this only supports simple capabilities encoded as an OID with an optional integer parameter (e.g., the key size of a cipher). Make this API transactional, i.e., don't leave a new empty set behind on failure or leak the key size if setting the parameter on the X509_ALGOR fails. Also convert to single exit and add a doc comment with a reference. ok beck
* Remove incorrect function countstb2024-04-041-4/+4
| | | | | | | | | Vincent Lee spotted that I failed to update numbers that count how many functions are documented here when removing {CRYPTO,OPENSSL}_realloc. This isn't helpful information and nobody will remember to go look for such numbers next time this page is adjusted, so remove the counts. agreement from jmc
* Simplify ecx_cms_sign_or_verify() using X509_ALGOR_set0_by_nid()tb2024-04-021-5/+3
| | | | ok jsing
* Add missing LCRYPTO_ALIAS()tb2024-03-301-1/+3
| | | | | | HMAC_CTX_reset() and HMAC_Init() had missing LCRYPTO_ALIAS(). ok beck jsing
* Fix LCRYPTO_UNUSED() in namespace buildstb2024-03-301-4/+7
| | | | | | | | | If namespace builds are enabled, static links don't work due to missing _lcry_* symbols. Make LCRYPTO_UNUSED() match LCRYPTO_USED() with an extra deprecated attribute. This way we can remove the !LIBRESSL_INTERNAL #ifdef wrapping in public headers. ok beck joshua
* Hide symbols in aesjoshua2024-03-305-3/+74
| | | | ok jsing
* Hide symbols in camelliajoshua2024-03-303-1/+60
| | | | ok tb
* Rewrite RSA_padding_add_PKCS1_type_{1,2}() with CBS/CBB.jsing2024-03-301-33/+99
| | | | ok tb@
* Hide symbols in whrlpooljoshua2024-03-303-1/+45
| | | | ok tb
* Hide symbols in CMSjoshua2024-03-305-4/+30
| | | | ok jsing
* Remove pointless guard in cms headerjoshua2024-03-301-4/+2
| | | | ok jsing
* Tweak defines since the Td4 table is only used for AES_{encrypt,decrypt}jsing2024-03-291-6/+9
|
* Always use C functions for AES_{encrypt,decrypt}().jsing2024-03-2914-84/+124
| | | | | | | Always provide AES_{encrypt,decrypt}() via C functions, which then either use a C implementation or call the assembly implementation. ok tb@
* Remove previously missed idea file.jsing2024-03-291-176/+0
|
* Consolidate cast code.jsing2024-03-297-703/+398
|
* Consolidate camellia code.jsing2024-03-299-640/+124
|
* Move camellia to primary Makefile.jsing2024-03-2912-44/+14
| | | | These files are now built on all platforms.
* Remove now unused camellia assembly implementations.jsing2024-03-292-2001/+0
|
* Stop building camellia assembly on amd64 and i386.jsing2024-03-292-5/+8
| | | | | | | This is a legacy algorithm and the assembly is only marginally faster than the C code. Discussed with beck@ and tb@
* Sprinkle a few references to RFC 8419tb2024-03-293-6/+15
|
* Implement Ed25519 signatures for CMS (RFC 8419)tb2024-03-292-21/+126
| | | | | | | | | | | | | | | | | | | | This adds support for Edwards curve digital signature algorithms in the cryptographic message syntax, as specified in RFC 8419. Only Ed25519 is supported since that is the only EdDSA algorithm that LibreSSL supports (this is unlikely to change ever, but, as they say - never is a very long time). This has the usual curly interactions between EVP and CMS with poorly documented interfaces and lots of confusing magic return values and controls. This improves upon existing control handlers by documenting what is being done and why. Unlike other (draft) implementations we also happen to use the correct hashing algorithm. There are no plans to implement RFC 8418. joint work with job at p2k23 ok jsing
* Move aes_core.c to the primary Makefile.jsing2024-03-2912-32/+12
| | | | This is now built on all platforms.
* Consolidate idea into a single C file.jsing2024-03-295-357/+287
|
* Remove unused n2ln, l2nn, n2l and l2n macros.jsing2024-03-291-44/+1
|
* Make X509_VERIFY_PARAM_set1_policies() less badtb2024-03-291-22/+34
| | | | | | | | | | | If any OBJ_dup() fails along the way, a partially copied policy stack would remain on the params object. This makes no sense. Implement and use an sk_ASN1_OBJECT_deep_copy(), that copies the full stack or else returns NULL. Remove unnecessary NULL check and streamline some other logic. ok jsing
* Clean up X509_VERIFY_PARAM_add0_policy()tb2024-03-291-6/+5
| | | | | | Streamline some checks and use more idiomatic sk_push() error check ok jsing
* Always use C functions for AES_set_{encrypt,decrypt}_key().jsing2024-03-299-57/+100
| | | | | | | | Always include aes_core.c and provide AES_set_{encrypt,decrypt}_key() via C functions, which then either use a C implementation or call the assembly implementation. ok tb@
* Retire mime_debug()tb2024-03-291-5/+1
| | | | discussed with jsing
* Improve error checking in i2d_ASN1_bio_stream()tb2024-03-291-23/+24
| | | | | | | | | | The streaming BIO API is full of missing error checks. This diff reverts the logic so that the single call to ASN1_item_i2d_bio() is error checked (it has the usual 1/0 return values), unindents the bulk of the code and propagates the SMIME_crlf_copy() return value (alos 1/0) to be the actual error. ok jsing
* Consolidate whirlpool into a single C file.jsing2024-03-294-284/+229
| | | | | | | Buy a vowel at the same time, since we're no longer limited to 8.3 file names. Discussed with tb@
* Remove now unused assembly implementations of whirlpool.jsing2024-03-292-978/+0
|
* Hide symbols in Blowfishjoshua2024-03-293-1/+51
| | | | ok jsing tb
* Move wp_block.c to the primary Makefile.jsing2024-03-2912-35/+12
| | | | This is now built on all platforms.
* Stop playing #ifdef HEADER_PEM_H games in cms.h.jsing2024-03-291-3/+4
| | | | | | | | Rather than making prototypes appear and disappear depending on whether or not you've included pem.h before cms.h, just include pem.h from cms.h itself. ok joshua@ tb@
* Stop using pem2.h.jsing2024-03-292-4/+3
| | | | | | | | Somewhere in the past 25 years, the circular dependency between err and pem went away. Stop pulling in pem2.h and just use pem.h directly (pem2.h can probably be removed at some point, but that remains for another day). ok joshua@ tb@
* Hide symbols in DESjoshua2024-03-2922-20/+157
| | | | ok jsing beck
* Rename AES_cbc_encrypt to aes_cbc_encrypt_internal for the SEH handlers.jsing2024-03-291-4/+4
| | | | Should fix windows build.
* Stop building whirlpool assembly on amd64 and i386.jsing2024-03-292-6/+3
| | | | | | | This is a legacy algorithm and the assembly is only marginally faster than the C code. Discussed with beck@ and tb@
* Fix indenttb2024-03-291-2/+2
|