]> git.ipfire.org Git - thirdparty/openssl.git/log
thirdparty/openssl.git
3 months agoFix a typo in evpciph_des3_common.txt
Matt Caswell [Thu, 17 Apr 2025 11:45:31 +0000 (12:45 +0100)] 
Fix a typo in evpciph_des3_common.txt

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27408)

3 months agoFix a deadlock while attempting to get the Primary EVP_RAND_CTX
Matt Caswell [Tue, 15 Apr 2025 14:03:36 +0000 (15:03 +0100)] 
Fix a deadlock while attempting to get the Primary EVP_RAND_CTX

When only the FIPS provider was loaded we could get a deadlock when
calling RAND_get0_primary() due to attempting to obtain a recursive
lock.

We reduce the scope of the locks that we hold to avoid this.

Fixes #27391

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27408)

3 months agoEnsure that our fips internal provider is always loaded
Matt Caswell [Wed, 16 Apr 2025 11:20:10 +0000 (12:20 +0100)] 
Ensure that our fips internal provider is always loaded

The fips provider has an internal provider. In some circumstances we
could end up trying to find it, but failing because it hasn't been loaded
yet. We just always ensure it is loaded early to avoid this.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27408)

3 months agoAssert that we successfully obtained a lock
Matt Caswell [Wed, 16 Apr 2025 11:15:51 +0000 (12:15 +0100)] 
Assert that we successfully obtained a lock

We should never fail to obtain a lock, so assert that we are successful

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27408)

3 months agoAdd a test for calling RAND_get0_primary()
Matt Caswell [Wed, 16 Apr 2025 11:14:55 +0000 (12:14 +0100)] 
Add a test for calling RAND_get0_primary()

We simply test that calling RAND_get0_primary() returns a success
for both the default and fips providers.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27408)

3 months agoFix aesv8 arm assembler code not working on 32 bit Android
Arne Schwabe [Sat, 26 Apr 2025 18:21:28 +0000 (20:21 +0200)] 
Fix aesv8 arm assembler code not working on 32 bit Android

OpenSSL uses 'void' as perlasm for the 32 bit armeabi-arm target, which
most notably lacks a 32 or 64 in its name. So while most code that is
targeted for 32 uses !~ /64/ there is one instance that uses ~= /32/,
introduced by commit 8e69c18 between 3.4.0 and 3.5.0. This leaves out
that line on 32 bit android causing a segfault.

This fixes the compilation issue by replacing the ~= /32/ with !~ /64/
compilation taget (see 15-android.conf)

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27510)

3 months agoossl_json_f64() seems to be unused, remove it to avoid libm dependency
sashan [Fri, 18 Apr 2025 10:09:52 +0000 (12:09 +0200)] 
ossl_json_f64() seems to be unused, remove it to avoid libm dependency

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

3 months agodoc/man3: Document missing macro function history
Norbert Pocs [Fri, 25 Apr 2025 17:06:44 +0000 (19:06 +0200)] 
doc/man3: Document missing macro function history

By updating the `util/find-doc-nits` new missing history sections were
discovered. This commit adds the missing.

Signed-off-by: Norbert Pocs <norbertpocs0@gmail.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27488)

3 months agodoc/man3: Change formulation to let the script to catch it
Norbert Pocs [Thu, 24 Apr 2025 11:32:40 +0000 (13:32 +0200)] 
doc/man3: Change formulation to let the script to catch it

Signed-off-by: Norbert Pocs <norbertpocs0@gmail.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27488)

3 months agoother.syms: These functions were deprecated
Norbert Pocs [Thu, 24 Apr 2025 11:05:47 +0000 (13:05 +0200)] 
other.syms: These functions were deprecated

Signed-off-by: Norbert Pocs <norbertpocs0@gmail.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27488)

3 months agoutil/find-doc-nits: Check function macros in history
Norbert Pocs [Tue, 22 Apr 2025 18:47:39 +0000 (20:47 +0200)] 
util/find-doc-nits: Check function macros in history

Add a checker for function macros if they are present in the HISTORY
section of the man page.

Resolves: #26774

Signed-off-by: Norbert Pocs <norbertpocs0@gmail.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27488)

3 months agoClarify how s_client -ign_eof and -quiet impact command processing
Matt Caswell [Fri, 25 Apr 2025 14:21:47 +0000 (15:21 +0100)] 
Clarify how s_client -ign_eof and -quiet impact command processing

If -ign_eof -or -quiet are passed to s_client this implicitly turns off
command processing (i.e. equivalent to -nocommands). This was stated on
the man page in the "CONNECTED COMMANDS" section, but not in the
documentation for "-ign_eof" or "-quiet" directly. We state it here as
well to make it clearer.

