]> git.ipfire.org Git - thirdparty/openssl.git/log
thirdparty/openssl.git
2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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)

2 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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)

2 years agoRemove remaining refs to enc_(write|read)_ctx/(read|write)_hash
Matt Caswell [Mon, 31 Oct 2022 16:04:08 +0000 (16:04 +0000)] 
Remove remaining refs to enc_(write|read)_ctx/(read|write)_hash

Those fields are no longer used. Their previous function is now in the new
record layer.

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

2 years agouse OSSL_PARAM_construct_uint32 for max_early_data
J.W. Jagersma [Thu, 10 Nov 2022 16:46:40 +0000 (17:46 +0100)] 
use OSSL_PARAM_construct_uint32 for max_early_data

Otherwise, this causes a warning on platforms where 'uint32_t' is
defined as 'unsigned long int' instead of 'unsigned int'.

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

2 years agodjgpp: Fix unused-but-set-variable warning
J.W. Jagersma [Sat, 1 Oct 2022 18:14:48 +0000 (20:14 +0200)] 
djgpp: Fix unused-but-set-variable warning

I chose to just hide this behind '#ifndef __DJGPP__', instead of listing
all the macro combinations where it *is* used.  That would make quite a
mess.

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

2 years agodjgpp: Skip check for negative timeval
J.W. Jagersma [Sat, 1 Oct 2022 17:03:11 +0000 (19:03 +0200)] 
djgpp: Skip check for negative timeval

This causes a warning since tv_sec is unsigned.

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

2 years agoDefine threads_lib.c functions only for OPENSSL_SYS_UNIX
J.W. Jagersma [Sat, 1 Oct 2022 17:01:40 +0000 (19:01 +0200)] 
Define threads_lib.c functions only for OPENSSL_SYS_UNIX

This matches the declaration in <openssl/crypto.h>.

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

2 years agoCast socklen_t to size_t in assert comparison
J.W. Jagersma [Sat, 1 Oct 2022 16:44:38 +0000 (18:44 +0200)] 
Cast socklen_t to size_t in assert comparison

This causes a warning otherwise when socklen_t is signed (Watt32).

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

2 years agoCast values to match printf format strings.
J.W. Jagersma [Sat, 1 Oct 2022 16:41:44 +0000 (18:41 +0200)] 
Cast values to match printf format strings.

For some reason djgpp uses '(unsigned) long int' for (u)int32_t.  This
causes errors with -Werror=format, even though these types are in
practice identical.

Obvious solution: cast to the types indicated by the format string.

For asn1_time_test.c I changed the format string to %lli since time_t
may be 'long long' some platforms.

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

2 years agoResign test/certs/rootCA.pem to expire in 100 years
Bernd Edlinger [Thu, 10 Nov 2022 17:51:44 +0000 (18:51 +0100)] 
Resign test/certs/rootCA.pem to expire in 100 years

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

2 years agoUpdate the validity period of ed25519 cerificates
Bernd Edlinger [Thu, 10 Nov 2022 17:23:25 +0000 (18:23 +0100)] 
Update the validity period of ed25519 cerificates

Note: The private key is test/certs/root-ed25519.privkey.pem

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

2 years agotest_CMAC_keygen(): Avoid using ECB cipher with CMAC
Tomas Mraz [Wed, 12 Oct 2022 10:22:25 +0000 (12:22 +0200)] 
test_CMAC_keygen(): Avoid using ECB cipher with CMAC

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19401)

2 years agocmac_set_ctx_params(): Fail if cipher mode is not CBC
Tomas Mraz [Wed, 12 Oct 2022 09:30:56 +0000 (11:30 +0200)] 
cmac_set_ctx_params(): Fail if cipher mode is not CBC

Also add negative test cases for CMAC and GMAC using
a cipher with wrong mode.

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19401)

2 years agodemos/mac/cmac-aes256: Clarify the cipher algorithm used
Tomas Mraz [Wed, 12 Oct 2022 09:26:43 +0000 (11:26 +0200)] 
demos/mac/cmac-aes256: Clarify the cipher algorithm used

The currently used cipher is aes256 which is an alias to AES-256-CBC,
so the demo is correct.
However it might be misleading so make it clear the CBC mode
cipher is used.

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19401)

2 years agoAdd test for generating safeprime DH parameters
Tomas Mraz [Wed, 9 Nov 2022 12:36:21 +0000 (13:36 +0100)] 
Add test for generating safeprime DH parameters

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

2 years agoUse libctx when generating DH parameters
Tomas Mraz [Wed, 9 Nov 2022 09:55:48 +0000 (10:55 +0100)] 
Use libctx when generating DH parameters

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

2 years agofuzz: add punycode decoder fuzz test
Pauli [Thu, 3 Nov 2022 21:43:38 +0000 (08:43 +1100)] 
fuzz: add punycode decoder fuzz test

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

2 years agopunycode: update to use WPACKET instead of using custom range checking
Pauli [Thu, 3 Nov 2022 00:55:13 +0000 (11:55 +1100)] 
punycode: update to use WPACKET instead of using custom range checking

Add test for `.' overflows, remove the output size argument from
ossl_a2ulabel() since it was never used and greatly complicated the code.
Convert ossl_a2ulabel() to use WPACKET for building the output string.
Update the documentation to match the new definition of ossl_a2ulabel().

x509: let punycode handle the '\0' string termination.  Saves a memset(3)
and some size fiddling.  Also update to deal with the modified parameters.

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

2 years agopem: avoid segfault if PKEY is NULL in PEM_write_bio_PrivateKey
Milan Broz [Sat, 29 Oct 2022 09:48:51 +0000 (11:48 +0200)] 
pem: avoid segfault if PKEY is NULL in PEM_write_bio_PrivateKey

Make the code more robust and correctly handle EVP_PKEY set to NULL
instead of dereferencing null pointer.

Signed-off-by: Milan Broz <gmazyland@gmail.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19536)

2 years agopem: fix a memory leak in PEM_write_bio_PrivateKey_traditional
Milan Broz [Sat, 29 Oct 2022 09:46:34 +0000 (11:46 +0200)] 
pem: fix a memory leak in PEM_write_bio_PrivateKey_traditional

The copy of PKEY should be released on the error path.
Easily reproduced with "ED448" context.

Signed-off-by: Milan Broz <gmazyland@gmail.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19536)

2 years agoLimit size of modulus for BN_mod_exp_mont_consttime()
Tomas Mraz [Tue, 8 Nov 2022 16:43:22 +0000 (17:43 +0100)] 
Limit size of modulus for BN_mod_exp_mont_consttime()

Otherwise the powerbufLen can overflow.

Issue reported by Jiayi Lin.

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

2 years agoRevert "Skip DES based tests in FIPS mode"
Pauli [Wed, 9 Nov 2022 00:31:50 +0000 (11:31 +1100)] 
Revert "Skip DES based tests in FIPS mode"

This reverts commit 5db2b4a292b4576185287a9e01e4ba4098b4aa66.

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

2 years agoRevert "Remove conditional FIPS dependence for 3DES"
Pauli [Tue, 8 Nov 2022 22:54:02 +0000 (09:54 +1100)] 
Revert "Remove conditional FIPS dependence for 3DES"

This reverts commit 464c1011b02936850fc779739013dba52650840a.

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

2 years agoRevert "Move DES based test cases out of FIPS territory"
Pauli [Tue, 8 Nov 2022 22:53:21 +0000 (09:53 +1100)] 
Revert "Move DES based test cases out of FIPS territory"

This reverts commit c511953a0828e126b80a9ea8cee12d001d685ba8.

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