summaryrefslogtreecommitdiff
path: root/src/lib/libssl/tls13_buffer.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2020-08-08Enable P-521 and run the tests that use it.tb1-5/+3
2020-08-06delete another word to improve the wording; suggested by jmc@schwarze1-2/+2
2020-08-06Explain the purpose of CMAC_resume(3) in more detail.schwarze1-3/+9
Triggered by jmc@ apparently misunderstanding the intention of the text and fixing a grammatical error in a way that wasn't ideal, so i guess he wouldn't have been the only one to find the previous version hard to understand. OK jmc@
2020-08-04Cleanup aead_ctxinoguchi1-1/+3
ok jsing@ tb@
2020-08-03Only parse a client's status_request in the CHtb1-1/+4
A client should only send a status_request as part of the CH. Pointed out by Michael Forney ok inoguchi jsing
2020-08-03Ensure clients only send a status_request in the CHtb1-3/+7
The current code might cause a client to send a status_request containing a CertificateStatusRequest with its certificate. This makes no sense. Pointed out by Michael Forney ok inoguchi jsing
2020-08-03Correctly handle server requests for an OCSP responsetb1-1/+12
According to RFC 8446, 4.4.2.1, a server may request that a client present an OCSP response with its certificate by sending an empty status_request extension as part of the certificate request. The current code expects a full CertificateStatus structure, which is only sent if the server sends an OCSP response with its certificate. This causes interoperability issues with Go's TLS server and with newer GnuTLS where we would abort the handshake with a decode_error alert and length mismatch error. Issue reported and diagnosed by Michael Forney Problem also found by Mikolaj Kucharski and inoguchi. ok inoguchi jsing
2020-08-02Check the return value of tls1_enc() in the write path.jsing2-6/+6
The write path can return a failure in the AEAD path and there is no reason not to check a return value. Spotted by tb@ during another review. ok tb@
2020-08-01Clean up/simplify more of the dtls1/ssl3 record writing code:jsing2-73/+34
- Make the DTLS code much more consistent with the ssl3 code. - Avoid assigning wr->input and wr->length just so they can be used as arguments to memcpy(). - Remove the arc4random_buf() call for the explicit IV, since tls1_enc() already does this for us. ok tb@
2020-08-01Pull record version selection code up and pass it as an argument tojsing1-15/+15
ssl3_create_record(). ok tb@
2020-08-01Replace hostname underscore with hyphen in appstest.shinoguchi1-28/+28
2020-07-30Have ssl_init_wbio_buffer() push the buffering BIO rather than doing itjsing1-5/+2
ourselves. Spotted by tb@ during a previous review.
2020-07-30Clean up and simplify some of the SSL3/DTLS1 record writing code.jsing2-76/+72
This will allow for further changes to be made with less complexity and easier review. In particular, decide if we need an empty fragment early on and only do the alignment calculation once (rather than in two separate parts of the function. ok tb@ inoguchi@
2020-07-30Add minimal info callback support for TLSv1.3tb3-3/+32
As abieber@ found the hard way, some python frameworks (twisted, synapse) thought it a great idea to use the info callback mechanism (designed to get state information about SSL objects) to modify state information such as setting and verifying the SNI. The switch of TLS_method() to default to TLSv1.3 broke these contraptions. Further bits of the info callback mechanism will likely metastasize throughout the TLSv1.3 stack if we need them, so we only do what's really necessary now. Lots of debugging, crucial hint and testing by abieber input & ok jsing
2020-07-27Wrap long lines s_server.cinoguchi1-67/+130
2020-07-27Add function prototype and move sub functions to bottominoguchi1-198/+197
2020-07-27Remove space between '*' and pointer variable in s_server.cinoguchi1-12/+12
2020-07-27Remove 's_' prefix from member of s_server_config structinoguchi1-110/+110
2020-07-27Convert openssl(1) s_server option handlinginoguchi1-568/+929
ok and comments from jsing@
2020-07-25Handle SSL_MODE_AUTO_RETRY being changed during a TLSv1.3 session.jsing1-1/+4
Both Perl's HTTP::Tiny and IO::Socket::SSL know about SSL_MODE_AUTO_RETRY and try to work around the fact that OpenSSL enabled it by default. However, this can lead to the mode being disabled prior to the TLSv1.3 handshake and then enabled after the handshake has completed. In order to handle this correctly we have to check the mode and inform the record layer prior to every read. Issue reported and test case provided by Nathanael Rensen <nathanael@polymorpheus.com>. ok inoguchi@ tb@
2020-07-25remove half a dozen "goto" statements and a labelschwarze1-14/+1
that change nothing whatsoever, except making the code harder to read; OK tb@
2020-07-24tweak previous;jmc1-4/+4
2020-07-23document PEM_X509_INFO_read(3) and PEM_X509_INFO_read_bio(3)schwarze7-14/+207
OK tb@
2020-07-23Fix a bug in PEM_X509_INFO_read_bio(3) that is very likely to causeschwarze4-22/+211
use-after-free and double-free issues in calling programs. The bug was introduced in SSLeay-0.6.0 released on June 21, 1996 and has been present since OpenBSD 2.4. I found the bug while documenting the function. The bug could bite in two ways that looked quite different from the perspective of the calling code: * If a stack was passed in that already contained some X509_INFO objects and an error occurred, all the objects passed in would be freed, but without removing the freed pointers from the stack, so the calling code would probable continue to access the freed pointers and eventually free them a second time. * If the input BIO contained at least two valid PEM objects followed by at least one PEM object causing an error, at least one freed pointer would be put onto the stack, even though the function would return NULL rather than the stack. But the calling code would still have a pointer to the stack, so it would be likely to access the new bogus pointers sooner or later. Fix all this by remembering the size of the input stack on entry and cutting it back to exactly that size when exiting due to an error, but no further. While here, do some related cleanup: * Garbage collect the automatic variables "error" and "i" which were only used at one single place each. * Use NULL rather than 0 for pointers. I like bugfixes that make the code four lines shorter, reduce the number of variables by one, reduce the number of brace-blocks by one, reduce the number if if-statements by one, and reduce the number of else-clauses by one. Tweaks and OK tb@.
2020-07-16Fix perl bugs that had me printing the wrong cert number for errorsbeck1-8/+9
2020-07-15The exit code from the perl matters herebeck1-1/+3
2020-07-15Don't leak the X509_STOREbeck1-1/+3
2020-07-15Add certificate validation tests generated using the tools frombeck10945-0/+444760
bettertls.com, and a verification suite to try each certificate in the same manner as the web based tests do using X509_verify. This includes the list of "known" failures today in our validaion code so we can move forward without moving back.
2020-07-14Convert option handling for openssl(1) verify.jsing1-88/+220
ok inoguchi@, tb@
2020-07-14Dedup the use legacy stack code.jsing1-56/+25
ok inoguchi@ tb@
2020-07-14Revert the TLSv1.3 version switching fix/hack.jsing1-10/+1
This is no longer necessary since the TLS_method() now supports TLSv1.3. Reverts r1.211 of ssl_lib.c. ok beck@ inoguchi@ tb@
2020-07-14Enter the certs regress directory.jsing1-1/+2
2020-07-14Add regress for X509_verify() using the new bundles.jsing2-3/+369
A number of these tests are known to fail due to bugs/incorrect verification implementation.
2020-07-14Provide generated certificate bundles and roots for regress.jsing74-0/+3721
ok beck@ tb@
2020-07-14Provide tools to build certificate changes for verify regress.jsing4-0/+636
This provides a script that generates a variety of certificate chains and assembles them into bundles containing various permutations, which can be used to test our X.509 verification. A Go program is included to verify each of these bundles. ok beck@ tb@
2020-07-14Force TLSv1.2 when testing SSLv3/TLSv1.2 cipher suites.jsing1-1/+1
Otherwise we end up switching to TLSv1.3 and using a TLSv1.3 cipher suite.
2020-07-14Add a -tls1_2 option so we can force TLSv1.2 for testing.jsing1-5/+9
2020-07-14getopt(3) returns an int so don't use a char to store its return value.kettenis2-4/+4
Makes the test work on architectures where char is unsigned. ok deraadt@, millert@
2020-07-14Remove hypheninoguchi1-3/+3
2020-07-14Add single space between pem and ...inoguchi1-2/+2
2020-07-14Add manual for openssl(1) certhashinoguchi1-2/+57
ok jmc@
2020-07-10Clean up s_client.cinoguchi1-26/+27
- Remove space between '*' and pointer variable. - Add function prototype. - Move callback function to bottom. - Move typedef struct to up.
2020-07-10Change variable bio_c_out from global to localinoguchi1-15/+11
ok tb@
2020-07-09Wrap long lines and put space in front of label in s_client.cinoguchi1-46/+80
2020-07-09Remove c_ prefix from s_client_config memberinoguchi1-33/+33
2020-07-09Convert openssl(1) s_client option handlinginoguchi1-450/+770
suggestions and ok beck@ jsing@ tb@
2020-07-09New regression tests for integral type conversionsschwarze2-2/+378
and for their modifiers, written from scratch.
2020-07-08New regression tests for character and string conversionsschwarze2-2/+445
and for their modifiers, written from scratch.
2020-07-07Remove temporary RSA keys/callbacks code.jsing1-43/+0
This was removed from libssl a very long time ago...
2020-07-07Test TLSv1.3 ciphersuites now that TLS_method() supports TLSv1.3.jsing1-0/+12