]> git.ipfire.org Git - thirdparty/openssl.git/log
thirdparty/openssl.git
13 hours agoquic: fix incoming port cleanup on failure master
Nikola Pajkovsky [Mon, 4 May 2026 20:47:04 +0000 (22:47 +0200)] 
quic: fix incoming port cleanup on failure

port_make_channel() builds an incoming QUIC channel in stages: allocate
the channel, create the user SSL and inner TLS objects, optionally copy
qlog state, then initialise the channel. Under the mfail allocator,
failures in the middle of that sequence could leave ownership split
between the partially-created channel and the user SSL, leaking
allocations from ossl_quic_channel_alloc().

Make port_new_handshake_layer() return the created user SSL to
port_make_channel() and detach the borrowed channel before cleaning up
its own failures. port_make_channel() now owns the error path: it
detaches any created user SSL from the channel, frees the channel exactly
once according to whether channel initialisation already ran cleanup, and
then frees the user SSL.

Also make QUIC stream map cleanup tolerate a NULL map during partial
channel cleanup, and add a focused mfail regression test for
ossl_quic_port_create_incoming().

Fixes: https://github.com/openssl/openssl/issues/31014
Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.foundation>
Reviewed-by: Neil Horman <nhorman@openssl.org>
MergeDate: Tue May 12 12:01:04 2026
(Merged from https://github.com/openssl/openssl/pull/31038)

13 hours agoquic: check lh_QUIC_STREAM_new() return value in stream_map_init
Nikola Pajkovsky [Mon, 4 May 2026 08:44:58 +0000 (10:44 +0200)] 
quic: check lh_QUIC_STREAM_new() return value in stream_map_init

ossl_quic_stream_map_init() did not check whether lh_QUIC_STREAM_new()
succeeded. On allocation failure qsm->map would be NULL and subsequent
operations on the stream map would dereference it.

Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.foundation>
Reviewed-by: Neil Horman <nhorman@openssl.org>
MergeDate: Tue May 12 12:01:02 2026
(Merged from https://github.com/openssl/openssl/pull/31038)

20 hours agotest: add test for IV reuse in AEAD providers
Milan Broz [Thu, 7 May 2026 06:34:53 +0000 (08:34 +0200)] 
test: add test for IV reuse in AEAD providers

After EVP_EncryptFinal, AEAD providers (GCM, OCB, Chacha20-Poly1305)
transition to IV_STATE_FINISHED to prevent IV reuse.

No encryption should be possible in such state.

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
MergeDate: Tue May 12 05:14:10 2026
(Merged from https://github.com/openssl/openssl/pull/31104)

20 hours agochacha_poly: Use IV_STATE guard to prevent IV reuse
Milan Broz [Mon, 4 May 2026 14:11:32 +0000 (16:11 +0200)] 
chacha_poly: Use IV_STATE guard to prevent IV reuse

If IV was set for Chacha20-Poly1305, code should not
allow reusing IV after calling CipherFinal.

Use iv_state (as used in GCM or OCB mode) to prevent that.

Thanks to Alex Gaynor for reporting the issue.

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
MergeDate: Tue May 12 05:14:09 2026
(Merged from https://github.com/openssl/openssl/pull/31104)

40 hours agoDeprecate the ASN1_BIT_STRING name related funcitons.
Bob Beck [Wed, 15 Apr 2026 19:31:42 +0000 (13:31 -0600)] 
Deprecate the ASN1_BIT_STRING name related funcitons.

These seem to have been from something long long ago
that nothing uses anymore. It seems like this is just something
we should not be doing in this way.

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Mon May 11 09:23:13 2026
(Merged from https://github.com/openssl/openssl/pull/30853)

41 hours agoFix OOB read in EC_GROUP_new_from_params() with zero-length generator
Harry Betts [Sat, 9 May 2026 06:54:52 +0000 (16:54 +1000)] 
Fix OOB read in EC_GROUP_new_from_params() with zero-length generator

When OSSL_PKEY_PARAM_EC_GENERATOR is provided as an octet string of
length 0, buf[0] is read before validating data_size, causing a
heap-buffer-overflow detectable under ASan.

Reject zero-length generator octet strings before the dereference.

CLA: trivial
Resolves: https://github.com/openssl/openssl/issues/31125
Fixes: c0f39ded68ba "Add Explicit EC parameter support to providers."
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com>
MergeDate: Mon May 11 08:34:15 2026
(Merged from https://github.com/openssl/openssl/pull/31128)

41 hours agoAdd various MFAIL tests to excercise ht insert
Jakub Zelenka [Tue, 5 May 2026 17:56:34 +0000 (19:56 +0200)] 
Add various MFAIL tests to excercise ht insert

Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Mon May 11 08:21:56 2026
(Merged from https://github.com/openssl/openssl/pull/31092)

41 hours agoFix ignored call in ossl_rcu_call when cb item alloc fails
Jakub Zelenka [Tue, 5 May 2026 17:50:11 +0000 (19:50 +0200)] 
Fix ignored call in ossl_rcu_call when cb item alloc fails

Currently when allocation of cb item fails, the actual cb function is
not called. The is used just in hashtable when the cb function frees
the old item which result in memory leak.

To fix this, the allocation needs to be separated and happen before the
assign operation is done.

Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Mon May 11 08:21:55 2026
(Merged from https://github.com/openssl/openssl/pull/31092)

41 hours agoAdd mfail test for new BIO dgram mem
Jakub Zelenka [Fri, 8 May 2026 14:42:01 +0000 (16:42 +0200)] 
Add mfail test for new BIO dgram mem

Reviewed-by: Matt Caswell <matt@openssl.foundation>
Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Mon May 11 08:09:16 2026
(Merged from https://github.com/openssl/openssl/pull/31121)

41 hours agoFix BIO dgram pair memleak in dgram_mem_init
Jakub Zelenka [Fri, 8 May 2026 14:41:08 +0000 (16:41 +0200)] 
Fix BIO dgram pair memleak in dgram_mem_init

The created pair was not freed if ring buf init failed.

Fixes: 3a857b953216 "Implement BIO_s_dgram_mem() reusing the BIO_s_dgram_pair() code"
Reviewed-by: Matt Caswell <matt@openssl.foundation>
Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Mon May 11 08:09:14 2026
(Merged from https://github.com/openssl/openssl/pull/31121)

41 hours agoReject CR/LF in HTTP request components
OpenSSL Machine [Wed, 29 Apr 2026 13:53:25 +0000 (22:53 +0900)] 
Reject CR/LF in HTTP request components

Reject CR and LF characters before serializing request lines and HTTP
headers. This prevents malformed URL or caller supplied components
from altering the generated HTTP request.

Resolves: https://github.com/openssl/openssl/issues/31099

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Matt Caswell <matt@openssl.foundation>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
MergeDate: Mon May 11 07:44:19 2026
(Merged from https://github.com/openssl/openssl/pull/31100)

42 hours agoAdd mfail test for ossl_ffc_params_copy
Jakub Zelenka [Wed, 6 May 2026 16:25:20 +0000 (18:25 +0200)] 
Add mfail test for ossl_ffc_params_copy

Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.foundation>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Mon May 11 07:21:47 2026
(Merged from https://github.com/openssl/openssl/pull/31098)

42 hours agoFix memleak in ossl_ffc_params_copy if alloc fails
Jakub Zelenka [Wed, 6 May 2026 16:22:47 +0000 (18:22 +0200)] 
Fix memleak in ossl_ffc_params_copy if alloc fails

If allocation fails in ossl_ffc_params_copy, then the params that were
previously allocated are not freed. This results in a memory leak.

Fixes: dc8de3e6f1ee "Modify DSA and DH keys to use a shared FFC_PARAMS struct"
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.foundation>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Mon May 11 07:21:45 2026
(Merged from https://github.com/openssl/openssl/pull/31098)

42 hours agoopenssl-s_client.pod.in: remove mention of empty -alpn handling
Harry Betts [Fri, 8 May 2026 11:55:49 +0000 (21:55 +1000)] 
openssl-s_client.pod.in: remove mention of empty -alpn handling

The functionality was removed in e78253f2d0c1 "Ignore empty ALPN
elements in CLI args".

CLA: trivial
Complements: e78253f2d0c1 "Ignore empty ALPN elements in CLI args"
Resolves: https://github.com/openssl/openssl/issues/31088

Reviewed-by: Matt Caswell <matt@openssl.foundation>
Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Mon May 11 07:01:42 2026
(Merged from https://github.com/openssl/openssl/pull/31119)

2 days agoCorrect ASN1_STRING_set() behaviour to match the documentation
Bob Beck [Thu, 7 May 2026 21:30:03 +0000 (15:30 -0600)] 
Correct ASN1_STRING_set() behaviour to match the documentation

ASN1_STRING_set() has never promised to call strlen() for other
negative values.  Other values here likely indicate an error,
such as an integer overflow.  Call strlen() only if the length
provided is -1.

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com>
MergeDate: Mon May 11 00:34:25 2026
(Merged from https://github.com/openssl/openssl/pull/31113)

2 days agocrypto/evp/evp_lib.c: call va_end() in EVP_PKEY_Q_keygen() on error
Eugene Syromiatnikov [Thu, 7 May 2026 14:13:53 +0000 (16:13 +0200)] 
crypto/evp/evp_lib.c: call va_end() in EVP_PKEY_Q_keygen() on error

Instead of returning NULL immediately, jump to the cleanup at the end
of the function.  Reported by Coverity.

Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1593754
Fixes: 18472994f065 "The EVP_PKEY_Q_keygen function now explicitly handles NULL curve name"
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.foundation>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Mon May 11 00:28:25 2026
(Merged from https://github.com/openssl/openssl/pull/31107)

2 days agoquic_channel.c: fix potential memory leak on failure in ossl_quic_channel_alloc
Alexandr Nedvedicky [Thu, 9 Apr 2026 13:50:01 +0000 (15:50 +0200)] 
quic_channel.c: fix potential memory leak on failure in ossl_quic_channel_alloc

Add missing OPENSSL_free() in error path.

Fixes: 35dc6c353bf "QUIC: Make more transport parameters configurable"
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.foundation>
MergeDate: Mon May 11 00:23:13 2026
(Merged from https://github.com/openssl/openssl/pull/30754)

2 days agoDeprecate the X509_check_{email,host,ip,ip_asc} family of functions
Bob Beck [Thu, 29 Jan 2026 18:31:40 +0000 (11:31 -0700)] 
Deprecate the X509_check_{email,host,ip,ip_asc} family of functions

Our own documentation for quite some time has indicated
that you should call X509_verify_cert() instead of using these.
Actually deprecate them and make apps not use the now deprecated
functions.

Resolves: https://github.com/openssl/project/issues/1899
References: https://github.com/openssl/project/issues/1897

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Mon May 11 00:08:33 2026
(Merged from https://github.com/openssl/openssl/pull/30403)

2 days agodoc: clarify algorithm discovery in openssl-genpkey.pod.in
Zoey Chapell [Tue, 24 Mar 2026 15:30:52 +0000 (11:30 -0400)] 
doc: clarify algorithm discovery in openssl-genpkey.pod.in

Add a reference to 'openssl list -public-key-algorithms' in the
-algorithm description to improve discoverability and long term
consistency. Documentation only change.

Add clarification for how to select the naming output in the correct spot.

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
MergeDate: Sun May 10 23:59:03 2026
(Merged from https://github.com/openssl/openssl/pull/30556)

2 days agodoc: clarify -dateopt rfc_822 date format
kovan [Thu, 7 May 2026 16:02:51 +0000 (18:02 +0200)] 
doc: clarify -dateopt rfc_822 date format

The rfc_822 date output format uses an asctime-style month-first form.

It does not match RFC 822, RFC 2822, or RFC 5322.

Document the day/month ordering, RFC 822 year length, GMT timezone, and affected commands.

Resolves: https://github.com/openssl/openssl/issues/22223

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
MergeDate: Sun May 10 23:52:21 2026
(Merged from https://github.com/openssl/openssl/pull/29851)

2 days agoMove *_arch.h to include/arch
Norbert Pocs [Thu, 9 Apr 2026 11:38:07 +0000 (13:38 +0200)] 
Move *_arch.h to include/arch

Move all the architecture specific header files under a single directory
in include/

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Sun May 10 09:53:34 2026
(Merged from https://github.com/openssl/openssl/pull/30751)

4 days agoMake test/quic_fc_test.c clang-format friendly
Alexandr Nedvedicky [Wed, 6 May 2026 12:14:12 +0000 (14:14 +0200)] 
Make test/quic_fc_test.c clang-format friendly

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
MergeDate: Fri May  8 16:25:01 2026
(Merged from https://github.com/openssl/openssl/pull/31095)

4 days agoEVP_CIPHER_CTX_get_iv_length can not return a negative value
Bob Beck [Fri, 27 Mar 2026 22:14:10 +0000 (16:14 -0600)] 
EVP_CIPHER_CTX_get_iv_length can not return a negative value

but it can return 0.  Remove dead code and handle this
correctly - memcpy of 0 bytes from NULL is UB.

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
MergeDate: Fri May  8 12:15:17 2026
(Merged from https://github.com/openssl/openssl/pull/30609)

5 days agoui_openssl.c: remove unreachable _WIN32
Milan Broz [Mon, 4 May 2026 14:13:27 +0000 (14:13 +0000)] 
ui_openssl.c: remove unreachable _WIN32

noecho_fgets() is enclosed by

  #if defined(OPENSSL_SYS_MSDOS) && !defined(_WIN32)

The inner #if  defined(_WIN32) is unreachable

  #if defined(_WIN32)
          i = _getch();
  #else
          i = getch();
  #endif

Remove it.

Verified by cross compilation under DJGPP which is AFAIK the only
MSDOS/non-WIN32 environment we can use.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
MergeDate: Thu May  7 20:11:18 2026
(Merged from https://github.com/openssl/openssl/pull/31076)

5 days agobn_nist.c: remove unreachable BN_BITS2 == 64
Milan Broz [Mon, 4 May 2026 14:13:27 +0000 (14:13 +0000)] 
bn_nist.c: remove unreachable BN_BITS2 == 64

The block in BN_nist_mod_224() is gated by

  #if defined(NIST_INT64) && BN_BITS2 != 64

so the #if

  #if BN_BITS2 == 64
          rp[7] = carry;
  #endif

is unreachable. Remove it.

The code is actualy relic of an earlier design where the NIST_INT64
accumulator path was meant 64-bit too.

Disabling 64-bit path above with BN_BITS2 != 64 resulted in
#if BN_BITS2 == 64 was left unreachable

The outer condition is correct, it is meant to be 32bit only,
otherwise it would need to introduce load_u32/store_lo32 as in other
functions to avoid clang strict-aliasing optimizer issues.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
MergeDate: Thu May  7 20:11:12 2026
(Merged from https://github.com/openssl/openssl/pull/31076)

5 days agoasync_posix.h: remove unreachable OPENSSL_SYS_TANDEM
Milan Broz [Mon, 4 May 2026 14:13:26 +0000 (14:13 +0000)] 
async_posix.h: remove unreachable OPENSSL_SYS_TANDEM

The top-level #if requires !defined(OPENSSL_SYS_TANDEM):

  #if defined(OPENSSL_SYS_UNIX)                                 \
      && defined(OPENSSL_THREADS) && !defined(OPENSSL_NO_ASYNC) \
      && !defined(__ANDROID__) && !defined(__OpenBSD__)         \
      && !defined(OPENSSL_SYS_TANDEM)

so the nested

  #if defined(OPENSSL_SYS_TANDEM)
  #include <tdmsig.h>
  #else
  #include <ucontext.h>
  #endif

can never select the OPENSSL_SYS_TANDEM condition.

According to discussion on the issue 31074, removal of the second
(unreachable) condition is the way to go.

Fixes #31074

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
MergeDate: Thu May  7 20:11:08 2026
(Merged from https://github.com/openssl/openssl/pull/31076)

5 days agoMerge .inc files with header
Norbert Pocs [Mon, 4 May 2026 13:51:50 +0000 (15:51 +0200)] 
Merge .inc files with header

When the .inc is only used once, include the file at place.

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
MergeDate: Thu May  7 19:30:01 2026
(Merged from https://github.com/openssl/openssl/pull/31075)

5 days agoFix potential UB memcmps in obj_dat.c
Bob Beck [Thu, 30 Apr 2026 19:27:32 +0000 (13:27 -0600)] 
Fix potential UB memcmps in obj_dat.c

By calling the real OBJ_cmp

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
MergeDate: Thu May  7 18:14:54 2026
(Merged from https://github.com/openssl/openssl/pull/31048)

5 days agoAdd a test for a bogus SMTPUTF8 name constraint in a cert.
Bob Beck [Thu, 26 Mar 2026 20:07:06 +0000 (14:07 -0600)] 
Add a test for a bogus SMTPUTF8 name constraint in a cert.

We will reject these.

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
MergeDate: Thu May  7 16:09:48 2026
(Merged from https://github.com/openssl/openssl/pull/30329)

5 days agoForbid GEN_OTHERNAME SMTP UTF8 email name constraints.
Bob Beck [Mon, 9 Mar 2026 20:30:02 +0000 (14:30 -0600)] 
Forbid GEN_OTHERNAME SMTP UTF8 email name constraints.

RFC 9598 States:

Certificate Authorities that wish to issue CA certificates with email
address name constraints MUST use rfc822Name subject alternative names
only. These MUST be IDNA2008-conformant names with no mappings and with
non-ASCII domains encoded in A-labels only.

This appears to be to get around the confusion created if someone
attempts to encode a name constraint for an email address into the
UTF-8 version of the name

Were someone to attempt to support this, not only would you now have
to check two separate sets of name constraints for the same thing, but
would now have to decide what to do if they said different things.

So we just flag any such certficiate as invalid

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
MergeDate: Thu May  7 16:09:44 2026
(Merged from https://github.com/openssl/openssl/pull/30329)

5 days agoUpdate crypto/objects/obj_dat.pl
Bob Beck [Mon, 4 May 2026 23:59:18 +0000 (17:59 -0600)] 
Update crypto/objects/obj_dat.pl

Co-authored-by: Matt Caswell <matt@openssl.foundation>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
MergeDate: Thu May  7 15:41:15 2026
(Merged from https://github.com/openssl/openssl/pull/31046)

5 days agoDon't rely on cmp of uninitialized values in obj_dat.pl
Bob Beck [Thu, 30 Apr 2026 16:34:28 +0000 (10:34 -0600)] 
Don't rely on cmp of uninitialized values in obj_dat.pl

Since we use this for a sort, in theory this could become
inconsistent if we were to do a make update, re-generate
the output, and check it in from a different development
platform that returns different inconsistencies in how
cmp behaves on uninitialized values.

Rather than ponder this, just make this consistent
by ensuring undefined values have 0 length, and remove
the disabling of the warnings in obj_cmp

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
MergeDate: Thu May  7 15:41:12 2026
(Merged from https://github.com/openssl/openssl/pull/31046)

5 days agoThe tag value must fit into int
Tomas Mraz [Tue, 5 May 2026 15:01:42 +0000 (17:01 +0200)] 
The tag value must fit into int

We cannot allow an unbounded tag value as this is an O(n^2) algorithm
and the tag cannot be larger than INT_MAX anyway.
Fixes 35852da1d9e24cb74034b2f418cef3a58203b127

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.foundation>
Reviewed-by: Simo Sorce <simo@redhat.com>
MergeDate: Thu May  7 12:12:25 2026
(Merged from https://github.com/openssl/openssl/pull/31091)

5 days agoAdd coverage files clean up make targets
Jakub Zelenka [Mon, 4 May 2026 09:50:48 +0000 (11:50 +0200)] 
Add coverage files clean up make targets

Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
MergeDate: Thu May  7 07:09:02 2026
(Merged from https://github.com/openssl/openssl/pull/31071)

6 days agoAdd /MTd build for debug configuration for VC-noCE-common
Moryakhin Stas [Mon, 4 May 2026 13:15:43 +0000 (16:15 +0300)] 
Add /MTd build for debug configuration for VC-noCE-common

Fixes #30936

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Wed May  6 19:17:18 2026
(Merged from https://github.com/openssl/openssl/pull/31073)

6 days agoFixes #30966: return value for certain cases in EVP_cipher_get_type
Abel Tom [Sun, 26 Apr 2026 13:52:10 +0000 (15:52 +0200)] 
Fixes #30966: return value for certain cases in EVP_cipher_get_type

The function previously returned `NID_des_cfb64` even when nid of the
passed cipher was NID_des_ede3_cfb64, NID_des_ede3_cfb8,
NID_des_ede3_cfb1.

Corrected now to return `NID_des_ede3_cfb64`.

Added an extra test to verify the change.

Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Wed May  6 18:58:09 2026
(Merged from https://github.com/openssl/openssl/pull/30977)

6 days agotest: reinitialize buffer length in test_EVP_SM2
GGAutomaton [Tue, 7 Apr 2026 01:31:36 +0000 (18:31 -0700)] 
test: reinitialize buffer length in test_EVP_SM2

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Wed May  6 16:51:02 2026
(Merged from https://github.com/openssl/openssl/pull/30614)

6 days agosm2: check buffer size before writing ciphertext
GGAutomaton [Sat, 28 Mar 2026 07:41:33 +0000 (00:41 -0700)] 
sm2: check buffer size before writing ciphertext

The SM2 encryption may write past the caller-provided output buffer
when the required ciphertext size exceeds the supplied buffer length.

Reject outputs that do not fit in the caller-provided buffer.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Wed May  6 16:51:00 2026
(Merged from https://github.com/openssl/openssl/pull/30614)

6 days agoMoved the EVP_EC_gen macro to evp.h
Igor Ustinov [Tue, 14 Apr 2026 14:55:02 +0000 (16:55 +0200)] 
Moved the EVP_EC_gen macro to evp.h

Also fixed the potential NULL pointer dereference in this macro.

Reviewed-by: Matt Caswell <matt@openssl.foundation>
Reviewed-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Wed May  6 16:47:58 2026
(Merged from https://github.com/openssl/openssl/pull/30597)

6 days agoAdded the EVP_EC_affine2oct() helper function
Igor Ustinov [Tue, 14 Apr 2026 14:46:51 +0000 (16:46 +0200)] 
Added the EVP_EC_affine2oct() helper function

This function converts affine coordinates of an EC point
to an octet string conforming to Sec. 2.3.4
of the SECG SEC 1 ("Elliptic Curve Cryptography") standard.

Reviewed-by: Matt Caswell <matt@openssl.foundation>
Reviewed-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Wed May  6 16:47:57 2026
(Merged from https://github.com/openssl/openssl/pull/30597)

6 days agoThe EVP_PKEY_Q_keygen function now explicitly handles NULL curve name
Igor Ustinov [Tue, 14 Apr 2026 14:39:38 +0000 (16:39 +0200)] 
The EVP_PKEY_Q_keygen function now explicitly handles NULL curve name

It errors out with ERR_R_PASSED_NULL_PARAMETER in such case.

Reviewed-by: Matt Caswell <matt@openssl.foundation>
Reviewed-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Wed May  6 16:47:55 2026
(Merged from https://github.com/openssl/openssl/pull/30597)

6 days agoAllow 0 length comparisons in OBJ_CMP to return 0 without UB memcmp
Bob Beck [Wed, 22 Apr 2026 18:37:29 +0000 (12:37 -0600)] 
Allow 0 length comparisons in OBJ_CMP to return 0 without UB memcmp

X509_verify is documented to return -1 if the algorithm is invalid
or can't be compared for any reason.

Sadly this implies that it is legitimate to pass it an incorrect X509
object and it should see this. If we hand it a new X509 object with
nothing filled in, it will memcmp(NULL...) at the end of a stack of
FOO_cmp abstractions, which is UB.

Fix this by permitting the 0 length case to return equal without
a memcmp, as suggested by slontis@ and botovq@

Fixes: https://github.com/openssl/openssl/issues/30922
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Matt Caswell <matt@openssl.foundation>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
MergeDate: Wed May  6 14:55:20 2026
(Merged from https://github.com/openssl/openssl/pull/30943)

6 days agodoc: add documentation for BIO_nread0, BIO_nread, BIO_nwrite0, BIO_nwrite
kovan [Thu, 29 Jan 2026 14:28:59 +0000 (15:28 +0100)] 
doc: add documentation for BIO_nread0, BIO_nread, BIO_nwrite0, BIO_nwrite

Document the non-copying interface functions for BIO pairs that allow
direct access to the internal buffer:
- BIO_nread0/BIO_nread for zero-copy reading
- BIO_nwrite0/BIO_nwrite for zero-copy writing

Also add return value documentation for these functions and remove
the placeholder "[XXXXX: More return values need to be added here]".

Fixes #16366

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
MergeDate: Wed May  6 14:51:27 2026
(Merged from https://github.com/openssl/openssl/pull/29849)

6 days agoFix missing pointers in SSL_CTX_set_session_cache_mode synopsis
Nyveruus [Fri, 24 Apr 2026 21:06:03 +0000 (23:06 +0200)] 
Fix missing pointers in SSL_CTX_set_session_cache_mode synopsis

SSL_CTX_set_session_cache_mode and SSL_CTX_get_session_cache_mode
were documented with SSL_CTX ctx instead of SSL_CTX *ctx in their
synopsis.

CLA: trivial

Reviewed-by: Matt Caswell <matt@openssl.foundation>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
MergeDate: Wed May  6 11:53:35 2026
(Merged from https://github.com/openssl/openssl/pull/30965)

6 days agoAdd a CHANGES.md entry
Bob Beck [Tue, 28 Apr 2026 16:08:29 +0000 (10:08 -0600)] 
Add a CHANGES.md entry

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Wed May  6 11:36:09 2026
(Merged from https://github.com/openssl/openssl/pull/31001)

6 days agoFix accidental double guard in openssl/types.h
Bob Beck [Tue, 28 Apr 2026 15:15:10 +0000 (09:15 -0600)] 
Fix accidental double guard in openssl/types.h

The windows goo before the guard tricked my tooling

(doing stuff like this on every include is a bit icky, we should
probably fix this somehow)

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Wed May  6 11:36:08 2026
(Merged from https://github.com/openssl/openssl/pull/31001)

6 days agomake providers includes self contained
Bob Beck [Mon, 27 Apr 2026 23:54:20 +0000 (17:54 -0600)] 
make providers includes self contained

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Wed May  6 11:36:07 2026
(Merged from https://github.com/openssl/openssl/pull/31001)

6 days agoGuard include files in providers
Bob Beck [Mon, 27 Apr 2026 23:21:46 +0000 (17:21 -0600)] 
Guard include files in providers

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Wed May  6 11:36:06 2026
(Merged from https://github.com/openssl/openssl/pull/31001)

6 days agoGuard obj_mac.h from clang-format
Bob Beck [Tue, 28 Apr 2026 01:55:17 +0000 (19:55 -0600)] 
Guard obj_mac.h from clang-format

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Wed May  6 11:36:04 2026
(Merged from https://github.com/openssl/openssl/pull/31001)

6 days agoGuard charmap.h
Bob Beck [Tue, 28 Apr 2026 01:38:41 +0000 (19:38 -0600)] 
Guard charmap.h

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Wed May  6 11:36:02 2026
(Merged from https://github.com/openssl/openssl/pull/31001)

6 days agoGuard output of keysets.pl
Bob Beck [Tue, 28 Apr 2026 01:29:34 +0000 (19:29 -0600)] 
Guard output of keysets.pl

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Wed May  6 11:36:01 2026
(Merged from https://github.com/openssl/openssl/pull/31001)

6 days agoGenerate guarded bn_prime.h
Bob Beck [Tue, 28 Apr 2026 01:23:48 +0000 (19:23 -0600)] 
Generate guarded bn_prime.h

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Wed May  6 11:36:00 2026
(Merged from https://github.com/openssl/openssl/pull/31001)

6 days agoGuard and make self-contained obj_dat.h and obj_xref.h
Bob Beck [Mon, 27 Apr 2026 23:14:05 +0000 (17:14 -0600)] 
Guard and make self-contained obj_dat.h and obj_xref.h

Modifies the perl to generate them as such

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Wed May  6 11:35:59 2026
(Merged from https://github.com/openssl/openssl/pull/31001)

6 days agoMake the crypto includes self-contained
Bob Beck [Mon, 27 Apr 2026 22:50:06 +0000 (16:50 -0600)] 
Make the crypto includes self-contained

Except for obj_dat.h and obj_xref.h which need perl mungery

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Wed May  6 11:35:57 2026
(Merged from https://github.com/openssl/openssl/pull/31001)

6 days agothe curve448 f_impl.h files are not self contained headers
Bob Beck [Mon, 27 Apr 2026 19:26:49 +0000 (13:26 -0600)] 
the curve448 f_impl.h files are not self contained headers

They are inline implementations. rename to .inc

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Wed May  6 11:35:56 2026
(Merged from https://github.com/openssl/openssl/pull/31001)

6 days agoAdd missing header guards in local crypto includes.
Bob Beck [Mon, 27 Apr 2026 18:39:18 +0000 (12:39 -0600)] 
Add missing header guards in local crypto includes.

These are guarded with "OSSL_LIBCRYPTO" to ensure the namespace
is distinct from the "OSSL_CRYPTO" guards used in include/crypto

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Wed May  6 11:35:55 2026
(Merged from https://github.com/openssl/openssl/pull/31001)

6 days agoMake apps self-contained
Bob Beck [Mon, 27 Apr 2026 16:44:29 +0000 (10:44 -0600)] 
Make apps self-contained

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Wed May  6 11:35:53 2026
(Merged from https://github.com/openssl/openssl/pull/31001)

6 days agoFix progs.pl to generate guarded header
Bob Beck [Mon, 27 Apr 2026 19:10:18 +0000 (13:10 -0600)] 
Fix progs.pl to generate guarded header

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Wed May  6 11:35:52 2026
(Merged from https://github.com/openssl/openssl/pull/31001)

6 days agoAdd missing header guards in apps
Bob Beck [Mon, 27 Apr 2026 18:25:45 +0000 (12:25 -0600)] 
Add missing header guards in apps

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Wed May  6 11:35:51 2026
(Merged from https://github.com/openssl/openssl/pull/31001)

6 days agoMake ssl includes self-contained
Bob Beck [Tue, 14 Apr 2026 18:07:20 +0000 (12:07 -0600)] 
Make ssl includes self-contained

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Wed May  6 11:35:50 2026
(Merged from https://github.com/openssl/openssl/pull/31001)

6 days agoAdd missing header guards in ssl
Bob Beck [Mon, 27 Apr 2026 18:53:22 +0000 (12:53 -0600)] 
Add missing header guards in ssl

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Wed May  6 11:35:49 2026
(Merged from https://github.com/openssl/openssl/pull/31001)

6 days agomake includes self-contained
Bob Beck [Wed, 3 Sep 2025 00:54:49 +0000 (18:54 -0600)] 
make includes self-contained

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Wed May  6 11:35:48 2026
(Merged from https://github.com/openssl/openssl/pull/31001)

6 days agoAdd missing include guards in include
Bob Beck [Mon, 27 Apr 2026 18:21:40 +0000 (12:21 -0600)] 
Add missing include guards in include

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Wed May  6 11:35:47 2026
(Merged from https://github.com/openssl/openssl/pull/31001)

6 days agothe async/arch/async_foo.h files are not self contained headers
Bob Beck [Wed, 3 Sep 2025 01:10:13 +0000 (19:10 -0600)] 
the async/arch/async_foo.h files are not self contained headers

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Wed May  6 11:35:46 2026
(Merged from https://github.com/openssl/openssl/pull/31001)

6 days agoasn1_item_list.h is not a self contained header file
Bob Beck [Wed, 3 Sep 2025 01:03:38 +0000 (19:03 -0600)] 
asn1_item_list.h is not a self contained header file

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Wed May  6 11:35:45 2026
(Merged from https://github.com/openssl/openssl/pull/31001)

6 days agomd32_common.h is not a self contained header file
Bob Beck [Wed, 3 Sep 2025 00:52:16 +0000 (18:52 -0600)] 
md32_common.h is not a self contained header file

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Wed May  6 11:35:44 2026
(Merged from https://github.com/openssl/openssl/pull/31001)

6 days agoqlog_events.h is not a self-contained header file
Bob Beck [Wed, 3 Sep 2025 00:40:22 +0000 (18:40 -0600)] 
qlog_events.h is not a self-contained header file

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Wed May  6 11:35:42 2026
(Merged from https://github.com/openssl/openssl/pull/31001)

8 days agoDoc: Add documentation for existing Hybrid ML_KEM algorithms used by
slontis [Tue, 17 Feb 2026 05:05:14 +0000 (16:05 +1100)] 
Doc: Add documentation for existing Hybrid ML_KEM algorithms used by
TLS1.3.

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
MergeDate: Mon May  4 11:51:12 2026
(Merged from https://github.com/openssl/openssl/pull/30037)

8 days agoLimit job count on compiler zoo builds
Neil Horman [Fri, 1 May 2026 12:23:27 +0000 (08:23 -0400)] 
Limit job count on compiler zoo builds

The security repo keeps failing our compiler zoo jobs, consistently.  It
appears to be happening because our compiler zoo jobs use make -j
without any limit on the number of jobs, leading to github aborting them
all when the workload gets too high.  I suspect that we're using a
smaller runner in the security repo than we are in our public repo,
which is why we don't see it there.

Our other CI jobs all limit the job count to 4 during make, do the same
here.

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
MergeDate: Mon May  4 09:33:34 2026
(Merged from https://github.com/openssl/openssl/pull/31059)

9 days agodoc: Add documentation for X509_STORE_CTX_set_time
kovan [Mon, 2 Feb 2026 11:32:04 +0000 (12:32 +0100)] 
doc: Add documentation for X509_STORE_CTX_set_time

Document the X509_STORE_CTX_set_time() function which sets the
verification time for certificate chain validation. This is a
convenience wrapper around X509_VERIFY_PARAM_set_time().

Remove X509_STORE_CTX_set_time from missingcrypto.txt and
missingcrypto111.txt.

Fixes #21362

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
MergeDate: Sun May  3 15:38:26 2026
(Merged from https://github.com/openssl/openssl/pull/29899)

9 days agotest: respect disabled IPv6 in bio_tfo_test
Mounir IDRASSI [Mon, 27 Apr 2026 02:55:51 +0000 (11:55 +0900)] 
test: respect disabled IPv6 in bio_tfo_test

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
MergeDate: Sun May  3 15:25:55 2026
(Merged from https://github.com/openssl/openssl/pull/30988)

9 days agodemos/guide: switch clients to HTTP/1.1
Eugene Adell [Sun, 26 Apr 2026 17:50:26 +0000 (19:50 +0200)] 
demos/guide: switch clients to HTTP/1.1

The Host Header comes with HTTP/1.1, not 1.0, and some
Web Server now doesn't want to answer to such requests.

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Matt Caswell <matt@openssl.foundation>
MergeDate: Sun May  3 15:21:35 2026
(Merged from https://github.com/openssl/openssl/pull/30981)

9 days agoAccording to RFC8446 there must always be one identity in the list
Matt Caswell [Tue, 28 Apr 2026 08:56:20 +0000 (09:56 +0100)] 
According to RFC8446 there must always be one identity in the list

We were silently accepting a list with zero identities. Technically this
is a syntax error so we should fail with a decode_error in this case.

Fixes #31006

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Sun May  3 15:19:27 2026
(Merged from https://github.com/openssl/openssl/pull/31010)

9 days agosparse_array: avoid ubsan violation in typed doall
Nikola Pajkovsky [Wed, 29 Apr 2026 18:15:32 +0000 (20:15 +0200)] 
sparse_array: avoid ubsan violation in typed doall

clang-22 with enable-asan and enable-ubsan enabled fails with error

  crypto/sparse_array.c:93:21: runtime error: call to function alg_copy
  through pointer to incorrect function type 'void (*)(unsigned long, void *, void *)'

    ossl_sa_##type##_doall(const SPARSE_ARRAY_OF(type) * sa,
        void (*leaf)(ossl_uintmax_t, type *))
    {
        ossl_sa_doall((OPENSSL_SA *)sa,
            (void (*)(ossl_uintmax_t, void *))leaf);
    }

typed doall(_arg) expect leaf to have type, but generic code is using
void *, and the type-casting cases the error.

Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Sun May  3 15:17:58 2026
(Merged from https://github.com/openssl/openssl/pull/31035)

9 days agoslh_dsa: cleanse generated add_random buffer
Mounir IDRASSI [Wed, 29 Apr 2026 11:21:51 +0000 (20:21 +0900)] 
slh_dsa: cleanse generated add_random buffer

Fix the inverted cleanse guard in the SLH DSA provider signing path.

When randomized signing populates the local add_rand buffer, the cleanup step currently skips that stack buffer. Other signing modes do not create this transient buffer, so they should not drive this cleanup. Swap the guard so only the transient per signature buffer is cleansed, and cleanse the full fixed size buffer directly.

Fixes #30950

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
MergeDate: Sun May  3 14:49:20 2026
(Merged from https://github.com/openssl/openssl/pull/31029)

9 days agoMap rsaesOaep SubjectPublicKeyInfo to RSA
Craig Lorentzen [Fri, 24 Apr 2026 17:25:29 +0000 (17:25 +0000)] 
Map rsaesOaep SubjectPublicKeyInfo to RSA

TPM 1.2 Endorsement Key certificates use id-RSAES-OAEP
(NID_rsaesOaep) as their SubjectPublicKeyInfo algorithm
identifier per TCG Credential Profiles V1.2 section 3.2.7.
The underlying key is a standard RSAPublicKey.  Without
this mapping, X509_get_pubkey() fails with a decode error
and X509_verify_cert() cannot validate these certificates.

Add NID_rsaesOaep handling to the three SPKI decode paths,
each of which points at the other two so future changes stay
in sync:

 - x509_pubkey_decode(): remap the NID to NID_rsaEncryption
   for the legacy ameth lookup.  This path is reached via
   d2i_RSA_PUBKEY()/ossl_d2i_PUBKEY_legacy(), which is in
   turn invoked by the provider RSA decoder's rsa_d2i_PUBKEY,
   so it is load-bearing even when the provider path is in
   use.

 - x509_pubkey_ex_d2i_ex(): use "RSA" as the decoder keytype
   name so OSSL_DECODER_CTX_new_for_pkey() selects the RSA
   provider decoder.  The NID check precedes OBJ_obj2txt()
   so the text conversion is skipped when unused.

 - ossl_spki2typespki_der_decode(): same remap in the
   SPKI-to-type-SPKI provider decoder chain.  Flatten the
   existing SM2 special case while here: the original code
   relied on a dangling else across the #endif, which made
   the rsaesOaep branch awkward to add.  The new structure
   initializes dataname to empty, applies each special case
   in turn, and falls back to OBJ_obj2txt() only when no
   override applied.  strcpy() is replaced with
   OPENSSL_strlcpy() for consistency with surrounding code.

The OAEP AlgorithmIdentifier parameters (which carry a
TCG-specific pSourceAlgorithm "TCPA" for TPM EKs) are
deliberately not interpreted; only the RSAPublicKey body is
consumed.

Add a test using a real TPM 1.2 EK certificate.  The test
exercises both the provider decoder path (via X509_from_strings
+ X509_get0_pubkey) and, when deprecated APIs are available,
the legacy path (via d2i_RSA_PUBKEY), confirming the key
decodes to an RSA EVP_PKEY of the expected size.

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
MergeDate: Sun May  3 14:44:24 2026
(Merged from https://github.com/openssl/openssl/pull/30961)

9 days agoValidate that a PSK identity is at least one byte long
Matt Caswell [Fri, 1 May 2026 11:29:44 +0000 (12:29 +0100)] 
Validate that a PSK identity is at least one byte long

RFC8446 requires that a PSK identity is at least one byte in length. We
should validate this.

Fixes #31007

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com>
MergeDate: Sun May  3 13:46:21 2026
(Merged from https://github.com/openssl/openssl/pull/31058)

9 days agoFix: Typo "configdata.pem" -> "configdata.pm"
Pascal Ernster [Sat, 2 May 2026 02:33:28 +0000 (02:33 +0000)] 
Fix: Typo "configdata.pem" -> "configdata.pm"

CLA: trivial
Fixes: ddf1847dc81c "unified build scheme: add and document the "unified" driving engine"
Signed-off-by: Pascal Ernster <git@hardfalcon.net>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Sun May  3 13:42:56 2026
(Merged from https://github.com/openssl/openssl/pull/31064)

9 days agodocs: Document required output buffer length in EVP_CIPHER-DES
Joshua Rogers [Tue, 31 Mar 2026 16:17:34 +0000 (00:17 +0800)] 
docs: Document required output buffer length in EVP_CIPHER-DES

Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
MergeDate: Sun May  3 13:41:54 2026
(Merged from https://github.com/openssl/openssl/pull/30651)

10 days agossl/record/methods/tls_common.c: call BIO_free_all() on rl->bio in tls_int_free
Eugene Syromiatnikov [Tue, 28 Apr 2026 10:02:48 +0000 (12:02 +0200)] 
ssl/record/methods/tls_common.c: call BIO_free_all() on rl->bio in tls_int_free

Since it is free'd using this call in tls_set1_bio().

Complements: 435feadaf4f9 "Fix record layer leak when swapping chained transport BIO"
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.foundation>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
MergeDate: Sat May  2 18:10:42 2026
(Merged from https://github.com/openssl/openssl/pull/31011)

10 days agoAvoid needless casting away of const in X509_VERIFY_PARAM_get1_ip_asc
Eugene Syromiatnikov [Fri, 1 May 2026 00:07:38 +0000 (02:07 +0200)] 
Avoid needless casting away of const in X509_VERIFY_PARAM_get1_ip_asc

Instead of needlessly casting const away, simply update the prototype
of ossl_ipaddr_to_asc(), that doesn't modify the passed data in any way
anyway.

Fixes: f584ae959cbc "Let's support multiple names for certificate verification"
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.foundation>
Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com>
MergeDate: Sat May  2 18:07:19 2026
(Merged from https://github.com/openssl/openssl/pull/31051)

10 days agoGuard memcmp for ub in X509_vpm.c
Bob Beck [Thu, 30 Apr 2026 19:41:32 +0000 (13:41 -0600)] 
Guard memcmp for ub in X509_vpm.c

Techincally unnecessary, since this thing won't let you add NULL
data to it, but this is harmless and then obviously following
the correct paradigm.

Reviewed-by: Matt Caswell <matt@openssl.foundation>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Sat May  2 18:05:04 2026
(Merged from https://github.com/openssl/openssl/pull/31049)

11 days agoFix memory leak in asn_mime multi_split
Jakub Zelenka [Wed, 29 Apr 2026 17:26:47 +0000 (19:26 +0200)] 
Fix memory leak in asn_mime multi_split

The bpart is not freed if BIO_write or BIO_puts fails. It also makes the
error handling of that case consistent with other parts freeing the
bpart.

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
MergeDate: Fri May  1 13:06:32 2026
(Merged from https://github.com/openssl/openssl/pull/31033)

11 days agoCheck wrlmethod existence before sending alert
Jakub Zelenka [Tue, 28 Apr 2026 20:43:45 +0000 (22:43 +0200)] 
Check wrlmethod existence before sending alert

If there is a memory failure during record wrlmethod allocation, then
the alert is attemted but it crashes because wrlmethod is NULL.

Found using memfail integration to fuzz tests: GH-30944

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Matt Caswell <matt@openssl.foundation>
MergeDate: Fri May  1 12:09:11 2026
(Merged from https://github.com/openssl/openssl/pull/31017)

11 days agoTouch the perl miasma in self defense.
Bob Beck [Sat, 25 Apr 2026 02:19:41 +0000 (20:19 -0600)] 
Touch the perl miasma in self defense.

The symbol presence test fails for NO_DEPRECATED
builds  if you use modern CPP practices for definitions.

This is the result of my accepting that doing so will be as PTSD
inducing as walking into my parents bedroom at an inopportune
time, and fixing it. Better me who has less time left to live
with the mental trauma than a younger developer.

Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Fri May  1 11:01:46 2026
(Merged from https://github.com/openssl/openssl/pull/31016)

12 days agoUse the actually correct define for solaris and gcc
Bob Beck [Tue, 28 Apr 2026 19:51:31 +0000 (13:51 -0600)] 
Use the actually correct define for solaris and gcc

And to avoid future confusion just namespace all of these
to OSSL_

Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
MergeDate: Thu Apr 30 11:52:48 2026
(Merged from https://github.com/openssl/openssl/pull/30738)

12 days agoAdd an OSSL_ATOMICS_LOCKLESS internal define
Bob Beck [Wed, 8 Apr 2026 19:11:06 +0000 (13:11 -0600)] 
Add an OSSL_ATOMICS_LOCKLESS internal define

So that we can decide to decide to do fast path things with conditional
compilaiton, and avoid adding a lock to save a lock

Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
MergeDate: Thu Apr 30 11:52:47 2026
(Merged from https://github.com/openssl/openssl/pull/30738)

12 days agoDo not compile AVX2 code if AVX2 intrinsics is not supported
Milan Broz [Tue, 28 Apr 2026 20:21:14 +0000 (22:21 +0200)] 
Do not compile AVX2 code if AVX2 intrinsics is not supported

Old and exotic compilers do not support AVX2 instrinsic.
Add guard for Clang, GCC >= 8 and MSVC >= 2019.

Fixes: #30958
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
MergeDate: Thu Apr 30 11:44:32 2026
(Merged from https://github.com/openssl/openssl/pull/31020)

12 days agoUse ossl_inline instead of inline in enc_b64_avx2.c
Milan Broz [Tue, 28 Apr 2026 20:19:05 +0000 (22:19 +0200)] 
Use ossl_inline instead of inline in enc_b64_avx2.c

This supports older compilers too.

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
MergeDate: Thu Apr 30 11:44:31 2026
(Merged from https://github.com/openssl/openssl/pull/31020)

12 days agoci: Enable MINGW63/32 builkd matrix with strict warnings
Milan Broz [Wed, 22 Apr 2026 14:12:45 +0000 (16:12 +0200)] 
ci: Enable MINGW63/32 builkd matrix with strict warnings

And also enable demos to 64bit cover compilation of these.

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Thu Apr 30 11:42:36 2026
(Merged from https://github.com/openssl/openssl/pull/30941)

12 days agoFix ignoring return value in RCU witn MINGW 32bit
Milan Broz [Wed, 22 Apr 2026 14:05:35 +0000 (16:05 +0200)] 
Fix ignoring return value in RCU witn MINGW 32bit

For code that uses NO_INTERLOCKEDOR64 (Win32 32bit),
there is a warning in RCU code
    error: ignoring return value of 'CRYPTO_THREAD_write_lock'
    declared with attribute 'warn_unused_result' [-Werror=unused-result]

As the function cannot fail on that platform (and error
path would need some reverts leading to impossible dereference later),
just use trick to silence the warning.

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Thu Apr 30 11:42:34 2026
(Merged from https://github.com/openssl/openssl/pull/30941)

12 days agoFix DSO symbol test with MINGW64 and pedantic warnings
Milan Broz [Wed, 22 Apr 2026 13:39:29 +0000 (15:39 +0200)] 
Fix DSO symbol test with MINGW64 and pedantic warnings

GetProcAddress() cannot be simple cast to void* (SD_SYM)
under strict warnigs, as it produces this
 error: ISO C forbids conversion of function pointer to
 object pointer type [-Werror=pedantic]

Use common trick with cast to (uintptr_t).

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Thu Apr 30 11:42:33 2026
(Merged from https://github.com/openssl/openssl/pull/30941)

12 days agoUse INVALID_SOCKET in SSLEcho demo
Milan Broz [Wed, 22 Apr 2026 13:34:05 +0000 (15:34 +0200)] 
Use INVALID_SOCKET in SSLEcho demo

On Windows, SOCKET type is unsigned.

All comparison with negative value produces signed/unsigned
warnings, moreover the code is incorrect in error path.

Use INVALID_SOCKET define that should work on all
platforms to detect error.

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Thu Apr 30 11:42:31 2026
(Merged from https://github.com/openssl/openssl/pull/30941)

12 days agoRemove unused warnx from QUIC demos
Milan Broz [Wed, 22 Apr 2026 13:31:02 +0000 (15:31 +0200)] 
Remove unused warnx from QUIC demos

It only produces missing prototype warnings.

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Thu Apr 30 11:42:30 2026
(Merged from https://github.com/openssl/openssl/pull/30941)

12 days agoRemove redefined progname from QUIC demos
Milan Broz [Wed, 22 Apr 2026 13:28:35 +0000 (15:28 +0200)] 
Remove redefined progname from QUIC demos

The global progname is already defined above.

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Thu Apr 30 11:42:28 2026
(Merged from https://github.com/openssl/openssl/pull/30941)

12 days agoRemove unused ossl_crypto_mem_barrier in old Windows threads
Milan Broz [Wed, 22 Apr 2026 13:25:31 +0000 (15:25 +0200)] 
Remove unused ossl_crypto_mem_barrier in old Windows threads

This function is unused and only causes missing prototype
warning.

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Thu Apr 30 11:42:26 2026
(Merged from https://github.com/openssl/openssl/pull/30941)

12 days agoFix rand_deprecated build if OPENSSL_API_COMPAT is not defined
Milan Broz [Wed, 22 Apr 2026 13:19:24 +0000 (15:19 +0200)] 
Fix rand_deprecated build if OPENSSL_API_COMPAT is not defined

Add test for OPENSSL_NO_DEPRECATED_1_1_0 (that covers symbols
for these ancient functions).

With strict warnings it break build with
  'OPENSSL_API_COMPAT' is not defined, evaluates to '0' [-Werror=undef]

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Thu Apr 30 11:42:25 2026
(Merged from https://github.com/openssl/openssl/pull/30941)

12 days agoDefine WINAPI_PARTITION_SYSTEM for older Windows headers
Milan Broz [Wed, 22 Apr 2026 13:09:05 +0000 (15:09 +0200)] 
Define WINAPI_PARTITION_SYSTEM for older Windows headers

Some older Windows and MING64 environments does not have
WINAPI_PARTITION_SYSTEM defined.

This breaks build with strict warnings.

Add empty definition if this happens.

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Thu Apr 30 11:42:23 2026
(Merged from https://github.com/openssl/openssl/pull/30941)

12 days agoFix warning for incompatible function cast
Milan Broz [Wed, 22 Apr 2026 13:03:47 +0000 (15:03 +0200)] 
Fix warning for incompatible function cast

With pedantic option (strict warnings) and MINGW64,
the GetProcAddress() cannot be simply casted, as it leads to
 error: cast between incompatible function types from 'FARPROC' ...

Introduce local macro that will wrap all such calls
and silence benign warnings.

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Thu Apr 30 11:42:21 2026
(Merged from https://github.com/openssl/openssl/pull/30941)

12 days agoFix signed/unsigned comparison under MINGW64
Milan Broz [Wed, 22 Apr 2026 13:00:49 +0000 (15:00 +0200)] 
Fix signed/unsigned comparison under MINGW64

SOCKET is unsigned on Windows, these is no need to cast
parameter. INVALID_SOCKET test should work on all platforms.

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Thu Apr 30 11:42:20 2026
(Merged from https://github.com/openssl/openssl/pull/30941)