openssl.git
3 hours agodoc: add note for sm4 xts master
Xu Yizhou [Fri, 25 Nov 2022 05:57:37 +0000 (13:57 +0800)]
doc: add note for sm4 xts

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19619)

3 hours agotest: add sm4 xts test cases
Xu Yizhou [Fri, 25 Nov 2022 05:54:07 +0000 (13:54 +0800)]
test: add sm4 xts test cases

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19619)

3 hours agoproviders: Add SM4 XTS implementation
Xu Yizhou [Fri, 25 Nov 2022 05:52:49 +0000 (13:52 +0800)]
providers: Add SM4 XTS implementation

Signed-off-by: Xu Yizhou <xuyizhou1@huawei.com>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19619)

3 hours agoobj: Add SM4 XTS OID
Xu Yizhou [Tue, 1 Nov 2022 09:06:45 +0000 (17:06 +0800)]
obj: Add SM4 XTS OID

Add the following OID:

SM4-XTS: 1.2.156.10197.1.104.10

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19619)

3 hours agoUpdate pyca-cryptography submodule to 38.0.4
Nicola Tuveri [Sun, 27 Nov 2022 21:43:16 +0000 (23:43 +0200)]
Update pyca-cryptography submodule to 38.0.4

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19681)

(cherry picked from commit d656efb9eb7692c0b1cba843d7787751e388cc8a)

3 hours agoHonor OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT as set and default to UNCOMPRESSED
Nicola Tuveri [Sat, 18 Sep 2021 15:17:39 +0000 (18:17 +0300)]
Honor OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT as set and default to UNCOMPRESSED

Originally the code to im/export the EC pubkey was meant to be consumed
only by the im/export functions when crossing the provider boundary.
Having our providers exporting to a COMPRESSED format octet string made
sense to avoid memory waste, as it wasn't exposed outside the provider
API, and providers had all tools available to convert across the three
formats.

Later on, with #13139 deprecating the `EC_KEY_*` functions, more state
was added among the params imported/exported on an EC provider-native
key (including `OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT`, although it
did not affect the format used to export `OSSL_PKEY_PARAM_PUB_KEY`).

Finally, in #14800, `EVP_PKEY_todata()` was introduced and prominently
exposed directly to users outside the provider API, and the choice of
COMPRESSED over UNCOMPRESSED as the default became less sensible in
light of usability, given the latter is more often needed by
applications and protocols.

This commit fixes it, by using `EC_KEY_get_conv_form()` to get the
point format from the internal state (an `EC_KEY` under the hood) of the
provider-side object, and using it on
`EVP_PKEY_export()`/`EVP_PKEY_todata()` to format
`OSSL_PKEY_PARAM_PUB_KEY`.
The default for an `EC_KEY` was already UNCOMPRESSED, and it is altered
if the user sets `OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT` via
`EVP_PKEY_fromdata()`, `EVP_PKEY_set_params()`, or one of the
more specialized methods.

For symmetry, this commit also alters `ec_pkey_export_to()` in
`crypto/ec/ec_ameth.c`, part of the `EVP_PKEY_ASN1_METHOD` for legacy EC
keys: it exclusively used COMPRESSED format, and now it honors the
conversion format specified in the EC_KEY object being exported to a
provider when this function is called.

Expand documentation about `OSSL_PKEY_PARAM_PUB_KEY` and mention the
3.1 change in behavior for our providers.

Fixes #16595

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19681)

(cherry picked from commit 926db476bc669fdcc4c4d2f1cb547060bdbfa153)

5 hours agoFix Coverity issues in HPKE
slontis [Sun, 27 Nov 2022 21:49:17 +0000 (07:49 +1000)]
Fix Coverity issues in HPKE

CID 1517043 and 1517038: (Forward NULL) - Removed redundant check that is already
done by the caller. It was complaining that it checked for ctlen == NULL
and then did a goto that used this *ctlen.

CID 1517042 and 1517041: (Forward NULL) - Similar to above for ptlen in
hpke_aead_dec()

CID 1517040: Remove unneeded logging. This gets rid of the warning
related to taking the sizeof(&)

CID 1517039: Check returned value of  RAND_bytes_ex() in hpke_test

CID 1517038: Check return result of KEM_INFO_find() in
OSSL_HPKE_get_recomended_ikmelen. Even though this is a false positive,
it should not rely on the internals of other function calls.

Changed some goto's into returns to match OpenSSL coding guidelines.
Removed Raises from calls to _new which fail from malloc calls.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19774)