Fixes #27443

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

3 months agoTest+fix handling "wrong" downgrade signals
Anton Tieleman [Mon, 28 Apr 2025 11:49:25 +0000 (13:49 +0200)] 
Test+fix handling "wrong" downgrade signals

This accounts for cases that can only occur when een non-compliant server sends
the wrong downgrade signal. (TLS1.1 signal when negotiating TLS1.2 or TLS1.2
signal when negotiating TLS1.0/TLS1.1). According to the TLS1.3 RFC these
cases should be rejected:

RFC8446, section 4.1.3: TLS 1.3 clients receiving a ServerHello indicating
TLS 1.2 or below MUST check that the last 8 bytes are not equal to either of
these values. TLS 1.2 clients SHOULD also check that the last 8 bytes are
not equal to the second value if the ServerHello indicates TLS 1.1 or below.

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

3 months agoRepair downgrade tests
Anton Tieleman [Mon, 28 Apr 2025 11:30:01 +0000 (13:30 +0200)] 
Repair downgrade tests

A number of these tests were failing for the wrong reasons. The intention is to verify
that the client sends an illegal parameter alert when an unexpected downgrade signal
is received. Instead, a number of tests failed because TLS1.1 was not available. The
tests are adapted to explicitly check for an illegal parameter alert from the client.

Client and server flags are updated to enable TLS1.1 where required and a few tests
requiring TLS1.1 were moved to be disabled when TLS1.1 is not available.

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

3 months agoMake cpuid_setup non-constructor
Hongren Zheng [Tue, 22 Apr 2025 10:49:45 +0000 (18:49 +0800)] 
Make cpuid_setup non-constructor

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

3 months agoImprove documentation for -cipher option in openssl genpkey
Kelsey Mulrooney [Tue, 4 Mar 2025 18:25:53 +0000 (13:25 -0500)] 
Improve documentation for -cipher option in openssl genpkey

CLA: trivial

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

3 months agodoc: OSSL_PROV_PARAM_STATUS is signed integer
Ariana Ciaschini [Fri, 7 Mar 2025 02:10:15 +0000 (21:10 -0500)] 
doc: OSSL_PROV_PARAM_STATUS is signed integer

CLA: trivial

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

3 months agoapps/prime.c: Fix memory leak of a BIGNUM
Tomas Mraz [Tue, 29 Apr 2025 09:56:23 +0000 (11:56 +0200)] 
apps/prime.c: Fix memory leak of a BIGNUM

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27521)

3 months agoUpdate to use BIO_get_line() with support for multiple primes per in file
zriback [Fri, 4 Apr 2025 09:47:24 +0000 (05:47 -0400)] 
Update to use BIO_get_line() with support for multiple primes per in file

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26549)

3 months agoAddress and add tests for edge cases involving short or empty files
zriback [Fri, 31 Jan 2025 02:05:32 +0000 (21:05 -0500)] 
Address and add tests for edge cases involving short or empty files

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26549)

3 months agoFix issue where file is not read correctly with Windows line endings
zriback [Thu, 30 Jan 2025 16:41:15 +0000 (11:41 -0500)] 
Fix issue where file is not read correctly with Windows line endings

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26549)

3 months agoAdd 20-test_prime unit test
zriback [Fri, 24 Jan 2025 20:43:22 +0000 (15:43 -0500)] 
Add 20-test_prime unit test

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26549)

3 months agoAdd -in option to prime function to allow input from file for primality testing....
zriback [Fri, 24 Jan 2025 06:03:35 +0000 (01:03 -0500)] 
Add -in option to prime function to allow input from file for primality testing. Update -hex option documentation to reflect use with input and output.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26549)

3 months agoAdded quotes to mask spaces in the path when building
Martin Rauch [Fri, 25 Apr 2025 08:30:16 +0000 (10:30 +0200)] 
Added quotes to mask spaces in the path when building

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

3 months agoBIO_dump_indent_cb(): Check for negative return from BIO_snprintf()
Tomas Mraz [Fri, 25 Apr 2025 08:04:37 +0000 (10:04 +0200)] 
BIO_dump_indent_cb(): Check for negative return from BIO_snprintf()

In practice this cannot happen but Coverity complains.

Fixes Coverity 1646683

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27493)

3 months agoFix also BIO_printf formatting for INF and NAN
Bernd Edlinger [Thu, 24 Apr 2025 19:09:40 +0000 (21:09 +0200)] 
Fix also BIO_printf formatting for INF and NAN

Avoid infinite loooooooops in %e and %g formatting for +/-INF and
make the invalid value at least visible by using '?' as signvalue.

Fixes #26973

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

