]> git.ipfire.org Git - thirdparty/openssl.git/log
thirdparty/openssl.git
14 months agofirst cut at sigalg loading
Michael Baentsch [Mon, 26 Sep 2022 15:32:05 +0000 (17:32 +0200)] 
first cut at sigalg loading

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

14 months agotest/recipes/01-test_symbol_presence.t: check for duplicate symbols in static libs
Richard Levitte [Sat, 18 Feb 2023 10:22:39 +0000 (11:22 +0100)] 
test/recipes/01-test_symbol_presence.t: check for duplicate symbols in static libs

This checks that all symbols are unique across all public static libraries.
This includes a bit of refacftoring to avoid repeating code too much.

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

14 months agoAdd help for pkeyopt values for the genpkey commandline app.
slontis [Thu, 15 Dec 2022 02:13:55 +0000 (12:13 +1000)] 
Add help for pkeyopt values for the genpkey commandline app.

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

14 months agoSkip subdirectories in SSL_add_dir_cert_subjects_to_stack()
olszomal [Tue, 21 Feb 2023 13:20:24 +0000 (14:20 +0100)] 
Skip subdirectories in SSL_add_dir_cert_subjects_to_stack()

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

14 months agoFixes #20278: Fixed double free bug in crypto/http/http_client.c
Jeeban Sethi [Tue, 21 Feb 2023 16:01:43 +0000 (21:31 +0530)] 
Fixes #20278: Fixed double free bug in crypto/http/http_client.c

CLA: trivial

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

14 months agoTest that QUIC has the ciphersuites that we expect
Matt Caswell [Thu, 26 Jan 2023 18:23:32 +0000 (18:23 +0000)] 
Test that QUIC has the ciphersuites that we expect

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

14 months agoDon't send ciphersuites twice in QUIC
Matt Caswell [Thu, 26 Jan 2023 17:53:30 +0000 (17:53 +0000)] 
Don't send ciphersuites twice in QUIC

QUIC TLS was sending some ciphersuites twice in the ClientHello. This
was due to us declaring some TLSv1.3 ciphersuites in the list intended to
describe the TLSv1.2 ciphersuites supported by the SSL_METHOD.

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

14 months agoCI: add Clang 16
Sam James [Tue, 21 Feb 2023 00:37:57 +0000 (00:37 +0000)] 
CI: add Clang 16

Clang 16 will be released shortly (beginning of March).

Signed-off-by: Sam James <sam@gentoo.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20346)

14 months agoFix potential NULL pointer dereference in function evp_pkey_asn1_ctrl
zhailiangliang [Wed, 15 Feb 2023 02:43:01 +0000 (10:43 +0800)] 
Fix potential NULL pointer dereference in function evp_pkey_asn1_ctrl

CLA: trivial

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

14 months agoAdd const to some test tserver functions
Matt Caswell [Mon, 6 Feb 2023 15:56:33 +0000 (15:56 +0000)] 
Add const to some test tserver functions

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

14 months agoRename various functions OSSL_QUIC_FAULT -> QTEST_FAULT
Matt Caswell [Mon, 6 Feb 2023 15:34:05 +0000 (15:34 +0000)] 
Rename various functions OSSL_QUIC_FAULT -> QTEST_FAULT

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

14 months agoDon't declare SSL_CONNECTION twice
Matt Caswell [Thu, 26 Jan 2023 15:19:40 +0000 (15:19 +0000)] 
Don't declare SSL_CONNECTION twice

It causes problems with some compilation options

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

14 months agoEnsure calling BIO_recvmmsg() with a dgram pair reports errors
Matt Caswell [Thu, 26 Jan 2023 14:55:28 +0000 (14:55 +0000)] 
Ensure calling BIO_recvmmsg() with a dgram pair reports errors

When calling BIO-recvmmsg() and using a dgram pair we were failing to
raise an error in the case that a problem occurs. This means that the
reason behind a failure cannot be detected and all problems are treated
as fatal even if they may not be.

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

14 months agoAdd a helper function to prepend a frame to a packet
Matt Caswell [Tue, 17 Jan 2023 15:16:42 +0000 (15:16 +0000)] 
Add a helper function to prepend a frame to a packet

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

14 months agoAdd explanatory comments to say what happens during resizing of buffers
Matt Caswell [Wed, 11 Jan 2023 16:08:53 +0000 (16:08 +0000)] 
Add explanatory comments to say what happens during resizing of buffers

Explain that buffers are over allocated to being with, so a resize is a
logical resize only. Buffer addresses never change.

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