11 hours agoFix occasional assertion failure when storing properties
Tomas Mraz [Thu, 24 Nov 2022 17:48:10 +0000 (18:48 +0100)]
Fix occasional assertion failure when storing properties

Fixes #18631

The store lock does not prevent concurrent access to the
property cache, because there are multiple stores.

We drop the newly created entry and use the exisiting one
if there is one already.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19762)

32 hours agoFix accumulated index comments in felem_inv for p521
Rohan McLure [Fri, 25 Nov 2022 03:42:12 +0000 (14:42 +1100)]
Fix accumulated index comments in felem_inv for p521

Comments in felem_inv refer to the logarithm with respect to in of the
element that has just been computed. The last two such annotations are
incorrect. By Fermat's last theorem, we hope to compute in^(p-2) in
GF(2^521-1), as such we expect the final index we reach to be 2^521-3.

CLA: Trivial

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19765)

32 hours agoDrop incorrect skipping of some evp_test testcases with no-gost
Tomas Mraz [Wed, 23 Nov 2022 08:09:24 +0000 (09:09 +0100)]
Drop incorrect skipping of some evp_test testcases with no-gost

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19739)

4 days agoAdd test for EVP_PKEY_Q_keygen
Tomas Mraz [Thu, 24 Nov 2022 15:46:38 +0000 (16:46 +0100)]
Add test for EVP_PKEY_Q_keygen

Test for #19736

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19761)

4 days agoImplements Hybrid Public Key Encryption (HPKE) as per RFC9180.
Stephen Farrell [Tue, 22 Nov 2022 02:42:04 +0000 (02:42 +0000)]
Implements Hybrid Public Key Encryption (HPKE) as per RFC9180.

This supports all the modes, suites and export mechanisms defined
in RFC9180 and should be relatively easily extensible if/as new
suites are added.  The APIs are based on the pseudo-code from the
RFC, e.g. OSS_HPKE_encap() roughly maps to SetupBaseS().  External
APIs are defined in include/openssl/hpke.h and documented in
doc/man3/OSSL_HPKE_CTX_new.pod.  Tests (test/hpke_test.c) include
verifying a number of the test vectors from the RFC as well as
round-tripping for all the modes and suites.  We have demonstrated
interoperability with other HPKE implementations via a fork [1]
that implements TLS Encrypted ClientHello (ECH) which uses HPKE.

@slontis provided huge help in getting this done and this makes
extensive use of the KEM handling code from his PR#19068.

[1] https://github.com/sftcd/openssl/tree/ECH-draft-13c

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17172)

4 days agoFix typos in doc/man3/EVP_EncryptInit.pod
Marco Abbadini [Thu, 24 Nov 2022 01:11:25 +0000 (02:11 +0100)]
Fix typos in doc/man3/EVP_EncryptInit.pod
Fixes #19728

CLA: trivial

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19753)

4 days agoWhen using PEM_read_bio_PrivateKey_ex() the public key is optional
Tomas Mraz [Wed, 26 Oct 2022 09:29:49 +0000 (11:29 +0200)]
When using PEM_read_bio_PrivateKey_ex() the public key is optional

Fixes #19498

However the private key part is not optional which was
mishandled by the legacy routine.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19505)

4 days agoDisable atomic refcounts with no-threads
J.W. Jagersma [Tue, 22 Nov 2022 18:20:53 +0000 (19:20 +0100)]
Disable atomic refcounts with no-threads

This is needed for building with '-march=i386 no-threads', on platforms
where libatomic is not available (djgpp, specifically).  The
implementation now falls back to 'CRYPTO_atomic_add()', which performs
plain lock-free addition in a 'no-threads' build.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19751)

4 days agoadd missing OSSL_CMP_CTX_reset_geninfo_ITAVs() function
Dr. David von Oheimb [Mon, 19 Sep 2022 11:15:04 +0000 (13:15 +0200)]
add missing OSSL_CMP_CTX_reset_geninfo_ITAVs() function

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/19216)

4 days agoOSSL_CMP_CTX_reinit(): fix missing reset of ctx->genm_ITAVs
Dr. David von Oheimb [Wed, 14 Sep 2022 15:37:27 +0000 (17:37 +0200)]
OSSL_CMP_CTX_reinit(): fix missing reset of ctx->genm_ITAVs

Otherwise, further OSSL_CMP_exec_GENM_ses() calls will go wrong.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/19216)

