summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/reallocarray.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2024-07-09Hide remaining unused ERR functions in err.hbeck4-5/+9
ok tb@
2024-07-09Hide CRYPTO_get_dynlock_create_callbackbeck3-2/+5
ok tb@
2024-07-09Hide DES global variablesbeck4-3/+11
ok tb@
2024-07-09Add missing symbols to Symbols.namespacebeck1-0/+10
ok tb@
2024-07-09Remove duplicates from Symbols.namespacebeck1-6/+0
ok tb@
2024-07-09Hide symbols for two missed public functions in bio.hbeck4-3/+9
ok tb@
2024-07-09Hide global _it symbols in pkcs12.hbeck3-2/+10
ok tb@
2024-07-09Hide global _it symbola in cms.hbeck3-2/+10
ok tb@
2024-07-08Hide global _it symbols in dsa.hbeck3-2/+13
ok tb@
2024-07-08Hide global _it symbols in rsa.hbeck3-2/+20
ok tb@
2024-07-08Guard variable declarations to unbreak non-namespaced builds.beck6-8/+18
ok tb@
2024-07-08Hide global _it symbols in asn1t.hbeck6-8/+20
ok tb@
2024-07-08Hide global _it symbols in pkcs7.hbeck3-2/+39
ok tb@
2024-07-08remove a further spkac reference; ok tbjmc1-5/+3
2024-07-08Hide global _it variables in ocsp.hbeck3-2/+49
ok tb@
2024-07-08Hide global _it variables in asn1.hbeck9-8/+77
ok tb@
2024-07-08Hide global _it variables in x509.hbeck15-14/+77
ok tb@
2024-07-08Hide global _it variables in x509v3.hbeck15-14/+113
ok tb@
2024-07-08Pretend to clarify the way ipv6_asc() worksjca1-4/+5
Give example IPv6 addresses to clarify what is meant with 1, 2 or 3 zero length elements. tb made me look. perverted, twisted, crippled
2024-07-08Adjust regress for SPKAC removaltb1-38/+1
ok jsing
2024-07-08Adjust manpage for SPKAC removaltb1-84/+4
ok jsing
2024-07-08Remove spkac subcommandtb4-317/+4
Google killed efforts to have SPKAC in html5 by zapping it from chrome a decade ago. This effort doesn't look like it's going anywhere: https://datatracker.ietf.org/doc/draft-leggett-spkac/ Unfortunately, PHP and Ruby still support NETSCAPE_SPKI, so we can't kill that code, but I see no real reason we need to support this in our openssl command. If the need should arise we can write a somewhat less poor version of this. ok jsing
2024-07-08Remove spkac handling from openssl(1) catb1-187/+3
This is very poorly written code and now the only consumer of some public API that should not have survived the turn of the millenium. ok jsing
2024-07-01signal handler must use the save_errno dance, and massage a variablederaadt1-2/+5
of type 'volatile sig_atomic_t' ok tb
2024-06-30Remove lhash statistics.jsing2-30/+2
These are not exactly useful and we previously stopped exposing them. ok tb@
2024-06-29fix typotb1-2/+2
2024-06-28Add more regress coverage for SSL_select_next_proto()tb1-1/+291
2024-06-28The ALPN callback should really ignore the out parameter if there'stb1-3/+13
no overlap. Document that explicitly. Also make it more explicit that that the caller must work with a copy of out. ok jsing
2024-06-28Fix SSL_select_next_proto()tb1-29/+54
SSL_select_next_proto() is already quite broken by its design: const in, non-const out, with the intention of pointing somewhere inside of the two input pointers. A length returned in an unsigned char (because, you know, the individual protocols are encoded in Pascal strings). Can't signal uailure either. It also has an unreachable public return code. Also, due to originally catering to NPN, this function opportunistically selects a protocol from the second input (client) parameters, which makes little sense for ALPN since that means the server falls back to a protocol it doesn't (want to) support. If there's no overlap, it's the callback's job to signal error to its caller for ALPN. As if that wasn't enough misdesign and bugs, the one we're concerned with here wasn't reported to us twice in ten years is that if you pass this API a zero-length (or a sufficiently malformed client protocol list), it would return a pointer pointing somewhere into the heap instead into one of the two input pointers. This pointer could then be interpreted as a Pascal string, resulting in an information disclosure of up to 255 bytes from the heap to the peer, or a crash. This can only happen for NPN (where it does happen in old python and node). A long time ago jsing removed NPN support from LibreSSL, because it had an utter garbage implementation and because it was practically unused. First it was already replaced by the somewhat less bad ALPN, and the only users were the always same language bindings that tend to use every feature they shouldn't use. There were a lot of complaints due to failing test cases in there, but in the end the decision turned out to be the right one: the consequence is that LibreSSL isn't vulnerable to CVE-2024-5535. Still, there is a bug here to fix. It is completely straightforward to do so. Rewrite this mess using CBS, preserving the current behavior. Also, we do not follow BoringSSL's renaming of the variables. It would result in confusing code in almost all alpn callbacks I've seen in the wild. The only exception is the accidental example of Qt. ok jsing
2024-06-28Remove handling of SSLv2 client hello messages.jsing1-205/+1
This code was only previously enabled if the minimum enabled version was TLSv1.0 and a non-version locked method is in use. Since TLSv1.0 and TLSv1.1 were disabled nearly a year ago, this code is no longer ever being used. ok tb@
2024-06-26remove psk_idx from tlsext_randomize_build_order()tb1-3/+3
ok jsing
2024-06-26tls_extension_find(): make output index optionaltb1-2/+3
suggested by jsing
2024-06-25Implement RSA key exchange in constant time.jsing3-63/+73
RSA key exchange is known to have multiple security weaknesses, including being potentially susceptible to padding oracle and timing attacks. The RSA key exchange code that we inherited from OpenSSL was riddled with timing leaks, many of which we fixed (or minimised) early on. However, a number of issues still remained, particularly those related to libcrypto's RSA decryption and padding checks. Rework the RSA key exchange code such that we decrypt with RSA_NO_PADDING and then check the padding ourselves in constant time. In this case, the pre-master secret is of a known length, hence the padding is also a known length based on the size of the RSA key. This makes it easy to implement a check that is much safer than having RSA_private_decrypt() depad for us. Regardless, we still strongly recommend disabling RSA key exchange and using other key exchange methods that provide perfect forward secrecy and do not depend on client generated keys. Thanks to Marcel Maehren, Nurullah Erinola, Robert Merget, Juraj Somorovsky, Joerg Schwenk and Hubert Kario for raising these issues with us at various points in time. ok tb@
2024-06-25Fix TLS extension shufflingtb1-2/+2
The diff decoupling the shuffle from the table order still relied on PSK being last because it failed to adjust the upper bound in the for loop. ok jsing
2024-06-24ssl_err: KNF tweaktb1-2/+2
2024-06-24ssl_err: fix whitespacetb1-13/+13
2024-06-24libcrypto: constify most error string tablestb26-139/+321
These constitute the bulk of the remaining global mutable state in libcrypto. This commit moves most of them into data.rel.ro, leaving out ERR_str_{functs,libraries,reasons} (which require a slightly different approach) and SYS_str_reasons which is populated on startup. The main observation is that if ERR_load_strings() is called with a 0 lib argument, the ERR_STRING_DATA argument is not actually modified. We could use this fact to cast away const on the caller side and be done with it. We can make this cleaner by adding a helper ERR_load_const_strings() which explicitly avoids the assignment to str->error overriding the error code already set in the table. In order for this to work, we need to sprinkle some const in err/err.c. CMS called ERR_load_strings() with non-0 lib argument, but this didn't actually modify the error data since it ored in the value already stored in the table. Annoyingly, we need to cast const away once, namely in the call to lh_insert() in int_err_set_item(). Fixing this would require changing the public API and is going to be tricky since it requires that the LHASH_DOALL_FN_* types adjust. ok jsing
2024-06-24x509_conf: rename the merr label into errtb1-8/+8
2024-06-23rust-openssl: switch from deprecated config to config.tomltb2-2/+2
2024-06-23openssl ca: avoid double free for spkac files without default sectiontb1-2/+1
ok jsing
2024-06-23strmode takes a mode_t, not an int; prompted by Collin Funk.otto1-4/+2
ok kettenis@ deraadt@ tb@
2024-06-22Remove the less-than-useful change log.jsing1-39/+1
ok tb@
2024-06-22Rewrite BN_bn2mpi() using CBB.jsing1-24/+35
The content is effectively a u32 length prefixed field, so use CBB_add_u32_length_prefixed(). Use BN_bn2binpad() rather than manually padding if we need to extend and use sensible variable names so that the code becomes more readable. Note that since CBB can fail we now need to be able to indicate failure. This means that BN_bn2mpi() can now return -1 when it would not have previously (correct callers will check that BN_bn2mpi() returns a positive length). ok tb@
2024-06-22Sync bytestring from libssl.jsing2-2/+15
2024-06-22Provide CBB_add_u32_length_prefixed().jsing2-2/+15
This is needed for an upcoming change in libcrypto. ok tb@
2024-06-19x_all.c: remove a bunch of unnecessary parenthesestb1-23/+19
2024-06-18v3_generic_extension() use ASN1_STRING_set0()tb1-4/+4
This aligns it with do_ext_i2d()
2024-06-18v3_generic_extension() rename the X509_EXTENSIONtb1-4/+5
now that ext is free, we can use it like everywhere else
2024-06-18Rename 'ext' to 'name' in v3_generic_extension()tb1-4/+4
In this code 'ext' is usually used for an X509_EXTENSION object.
2024-06-18Make local BIT_STRING_BITNAME variables consttb2-5/+5
There's no reason for them not to be const. This is a piece of a larger diff that I carry in several of my trees to move more things to rodata or relro. The full diff requires a change to a public header and it's very annoying to have to 'make includes' and recompile the entire lib all the time when hopping from tree to tree.