summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* free class->indexes in CRYPTO_cleanup_all_ex_data()tb2024-08-021-1/+2
| | | | ok jsing
* Rewrite CRYPTO_EX_DATA.jsing2024-08-023-639/+419
| | | | | | | | | | | | | | | | | | | | | | | | | CRYPTO_EX_DATA exists as a way to allow an application to attach data to various components in libcrypto and libssl. The general idea is that there are various "classes" (e.g. RSA) and an application can get an "index" (which can have new/dup/free functions provided). The application can then use the index to store a pointer to some form of data within that class, for later retrieval. However, even by OpenSSL standards, this is an insane API. The current implementation allows for data to be set without calling new, indexes can be used without allocation, new can be called without actually getting an index and dup can be called either after new or without new (see regress and RSA_get_ex_new_index(3)/CRYPTO_set_ex_data(3) for more details). On top of this, the previous "overhaul" of the code was written to be infinitely extensible. For now, the rewrite intends to maintain the existing behaviour - once we bed this down we can attempt to ratchet the API requirements and require some sort of sensible sequence. The only intentional change is that there is now a hard limit on the number of indexes that can be allocated (previously there was none, relying only on ENOMEM). ok tb@
* sched_yield() is not strong enough to overflow the recv buffer on someclaudio2024-07-301-2/+2
| | | | systems. Use a proper sleep using usleep(100) instead.
* typo: regresss -> regresstb2024-07-291-2/+2
|
* Mark X509at_get_attr{,_count}() and X509at_delete_attr() as unusedtb2024-07-261-4/+4
| | | | ok jsing
* Disable X509at_get_attr{,_count}() and X509at_delete_attr()tb2024-07-261-12/+7
| | | | | | | | | These are (not so) thin wrappers around the stack API and only make things unreadable by adding an unneccesary layer of indirection and repeating checks already present in the stack API. X509at_delete_attr() is a masterpiece. ok jsing
* Inline last user of X509at_get_attr()tb2024-07-261-2/+2
| | | | ok jsing
* Inline trivial X509at_* calls in x509_reqtb2024-07-261-4/+4
| | | | ok jsing
* Inline a few trivial X509at_* calls in cmstb2024-07-261-7/+7
| | | | ok jsing
* Put opening brace on correct linetb2024-07-261-4/+3
|
* BUF_MEM_new.3: add a touch of KNFtb2024-07-241-4/+3
|
* Revise regress for ssl3_get_cipher() changes.jsing2024-07-231-8/+3
|
* Remove get_cipher from SSL_METHOD.jsing2024-07-235-73/+32
| | | | | | | | | | | | | | | Inline the get_cipher implementation (including the special handling for DTLS) in ssl_cipher_collect_ciphers() (the only consumer), remove the get_cipher member of SSL_METHOD and mop up dtls1_get_cipher(). ssl3_get_cipher() has always had a strange property of being a reverse index, which is relied on by the cipher list ordering code, since it currently assumes that high cipher suite values are preferable. Rather than complicating ssl3_get_cipher() (and regress), change the iteration order in ssl_cipher_collect_ciphers() to match what it requires. Lastly, rename ssl3_get_cipher() to be more descriptive. ok tb@
* Revise regress to match cipher suite values change.jsing2024-07-222-17/+13
|
* Use cipher suite values instead of IDs.jsing2024-07-2212-392/+179
| | | | | | | | | | | | | | | | OpenSSL has had the concept of cipher IDs, which were a way of working around overlapping cipher suite values between SSLv2 and SSLv3. Given that we no longer have to deal with this issue, replace the use of IDs with cipher suite values. In particular, this means that we can stop mapping back and forth between the two, simplifying things considerably. While here, remove the 'valid' member of the SSL_CIPHER. The ssl3_ciphers[] table is no longer mutable, meaning that ciphers cannot be disabled at runtime (and we have `#if 0' if we want to do it at compile time). Clean up the comments and add/update RFC references for cipher suites. ok tb@
* asn1time: indicate which comparison function failedtb2024-07-211-4/+7
| | | | extracted from a diff by Kenjiro Nakayama
* Add back a .tb2024-07-211-2/+2
|
* Unify description of the obsolete ENGINE parametertb2024-07-2114-142/+130
| | | | | | | This uses the same language in most manuals mentioning the obsolete ENGINE parameters. Make it clear that it is always ignored and that NULL should be passed. Always call it engine instead of a mix of e pe, impl, eng.
* Drop ENGINE from EVP_PKEY_derive exampletb2024-07-211-5/+4
|
* Garbage collect ENGINE "use" from EVP_PKEY_decrypt() exampletb2024-07-211-5/+4
|
* Make example slightly less terrible by dropping the ENGINE "handling"tb2024-07-211-5/+4
|
* Fix golden numbers after beck broke it months agotb2024-07-202-23/+20
| | | | (why is it always me who gets to clean up this shit?)
* Remove cipher from SSL_SESSION.jsing2024-07-2013-73/+70
| | | | | | | | | | | | | | | | For a long time SSL_SESSION has had both a cipher ID and a pointer to an SSL_CIPHER (and not both are guaranteed to be populated). There is also a pointer to an SSL_CIPHER in the SSL_HANDSHAKE that denotes the cipher being used for this connection. Some code has been using the cipher from SSL_SESSION and some code has been using the cipher from SSL_HANDSHAKE. Remove cipher from SSL_SESSION and use the version in SSL_HANDSHAKE everywhere. If resuming from a session then we need to use the SSL_SESSION cipher ID to set the SSL_HANDSHAKE cipher. And we still need to ensure that we update the cipher ID in the SSL_SESSION whenever the SSL_HANDSHAKE cipher changes (this only occurs in a few places). ok tb@
* Annotate issues with tls_session_secret_cb() related code.jsing2024-07-192-2/+15
|
* Move client ciphers from SSL_SESSION to SSL_HANDSHAKE.jsing2024-07-196-28/+26
| | | | | | | | SSL_SESSION has a 'ciphers' member which contains a list of ciphers that were advertised by the client. Move this from SSL_SESSION to SSL_HANDSHAKE and rename it to match reality. ok tb@
* Add RCS idtb2024-07-171-0/+1
|
* Enable regress for SSL_CIPHER_get_handshake_digest()jsing2024-07-171-4/+0
| | | | Turns out this is already linked statically.
* Rework cipher find test to also provide coverage for SSL_CIPHER_*()jsing2024-07-171-8/+754
|
* Update regress for removal of SSL_HANDSHAKE_MAC_DEFAULT.jsing2024-07-161-25/+2
|
* Clean up SSL_HANDSHAKE_MAC_DEFAULT.jsing2024-07-163-63/+39
| | | | | | | | | | The handshake MAC needs to be upgraded when TLSv1.0 and TLSv1.1 ciphersuites are used with TLSv1.2. Since we no longer support TLSv1.0 and TLSv1.1, we can simply upgrade the handshake MAC in the ciphersuite table and remove the various defines/macros/code that existed to handle the upgrade. ok tb@
* Fix .Ox for SSL_CIPHER_get_handshake_digest()tb2024-07-161-3/+3
|
* Switch the EVP_PKEY_*attr* API to LCRYPTO_UNUSED()tb2024-07-151-10/+10
| | | | This would have prevented the PKCS12 oopsie.
* Fix PKCS12_create()tb2024-07-151-6/+21
| | | | | | | | | | This tries to copy some microsoft attributes which are not usually present and chokes on the now disabled EVP_PKEY_*attr* API. Instead of reviving about four layers of traps and indirection, just inline the two functions in a way that should be more obvious. found by anton via the ruby-openssl tests ok jsing
* Mop up TLS1_PRF* defines.jsing2024-07-152-76/+67
| | | | | | | | These have not been used for a long time, however SSL_CIPHER was not opaque at the time, hence they had to stick around. Now that SSL_CIPHER is opaque we can simply mop them up. ok tb@
* fix signature of main()anton2024-07-151-4/+3
|
* enable warnings and apply a dash of knfmtanton2024-07-152-1/+2
|
* ocurred -> occurredjsg2024-07-151-3/+3
|
* Rewrite EVP_PKEY_add1_attr_by_NID()tb2024-07-141-11/+41
| | | | | | | Instead of jumping through many layers that cause headache, we can achieve the same in an entirely straightforward way without losing clarity. ok jsing
* Disable most EVP_PKEY_*attr* APItb2024-07-141-14/+17
| | | | | | | | There is a single consumer of this entire family of function, namely the openssl(1) pkcs12 command uses EVP_PKEY_add1_attr_by_NID, so leave that one intact for now. ok jsing
* Forgot to annotate the TMP UGLY CAST[S] as requested by jsingtb2024-07-141-1/+2
| | | | h/t to levitte
* Document SSL_CIPHER_get_handshake_digest(3)tb2024-07-141-2/+22
|
* Prepare to provide SSL_CIPHER_get_handshake_digest()tb2024-07-143-3/+23
| | | | | | | Needed by newer freeradius. This is a straightforward implementation that essentially duplicates tls13_cipher_hash(). ok jsing
* Remove lhash_local.h.jsing2024-07-144-99/+26
| | | | | | | | | lhash_local.h was previously needed since conf/conf_api.c and objects/obj_dat.c were fiddling with lhash internals when deleting via a callback. Since we no longer need to do that, inline the structs in lhash.c and remove the header. ok tb@
* Add wcsnlen(3), wcslen(3) with a max len argumentjca2024-07-143-7/+84
| | | | Missing function hit by fcambus@ some time ago. ok millert@
* Add elf_aux_info(3)jca2024-07-143-1/+59
| | | | | | | | Designed to let userland peek at AT_HWCAP and AT_HWCAP2 using an already existing interface coming from FreeBSD. Headers bits were snatched from there. Input & ok kettenis@ libc bump and sets sync will follow soon
* "please refer" -> "refer"jsg2024-07-141-3/+3
| | | | | missed in 2022 "remove please from manual pages" commit ok tb@
* ssl2.h and ssl23.h join the party in the attictb2024-07-135-257/+11
| | | | | | | Now that the SSL2 client hello support is gone, nothing uses this anymore, except that a few ports still need SSL2_VERSION. ok beck
* Make error constants const in libssltb2024-07-131-5/+5
| | | | | | | | This could be made cleaner if we expose ERR_load_const_strings(), but for now this hackier version with casts achieves the same and removes the last unprotected modifiable globals in this library. ok jsing
* Move the sigaction next to multitb2024-07-131-2/+2
| | | | Reduces diff in -portable
* Unify X.509v3 extension methodstb2024-07-1321-376/+691
| | | | | | | | | | | | Use C99 initializers for all structs (some were forgotten). Make all the structs static, call them x509v3_ext_* matching NID_*. Add accessors called x509v3_ext_method_* and use these to implement X509V3_EXT_get_nid(). This adds consistency and avoids a few contortions like grouping a few extensions in arrays to save a couple externs. ok beck jsing