4 days agoCMP: fix gen_new() in cmp_msg.c checking wrong ITAVs
Dr. David von Oheimb [Sat, 17 Sep 2022 18:58:16 +0000 (20:58 +0200)]
CMP: fix gen_new() in cmp_msg.c checking wrong ITAVs

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/19216)

4 days agoCMS_decrypt_set1_*(): remove misleading error queue entry when recipient mismatch...
Dr. David von Oheimb [Tue, 18 Oct 2022 16:12:38 +0000 (18:12 +0200)]
CMS_decrypt_set1_*(): remove misleading error queue entry when recipient mismatch was not the issue

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/19222)

4 days agoCMS_decrypt_set1_password(): prevent mem leak on any previously set decryption key
Dr. David von Oheimb [Fri, 14 Oct 2022 10:56:54 +0000 (12:56 +0200)]
CMS_decrypt_set1_password(): prevent mem leak on any previously set decryption key

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/19222)

4 days agoCMS_decrypt*(): fix misconceptions and mem leak
Dr. David von Oheimb [Thu, 15 Sep 2022 09:51:30 +0000 (11:51 +0200)]
CMS_decrypt*(): fix misconceptions and mem leak

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/19222)

4 days agoFix typo in openssl-x509.pod.in
Jan [Wed, 23 Nov 2022 15:14:07 +0000 (16:14 +0100)]
Fix typo in openssl-x509.pod.in

CLA: trivial

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19746)

5 days agoAdd SM2 support for EVP_PKEY_Q_keygen
Jiaxun Yang [Tue, 22 Nov 2022 19:53:38 +0000 (19:53 +0000)]
Add SM2 support for EVP_PKEY_Q_keygen

There is no reason preventing this API to support SM2,
which gives us a simple method to do SM2 key gen.

CLA: trivial

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/19736)

5 days agoCMP: fix handling of unset or missing failInfo PKI status information
Dr. David von Oheimb [Tue, 13 Sep 2022 20:22:48 +0000 (22:22 +0200)]
CMP: fix handling of unset or missing failInfo PKI status information

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/19205)

5 days agoCMP: fix status held in OSSL_CMP_CTX, in particular for genp messages
Dr. David von Oheimb [Tue, 13 Sep 2022 13:43:59 +0000 (15:43 +0200)]
CMP: fix status held in OSSL_CMP_CTX, in particular for genp messages

On this occasion, replace magic constants by mnemonic ones; update doc

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/19205)

5 days agoOSSL_CMP_ITAV_set0.pod: fix formatting nits, update example
Dr. David von Oheimb [Sat, 17 Sep 2022 19:54:07 +0000 (21:54 +0200)]
OSSL_CMP_ITAV_set0.pod: fix formatting nits, update example

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/19230)

5 days agoCMP+CRMF: fix formatting nits in crypto/, include/, and test/
Dr. David von Oheimb [Sat, 17 Sep 2022 19:51:48 +0000 (21:51 +0200)]
CMP+CRMF: fix formatting nits in crypto/, include/, and test/

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/19230)

5 days agoAdd support for KTLS zerocopy sendfile on Linux
Maxim Mikityanskiy [Wed, 9 Nov 2022 09:26:11 +0000 (11:26 +0200)]
Add support for KTLS zerocopy sendfile on Linux

TLS device offload allows to perform zerocopy sendfile transmissions.
FreeBSD provides this feature by default, and Linux 5.19 introduced it
as an opt-in. Zerocopy improves the TX rate significantly, but has a
side effect: if the underlying file is changed while being transmitted,
and a TCP retransmission happens, the receiver may get a TLS record
containing both new and old data, which leads to an authentication
failure and termination of connection. This effect is the reason Linux
makes a copy on sendfile by default.

This commit adds support for TLS zerocopy sendfile on Linux disabled by
default to avoid any unlikely backward compatibility issues on Linux,
although sacrificing consistency in OpenSSL's behavior on Linux and
FreeBSD. A new option called KTLSTxZerocopySendfile is added to enable
the new zerocopy behavior on Linux. This option should be used when the
the application guarantees that the file is not modified during
transmission, or it doesn't care about breaking the connection.

The related documentation is also added in this commit. The unit test
added doesn't test the actual functionality (it would require specific
hardware and a non-local peer), but solely checks that it's possible to
set the new option flag.

Signed-off-by: Maxim Mikityanskiy <maximmi@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Boris Pismenny <borisp@nvidia.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18650)