14 months agoAdd a qtest_check_server_transport_err helper function
Matt Caswell [Wed, 11 Jan 2023 16:04:25 +0000 (16:04 +0000)] 
Add a qtest_check_server_transport_err helper function

Allows tests to check that a given transport error was received by the
server.

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

14 months agoExtend the corruption test to truncate a datagram
Matt Caswell [Wed, 11 Jan 2023 15:14:52 +0000 (15:14 +0000)] 
Extend the corruption test to truncate a datagram

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

14 months agoAdd the capability to listen for datagrams
Matt Caswell [Tue, 10 Jan 2023 18:55:05 +0000 (18:55 +0000)] 
Add the capability to listen for datagrams

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

14 months agoDon't treat the Tserver as connected until the handshake is confirmed
Matt Caswell [Tue, 10 Jan 2023 17:52:18 +0000 (17:52 +0000)] 
Don't treat the Tserver as connected until the handshake is confirmed

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

14 months agoAdd a test for a corrupted packet
Matt Caswell [Tue, 10 Jan 2023 16:22:20 +0000 (16:22 +0000)] 
Add a test for a corrupted packet

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

14 months agoEnable the fault injector to add faults to post-encryption packets
Matt Caswell [Mon, 12 Dec 2022 16:52:50 +0000 (16:52 +0000)] 
Enable the fault injector to add faults to post-encryption packets

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

14 months agoExpand some comments in the header file
Matt Caswell [Fri, 9 Dec 2022 17:00:46 +0000 (17:00 +0000)] 
Expand some comments in the header file

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

14 months agoRaise a protocol error if we have not received transport params from peer
Matt Caswell [Wed, 7 Dec 2022 16:55:21 +0000 (16:55 +0000)] 
Raise a protocol error if we have not received transport params from peer

If we complete the TLS handshake but transport params were not received
then this is a protcol error and we should fail.

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

14 months agoAdd a test for a server that doesn't provide transport params
Matt Caswell [Tue, 6 Dec 2022 16:44:09 +0000 (16:44 +0000)] 
Add a test for a server that doesn't provide transport params

Check that we fail if the server has failed to provide transport params.

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

14 months agoImplement the QUIC Fault injector support for TLS handshake messages
Matt Caswell [Fri, 2 Dec 2022 15:52:21 +0000 (15:52 +0000)] 
Implement the QUIC Fault injector support for TLS handshake messages

Provide helper functions to listen for TLS handshake messages being sent,
as well as the ability to change the contents of those messages as well as
resizing them.

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

14 months agoAdd the ability to mutate TLS handshake messages before they are written
Matt Caswell [Fri, 2 Dec 2022 14:38:46 +0000 (14:38 +0000)] 
Add the ability to mutate TLS handshake messages before they are written

We add callbacks so that TLS handshake messages can be modified by the test
framework before they are passed to the handshake hash, possibly encrypted
and written to the network. This enables us to simulate badly behaving
endpoints.

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

14 months agoAdd a test where an unknown frame type is received
Matt Caswell [Thu, 1 Dec 2022 11:52:48 +0000 (11:52 +0000)] 
Add a test where an unknown frame type is received

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

14 months agoEnable QUIC test server to find out the termination reason
Matt Caswell [Thu, 1 Dec 2022 16:37:47 +0000 (16:37 +0000)] 
Enable QUIC test server to find out the termination reason

We enable querying of the termination reason which is useful for tests.

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

14 months agoTreat unknown frames as a protocol error
Matt Caswell [Thu, 1 Dec 2022 16:36:08 +0000 (16:36 +0000)] 
Treat unknown frames as a protocol error

From RFC9000, section 19.21 "An extension to QUIC that wishes to use a new
type of frame MUST first ensure that a peer is able to understand the
frame". So if we receive an unknown frame type from a peer we should treat
it as a protocol violation. In fact we ignore it, and ignore all the
contents of the rest of the packet and continue on regardless.

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

14 months agoDon't raise an error on retryable read in a BIO_s_dgram_pair()
Matt Caswell [Thu, 1 Dec 2022 14:16:02 +0000 (14:16 +0000)] 
Don't raise an error on retryable read in a BIO_s_dgram_pair()

This results in spurious errors appearing on the queue in normal
operation, e.g. calling SSL_tick() with a QUIC connection will succeed,
but an error will end up on the queue anyway.

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

14 months agoImplement the QUIC Fault injector support for plaintext packets
Matt Caswell [Wed, 30 Nov 2022 16:41:31 +0000 (16:41 +0000)] 
Implement the QUIC Fault injector support for plaintext packets