3 months agoFix POD indentation in OSSL_CMP_CTX_new
Nicholas Brink [Wed, 23 Apr 2025 17:22:56 +0000 (13:22 -0400)] 
Fix POD indentation in OSSL_CMP_CTX_new

Fixes #27459

Sourced from
https://github.com/quictls/quictls/commit/0c12a613effc9dac8abc9a68e31e641d0cdb6541

Plus one line of documentation fixes

CLA: trivial

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

3 months agoFix typo in SHA256 RISC-V64 Zbb comments: Sigma0 -> Sum0
yexiaochuan [Wed, 23 Apr 2025 14:28:09 +0000 (22:28 +0800)] 
Fix typo in SHA256 RISC-V64 Zbb comments: Sigma0 -> Sum0

This corrects a misleading comment in sha256-riscv64-zbb.pl. The rotation
operation corresponds to the Sum0 function as defined in the FIPS 180-4
standard, not Sigma0.

CLA: trivial

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

3 months agoTest ML-DSA, SLH-DSA, and ML-KEM PCT implementations
Joachim Vandersmissen [Fri, 18 Apr 2025 16:09:05 +0000 (11:09 -0500)] 
Test ML-DSA, SLH-DSA, and ML-KEM PCT implementations

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

3 months agoMove to error state if ML-DSA / SLH-DSA PCT fails
Joachim Vandersmissen [Fri, 18 Apr 2025 16:07:53 +0000 (11:07 -0500)] 
Move to error state if ML-DSA / SLH-DSA PCT fails

As required by FIPS 140-3 AS10.07, if the module fails a self-test, it
shall enter an error state.

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

3 months agoFacilitate corruption in ML-DSA PCT
Joachim Vandersmissen [Fri, 18 Apr 2025 16:07:43 +0000 (11:07 -0500)] 
Facilitate corruption in ML-DSA PCT

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

3 months agoAdd verbose output to 'openssl list -store-loaders'
Richard Levitte [Thu, 16 Jan 2025 09:16:17 +0000 (10:16 +0100)] 
Add verbose output to 'openssl list -store-loaders'

The provider based STORE loaders do have settable parameters, so they should
be displayed when '-verbose' is given, just like for any other list.

Out of necessity, this also introduces OSSL_STORE_LOADER_settable_ctx_params()

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

3 months agopoll builder: add dummy field
Gerd Hoffmann [Fri, 25 Apr 2025 05:51:53 +0000 (07:51 +0200)] 
poll builder: add dummy field

The microsoft compiler does not like the empty struct,
so go add a dummy field instead.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27494)

3 months agoapp/s_client.c: clean up and broaden use of ERR_print_errors()
Dr. David von Oheimb [Fri, 25 Apr 2025 06:00:37 +0000 (08:00 +0200)] 
app/s_client.c: clean up and broaden use of ERR_print_errors()

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

3 months agofile_store.c: give detail on file_set_ctx_params() error
Dr. David von Oheimb [Fri, 25 Apr 2025 10:49:35 +0000 (12:49 +0200)] 
file_store.c: give detail on file_set_ctx_params() error

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

3 months agoby_store.c: suppress in cache_objects() likely non-relevant error queue entries calli...
Dr. David von Oheimb [Fri, 25 Apr 2025 10:54:00 +0000 (12:54 +0200)] 
by_store.c: suppress in cache_objects() likely non-relevant error queue entries calling OSSL_STORE_find()

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

3 months agoFix P-384 curve on lower-than-P9 PPC64 targets
A. Wilcox [Thu, 17 Apr 2025 13:51:53 +0000 (08:51 -0500)] 
Fix P-384 curve on lower-than-P9 PPC64 targets

The change adding an asm implementation of p384_felem_reduce incorrectly
uses the accelerated version on both targets that support the intrinsics
*and* targets that don't, instead of falling back to the generics on older
targets.  This results in crashes when trying to use P-384 on < Power9.

Signed-off-by: Anna Wilcox <AWilcox@Wilcox-Tech.com>
Closes: #27350
Fixes: 85cabd94 ("Fix Minerva timing side-channel signal for P-384 curve on PPC")
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27429)

3 months agoAdd test to check SKEYMGMT interfaces
Simo Sorce [Thu, 24 Apr 2025 14:05:53 +0000 (10:05 -0400)] 
Add test to check SKEYMGMT interfaces

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

3 months agoSKEYMGMT: Expose settable params
Simo Sorce [Wed, 23 Apr 2025 22:38:59 +0000 (18:38 -0400)] 
SKEYMGMT: Expose settable params

This is needed for tools that do things like passing
    -skeyopt hexraw-bytes:0102030405060708090a0b0c0d0e0f10
to tools.

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