5 days agoQUIC TXP: Fix missing OSSL_NELEM include
Hugo Landau [Thu, 24 Nov 2022 08:54:01 +0000 (08:54 +0000)]
QUIC TXP: Fix missing OSSL_NELEM include

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/19756)

5 days agoMake parsing of piped data in `speed.c` more robust
Daniel Fiala [Mon, 19 Sep 2022 04:41:58 +0000 (06:41 +0200)]
Make parsing of piped data in `speed.c` more robust

Fixes openssl#19050

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19238)

5 days agoQUIC TX Packetiser and Streams Mapper
Hugo Landau [Mon, 26 Sep 2022 16:06:59 +0000 (17:06 +0100)]
QUIC TX Packetiser and Streams Mapper

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19346)

5 days agoAdd HISTORY section to EVP_KEM-EC document.
slontis [Wed, 16 Nov 2022 21:30:14 +0000 (07:30 +1000)]
Add HISTORY section to EVP_KEM-EC document.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19699)

5 days agoAdd two new build targets to enable the possibility of using clang-cl as
Everton Constantino [Thu, 27 Oct 2022 18:07:48 +0000 (15:07 -0300)]
Add two new build targets to enable the possibility of using clang-cl as
an assembler for Windows on Arm builds and also clang-cl as the compiler
as well. Make appropriate changes to armcap source and peralsm scripts.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19523)

6 days agoCleanup : directly include of `internal/nelem.h` when required.
FdaSilvaYY [Sat, 20 Feb 2021 22:39:30 +0000 (23:39 +0100)]
Cleanup : directly include of `internal/nelem.h` when required.

And so clean a few useless includes

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19721)

6 days agoCMP: add API functions OSSL_CMP_CTX_get0_libctx() and OSSL_CMP_CTX_get0_propq()
Dr. David von Oheimb [Wed, 21 Sep 2022 15:56:41 +0000 (17:56 +0200)]
CMP: add API functions OSSL_CMP_CTX_get0_libctx() and OSSL_CMP_CTX_get0_propq()

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/19715)

6 days agoImprove FIPS RSA keygen performance.
slontis [Wed, 2 Nov 2022 03:20:55 +0000 (13:20 +1000)]
Improve FIPS RSA keygen performance.

Reduce the Miller Rabin counts to the values specified by FIPS 186-5.
The old code was using a fixed value of 64.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19579)

6 days agoFix version mistake in some HISTORY sections
Tomas Mraz [Mon, 21 Nov 2022 11:11:02 +0000 (12:11 +0100)]
Fix version mistake in some HISTORY sections

Follow up of PR#19690

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19725)

7 days agoUpdate CHANGES.md and NEWS.md from 3.0.7
Tomas Mraz [Tue, 1 Nov 2022 10:38:31 +0000 (11:38 +0100)]
Update CHANGES.md and NEWS.md from 3.0.7

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19565)

7 days agoAdd an EVP signature demo using DSA
Daniel Fiala [Fri, 21 Oct 2022 04:28:12 +0000 (06:28 +0200)]
Add an EVP signature demo using DSA

Fixes openssl#14114

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19492)

7 days agotest/recipes/80-test_cms.t: Fix the "CAdES ko" test
Richard Levitte [Tue, 22 Nov 2022 14:05:45 +0000 (15:05 +0100)]
test/recipes/80-test_cms.t: Fix the "CAdES ko" test

This test had commands that assumes that runner_loop() is used to perform
the tests.  These tests still run fine because Unix accepts braces in file
names, but other operating systems might not.

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19731)

(cherry picked from commit 20d3731006c9d29cbe17c2aedeba5e2abccfcd57)

7 days agoSplit out thread pool tests into threadpool_test
Tomas Mraz [Wed, 16 Nov 2022 15:09:55 +0000 (16:09 +0100)]
Split out thread pool tests into threadpool_test

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19695)

7 days agoAdd functions supporting thread pool only when it is enabled
Tomas Mraz [Wed, 16 Nov 2022 13:51:48 +0000 (14:51 +0100)]
Add functions supporting thread pool only when it is enabled

Fixes #19691

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19695)

8 days agoFix coverity issues in X509v3_addr
slontis [Thu, 17 Nov 2022 01:58:36 +0000 (11:58 +1000)]
Fix coverity issues in X509v3_addr