Provider helper functions to listen for plaintext packets being sent, as
well as the ability to change the contents of those packets as well as
resizing them.

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

14 months agoAdd a skeleton quicfaultstest
Matt Caswell [Wed, 30 Nov 2022 14:21:00 +0000 (14:21 +0000)] 
Add a skeleton quicfaultstest

Also includes helper support to create a QUIC connection inside a test.

We wil use quicfaultstest to deliberately inject faulty datagrams/packets
to test how we handle them.

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

14 months agoAdd the ability to mutate QUIC packets before they are written
Matt Caswell [Tue, 29 Nov 2022 16:04:23 +0000 (16:04 +0000)] 
Add the ability to mutate QUIC packets before they are written

We add callbacks so that QUIC packets can be modified by the test
framework before they are encrypted and written to the network. This
enables us to simulate badly behaving endpoints.

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

14 months agoupdate documentation to note that EdDSA is not FIPS approved
Pauli [Mon, 20 Feb 2023 22:20:43 +0000 (09:20 +1100)] 
update documentation to note that EdDSA is not FIPS approved

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

14 months agoupdate changes entry to note EdDSA is not FIPS approved
Pauli [Mon, 20 Feb 2023 22:20:22 +0000 (09:20 +1100)] 
update changes entry to note EdDSA is not FIPS approved

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

14 months agoRevert "Put EdDSA back as approved algorithms."
Pauli [Mon, 20 Feb 2023 22:11:44 +0000 (09:11 +1100)] 
Revert "Put EdDSA back as approved algorithms."

This reverts commit 09627a8ceb69e19d2855b36228f44a3660af177a.

NIST isn't allowing EdDSA at this stage after all, so flag it as not
FIPS approved in the FIPS provider.  Guidance for FIPS 140-3 is expected
later this month:

    The use of EdDSA still remains non-approved.

    Before the FIPS 186-5 and SP 800-186 algorithms / curves can be
    used in the approved mode, the CMVP will need to do (at least)
    the following:

    * Incorporate FIPS 186-5 and SP 800-186 into SP 800-140C/D;

    * Update IG 10.3.A to incorporate self-test requirements for the
      new algorithms/curves.

    * Write a new IG on this transition to clarify the issues raised in
      this thread and elsewhere and provide a clear transition schedule.

    The CMVP is working on all three of these items and hope to have
    drafts public by the end of March.

    Since security relevant changes are not permitted for new 140-2
    submissions, and under the assumption that this transition away
    from FIPS 186-4 algorithms will be 'soft' and not move modules to
    the historical list, we do not plan on writing 140-2 guidance for
    this transition.

It seems unlikely that all of these requirements will be completed before
we submit.

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

14 months agoAdd a test for no initialisation of the default config file
Matt Caswell [Mon, 20 Feb 2023 17:22:57 +0000 (17:22 +0000)] 
Add a test for no initialisation of the default config file

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

14 months agoOnly call OPENSSL_init_crypto on fetch if using the default libctx
Matt Caswell [Mon, 20 Feb 2023 14:47:20 +0000 (14:47 +0000)] 
Only call OPENSSL_init_crypto on fetch if using the default libctx

There is no point in calling OPENSSL_init_crypto() unless we are actually
going to be using the default libctx.

Fixes #20315

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

14 months agoDocument return value of OSSL_DECODER_from_data
Benno Evers [Fri, 17 Feb 2023 12:03:19 +0000 (13:03 +0100)] 
Document return value of OSSL_DECODER_from_data

CLA: trivial

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20327)

14 months agoFix incorrect error branch in ossl_bn_rsa_fips186_4_derive_prime()
ndossche [Mon, 13 Feb 2023 14:27:25 +0000 (15:27 +0100)] 
Fix incorrect error branch in ossl_bn_rsa_fips186_4_derive_prime()

BN_priv_rand_range_ex() and BN_add() both return a 0 on failure and a 1
on success. In case of failure, the algorithm should fail. However, the
branch that it goes through on failure is "goto end", not "goto err".
Therefore, the algorithm will return 1 which indicates success instead
of 0 for failure, leading to potential problems for the callers.
Fix it by changing the goto to "goto err" instead of "goto end".

CLA: trivial

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from https://github.com/openssl/openssl/pull/20279)

14 months agofuzz: fix coverity warnings
Philippe Antoine [Thu, 9 Feb 2023 14:21:59 +0000 (15:21 +0100)] 
fuzz: fix coverity warnings

