summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/recallocarray.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2022-02-05Add a workaround due to OpenSSL's limitation of SSL_CTX_set_cipher_listtb1-1/+5
SSL_CTX_set_cipher_list() in OpenSSL 1.1 does not accept TLSv1.3 ciphers. This wasn't a problem until now since the AEAD- ciphers were counted as distinct from TLS_ ciphers by the regress test, so they were never used in the {run,check}-cipher-${cipher}-client-${clib}-server-${slib} tests With the renaming, the TLSv1.3 ciphers are now considered as common ciphers, so they're tested. With openssl11 this results in 0:error:1410D0B9:SSL routines:SSL_CTX_set_cipher_list:no cipher match:ssl/ssl_lib.c:2573: The design of these tests doesn't allow easily adding a call to SSL_CTX_set_ciphersuites (since they also need to work with openssl 1.0.2) so skip the TLS_* ciphers for the time being.
2022-02-05Mechanically adjust from AEAD- to TLS_ to adjust to the new cipher names.tb1-10/+5
2022-02-05Adjust the ssl_get_shared_ciphers to the new names.tb1-23/+23
2022-02-05Switch TLSv1.3 cipher names from AEAD- to OpenSSL's TLS_tb3-16/+22
OpenSSL chose to break the previous naming convention for ciphers and to adopt TLS_* "RFC" names instead. Unfortunately, these names are exposed in several APIs and some language bindings test for these non-standard names instead of cipher values, which is ... unfortunate (others would say "plain crazy"). We currently have to maintain patches in regress and ports (p5-Net-SSLeay, openssl-ruby-tests - which means that Ruby will pick this up at some point) to work around this difference and that's just not worth the effort. The old AEAD- names will become aliases and continue to work, but in openssl ciphers and netcat output the TLS_* names will now be displayed. "I would be very happy if this gets committed" bluhm ok beck inoguchi, begrudgingly ok jsing
2022-02-05Revise for S3I removal.jsing1-81/+81
2022-02-05Bye bye S3I.jsing23-772/+755
S3I has served us well, however now that libssl is fully opaque it is time to say goodbye. Aside from removing the calloc/free/memset, the rest is mechanical sed. ok inoguchi@ tb@
2022-02-04Bump libressl's version in pkgconfig to 2.0.0tb2-4/+6
LibreSSL's pc files effectively hardcode the version to 1.0.0 since LibreSSL exists. That probably never made much sense. This causes some pain for ports that "need 'openssl' ['>= +1.1.0'] found '1.0.0'" or similar while they would build perfectly fine with LibreSSL. This only affects OpenBSD. We do not put the actual LibreSSL version in there since it may cause trouble Discussed with sthen, millert, inoguchi, beck over the past year. Diff from/ok sthen
2022-02-04Remove a strange inheritance check from addr_validate_path_internal()tb1-4/+1
The trust anchor can't inherit, but the code says that it can inherit just not if the leaf tries to inherit from that. This makes no sense and doesn't match what is done on the asid side. ok jsing
2022-02-04Fix capitalization of ChaCha20tb1-3/+3
2022-02-03Unindent and unwrap lines. Pull up a NULL check. No functional change.tb1-28/+26
2022-02-03Remove commented variable declarationstb1-6/+1
2022-02-03Fix copy-paste error: X509_V_ERR_CRL_SIGNATURE_FAILURE means that thetb1-3/+3
CRL's signature is invalid, not the certificate's.
2022-02-03Use X509_*get0_pubkey() wherever possible to simplify and clean uptb3-36/+22
the code. Also add error checking where possible. ok jsing
2022-02-03Remove some stale comments.tb1-21/+1
ok jsing
2022-02-03Cleanup/simplify ssl_cert_type()jsing6-34/+24
Remove the X509 argument as it is unused - this was passed so that ssl_cert_type() can get the public key from the X509 object if the EVP_PKEY argument is NULL, however this is never the case. ok tb@
2022-02-01Use TLS_PADDING_* defines.jsing1-4/+6
2022-02-01Provide our own signature padding defines.jsing2-6/+38
Rather than leaking libcrypto defines through the tls_sign_cb and tls_signer_sign() interfaces, provide and use our own TLS_PADDING_* defines. ok inoguchi@ tb@
2022-02-01Revise/simplify for signer interface change.jsing1-20/+10
2022-02-01Revise signer callback interface.jsing2-83/+128
The current design of tls_sign_cb provides a pointer to a buffer where the signature needs to be copied, however it fails to provide a length which could result in buffer overwrites. Furthermore, tls_signer_sign() is designed such that it allocates and returns ownership to the caller. Revise tls_sign_cb so that the called function is expected to allocate a buffer, returning ownership of the buffer (along with its length) to the caller of the callback. This makes it far easier (and safer) to implement a tls_sign_cb callback, plus tls_signer_sign can be directly plugged in (with an appropriate cast). While here, rename and reorder some arguments - while we will normally sign a digest, there is no requirement for this to be the case hence use 'input' and 'input_len'. Move padding (an input) before the outputs and add some additional bounds/return value checks. This is technically an API/ABI break that would need a libtls major bump, however since nothing is using the signer interface (outside of regress), we'll ride the original minor bump. With input from tb@ ok inoguchi@ tb@
2022-01-30Add test coverage for tls_signer when used with a TLS server.jsing1-2/+189
In this configuration the tls_signer is provided with the server certificate and private key, while the TLS server is configured with a sign callback and is only provided with the certificate.
2022-01-30Add initial regress for tls_signer.jsing3-1/+305
2022-01-29Add limits.h for INT_MAX in tls_signer.cinoguchi1-1/+3
ok jsing@ tb@
2022-01-28Error check for sk_push in libsslinoguchi1-4/+7
CID 118976 118979 ok tb@
2022-01-28Error check for sk_push in libsslinoguchi1-2/+5
CID 24838 comment and ok tb@
2022-01-28Expose tls_signer_error()jsing1-0/+1
Add tls_signer_error to Symbols.list - this was missed during the last libtls minor bump and can ride along. ok deraadt@
2022-01-27sort includes as usualtb1-2/+2
2022-01-27Do not depend on engine.h pulling in err.h and evp.htb2-6/+10
2022-01-26whitespacetb1-4/+4
2022-01-25minor bump after api additiomeric1-1/+1
2022-01-25Introduce a signer interface intented to make TLS privsep simplereric7-5/+438
to implement. Add a tls_config_set_sign_cb() function that allows to register a callback for the signing operation on a tls_config. When used, the context installs fake pivate keys internally, and the callback receives the hash of the public key. Add a tls_signer_*() set of functions to manage tls_signer objects. A tls_signer is an opaque structure on which keys are added. It is used to compute signatures with private keys identified by their associated public key hash. Discussed with and ok jsing@ tb@
2022-01-25Rewrite paragraph to refer to EVP_CIPHER_CTX_new() and HMAC_CTX_new()tb1-6/+6
to match reality. spotted by/ok jmc
2022-01-25Remove some HMAC_CTX_init() remnants in HMAC(3).tb1-31/+5
spotted by/ok jmc
2022-01-25Fix another return 0 bug in SSL_shutdown()tb1-6/+8
If tls13_recod_layer_send_pending() returns TLS13_IO_EOF, we will bubble this up to the caller via tls13_legacy_return_code(), which translates TLS13_IO_EOF to 0. This can happen if we have pending post handshake-handshake data and the peer closes the pipe. Presumably tls13_legacy_shutdown() should be rewritten yet again. ok jsing
2022-01-25Avoid an infinite loop in SSL_shutdown()tb1-2/+4
If the peer closed the write side of the connection and we have not yet received the close_notify, SSL_shutdown() makes an extra read to try and read the peer's close_notify from the pipe. In that situation, we receive EOF. The legacy stack will return -1 while the TLSv1.3 stack will end up returning 0. Since the documentation is not super explicit about what should be done if SSL_shutdown() returns 0, some applications will enter an infinite loop. The code and documentation indicate that SSL_shutdown() should only be called once more if it returned 0. Newer versions of the OpenSSL documentation explicitly say that one should call SSL_read() if SSL_shutdown() returns 0 in order to retrieve the close_notify. Doing this would also have avoided this infinite loop. Reported by Carsten Arzig and bluhm with a test case extracted from the syslogd tests using IO::Socket::SSL, which has such an infinite loop. ok bluhm jsing
2022-01-24Document X509_V_ERR_UNNESTED_RESOURCE. Previous version looked goodtb1-2/+9
to claudio
2022-01-24Garbage collect unused ret in ssl3_get_new_session_ticket()tb1-5/+4
ret is used to bubble up an error from ssl3_get_message() and is unused otherwise. Zap dead store and silly ret = 1; return ret; ok inoguchi jsing
2022-01-24In ssl3_get_server_key_exchange() switch a 'goto err' totb1-2/+2
'goto fatal_err' so that the illegal_parameter alert is actually sent in case of X509_get0_pubkey() failure. ok inoguchi jsing
2022-01-24Avoid use of uninitialized in tlsext_sni_server_parse()tb1-1/+3
If the hostname is too long, tlsext_sni_is_valid_hostname() will fail without having initialized *is_ip. As a result, the garbage value could lead to accepting (but otherwise ignoring) overlong and possibly invalid hostnames without erroring in tlsext_sni_server_parse(). ok inoguchi jsing
2022-01-24Garbage collect the unused rv in tls1_check_ec_server_key() andtb1-3/+2
convert to usual form of error checking. ok inoguchi jsing
2022-01-22Use memmove instead of memcpy for overlapping memoryinoguchi1-3/+3
CID 251047 251094 OK beck@ jsing@ millert@ tb@
2022-01-22Use memmove instead of memcpy for overlapping memoryinoguchi1-5/+5
CID 250936 251103 OK beck@ jsing@ millert@ tb@
2022-01-22X509_GET_PUBKEY(3) return value check in libcryptoinoguchi1-2/+3
CID 345116 ok beck@ tb@
2022-01-22X509_GET_PUBKEY(3) return value check in libcryptoinoguchi1-3/+4
CID 25131 ok beck@ tb@ suggest using X509_REQ_get0_pubkey() and remove the EVP_PKEY_free() from tb@
2022-01-22X509_GET_PUBKEY(3) return value check in libcryptoinoguchi1-3/+3
ok beck@ tb@ suggest using X509_get0_pubkey() and remove EVP_PKEY_free() from tb@
2022-01-22X509_GET_PUBKEY(3) return value check in libcryptoinoguchi2-4/+7
ok beck@ tb@
2022-01-20Remove the remaining three parens in return statements.tb1-4/+4
2022-01-20Use correct spelling of NULL.tb1-2/+2
2022-01-20remove unused variable from all copies of _asr_strdname()naddy2-6/+6
... including those inlined into print_dname(). This also fixes -Wunused-but-set-variable warnings warnings in smtpd and smtpctl. The code was imported with asr and then copied around. ok deraadt@ guenther@
2022-01-20Add check for EVP_CIPHER_CTX_ctrlinoguchi1-4/+6
suggestion from tb@
2022-01-20Add check for EVP_CIPHER_CTX_set_key_length return valueinoguchi1-2/+3
CID 21653 ok jsing@ millert@ tb@