CID 1516955 : Null pointer deref (REVERSE_INULL)
CID 1516954 : Null pointer deref (REVERSE_INULL)
CID 1516953 : RESOURCE_LEAK of child

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19700)

8 days agoAdd missing HISTORY sections for OpenSSL 3.0 related documents.
slontis [Wed, 16 Nov 2022 21:26:06 +0000 (07:26 +1000)]
Add missing HISTORY sections for OpenSSL 3.0 related documents.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19690)

8 days agoImprove FIPS RSA keygen performance.
slontis [Wed, 2 Nov 2022 02:01:34 +0000 (12:01 +1000)]
Improve FIPS RSA keygen performance.

FIPS 186-4 has 5 different algorithms for key generation,
and all of them rely on testing GCD(a,n) == 1 many times.

Cachegrind was showing that during a RSA keygen operation,
the function BN_gcd() was taking a considerable percentage
of the total cycles.

The default provider uses multiprime keygen, which seemed to
be much faster. This is because it uses BN_mod_inverse()
instead.

For a 4096 bit key, the entropy of a key that was taking a
long time to generate was recorded and fed back into subsequent
runs. Roughly 40% of the cycle time was BN_gcd() with most of the
remainder in the prime testing. Changing to use the inverse
resulted in the cycle count being 96% in the prime testing.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19578)

8 days agoDesign document for the QUIC-TLS integration
Matt Caswell [Mon, 14 Nov 2022 16:41:17 +0000 (16:41 +0000)]
Design document for the QUIC-TLS integration

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19683)

10 days agotest/timing_load_creds.c: use OPENSSL_SYS_ macros
Richard Levitte [Sat, 19 Nov 2022 12:05:19 +0000 (13:05 +0100)]
test/timing_load_creds.c: use OPENSSL_SYS_ macros

A previous change was only half done.  To avoid such mistakes again, we
switch to using the OPENSSL_SYS_ macros, as the are clearer than having
to check a pile of very platform and compiler specific macros.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/19720)

10 days agoDisable test/timing_load_creds.c on VMS
Richard Levitte [Fri, 18 Nov 2022 12:28:35 +0000 (13:28 +0100)]
Disable test/timing_load_creds.c on VMS

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/19713)

11 days agotest/smime-certs/ca.cnf: clean up comments, simplify settings using SKID and AKID...
Dr. David von Oheimb [Thu, 25 Aug 2022 15:45:40 +0000 (17:45 +0200)]
test/smime-certs/ca.cnf: clean up comments, simplify settings using SKID and AKID defaults

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19064)

11 days agox509/v3_purp.c: rename 'require_ca' parameters to the more adequate 'non_leaf'
Dr. David von Oheimb [Thu, 25 Aug 2022 15:26:01 +0000 (17:26 +0200)]
x509/v3_purp.c: rename 'require_ca' parameters to the more adequate 'non_leaf'

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19064)

11 days agox509/v3_purp.c etc.: improve doc/comments on codesign and timestamp purpose checks
Dr. David von Oheimb [Thu, 25 Aug 2022 15:24:27 +0000 (17:24 +0200)]
x509/v3_purp.c etc.: improve doc/comments on codesign and timestamp purpose checks

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19064)

11 days agoAdd doc for EVP_ASYM_CIPHER-RSA and clean up OSSL_PROVIDER-FIPS.pod.
slontis [Wed, 16 Nov 2022 05:40:09 +0000 (15:40 +1000)]
Add doc for EVP_ASYM_CIPHER-RSA and clean up OSSL_PROVIDER-FIPS.pod.

Removed fields from missingcrypto.txt that are no longer missing.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19692)

11 days agoFix more VMS inclusions
Richard Levitte [Fri, 18 Nov 2022 06:44:04 +0000 (07:44 +0100)]
Fix more VMS inclusions

Including things in ../ssl/record/methods from sources in test/ presented
another challenge for the current VMS C.  This is compensated for with the
usual whack-a-mole in Configurations/descrip.mms.tmpl.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19708)

11 days agoUpdate the record layer design based on implementation experience
Matt Caswell [Tue, 8 Nov 2022 14:52:55 +0000 (14:52 +0000)]
Update the record layer design based on implementation experience

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17969)

11 days agoAdd a record layer design document
Matt Caswell [Fri, 25 Mar 2022 15:25:45 +0000 (15:25 +0000)]
Add a record layer design document

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17969)