introduced by 2b9e2afc382490592078cdb69d06f54f0fefd4c6

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

14 months agoopenssl#20299: Fixed use after free bug
Jeeban Sethi [Wed, 15 Feb 2023 18:57:12 +0000 (00:27 +0530)] 
openssl#20299: Fixed use after free bug

CLA: trivial

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from https://github.com/openssl/openssl/pull/20300)

14 months agoFix possible memory leak on error
Todd Short [Thu, 16 Feb 2023 15:56:29 +0000 (10:56 -0500)] 
Fix possible memory leak on error

The two places that call `ossl_ssl_init()` assume that no additional
memory has been allocated when this fails; they subsequently free
the QUIC_CONNECTION/SSL_CONNECTION via OPENSSL_free() without freeing
any other resources.

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

14 months agoFix failing cms test when no-des is used
Bernd Edlinger [Mon, 13 Feb 2023 11:58:33 +0000 (12:58 +0100)] 
Fix failing cms test when no-des is used

The test tries to use DES but that may not be available.
But for the purpose of regression testing CVE-2023-0215
the cipher is not relevant, so we use AES-128 instead.

Fixes #20249

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from https://github.com/openssl/openssl/pull/20276)

14 months agoopenssl-3.0#20290: Fixed typo in "config" man page
Jeeban Sethi [Thu, 16 Feb 2023 12:00:45 +0000 (17:30 +0530)] 
openssl-3.0#20290: Fixed typo in "config" man page

CLA: trivial

Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20311)

(cherry picked from commit 3da073c405e2d2000188571c23f3a79cf67a6e9d)

14 months agokbkdf: Fix kbkdf_dup function pointer type
Clemens Lang [Thu, 16 Feb 2023 14:20:43 +0000 (15:20 +0100)] 
kbkdf: Fix kbkdf_dup function pointer type

kbkdf_dup should use the appropriate type OSSL_FUNC_kdf_dupctx_fn.

Signed-off-by: Clemens Lang <cllang@redhat.com>
Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20314)

14 months agoUse of sparse_array.c only in the shared libssl
Richard Levitte [Wed, 8 Feb 2023 07:23:41 +0000 (08:23 +0100)] 
Use of sparse_array.c only in the shared libssl

Conditioning it on $disabled{shared} isn't right, it will still end up
in the static variant of the library.  It's better to use SHARED_SOURCE
for these sorts of things.

Fixes #20238

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Ben Kaduk <kaduk@mit.edu>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20240)

14 months agoOSSL_CMP_certConf_cb(): fix regression on checking newly enrolled cert
Dr. David von Oheimb [Fri, 27 Jan 2023 20:17:50 +0000 (21:17 +0100)] 
OSSL_CMP_certConf_cb(): fix regression on checking newly enrolled cert

Also add corresponding tests and to this end update credentials

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

15 months agoCorrect a copy&paste error in a link URL
Tomas Mraz [Wed, 8 Feb 2023 07:47:15 +0000 (08:47 +0100)] 
Correct a copy&paste error in a link URL

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

15 months agoSync CHANGES.md and NEWS.md with 3.0.8 release
Tomas Mraz [Tue, 7 Feb 2023 16:18:54 +0000 (17:18 +0100)] 
Sync CHANGES.md and NEWS.md with 3.0.8 release

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

15 months agorsa: add msvc intrinsic for non x64 platforms
Hubert Kario [Wed, 8 Feb 2023 13:13:24 +0000 (14:13 +0100)] 
rsa: add msvc intrinsic for non x64 platforms

_umul128() is x86_64 (x64) only, while __umulh() works everywhere, but
doesn't generate optimal code on x64

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

15 months agoFix the return values of the aarch64 unroll8_eor_aes_gcm_*_*_kernel functions
Tom Cosgrove [Sat, 28 Jan 2023 18:43:30 +0000 (18:43 +0000)] 
Fix the return values of the aarch64 unroll8_eor_aes_gcm_*_*_kernel functions

These aren't currently checked when they are called in cipher_aes_gcm_hw_armv8.inc,
but they are declared as returning as size_t the number of bytes they have processed,
and the aes_gcm_*_*_kernel (unroll by 4) versions of these do return the correct
values.

Change-Id: Ic3eaf139e36e29e8779b5bd8b867c08fde37a337

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

15 months agoCMP cert_response(): add missing rejection status on client rejecting new cert
Dr. David von Oheimb [Wed, 1 Feb 2023 16:22:17 +0000 (17:22 +0100)] 
CMP cert_response(): add missing rejection status on client rejecting new cert

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

