summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2023-11-06ossl_qrl_enc_level_set_provide_secret(): Avoid leaking keyslot in error ↵Tomas Mraz
condition Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22600) (cherry picked from commit 0c2aabbaeacf1cc9864daaed11fae755fe7bc025)
2023-11-03Add negative test for key length changeTomas Mraz
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22590) (cherry picked from commit 1aa08644ecd4005c0f55276b2e8dabd8a2a758f0)
2023-11-03Add negative test for iv length changeTomas Mraz
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22590) (cherry picked from commit 82750a0826cd4728f40df9ef31b3294d83aaafe0)
2023-11-03update/final: Return error if key is not setTomas Mraz
Also make sure the key is not set if the key length is changed on the context after the key was set previously. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22590) (cherry picked from commit 3a95d1e41abf2e8eb0f6f07003bac844950bfaae)
2023-11-03When changing IV length invalidate previously set IVTomas Mraz
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22590) (cherry picked from commit eddbb78f4e5196eee33b2fd3d6adeabb69d52eb7)
2023-11-03rand uniform: fix likely usagePauli
@mspncp noted that the condition should have been likely not unlikely. Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22593) (cherry picked from commit b90662b4b0a6c7b6979a96581388ace7c217b470)
2023-11-03Add support for streams to the quic-client fuzzerMatt Caswell
Enable the quic-client fuzzer to accept and create new streams Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22592) (cherry picked from commit 3fa274ca815335e198cf36a1062c59a9f4c00510)
2023-11-03Call SSL_write() in the quic-client-fuzzerMatt Caswell
Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22592) (cherry picked from commit d3dcf88cc5dead2ecaf29714f40cba586d6188ca)
2023-11-03Add additional internal HPKE hardening checks resulting from code audit.Stephen Farrell
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22493) (cherry picked from commit a1c0306895bf6cf28056aaf9cd22cb3b65d4bb0a)
2023-11-02TLS: Fix use of an uninitialized valueHugo Landau
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22523) (cherry picked from commit f62fec64049959cee6b80043cd697d0e7357a24a)
2023-11-02QUIC: Test missing/malformed/duplicate/etc. transport parametersHugo Landau
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22523) (cherry picked from commit 8cb4a47dbb7fb5249c4ab9511d8f2e2f1cc4b445)
2023-11-02QUIC QTEST_FAULT: Allow deleted TLS extension to be outputHugo Landau
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22523) (cherry picked from commit 1d8a399f7bdbe9798cea9dc28bb6ee321f0f24f7)
2023-11-02QUIC WIRE: Refuse integer transport params with trailing body bytesHugo Landau
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22523) (cherry picked from commit 05937a70a14520a70e830af63aba4283ac6f3878)
2023-11-02QUIC CHANNEL: Set reason string for missing tparams extensionHugo Landau
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22523) (cherry picked from commit f94cacb70b677462ecca79314a3d9714f8c0faba)
2023-11-02ossl_quic_new(): Fix a leak found by error injectionTomas Mraz
Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22572) (cherry picked from commit 55936eee86ce31e80fa49d11757f61fe9e20821e)
2023-11-02Fix quicserver binding when duplicate entries existNeil Horman
In testing the quic demos, I found that the quicserver refused to start for me, indicating an inability to bind a socket to listen on The problem turned out to be that getaddrinfo on my system was returning multiple entries, due to the fact that /etc/host maps the localhost host name to both ipv4 (127.0.0.1) and ipv6 (::1), but returns the latter as an ipv4 mapped address (specifying family == AF_INET) It seems like the proper fix would be to modify the /etc/hosts file to not make that mapping, and indeed that works. However, since several distribution ship with this setup, it seems like it is worthwhile to manage it in the server code. its also that some other application may be bound to a given address/port leading to failure, which I think could be considered erroneous, as any failure for the full addrinfo list in quicserver would lead to a complete failure Fix this by modifying the create_dgram_bio function to count the number of sockets is successfully binds/listens on, skipping any failures, and only exit the application if the number of bound sockets is zero. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22559) (cherry picked from commit fe26b6b4961b1d5a560b52463923f6fb014f5068)
2023-11-02CHANGES.md: document BLAKE2b's "size"-setting supportнаб
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22583) (cherry picked from commit 19641b48afb57b48c8d67b44d3ed7054ee2c6bab)
2023-11-02QUIC SSTREAM: Fix bug in ossl_quic_sstream_is_totally_ackedHugo Landau
ossl_quic_sstream_is_totally_acked would return 0 if no data had been appended to the stream yet. Fixed and added tests. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22580) (cherry picked from commit 115ee28263c28c78a34ce4e40a9e4be8361deee6)
2023-11-02Fix a possible memory leak in load_builtin_compressionsBernd Edlinger
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22585) (cherry picked from commit daf26c2d7a4d29ec1040fc0d5d4215cfc2dcf4a7)
2023-11-02Update the OpenSSL Guide tutorials with changes to the demosMatt Caswell
The demo code has changed to accept the hostname/port on the command line. We update the tutorials to keep in sync with the demo code. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22552) (cherry picked from commit 9e973eb297c8127dcaefe97619ddcd5067d12f37)
2023-11-02Update the README with information about how to run the QUIC demosMatt Caswell
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22552) (cherry picked from commit cb8107b632661d2ae538961424768f0ed074fcf6)
2023-11-02Update the QUIC demos to accept hostname/port on the command lineMatt Caswell
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22552) (cherry picked from commit 420037c82c4b2bfea952cbe00730930844969438)
2023-11-02Extend the README to describe how to run the TLS demosMatt Caswell
We also supply some test certificates for use with the demos. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22552) (cherry picked from commit a2b824730ef12cda4e018f5f7cde2ab52a4d255c)
2023-11-02Amend the TLS demos to accept hostname/port as an argumentMatt Caswell
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22552) (cherry picked from commit 2ec4e73c0188425890329ae7f0372c66fb0c1234)
2023-11-02QUIC MULTISTREAM TEST: Ensure frames are only injected into correct packet typesHugo Landau
Although the previous commit is enough to fix the immediate cause of the stochastic failure on Windows, this is a more resilient fix; make sure we only inject a given frame into the correct packet type for our various injection functions. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22578) (cherry picked from commit 660718ee5bafce9c5ca7604801a59f53df28f202)
2023-11-02QUIC MULTISTREAM TEST: Fix script 38 stochastic failure on WindowsHugo Landau
The QUIC fault injector frame injection functionality injects injected frames on whatever EL we happen to be using to generate a packet in. This means we sometimes inject the frame into a packet type it is not allowed to be in, causing a different error code to be generated. Fix this by making sure the connection is fully established before trying to generate the frame in question. Fixes #22348. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22578) (cherry picked from commit a6eb287a667ccbc241c59b23b151672e450bda4b)
2023-11-01Don't create an ack frame if one isn't wanted for this pn_spaceMatt Caswell
The txp->want_ack value has different bit values for different pn_space values. Make sure we take that into account when we read it. Fixes #22568 Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22579) (cherry picked from commit d13488b93690121bd50c97599760a19ead6bcd1f)
2023-11-01quic ddd demos: update makefile and demo sourcesJames Muir
Update makefile and fix some signedness issues in the demo sources. Drop stray "\n" in the host-port format string that prevented ddd-01 from working (this was also noticed by Neil H). Also, determine the length of the message we are sending and send that many bytes (rather than send sizeof the buffer storing the message). These changes are part of https://github.com/openssl/project/issues/253 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22542) (cherry picked from commit d1338fcf12672ef4a3d417f5dd03e342710ee5b3)
2023-11-01quic docs: update ddd README.mdJames Muir
Minor edits (expand MVP acronym, suggest how to install "libuv") These changes are part of https://github.com/openssl/project/issues/253 Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22543) (cherry picked from commit bcc04ab287d59e4f680c1a5eb768c19c5f74bea5)
2023-11-01QUIC APL: Optimise write buffer sizes automaticallyHugo Landau
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22569) (cherry picked from commit b119f8b892ea1dc5ee75f01a4632e7bc2b67323b)
2023-11-01QUIC TXP: Fix drainage calculationHugo Landau
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22569) (cherry picked from commit 266528965f716be809a6e15bb5adfa659b56f9bb)
2023-11-01Stop the quicserver if the handshake or receiving the request failsMatt Caswell
Previously we entered an infinite loop if these things failed. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22557) (cherry picked from commit ddf84fc47e3a01047e2a4001289143cc689eed84)
2023-11-01rand uniform: add comments outlining the algorithmPauli
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22499) (cherry picked from commit dfb26e03c26b9234d04cb9fcaf6391d6bfb44dc4)
2023-11-01Add test case for uniform random generatorsPauli
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22499) (cherry picked from commit d05e0e40d712b9246c6e9db5b579fcce69dafa98)
2023-11-01rand: implement an unbiased random integer from a rangePauli
Refer: https://github.com/apple/swift/pull/39143 for a description of the algorithm. It is optimal in the sense of having: * no divisions * minimal number of blocks of random bits from the generator Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22499) (cherry picked from commit 55755fbf42ec073e86651065c5cce6f64662c9e6)
2023-11-01Don't error if s_client receives exactly BUFSIZZ dataMatt Caswell
We should accept that many bytes without failing Fixes #22551 Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> (Merged from https://github.com/openssl/openssl/pull/22558) (cherry picked from commit 74ff15e1a1987686812c465ee3200bc25efa0e8f)
2023-10-31Check for NULL when freeing the QUIC_TLS objectMatt Caswell
Free functions are expected to be tolerant of a NULL pointer being passed. Fixes the problem in https://github.com/openssl/openssl/pull/21668#issuecomment-1782718328 Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22536) (cherry picked from commit 8d13d9e7305643c28c69c57df798b553b78c2876)
2023-10-30evp_test.c: There are now 3 parameters possible for digestsTomas Mraz
In digest_test_run() there are now 3 parameters possible plus the sentinel value. In reality we will never use all three at once but Coverity rightfully complains that it is possible to overflow the params array. Fixes Coverity 1548054 Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22521) (cherry picked from commit 497a7810bcee48781aa12d4db870f6a565bd0592)
2023-10-30QUIC CHANNEL: Make ping deadline and idle deadline calculation consistentHugo Landau
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22533) (cherry picked from commit 758e9b537ac59680b4eaed77a81f5399cb38c0ae)
2023-10-30If the loss detection timer has fired we may not have lost packetsMatt Caswell
We calculate the delay from the point that a packet arrives until it will be counted as lost based on rtt info. Looking at all the packets we can then calculate the earliest time that a packet will be counted as lost. When that timer fires the latest rtt info may have changed and therefore the packet may no longer be counted as lost yet. We should not assume that just because the ackm timeout has fired that there will definitely be lost packets. Fixes #22538 Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22541) (cherry picked from commit 10dfd796c9c25dd78aa88cf84629a0418b8f0866)
2023-10-30free oaep label-octet-string on errorJames Muir
When successful, ossl_X509_ALGOR_from_nid() returns a pointer to an X509_ALGOR object. Inside ossl_X509_ALGOR_from_nid(), X509_ALGOR_set0() is called, and this passes ownership of the ASN1 object "los" (label octet string) to the X509_ALGOR object. When ossl_X509_ALGOR_from_nid() fails, ownership has not been passed on and we need to free "los". Change the scope of "los" and ensure it is freed on failure (on success, set it to NULL so it is not freed inside the function). Fixes #22336 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22495) (cherry picked from commit 83efd7170bfa48a3263fcf8c771a6029646e8ad2)
2023-10-30Update to latest fuzz corporaKurt Roeckx
Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22531) (cherry picked from commit 87bed01bdbd827904816130e92e2f8945ba9b99b)
2023-10-30Add a separate README for the guide demosMatt Caswell
Point users at the actual guide, and also explain about LD_LIBRARY_PATH Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22505) (cherry picked from commit ada33e98f53ab02dc4d6e8259c9e9edb6cd5c90c)
2023-10-30Add a reference for HTTP/3Matt Caswell
We also add reference for ALPN ids Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22505) (cherry picked from commit f666599f8dae9a892c28765cfbfe561fff52e213)
2023-10-30Add a reference to the demos subfolderMatt Caswell
Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22505) (cherry picked from commit 899c910e3480e80dc1e6740217de86af39ac606e)
2023-10-30Update to the demos README fileMatt Caswell
Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22505) (cherry picked from commit aefb529422dc029efecd5d9a192b9ffa600fc5db)
2023-10-30Update README-QUIC.mdMatt Caswell
We move some of the "why QUIC" content into the guide and just provide a summary in README-QUIC.md. We also clarify how to use s_client with QUIC. Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22505) (cherry picked from commit 355fd1f45b707d2b066d6dff555dd53928e55627)
2023-10-30Refresh the README.md fileMatt Caswell
Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22505) (cherry picked from commit 0181a1a49c6a63a0b23eb15558336660f5833002)
2023-10-26EVP_PKEY_get_size.pod and provider-keymgmt.pod: document their relationDr. David von Oheimb
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22459) (cherry picked from commit 09298141592c579504966f1907a44cb95f37cc6e)
2023-10-26EVP_PKEY_get_{bits,security_bits,size}(): add missing error queue entry on ↵Dr. David von Oheimb
failure Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22459) (cherry picked from commit ae643b32f91affe61dd411a58b76c8a44cbd7f50)