11 days agoevp_extra_test2: Test DH param checks with non-NULL libctx
Tomas Mraz [Fri, 11 Nov 2022 11:29:52 +0000 (12:29 +0100)]
evp_extra_test2: Test DH param checks with non-NULL libctx

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19656)

11 days agoDH_check[_params]() use libctx of the dh for prime checks
Tomas Mraz [Fri, 11 Nov 2022 11:29:44 +0000 (12:29 +0100)]
DH_check[_params]() use libctx of the dh for prime checks

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19656)

11 days agoParseC.pm: gracefully handle DOS-style end-of-line in source files
Dr. David von Oheimb [Tue, 15 Nov 2022 15:33:21 +0000 (16:33 +0100)]
ParseC.pm: gracefully handle DOS-style end-of-line in source files

When header files happen to have \r\n at line end, prevent hick-ups like:

Unmatched parentheses at include/openssl/asn1.h line 520

make[1]: *** [Makefile:4757: util/libcrypto.num] Error 255
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:3387: build_sw] Error 2

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/19686)

12 days agoFix openssl.txt
Todd Short [Tue, 15 Nov 2022 17:12:37 +0000 (12:12 -0500)]
Fix openssl.txt

The values don't match those in include/openssl/sslerr.h

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19688)

12 days agoUse <openssl/e_os2.h> rather than <stdint.h>
Richard Levitte [Wed, 16 Nov 2022 15:20:57 +0000 (16:20 +0100)]
Use <openssl/e_os2.h> rather than <stdint.h>

<stdint.h> is C99, which means that on older compiler, it can't be included.
We have code in <openssl/e_os2.h> that compensates.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19697)

13 days agoAdd test to confirm IPAddressFamily_check_len catches invalid len
Graham Woodward [Mon, 14 Nov 2022 21:15:27 +0000 (21:15 +0000)]
Add test to confirm IPAddressFamily_check_len catches invalid len

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19273)

13 days agoCatch incorrect IPAddressFamily lengths
Graham Woodward [Tue, 27 Sep 2022 11:37:59 +0000 (12:37 +0100)]
Catch incorrect IPAddressFamily lengths

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19273)

13 days agoDrop explicit check for engines in opt_legacy_okay
Simo Sorce [Mon, 14 Nov 2022 15:25:15 +0000 (10:25 -0500)]
Drop explicit check for engines in opt_legacy_okay

The providers indication should always indicate that this is not a
legacy request.
This makes a check for engines redundant as the default return is that
legacy is ok if there are no explicit providers.

Fixes #19662

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19671)

13 days agoKTLS: enable the CCM mode of ktls
Tianjia Zhang [Mon, 6 Dec 2021 09:50:50 +0000 (17:50 +0800)]
KTLS: enable the CCM mode of ktls

The latest kernel (including stable kernel) has fixed the issue
of decryption failure in CCM mode in TLS 1.3. It is necessary to
reenable CCM mode for KTLS.

Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17207)

13 days agoFix the check of EC_GROUP_check_named_curve
Peiwei Hu [Tue, 15 Nov 2022 04:22:24 +0000 (12:22 +0800)]
Fix the check of EC_GROUP_check_named_curve

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19678)

13 days agoapps/speed.c: fix the wrong checks
Peiwei Hu [Tue, 15 Nov 2022 03:25:38 +0000 (11:25 +0800)]
apps/speed.c: fix the wrong checks

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19678)

13 days agoEnsure that SIZE_MAX is defined where OSSL_SSIZE_MAX is used.
Richard Levitte [Wed, 16 Nov 2022 06:46:28 +0000 (07:46 +0100)]
Ensure that SIZE_MAX is defined where OSSL_SSIZE_MAX is used.

include/openssl/e_os2.h defines OSSL_SSIZE_MAX in terms of SIZE_MAX as a
fallback.  This doesn't work well on platforms where SIZE_MAX isn't defined,
so we must ensure that it's defined by including "internal/numbers.h".
Since this is compensating for operating system discrepancies, it's
reasonable to make this change in include/internal/e_os.h.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19693)

13 days agoFix documenation mistakes
Pauli [Sat, 22 Oct 2022 03:09:06 +0000 (14:09 +1100)]
Fix documenation mistakes

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/19377)

13 days agolist: add debug sanity checks
Pauli [Wed, 19 Oct 2022 05:00:52 +0000 (16:00 +1100)]
list: add debug sanity checks

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/19377)

13 days agolist: add an is empty function
Pauli [Thu, 13 Oct 2022 23:30:47 +0000 (10:30 +1100)]
list: add an is empty function

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/19377)