15 months agocmp_client_test.c: add tests for errors reported by server on subsequent requests...
Dr. David von Oheimb [Wed, 1 Feb 2023 14:50:54 +0000 (15:50 +0100)] 
cmp_client_test.c: add tests for errors reported by server on subsequent requests in a transaction

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

15 months agoossl_cmp_mock_srv_new.pod: correct/update names of internal test support functions
Dr. David von Oheimb [Wed, 1 Feb 2023 14:47:14 +0000 (15:47 +0100)] 
ossl_cmp_mock_srv_new.pod: correct/update names of internal test support functions

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

15 months agoOSSL_CMP_SRV_process_request(): fix recipNonce on error in subsequent request of...
Dr. David von Oheimb [Wed, 1 Feb 2023 14:43:35 +0000 (15:43 +0100)] 
OSSL_CMP_SRV_process_request(): fix recipNonce on error in subsequent request of a transaction

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

15 months agocmp_ctx.c: fix wrong comments on OSSL_CMP_CTX_set1_{recipient,issuer}
Dr. David von Oheimb [Wed, 1 Feb 2023 14:39:52 +0000 (15:39 +0100)] 
cmp_ctx.c: fix wrong comments on OSSL_CMP_CTX_set1_{recipient,issuer}

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

15 months agoCMP check_transactionID_or_nonce(): fix reason code on unmatched recipNonce
Dr. David von Oheimb [Wed, 1 Feb 2023 14:37:21 +0000 (15:37 +0100)] 
CMP check_transactionID_or_nonce(): fix reason code on unmatched recipNonce

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

15 months agoossl_cmp_msg_check_update(): fix two wrong error return values (-1 instead of 0)
Dr. David von Oheimb [Wed, 1 Feb 2023 14:36:25 +0000 (15:36 +0100)] 
ossl_cmp_msg_check_update(): fix two wrong error return values (-1 instead of 0)

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

15 months agotest_get_libctx(): prevent crash when called with NULL provider arg
Dr. David von Oheimb [Wed, 1 Feb 2023 14:34:19 +0000 (15:34 +0100)] 
test_get_libctx(): prevent crash when called with NULL provider arg

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

15 months agoFix BIO_set_indent() check
Niels Dossche [Wed, 1 Feb 2023 14:06:12 +0000 (15:06 +0100)] 
Fix BIO_set_indent() check

This function returns an errorcode <= 0, but only < 0 is checked. Other
callers that check the return value perform this check correctly. Fix it
by changing the check to <= 0.

CLA: trivial

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

15 months agoAdd tests for FIPS keygen self test failures.
slontis [Tue, 31 Jan 2023 23:19:02 +0000 (09:19 +1000)] 
Add tests for FIPS keygen self test failures.

During key generation RSA, EC and DSA have extra tests that run in FIPS mode
All 3 algorithms have a pairwise test, EC & DSA also run a KAT test.

This test uses the self test callback to force an error
during each of the extra pairwise and KAT tests.

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

15 months agoFix incomplete BIO_dup_state() error check
ndossche [Thu, 2 Feb 2023 13:02:34 +0000 (14:02 +0100)] 
Fix incomplete BIO_dup_state() error check

BIO_dup_state() returns an error code <= 0 according to my analysis tool
and the documentation. Currently only == 0 is checked. Fix it by
changing the check condition.

CLA: trivial

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

15 months agoFix incomplete check on CMS_SharedInfo_encode
ndossche [Tue, 31 Jan 2023 15:30:26 +0000 (16:30 +0100)] 
Fix incomplete check on CMS_SharedInfo_encode

CMS_SharedInfo_encode() can also return a negative error value, but this
is not checked in the current check, only the zero error return value is
covered. A previous PR [1] fixed the other caller's check of
CMS_SharedInfo_encode in this file, but it seems like this place was
missed. Fix it by changing the check to <= 0.

[1] https://github.com/openssl/openssl/pull/12628/commits/a752fc4da5e1dfd5b3a730d95272c2e2b0c48f1a

CLA: trivial

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

15 months agoFix error check on default_check() helper function
ndossche [Mon, 30 Jan 2023 14:24:01 +0000 (15:24 +0100)] 
Fix error check on default_check() helper function

default_check() can return a zero value to indicate an internal error in
one condition for the PRE_CTRL_STR_TO_PARAMS state. This state can be
reached from the default_fixup_args() function which does not check for
a zero value. All other callers of default_check() in that file do check
for a zero return value. Fix it by changing the check to <= 0.