3 months agoRelax absolut path checking in our 'file' scheme implementation
Richard Levitte [Wed, 23 Apr 2025 18:14:38 +0000 (20:14 +0200)] 
Relax absolut path checking in our 'file' scheme implementation

So far, we strictly obeyed [RFC 8089], which only allows absolute paths
in a 'file:' URI.  However, this seems to give a confusing user
experience, where something like 'file:foo.pem' wouldn't open foo.pem,
even though it's there in the current directory, but 'file:$(pwd)/foo.pem'
would.

To be less surprising for such use cases, we relax our implementation
visavi [RFC 8089] to allow relative paths.

[RFC 8089]: https://datatracker.ietf.org/doc/html/rfc8089

Fixes #27461

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

3 months agoProperly zeroize ML-KEM z and d values
Joachim Vandersmissen [Fri, 18 Apr 2025 17:48:24 +0000 (12:48 -0500)] 
Properly zeroize ML-KEM z and d values

Ensure z and d are actually zeroized by cleansing the full size of s,
rather than just vector_bytes.

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

3 months agoAdd a test for calling SSL_accept() on a listener
Matt Caswell [Fri, 11 Apr 2025 13:21:48 +0000 (14:21 +0100)] 
Add a test for calling SSL_accept() on a listener

We expect this scenario to fail

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27351)

3 months agoFix errors on SSL_accept() and SSL_get_error()
Matt Caswell [Fri, 11 Apr 2025 13:19:46 +0000 (14:19 +0100)] 
Fix errors on SSL_accept() and SSL_get_error()

Calling SSL_accept() was raising two errors on the stack if you passed
the wrong object type. Similarly SSL_get_error() was adding an error to
the stack if the wrong object type was passed and returning the wrong
result.

We also ensure SSL_set_accept_state() and SSL_set_connect_state() don't
raise spurious errors since these are void functions.

Fixes #27347
Fixes #27348

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27351)

3 months agoFix BIO_printf formatting for negative numbers formatted with %e
Richard Levitte [Wed, 23 Apr 2025 08:26:56 +0000 (10:26 +0200)] 
Fix BIO_printf formatting for negative numbers formatted with %e

Some parts of the formatting code assumed that the input number is
positive.  This is fixed by working on its absolute value.

test/bioprinttest.c is amended to test the output of negative numbers
as well.

Fixes #26973

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

3 months agodocs: update OSSL_PARAM_int documentation
Ryan Schanzenbacher [Sat, 8 Mar 2025 04:35:32 +0000 (23:35 -0500)] 
docs: update OSSL_PARAM_int documentation

This change adds an example to allow compilation without warnings using
compiler options like `-Wincompatible-pointer-types-discards-qualifiers`

Code for the example was inspired by libarchive's https://github.com/libarchive/libarchive/pull/1869/commits/9e3a7e4b6c77e8aa19a69430f48917dbc15b319d

Fixes #20956

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

3 months agoImproved error message for X509_V_ERR_CERT_NOT_YET_VALID
Luke Kurlandski [Tue, 4 Mar 2025 16:53:36 +0000 (11:53 -0500)] 
Improved error message for X509_V_ERR_CERT_NOT_YET_VALID

In addition to an invalid certificate, it is not unlikely that this
exact error (case X509_V_ERR_CERT_NOT_YET_VALID) is caused by an
incorrect system clock. This cannot be trivially fixed, so for now,
we simply improve the quality of the error message.

Fixes #14771

CLA: trivial

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

3 months agoFix default pkey(1) DER output
Viktor Dukhovni [Wed, 9 Apr 2025 07:33:02 +0000 (17:33 +1000)] 
Fix default pkey(1) DER output

This is expected to be PKCS#8, but was defaulting to traditional when
possible.  Changed default DER output format to PKCS#8 and extended the
`-traditional` option to apply also to DER output.

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

3 months agoAdvertize signature setting in settable_ctx fn
Simo Sorce [Tue, 15 Apr 2025 19:42:22 +0000 (15:42 -0400)] 
Advertize signature setting in settable_ctx fn

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27342)

3 months agoAdd test for ML-DSA sig/ver message update
Simo Sorce [Tue, 15 Apr 2025 18:58:20 +0000 (14:58 -0400)] 
Add test for ML-DSA sig/ver message update

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27342)

3 months agoAdd ml_dsa msg_update functions to provider code
Simo Sorce [Fri, 11 Apr 2025 21:24:09 +0000 (17:24 -0400)] 
Add ml_dsa msg_update functions to provider code

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27342)

3 months agoMake public ml_dsa_mu_.. helpers
Simo Sorce [Fri, 11 Apr 2025 17:38:20 +0000 (13:38 -0400)] 
Make public ml_dsa_mu_.. helpers

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27342)