13 days agolist: rename internal fields
Pauli [Tue, 11 Oct 2022 21:58:19 +0000 (08:58 +1100)]
list: rename internal fields

This makes conversion to using list.h easier because the compiler will error
on an unknown field name rather than accepting `head` and `tail` and missing
some changes.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/19377)

13 days agoQUIC: use list.h
Pauli [Tue, 11 Oct 2022 10:00:50 +0000 (21:00 +1100)]
QUIC: use list.h

The demux and record RX implemented lists internally.  This changes them over
to using list.h.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/19377)

13 days agoQUIC ackm: use list.h
Pauli [Tue, 11 Oct 2022 09:20:12 +0000 (20:20 +1100)]
QUIC ackm: use list.h

Instead of implementing a list internally.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/19377)

13 days agoQUIC tx record layer: use list.h
Pauli [Tue, 11 Oct 2022 08:59:24 +0000 (19:59 +1100)]
QUIC tx record layer: use list.h

As opposed to implementing a linked list explicitly.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/19377)

13 days agouint_set: convert uint_set to use the list data type
Pauli [Tue, 11 Oct 2022 07:41:04 +0000 (18:41 +1100)]
uint_set: convert uint_set to use the list data type

This is instead of re-implementing a linked list itself.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/19377)

13 days agoAdd documentation for CPUID bit #64+17
Joachim Vandersmissen [Mon, 14 Nov 2022 11:56:32 +0000 (12:56 +0100)]
Add documentation for CPUID bit #64+17

CLA: trivial

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19670)

13 days agogcm_get_funcs(): Add missing fallback for ghash on x86_64
Tomas Mraz [Mon, 14 Nov 2022 18:31:17 +0000 (19:31 +0100)]
gcm_get_funcs(): Add missing fallback for ghash on x86_64

Fixes #19673

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19674)

2 weeks agotest: fix typo in test description
Pauli [Mon, 14 Nov 2022 02:20:38 +0000 (13:20 +1100)]
test: fix typo in test description

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19666)

2 weeks agotest: add two comparision options to fips version test utility code
Pauli [Mon, 14 Nov 2022 02:13:44 +0000 (13:13 +1100)]
test: add two comparision options to fips version test utility code

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19666)

2 weeks agoAdd test for EVP_PKEY_eq
Simo Sorce [Fri, 11 Nov 2022 17:18:26 +0000 (12:18 -0500)]
Add test for EVP_PKEY_eq

This tests that the comparison work even if a provider can only return
a public key.

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19648)

2 weeks agoUpdate documentation for keymgmt export utils
Simo Sorce [Thu, 10 Nov 2022 21:58:28 +0000 (16:58 -0500)]
Update documentation for keymgmt export utils

Change function prototypes and explain how to use the selection
argument.

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19648)

2 weeks agoPropagate selection all the way on key export
Simo Sorce [Thu, 10 Nov 2022 15:46:32 +0000 (10:46 -0500)]
Propagate selection all the way on key export

EVP_PKEY_eq() is used to check, among other things, if a certificate
public key corresponds to a private key. When the private key belongs to
a provider that does not allow to export private keys this currently
fails as the internal functions used to import/export keys ignored the
selection given (which specifies that only the public key needs to be
considered) and instead tries to export everything.

This patch allows to propagate the selection all the way down including
adding it in the cache so that a following operation actually looking
for other selection parameters does not mistakenly pick up an export
containing only partial information.

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19648)

2 weeks agoapps/ocsp.c: Add missing test if make_ocsp_response failed
GW [Sat, 12 Nov 2022 06:51:15 +0000 (08:51 +0200)]
apps/ocsp.c: Add missing test if make_ocsp_response failed

CLA: trivial

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19660)

2 weeks agoapps/speed.c: add verifying if fdopen returns NULL
Vinz2008 [Thu, 10 Nov 2022 17:36:44 +0000 (18:36 +0100)]
apps/speed.c: add verifying if fdopen returns NULL

Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19651)

2 weeks agoAdd thread pool design document (phase 1)
Hugo Landau [Mon, 25 Jul 2022 12:51:42 +0000 (13:51 +0100)]
Add thread pool design document (phase 1)

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19455)

2 weeks agoTest SSL_shutdown() with async writes
Matt Caswell [Mon, 31 Oct 2022 14:23:18 +0000 (14:23 +0000)]
Test SSL_shutdown() with async writes