CLA: trivial

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

15 months agoApply aes-gcm unroll8+eor3 optimization patch to Neoverse V2
Xiaokang Qian [Sun, 29 Jan 2023 06:22:43 +0000 (06:22 +0000)] 
Apply aes-gcm unroll8+eor3 optimization patch to Neoverse V2

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

15 months agoS390x: Support ME and CRT offloading
Juergen Christ [Fri, 20 Jan 2023 16:43:59 +0000 (17:43 +0100)] 
S390x: Support ME and CRT offloading

S390x has to ability to offload modular exponentiation and CRT operations to
Crypto Express Adapters.  This possible performance optimization was not yet
used by OpenSSL.  Add support for offloading and implement an optimized
version of RSA and DH with it.

The environment variable OPENSSL_s390xcap now recognizes the token "nocex" to
prevent offloading.

Signed-off-by: Juergen Christ <jchrist@linux.ibm.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20113)

15 months agoFix incomplete error check on BIO_set_md()
ndossche [Thu, 2 Feb 2023 15:11:16 +0000 (16:11 +0100)] 
Fix incomplete error check on BIO_set_md()

BIO_set_md() can return an error value <= 0 according to my analysis
tool and the documentation. But only an error value == 0 is currently
checked. Fix it by changing the check condition.

CLA: trivial

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

15 months agoCMS_decrypt_set1_*(): fix NULL deref on unsuitable content type
Dr. David von Oheimb [Mon, 2 Jan 2023 12:05:08 +0000 (13:05 +0100)] 
CMS_decrypt_set1_*(): fix NULL deref on unsuitable content type

Fixes #19975
for CMS_decrypt_set1_pkey_and_peer() in the obvious way,
and a related potential crash in CMS_decrypt_set1_password().

The point is that the input might have an unexpected content type,
so a guard is needed at both places after `ec` is obtained.

Note that in CMS_decrypt_set1_pkey_and_peer() there was
no such ec != NULL guard for
```
    if (ris != NULL)
        debug = ec->debug;
```
maybe because it is implied here by ris != NULL.

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

15 months agoAdd coverage test for ossl_rsa_sp800_56b_derive_params_from_pq
slontis [Thu, 2 Feb 2023 23:37:51 +0000 (09:37 +1000)] 
Add coverage test for ossl_rsa_sp800_56b_derive_params_from_pq

This test runs the error path for the above function.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from https://github.com/openssl/openssl/pull/20200)

15 months agoCMP app and doc: improve texts on (un-)trusted certs, srvCert, etc.
Dr. David von Oheimb [Mon, 19 Dec 2022 09:56:50 +0000 (10:56 +0100)] 
CMP app and doc: improve texts on (un-)trusted certs, srvCert, etc.

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19946)

15 months agoNew function EC_GROUP_to_params to convert an EC_GROUP to an array of OSSL_PARAM.
Oliver Mihatsch [Thu, 2 Feb 2023 11:15:14 +0000 (12:15 +0100)] 
New function EC_GROUP_to_params to convert an EC_GROUP to an array of OSSL_PARAM.

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

15 months agocheck-format.pl: fix statistics on whitespace and nesting issues
Dr. David von Oheimb [Wed, 30 Nov 2022 20:11:48 +0000 (21:11 +0100)] 
check-format.pl: fix statistics on whitespace and nesting issues

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

15 months agocheck-format.pl: fix detection of '#ifdef __cplusplus'
Dr. David von Oheimb [Wed, 30 Nov 2022 20:12:20 +0000 (21:12 +0100)] 
check-format.pl: fix detection of '#ifdef __cplusplus'

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

15 months agocheck-format.pl: fix detection of function body start
Dr. David von Oheimb [Wed, 30 Nov 2022 20:07:40 +0000 (21:07 +0100)] 
check-format.pl: fix detection of function body start

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

15 months agoRationalize FIPS sources
Tomas Mraz [Fri, 11 Nov 2022 15:18:48 +0000 (16:18 +0100)] 
Rationalize FIPS sources

Avoid including QUIC related stuff in the FIPS sources.
Also avoid including libssl headers in ssl3_cbc.c.

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

15 months agoAdd Tests for RSA_sign_ASN1_OCTET_STRING & RSA_verify_ASN1_OCTET_STRING
slontis [Mon, 6 Feb 2023 04:26:23 +0000 (14:26 +1000)] 
Add Tests for RSA_sign_ASN1_OCTET_STRING & RSA_verify_ASN1_OCTET_STRING