3 months agoSplit the ML-DSA internal sigver functions
Simo Sorce [Wed, 9 Apr 2025 13:35:20 +0000 (09:35 -0400)] 
Split the ML-DSA internal sigver functions

Deconstruct the functions into 2 parts:
- mu computation (if needed)
- actual signing/verification

Adds helper to compute mu that is split in 3 parts
(init/update/finalize) where the update part can be used to feed the message
to be signed or verified in chunks of any size.

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27342)

3 months agoFix EVP_PKEY_verify man page
Simo Sorce [Tue, 15 Apr 2025 19:21:19 +0000 (15:21 -0400)] 
Fix EVP_PKEY_verify man page

Various functions were misnamed in the descriptions.

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27342)

3 months agoFix mldsa'a msg_inits operation type
Simo Sorce [Tue, 15 Apr 2025 19:20:41 +0000 (15:20 -0400)] 
Fix mldsa'a msg_inits operation type

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27342)

3 months agoFix URL parsing to handle missing ports and ISO 8601 timestamps in paths
olszomal [Fri, 3 Jan 2025 07:42:55 +0000 (08:42 +0100)] 
Fix URL parsing to handle missing ports and ISO 8601 timestamps in paths

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

3 months agos390x: Add new machine generation z17
Ingo Franzki [Fri, 26 Jul 2024 06:47:42 +0000 (08:47 +0200)] 
s390x: Add new machine generation z17

Allow to specify "z17" as machine generation in environment variable
OPENSSL_s390xcap.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27383)

3 months agoTypo in TLS introduction
Christian Wansart [Mon, 21 Apr 2025 09:39:23 +0000 (11:39 +0200)] 
Typo in TLS introduction

CLA: trivial

Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27455)

3 months agoReplace ilammy/setup-nasm with nasm install from choco
Dmitry Misharov [Tue, 22 Apr 2025 07:52:14 +0000 (09:52 +0200)] 
Replace ilammy/setup-nasm with nasm install from choco

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

3 months agoDocument SSL_CTX_set_min_proto_version defaults
Norbert Pocs [Wed, 16 Apr 2025 13:44:07 +0000 (15:44 +0200)] 
Document SSL_CTX_set_min_proto_version defaults

If the function is not called the settings default to 0.

Fixes #10584

Signed-off-by: Norbert Pocs <norbertpocs0@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27410)

3 months agoprovider-signature.pod: fix typos (digeset -> digest)
Dr. David von Oheimb [Mon, 14 Apr 2025 08:48:10 +0000 (10:48 +0200)] 
provider-signature.pod: fix typos (digeset -> digest)

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/27372)

3 months agoprovider-signature.pod: fix doc of OSSL_SIGNATURE_PARAM_ALGORITHM_ID, describing...
Dr. David von Oheimb [Sun, 13 Apr 2025 19:58:35 +0000 (21:58 +0200)] 
provider-signature.pod: fix doc of OSSL_SIGNATURE_PARAM_ALGORITHM_ID, describing its relevance

This provides a fix for the documentation part of #22932.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/27372)

3 months agoASN1_item_sign.pod: fix description of the algor1, algor2, and signature in/out-param...
Dr. David von Oheimb [Sun, 13 Apr 2025 19:55:53 +0000 (21:55 +0200)] 
ASN1_item_sign.pod: fix description of the algor1, algor2, and signature in/out-parameters

This provides a fix for the documentation part of #22932.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/27372)

3 months agotest: test for setting hkdf salt to null
Pauli [Wed, 9 Apr 2025 02:42:40 +0000 (12:42 +1000)] 
test: test for setting hkdf salt to null

Fixes #27302

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27305)

3 months agohkdf: allow salt to be set to null
Pauli [Wed, 9 Apr 2025 02:42:10 +0000 (12:42 +1000)] 
hkdf: allow salt to be set to null

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27305)

3 months agoparams: refactor some of the param helper code
Pauli [Mon, 31 Mar 2025 22:57:50 +0000 (09:57 +1100)] 
params: refactor some of the param helper code

Unifies some duplicated code.

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

3 months agocommands: fix parameter value output
Pauli [Mon, 31 Mar 2025 22:15:40 +0000 (09:15 +1100)] 
commands: fix parameter value output

The parameter value output library routine was incorrect.  It used the
incorrect length when printing fetched parameter sizes.  It also printed
a string which was potentially not zero terminated.  Both of these are
addressed here.

Additionally, octet strings have their initial bytes printed in hex.

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

3 months agoFix fips provider compatibility regression
Tomas Mraz [Thu, 17 Apr 2025 13:32:40 +0000 (15:32 +0200)] 
Fix fips provider compatibility regression

