summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/system.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2024-04-09Clean up Symbols.namespacebeck1-68/+0
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.beck4-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@
2024-04-08Remove spaces before tabstb1-2/+2
2024-04-08Make ASN1_TIME_set_string_X509 and ASN1_TIME_set_string match the man pagebeck3-39/+60
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@
2024-04-07Rework CMS_add_simple_smimecap()tb1-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
2024-04-04Remove incorrect function countstb1-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
2024-04-04Recommit a better version of the removal of the F5 workaroundtb1-9/+12
Unlike for previous TLS versions, TLSv1.3 servers can send the supported groups extension to inform a client of the server's preferences. The intention is that a client can adapt for subsequent commits. We ignore this info for now, but sthen ran into java-based servers that do this. Thus, rejecting the extension outright was incorrect. Instead, only allow the extension in TLSv1.3 encrypted extensions. This way the F5 workaround is also disabled, but we continue to interoperate with TLSv1.3 servers that do follow the last paragraph of RFC 8446, section 4.2.7. This mostly adjusts outdated/misleading comments. ok jsing sthen
2024-04-02Backout previous commit (intending that libressl client rejects a supportedsthen1-3/+17
groups extension from the server). It triggers 'CONNECT_CR_SRVR_HELLO:tlsv1 alert decode error' when connecting to a (modern) java server (tomcat 10.1.18 on openjdk 17.0.10). "please revert" tb@
2024-04-02Simplify ecx_cms_sign_or_verify() using X509_ALGOR_set0_by_nid()tb1-5/+3
ok jsing
2024-04-01Mention that port can be specified as 0 in some situations, so that thederaadt1-2/+3
system will allocate a port.
2024-03-30Add missing LCRYPTO_ALIAS()tb1-1/+3
HMAC_CTX_reset() and HMAC_Init() had missing LCRYPTO_ALIAS(). ok beck jsing
2024-03-30Fix LCRYPTO_UNUSED() in namespace buildstb1-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
2024-03-30Initialize quic_method in tlsexttesttb1-3/+3
This is only there to pretend a quic method was set on the SSL, but apparently some compilers warn about an uninitialized variable. from Christian Andersen
2024-03-30Replace silly test1_exit() with exit()tb1-21/+15
Appeases some compiler. from Christian Andersen
2024-03-30Remove call to lh_FUNCTION_free()tb1-3/+1
This is a wrapper around lh_free() which is already tested. From Christian Andersen
2024-03-30In _malloc_init(), round up the region being mprotected RW to the mallocmiod1-11/+11
page size, rather than relying upon mprotect to round up to the actual mmu page size. This repairs malloc operation on systems where the malloc page size (1 << _MAX_PAGE_SHIFT) is larger than the mmu page size. ok otto@
2024-03-30Hide symbols in aesjoshua5-3/+74
ok jsing
2024-03-30Hide symbols in camelliajoshua3-1/+60
ok tb
2024-03-30Rewrite RSA_padding_add_PKCS1_type_{1,2}() with CBS/CBB.jsing1-33/+99
ok tb@
2024-03-30Hide symbols in whrlpooljoshua3-1/+45
ok tb
2024-03-30Do multiple padding add/check iterations.jsing1-24/+34
This increases the chance of triggering bugs due to input and/or randomised padding.
2024-03-30Hide symbols in CMSjoshua5-4/+30
ok jsing
2024-03-30Add initial regress for RSA padding.jsing2-2/+328
2024-03-30Remove pointless guard in cms headerjoshua1-4/+2
ok jsing
2024-03-30Tidy indentation.jsing2-8/+8
Requested by tb@
2024-03-30Remove -app2_1 flags being passed to dsa and rsa regress.jsing2-14/+2
Nothing does flag handling in these tests.
2024-03-29Tweak defines since the Td4 table is only used for AES_{encrypt,decrypt}jsing1-6/+9
2024-03-29Always use C functions for AES_{encrypt,decrypt}().jsing14-84/+124
Always provide AES_{encrypt,decrypt}() via C functions, which then either use a C implementation or call the assembly implementation. ok tb@
2024-03-29Remove previously missed idea file.jsing1-176/+0
2024-03-29Consolidate cast code.jsing7-703/+398
2024-03-29Consolidate camellia code.jsing9-640/+124
2024-03-29Move camellia to primary Makefile.jsing12-44/+14
These files are now built on all platforms.
2024-03-29Add table-driven Whirlpool testsjoshua3-1/+251
ok tb
2024-03-29Remove now unused camellia assembly implementations.jsing2-2001/+0
2024-03-29Stop building camellia assembly on amd64 and i386.jsing2-5/+8
This is a legacy algorithm and the assembly is only marginally faster than the C code. Discussed with beck@ and tb@
2024-03-29Sprinkle a few references to RFC 8419tb3-6/+15
2024-03-29Add regress coverage for EdDSA in CMStb1-6/+42
2024-03-29Implement Ed25519 signatures for CMS (RFC 8419)tb2-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
2024-03-29Move aes_core.c to the primary Makefile.jsing12-32/+12
This is now built on all platforms.
2024-03-29Consolidate idea into a single C file.jsing5-357/+287
2024-03-29Remove unused n2ln, l2nn, n2l and l2n macros.jsing1-44/+1
2024-03-29Make X509_VERIFY_PARAM_set1_policies() less badtb1-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
2024-03-29Clean up X509_VERIFY_PARAM_add0_policy()tb1-6/+5
Streamline some checks and use more idiomatic sk_push() error check ok jsing
2024-03-29Always use C functions for AES_set_{encrypt,decrypt}_key().jsing9-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@
2024-03-29Retire mime_debug()tb1-5/+1
discussed with jsing
2024-03-29Improve error checking in i2d_ASN1_bio_stream()tb1-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
2024-03-29Consolidate whirlpool into a single C file.jsing4-284/+229
Buy a vowel at the same time, since we're no longer limited to 8.3 file names. Discussed with tb@
2024-03-29Remove now unused assembly implementations of whirlpool.jsing2-978/+0
2024-03-29Hide symbols in Blowfishjoshua3-1/+51
ok jsing tb
2024-03-29Move wp_block.c to the primary Makefile.jsing12-35/+12
This is now built on all platforms.