Note: Internally RSA_sign_ASN1_OCTET_STRING() is used with
RSA signing only when the digest is MDC2,
and RSA_verify_ASN1_OCTET_STRING() is unused.

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

15 months agoAdd more punycode tests and remove ossl_a2ucompare()
slontis [Tue, 31 Jan 2023 00:50:22 +0000 (10:50 +1000)] 
Add more punycode tests and remove ossl_a2ucompare()

The unused and untested internal function ossl_a2ucompare() has been
removed.

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

15 months agofuzz: make post handshake reachable
Philippe Antoine [Wed, 25 Jan 2023 14:43:50 +0000 (15:43 +0100)] 
fuzz: make post handshake reachable

So that CVE-2021-3449 can be found through fuzzing

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
(Merged from https://github.com/openssl/openssl/pull/20128)

15 months agoDocument limits on static and dynamic linking for HPE NonStop platforms.
Randall S. Becker [Wed, 21 Dec 2022 17:32:32 +0000 (10:32 -0700)] 
Document limits on static and dynamic linking for HPE NonStop platforms.

Documentation is necessary as static and dynamic linking cause SIGSEGV
during atexit() processing on the platform.

Fixes: 19951
Signed-off-by: Randall S. Becker <randall.becker@nexbridge.ca>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19952)

(cherry picked from commit e80518db6d52f9e6faec09df7c25f08a74e8aec2)

15 months agoFix a potential memory leak in apps/s_server.c
besher [Sat, 4 Feb 2023 23:08:14 +0000 (00:08 +0100)] 
Fix a potential memory leak in apps/s_server.c

Allocate memory for a new SSL session.
If any of these steps fail,
free the key memory and the tmpsess object
before returning 0 to prevent a memory leak.

Fixes: #20110
CLA: trivial

Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from https://github.com/openssl/openssl/pull/20213)

15 months agoFix incomplete error check on BIO_set_accept_name()
ndossche [Fri, 3 Feb 2023 12:43:03 +0000 (13:43 +0100)] 
Fix incomplete error check on BIO_set_accept_name()

BIO_set_accept_name() can return error values -1 and 0 according to
my analysis tool and the documentation. Documentation says a value of 1
indicates success. Currently, only an error value != 0 is checked which
erroneously interprets a -1 error return value as success.
Fix it by changing the check condition.

CLA: trivial

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

15 months agoRestrict the Arm 'LDR REG, =VALUE' pseudo instruction on Neon, to appease clang
Tom Cosgrove [Mon, 6 Feb 2023 08:32:46 +0000 (08:32 +0000)] 
Restrict the Arm 'LDR REG, =VALUE' pseudo instruction on Neon, to appease clang

Unlike gcc, the clang assembler has issues with the maximum value of the literal
in the `ldr REG, #VALUE` pseudo-instruction (where the assembler places the
value into a literal pool and generates a PC-relative load from that pool) when
used with Neon registers.

Specifically, while dN refers to 64-bit Neon registers, and qN refers to 128-bit
Neon registers, clang assembly only supports a maximum of 32-bit loads to
either with this instruction.

Therefore restrict accordingly to avoid breakage when building with clang.

clang appears to support the correct maximums with the scalar registers xN etc.

This will prevent the kind of breakage we saw when #19914 was merged (which has
since been fixed by #20202) - assembly authors will need to manually apply the
literal load, as is done in #20202.

None of the Arm assembler code uses this pseudo-instruction anyway, as it
doesn't seem to avoid duplication of constants.

Change-Id: If52f6ce22c10feb1cc334d996ff71b1efed3218e

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

15 months agoci: Add djgpp build
J.W. Jagersma [Wed, 28 Sep 2022 18:12:55 +0000 (20:12 +0200)] 
ci: Add djgpp build

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

15 months agodes: prevent error when using two key triple DES with a random key
Pauli [Mon, 6 Feb 2023 22:29:57 +0000 (09:29 +1100)] 
des: prevent error when using two key triple DES with a random key

Two key 3DES only sets two keys and the random generation errors out if fewer
than three keys are required.  It shouldn't.

Fixes #20212

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

15 months agoFix more VMS inclusions
Richard Levitte [Thu, 2 Feb 2023 16:51:26 +0000 (17:51 +0100)] 
Fix more VMS inclusions

inclusing quic/quic_local.h from ssl/ssl_lib.c presented another challenge
for the current VMS C.  Since ssl/quic/quic_local.h in turn includes
../ssl_local.h, we compensated for with the usual whack-a-mole in
Configurations/descrip.mms.tmpl.