Fixes CI regression from 418609e115.

Older versions place an error code to the error queue when retrieving
updated IV.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27417)

3 months agoSerialize install process to avoid multiple make depend operations
Neil Horman [Mon, 14 Apr 2025 16:23:15 +0000 (12:23 -0400)] 
Serialize install process to avoid multiple make depend operations

If make install is run with a large -j value (make install -j N , where
N < 1)

We can run into a situation in which the install fails because multiple
make depend operations are running in parallel, which will fail due to
makefile rewriting.

Serialize the install process to guarantee that those operations don't
step on one another

Fixes # 27074

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/27388)

3 months ago80-test_cms.t: Add test case for verification of multiple signatures
Jan Luebbe [Fri, 4 Apr 2025 10:38:40 +0000 (12:38 +0200)] 
80-test_cms.t: Add test case for verification of multiple signatures

openssl cms -verify requires all signatures to pass verification, so adding
a signature with -resign will cause overall verification to fail if the new
signature cannot be verified.

As I intend to optionally allow this case (see #26382), this new test
case ensures that the current behaviour stays the default.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/27269)

3 months agoFix OSSL_FUNC_keymgmt_load declaration in man7/provider-keymgmt
Mironenko [Fri, 28 Mar 2025 10:41:26 +0000 (13:41 +0300)] 
Fix OSSL_FUNC_keymgmt_load declaration in man7/provider-keymgmt

OSSL_FUNC_keymgmt_load prototype declared in man7 does not match
the actual OSSL_FUNC_keymgmt_load prototype declared in
include/openssl/core_dispatch.h. This commit fixes the prototype
in man7.

CLA: trivial

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

3 months agoFix winstore provider to work with recent decoder changes
Neil Horman [Mon, 14 Apr 2025 15:03:02 +0000 (11:03 -0400)] 
Fix winstore provider to work with recent decoder changes

Changes made recently in commit 31b5f3f made changes to how a default
decoder was created, in which ossl_decoder_instance_new() started
returning null.  Other storemgmt providers were updated to start using
ossl_decoder_instance_new_forprov, but the winstore manager seems to
have got missed.  Fix it up properly

Fixes #27355

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27384)

3 months agoFix silent error in EVP_CIPHER_CTX_get_updated_iv.
Nicolas Blais-Miko [Sat, 22 Mar 2025 12:14:50 +0000 (08:14 -0400)] 
Fix silent error in EVP_CIPHER_CTX_get_updated_iv.

Added new params API function OSSL_PARAM_set_octet_string_or_ptr to only
call the correct setter for OSSL_CIPHER_PARAM_IV and OSSL_CIPHER_PARAM_UPDATED_IV.
Both OSSL_PARAM_set_octet_string and OSSL_PARAM_set_octet_ptr could be called with
only one expected to succeed. This would put a silent error on the error stack when
calling EVP_CIPHER_CTX_get_updated_iv.

Fixes #27117

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

3 months agoTest that there is no silent error in EVP_CIPHER_CTX_get_updated_iv in evp_test
Nicolas Blais-Miko [Wed, 26 Mar 2025 14:56:39 +0000 (10:56 -0400)] 
Test that there is no silent error in EVP_CIPHER_CTX_get_updated_iv in evp_test

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

3 months agoRemove unused assembly function OPENSSL_wipe_cpu
Teddy Engel [Sat, 12 Apr 2025 11:51:55 +0000 (12:51 +0100)] 
Remove unused assembly function OPENSSL_wipe_cpu

CLA: trivial

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/27362)

3 months agoDocument update for keys.txt
slontis [Thu, 10 Apr 2025 21:54:19 +0000 (07:54 +1000)] 
Document update for keys.txt

Updated with new information since des3 and dsa are not recommended
algorithms.

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

3 months agoPoint to new docs location
Jon Ericson [Thu, 10 Apr 2025 05:04:41 +0000 (22:04 -0700)] 
Point to new docs location

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

3 months agoFix duplicate cipher definition in ssl/t1_trce.c
Yugandhar [Thu, 10 Apr 2025 03:55:29 +0000 (03:55 +0000)] 
Fix duplicate cipher definition in ssl/t1_trce.c

This commit removes the duplicate definition of cipher 0xC102 in
ssl/t1_trce.c, as reported in issue #27303.

The first definition (IANA-GOST2012-GOST8912-GOST8912) is kept as the
canonical one.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27329)

3 months agoFix EVP_PKEY_CTX_dup() so that it copies the keymanager.
slontis [Wed, 9 Apr 2025 00:05:09 +0000 (10:05 +1000)] 
Fix EVP_PKEY_CTX_dup() so that it copies the keymanager.