As well as SSL_shutdown() itself this excercises the async write paths
in ssl3_dispatch_alert().

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19550)

2 weeks agoResolve a TODO in ssl3_dispatch_alert
Matt Caswell [Thu, 27 Oct 2022 14:38:32 +0000 (15:38 +0100)]
Resolve a TODO in ssl3_dispatch_alert

Properly handle the case where there is pending write data and we want
to send an alert.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19550)

2 weeks agoUpdate Stream Receive Buffers design document with implementation details
Tomas Mraz [Thu, 10 Nov 2022 16:13:36 +0000 (17:13 +0100)]
Update Stream Receive Buffers design document with implementation details

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19351)

2 weeks agoPlug the QUIC_RSTREAM to the RX depacketizer
Tomas Mraz [Wed, 26 Oct 2022 16:35:04 +0000 (18:35 +0200)]
Plug the QUIC_RSTREAM to the RX depacketizer

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19351)

2 weeks agoQUIC Receive Stream Management: Call QUIC flow control
Tomas Mraz [Tue, 11 Oct 2022 06:44:46 +0000 (08:44 +0200)]
QUIC Receive Stream Management: Call QUIC flow control

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19351)

2 weeks agoQUIC Receive Stream Management
Tomas Mraz [Tue, 27 Sep 2022 12:08:43 +0000 (14:08 +0200)]
QUIC Receive Stream Management

Added SFRAME_LIST structure and QUIC_RSTREAM object to
manage received stream data.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19351)

2 weeks agoCOMP_expand_block: spelling (algorithm)
Serge Croisé [Wed, 26 Oct 2022 23:52:56 +0000 (01:52 +0200)]
COMP_expand_block: spelling (algorithm)

CLA: trivial

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/19509)

2 weeks agoFix memory leak when freeing the DTLS record layer
Matt Caswell [Mon, 7 Nov 2022 15:13:35 +0000 (15:13 +0000)]
Fix memory leak when freeing the DTLS record layer

We need to check whether the sent_messages has actually buffered any
messages in it. If not we won't free the old record layer later when we
clear out the old buffered messages and a memory leak will result.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19586)

2 weeks agoRename SSL3_RECORD to TLS_RL_RECORD
Matt Caswell [Wed, 2 Nov 2022 15:27:09 +0000 (15:27 +0000)]
Rename SSL3_RECORD to TLS_RL_RECORD

The SSL3 prefix no longer seems appropriate. We choose TLS_RL_RECORD instead
of TLS_RECORD because that type already exists elsewhere.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19586)

2 weeks agoRename SSL3_BUFFER to TLS_BUFFER
Matt Caswell [Wed, 2 Nov 2022 15:19:51 +0000 (15:19 +0000)]
Rename SSL3_BUFFER to TLS_BUFFER

The SSL3 prefix no longer seems appropriate.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19586)

2 weeks agoMove declarations out of record.h and record_local.h
Matt Caswell [Wed, 2 Nov 2022 14:56:16 +0000 (14:56 +0000)]
Move declarations out of record.h and record_local.h

We move many of the declarations in record.h and record_local.h into
locations inside ssl/record/methods instead. Also many declarations were
no longer required and could be removed completely.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19586)

2 weeks agoMove tls_pad.c into ssl/record/methods
Matt Caswell [Tue, 1 Nov 2022 15:57:56 +0000 (15:57 +0000)]
Move tls_pad.c into ssl/record/methods

This file is used by libssl record layer methods and therefore should now
be in the methods subdir

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19586)

2 weeks agoRemove references to read_mac_secret and write_mac_secret
Matt Caswell [Tue, 1 Nov 2022 15:54:30 +0000 (15:54 +0000)]
Remove references to read_mac_secret and write_mac_secret

They are no longer used and can be removed.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19586)

2 weeks agoRemove the read_iv/write_iv fields from SSL_CONNECTION
Matt Caswell [Mon, 31 Oct 2022 16:31:28 +0000 (16:31 +0000)]
Remove the read_iv/write_iv fields from SSL_CONNECTION

These fields are instead held in the new record layer code and are
therefore no longer needed.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19586)

2 weeks agoRemove compress/expand fields from SSL_CONNECTION
Matt Caswell [Mon, 31 Oct 2022 16:22:05 +0000 (16:22 +0000)]
Remove compress/expand fields from SSL_CONNECTION

They are no longer needed. The new record layer handles this.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19586)