As far as my personal tests go, this seems to be the last fix of this sort,
so far.

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

15 months agoInternaly declare the DSA type for no-deprecated builds
Tomas Mraz [Fri, 3 Feb 2023 13:57:04 +0000 (14:57 +0100)] 
Internaly declare the DSA type for no-deprecated builds

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(cherry picked from commit 7a21a1b5fa2dac438892cf3292d1f9c445d870d9)
(cherry picked from commit 2ad9928170768653d19d81881deabc5f9c1665c0)

15 months agoremove EdDSA from changes entry about non-fips algorithms
Pauli [Sun, 5 Feb 2023 20:46:22 +0000 (07:46 +1100)] 
remove EdDSA from changes entry about non-fips algorithms

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/20219)

15 months agodoc: remove EdDSA from list of non-FIPS algorithms.
Pauli [Sun, 5 Feb 2023 20:44:36 +0000 (07:44 +1100)] 
doc: remove EdDSA from list of non-FIPS algorithms.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/20219)

15 months agoPut EdDSA back as approved algorithms.
Pauli [Sun, 5 Feb 2023 20:39:49 +0000 (07:39 +1100)] 
Put EdDSA back as approved algorithms.

With FIPS 186-5 being published, these can again be validated.
https://csrc.nist.gov/publications/detail/fips/186/5/final

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/20219)

15 months agoEnable some disabled __owurs
Dmitry Belyavskiy [Thu, 24 Jun 2021 17:23:07 +0000 (19:23 +0200)] 
Enable some disabled __owurs

Fixes #15902

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

15 months agoAdditional testcase for missing return check of BIO_set_md() calls
Tomas Mraz [Thu, 19 Jan 2023 07:37:53 +0000 (08:37 +0100)] 
Additional testcase for missing return check of BIO_set_md() calls

This tests the handling of PKCS7 signedAndEnveloped type.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
15 months agoSupport signedAndEnveloped content in PKCS7_decrypt()
Tomas Mraz [Wed, 18 Jan 2023 17:07:55 +0000 (18:07 +0100)] 
Support signedAndEnveloped content in PKCS7_decrypt()

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
15 months agoAdd testcase for missing return check of BIO_set_md() calls
Tomas Mraz [Wed, 18 Jan 2023 16:07:24 +0000 (17:07 +0100)] 
Add testcase for missing return check of BIO_set_md() calls

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
15 months agopk7_doit.c: Check return of BIO_set_md() calls
Tomas Mraz [Wed, 18 Jan 2023 08:27:53 +0000 (09:27 +0100)] 
pk7_doit.c: Check return of BIO_set_md() calls

These calls invoke EVP_DigestInit() which can fail for digests
with implicit fetches. Subsequent EVP_DigestUpdate() from BIO_write()
or EVP_DigestFinal() from BIO_read() will segfault on NULL
dereference. This can be triggered by an attacker providing
PKCS7 data digested with MD4 for example if the legacy provider
is not loaded.

If BIO_set_md() fails the md BIO cannot be used.

CVE-2023-0401

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
15 months agoFix GENERAL_NAME_cmp for x400Address (master)
Hugo Landau [Tue, 17 Jan 2023 17:45:42 +0000 (17:45 +0000)] 
Fix GENERAL_NAME_cmp for x400Address (master)

CVE-2023-0286

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
15 months agoAdd test for DSA pubkey without param import and check
Tomas Mraz [Fri, 13 Jan 2023 17:46:15 +0000 (18:46 +0100)] 
Add test for DSA pubkey without param import and check

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
15 months agoDo not create DSA keys without parameters by decoder
Tomas Mraz [Fri, 13 Jan 2023 16:59:52 +0000 (17:59 +0100)] 
Do not create DSA keys without parameters by decoder

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
15 months agoPrevent creating DSA and DH keys without parameters through import
Tomas Mraz [Fri, 13 Jan 2023 16:57:59 +0000 (17:57 +0100)] 
Prevent creating DSA and DH keys without parameters through import

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
15 months agoFix NULL deference when validating FFC public key.
slontis [Wed, 11 Jan 2023 01:05:04 +0000 (11:05 +1000)] 
Fix NULL deference when validating FFC public key.

Fixes CVE-2023-0217

When attempting to do a BN_Copy of params->p there was no NULL check.
Since BN_copy does not check for NULL this is a NULL reference.

As an aside BN_cmp() does do a NULL check, so there are other checks
that fail because a NULL is passed. A more general check for NULL params
has been added for both FFC public and private key validation instead.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>