A call to EVP_PKEY_CTX_new() creates a keymgmt pointer internally,
but EVP_PKEY_CTX_dup() does not copy this field.

Calling EVP_PKEY_derive_set_peer_ex() after EVP_PKEY_CTX_dup() resulted
in a segfault because it tried to access this pointer.

EVP_PKEY_CTX_dup() has been updated to copy the keymanager (and upref it).

Reported by Eamon ODea (Oracle).

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

3 months agoUpdate cms_pwri.c
Kenzlee51 [Tue, 8 Apr 2025 10:56:50 +0000 (13:56 +0300)] 
Update cms_pwri.c

CLA: trivial

When entering the branch (pbe_nid <= 0), line 66 assigns new values ​​to the variable of line 67 (pbe_nid = NID_id_pbkdf2).
However, it is not used anywhere in the future.
For this reason, lines 66 and 67 were removed.

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27296)

3 months agoFix PKCS7_sign and CMS_sign default hash documentation
David Benjamin [Mon, 7 Apr 2025 20:40:05 +0000 (16:40 -0400)] 
Fix PKCS7_sign and CMS_sign default hash documentation

Fixes #27291. See issue for details.

Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27292)

3 months agoUpdated the change log to include SSLv3 being disabled by default.
emery [Mon, 7 Apr 2025 15:02:00 +0000 (11:02 -0400)] 
Updated the change log to include SSLv3 being disabled by default.

This change was implemented into version 1.1.0 and onward. The last version that had SSLv3 enabled was version 1.0.2h, which is why the addition was made where it is.

CLA: trivial

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/27289)

3 months agoadded deprecated note to OPENSSL_instrument_bus docs
jsondevers [Mon, 7 Apr 2025 14:32:27 +0000 (07:32 -0700)] 
added deprecated note to OPENSSL_instrument_bus docs

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27288)

3 months agorio: add RIO_POLL_METHOD_NONE
Gerd Hoffmann [Mon, 7 Apr 2025 12:06:28 +0000 (14:06 +0200)] 
rio: add RIO_POLL_METHOD_NONE

Fixes build on UEFI.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27284)

3 months agohashfunc: add stddef.h include
Gerd Hoffmann [Mon, 7 Apr 2025 11:29:36 +0000 (13:29 +0200)] 
hashfunc: add stddef.h include

size_t is declared in stddef.h, so include the header file to
make sure it is available.  Fixes build on UEFI.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27284)

3 months agocrypto: disable OSSL_PARAM_REAL on UEFI
Gerd Hoffmann [Mon, 7 Apr 2025 10:58:54 +0000 (12:58 +0200)] 
crypto: disable OSSL_PARAM_REAL on UEFI

Floating point types like double can't be used on UEFI.
Fix build on UEFI by disabling the OSSL_PARAM_REAL branch.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27284)

3 months agoRemove DAYS argument
Malcolm Hogan [Fri, 7 Mar 2025 23:30:43 +0000 (18:30 -0500)] 
Remove DAYS argument

This commit removes DAYS from certificate requests to avoid the warning

'Ignoring -days without -x509; not generating a certificate'

This argument is not needed with the -new argument. Additionally makes sure
$1 is handled when -nodes is not given. Preventing an uninitialized value
error when the DAYS argument is removed.

Fixes #26595

CLA: trivial

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/27277)

3 months agoPrevent CI jobs with secrets from running in forks
Vladimír Chlup [Fri, 4 Apr 2025 08:50:22 +0000 (10:50 +0200)] 
Prevent CI jobs with secrets from running in forks

These Github actions will run only in the upstream repository

CLA: trivial

Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/27275)

3 months agoFix potential NULL pointer dereference in final_maxfragmentlen()
Andrey Tsygunka [Fri, 4 Apr 2025 11:58:40 +0000 (14:58 +0300)] 
Fix potential NULL pointer dereference in final_maxfragmentlen()

In the final_maxfragmentlen() function, s->session is checked
for NULL after it was dereferenced earlier.
So move this NULL check to the top of the function.

CLA: trivial

Fixes: fa49560451 (Fix handling of max_fragment_length extension for PSK)
Signed-off-by: Andrey Tsygunka <aitsygunka@yandex.ru>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com>
Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
(Merged from https://github.com/openssl/openssl/pull/27272)

3 months agoFix test failures on big endian ARMv9 target
Bernd Edlinger [Thu, 3 Apr 2025 12:33:25 +0000 (14:33 +0200)] 
Fix test failures on big endian ARMv9 target

This fixes a couple of big-endian issues in the
assembler code of chacha, SM3 and SM4.

Fixes #27197
Tested-by: @zeldin
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27252)

3 months agossl/ssl_lib.c: Avoid crash when SSL_CONNECTION is NULL
Graham Leggett [Wed, 2 Apr 2025 11:08:11 +0000 (12:08 +0100)] 
ssl/ssl_lib.c: Avoid crash when SSL_CONNECTION is NULL

Detection for sc == NULL is performed after sc is used. Add the
check to the correct place.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/27241)

3 months agocrypto/ui/ui_lib.c: Add OPENSSL_free to avoid memory leaks
JiashengJiang [Tue, 1 Apr 2025 01:22:53 +0000 (21:22 -0400)] 
crypto/ui/ui_lib.c: Add OPENSSL_free to avoid memory leaks

Add OPENSSL_free() if general_allocate_boolean() or general_allocate_string fails to avoid memory leaks.

Fixes: a63d5eaab2 ("Add a general user interface API. This is designed to replace things like des_read_password and friends (backward compatibility functions using this new API are provided). The purpose is to remove prompting functions from the DES code section as well as provide for prompting through dialog boxes in a window system and the like.")
Signed-off-by: JiashengJiang <jiasheng@purdue.edu>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27218)

3 months agofixed multiline output bug in crl command, ensuring use of global variable to set...
aaSchwager [Sat, 22 Mar 2025 22:13:22 +0000 (15:13 -0700)] 
fixed multiline output bug in crl command, ensuring use of global variable to set changes

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
(Merged from https://github.com/openssl/openssl/pull/27124)

3 months agoAdd SSL_CTX_set_ec_point_formats() and SSL_set_ec_point_formats()
Tim Perry [Thu, 6 Mar 2025 13:33:17 +0000 (14:33 +0100)] 
Add SSL_CTX_set_ec_point_formats() and SSL_set_ec_point_formats()

The internal fields and implementation for configuration of this
parameter already existed, but was not exposed. This change adds simple
setters to allow configuration of this field.

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

3 months agoImplement AES-CBC-HMAC-SHA512 on aarch64
fangming.fang [Fri, 26 Jan 2024 10:48:17 +0000 (10:48 +0000)] 
Implement AES-CBC-HMAC-SHA512 on aarch64

This is to implement #19932, it adds enc-then-mac aes-cbc-hmac-sha512 on
aarch64, aes-cbc and hmac-sha512 are interleaved to achieve better
performance.It only supports non-padding mode that means the length of
input data should be multiple of 16 bytes.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/22949)

3 months agoImplement interleaving aes-cbc-hmac-sha on aarch64
fangming.fang [Wed, 17 Jan 2024 10:48:55 +0000 (10:48 +0000)] 
Implement interleaving aes-cbc-hmac-sha on aarch64

This is to implement #19932, it adds enc-then-mac aes-cbc-hmac-sha1/256,
aes-cbc and hmac-sha1/256 are interleaved to achieve better performance.
It only supports non-padding mode that means the length of input data
should be multiple of 16 bytes.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/22949)

3 months agoAdd a test for calling SSL_accept() on an accepted connection
Matt Caswell [Mon, 7 Apr 2025 10:45:25 +0000 (11:45 +0100)] 
Add a test for calling SSL_accept() on an accepted connection

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27283)

3 months agoDocument the state of the object you get from SSL_accept_connection()
Matt Caswell [Mon, 7 Apr 2025 09:12:55 +0000 (10:12 +0100)] 
Document the state of the object you get from SSL_accept_connection()

The object may or may not have completed its handshake.

See also:
https://github.com/openssl/openssl/pull/27239#issuecomment-2772148408

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27283)

3 months agoFix SSL_accept()
Matt Caswell [Mon, 7 Apr 2025 08:58:30 +0000 (09:58 +0100)] 
Fix SSL_accept()

If you have a QUIC server SSL connection object, you should be able to
call SSL_accept() on it.

Fixes #27282

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27283)

3 months agoImplement i2d_PKCS8PrivateKey
Viktor Dukhovni [Wed, 9 Apr 2025 07:55:03 +0000 (17:55 +1000)] 
Implement i2d_PKCS8PrivateKey

Added `i2d_PKCS8PrivateKey(3)` API to complement `i2d_PrivateKey(3)`,
the former always outputs PKCS#8.

Extended endecoder_test.c to check that `i2d_PKCS8PrivateKey()`
produces the expected PKCS#8 output.

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

3 months agoTest that SSL_poll does not report a stream as writable if it isn't
Matt Caswell [Wed, 9 Apr 2025 12:08:09 +0000 (13:08 +0100)] 
Test that SSL_poll does not report a stream as writable if it isn't

We consume all the credit and check the stream is no longer writeable

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/27319)