]> git.ipfire.org Git - thirdparty/openssl.git/log
thirdparty/openssl.git
2 weeks agoPrepare for 3.6 beta 2 28567/head
openssl-machine [Tue, 16 Sep 2025 12:18:28 +0000 (12:18 +0000)] 
Prepare for 3.6 beta 2

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Release: yes

2 weeks agoPrepare for release of 3.6 beta 1 openssl-3.6.0-beta1
openssl-machine [Tue, 16 Sep 2025 12:18:18 +0000 (12:18 +0000)] 
Prepare for release of 3.6 beta 1

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Release: yes

2 weeks agomake update
openssl-machine [Tue, 16 Sep 2025 12:18:17 +0000 (12:18 +0000)] 
make update

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Release: yes

2 weeks agoCopyright year updates
openssl-machine [Tue, 16 Sep 2025 12:16:23 +0000 (12:16 +0000)] 
Copyright year updates

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Release: yes

2 weeks agoEnable LMS on provider compat fips build for 3.6
Neil Horman [Sun, 14 Sep 2025 17:13:00 +0000 (13:13 -0400)] 
Enable LMS on provider compat fips build for 3.6

The LMS test for fips assumes that LMS is available in the provider in
any version equal to or later than 3.6.

We should probably augment the test such that instead of just checking
the openssl version, we instead query the provider to see if the needed
algs are available to use LMS.

But given the current state of affairs, it seems more sensible to just
enable lms in the 3.6 fips provider build to ensure lms gets tested.

Fixes openssl/project#1435

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

(cherry picked from commit 0e9415d583b686ac28e22bdf82433ff1e90ff0b2)

3 weeks agoTest failure of rsa_encrypt when buffer too short
Viktor Dukhovni [Sat, 13 Sep 2025 02:52:42 +0000 (12:52 +1000)] 
Test failure of rsa_encrypt when buffer too short

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28517)

(cherry picked from commit d498f56d0ab4a7a56746961848e07f561df5fdaf)

3 weeks agoHarden RSA public encrypt
Viktor Dukhovni [Thu, 11 Sep 2025 08:50:44 +0000 (18:50 +1000)] 
Harden RSA public encrypt

Check the that the indicated output buffer length is large enough.

Fix EVP_SealInit() to initialise the output buffer length to the RSA
modulus length, not the input KEK length.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28517)

(cherry picked from commit f34b1ad17ba37a76a96e53be3813d88bf2b329f2)

3 weeks agoUpdate our CI jobs to cover the 3.6 stable branch
Neil Horman [Thu, 11 Sep 2025 12:40:14 +0000 (08:40 -0400)] 
Update our CI jobs to cover the 3.6 stable branch

The coveralls, prov-compat and provider-compatibiity CI jobs test each
of the stable branches.  We need to add 3.6 to the list in each of those
tests

Fixes openssl/project#1424

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

(cherry picked from commit 5aae731a7d60b2ab9cbc25b8d0956c15f5ee2206)

3 weeks agoCHANGES.md, NEWS.md: update for 3.6.0-beta1
Eugene Syromiatnikov [Thu, 11 Sep 2025 14:59:55 +0000 (16:59 +0200)] 
CHANGES.md, NEWS.md: update for 3.6.0-beta1

CHANGES.md:
 * https://github.com/openssl/openssl/pull/28398
 * https://github.com/openssl/openssl/pull/28411
 * https://github.com/openssl/openssl/pull/28447
 * https://github.com/openssl/openssl/pull/28449

NEWS.md:
 * https://github.com/openssl/openssl/pull/28447

Release: yes
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28521)

3 weeks agoCHANGES.md, NEWS.md: ffix
Eugene Syromiatnikov [Thu, 11 Sep 2025 14:59:29 +0000 (16:59 +0200)] 
CHANGES.md, NEWS.md: ffix

Minor formating cleanups.

Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28521)

3 weeks agocrypto/bio/bio_print.c: improve handling of unreasonably large widths/precisions
Eugene Syromiatnikov [Wed, 10 Sep 2025 08:11:22 +0000 (10:11 +0200)] 
crypto/bio/bio_print.c: improve handling of unreasonably large widths/precisions

As fmt*() routines try to loop all the way up to pad sizes calculated
based on the user-provided width and precision specification,
it is relatively simple to trigger billions of loop iterations
by providing appropriate width and precision specification, even
if printing is done in a statically-sized buffer.  Avoid those
by introducing a helper eob_ok() function, that allows short-circuiting
those loops.

Resolves: https://github.com/openssl/openssl/issues/28416
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28502)

3 weeks agocrypto/bio/bio_print.c: avoid signed int overflow in desc->pos in doapr_outch
Eugene Syromiatnikov [Wed, 10 Sep 2025 08:08:21 +0000 (10:08 +0200)] 
crypto/bio/bio_print.c: avoid signed int overflow in desc->pos in doapr_outch

While highly improbable, a signed integer overflow can be triggered
by incrementing desc->pos LLONG_MAX + 1 times.

Fixes: 228ef5f54727 "crypto/bio/bio_print.c: make %n in line with other libc implementations"
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28502)

3 weeks agocrypto/bio/bio_print.c: avoid signed int overow in padlen calculation in fmtstr
Eugene Syromiatnikov [Wed, 10 Sep 2025 08:03:11 +0000 (10:03 +0200)] 
crypto/bio/bio_print.c: avoid signed int overow in padlen calculation in fmtstr

In a highly unlikely situation of str being longer than INT_MAX,
a signed integer overflow in padlen calculation can be triggered.
Avoid it by reworking the check for the need of padlen calculation.

Fixes: 230c691a5218 "Fix fmtstr for BIO_printf() et al"
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28502)

3 weeks agoOSSL_CALLBACK.pod: add missing info on required return values of callback functions
Dr. David von Oheimb [Mon, 14 Apr 2025 19:09:16 +0000 (21:09 +0200)] 
OSSL_CALLBACK.pod: add missing info on required return values of callback functions

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

(cherry picked from commit 1875bb0fecf6584cfe62dc5c454648e50a9ad281)

3 weeks agodoc: Add missing commas
Jakub Jelen [Tue, 9 Sep 2025 16:10:30 +0000 (18:10 +0200)] 
doc: Add missing commas

CLA: trivial
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28493)

(cherry picked from commit 1199882de69bf41225002603a8c3634c401ff99a)

3 weeks agoAdd one more trace message to the torture_rcu_high test
Bernd Edlinger [Mon, 8 Sep 2025 21:00:55 +0000 (23:00 +0200)] 
Add one more trace message to the torture_rcu_high test

It is interesting that in the very rare cases, where this
test failure has been observed so far, the rcu torture value
went always backwards to 0.  This could be either due to
ossl_rcu_deref(&writer_ptr) returning NULL, or the initial
value of "new = CRYPTO_zalloc(sizeof(uint64_t), NULL, 0)"
still visible despite ossl_rcu_assign_ptr(&writer_ptr, &new)
immediatley after the "*new = global_ctr++" statement.
Add one additional trace message to find out what exactly
happens here, when it happens again.
Additionally, we do no longer initialize the new value to
zero but something else, so it can also be detected.

Related to #27267

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28487)

(cherry picked from commit 17d5c9297ef6f6a4d72788082d6772deb7a18f24)

3 weeks agoAdd key_type to the derive_skey function
Dmitry Belyavskiy [Mon, 8 Sep 2025 18:50:59 +0000 (20:50 +0200)] 
Add key_type to the derive_skey function

In some cases this information is necessary on the provider side

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

(cherry picked from commit c4aa51747026a07dbdaff1fcaf306ce66ef41828)

3 weeks agodoc/man3/RAND_load_file.pod: RAND_load_file on non-regular files with bytes=-1
Eugene Syromiatnikov [Fri, 29 Aug 2025 08:29:26 +0000 (10:29 +0200)] 
doc/man3/RAND_load_file.pod: RAND_load_file on non-regular files with bytes=-1

Mention that RAND_load_file attempts to read only RAND_DRBG_STRENGTH
bytes on non-regular files if the number of bytes to be read
is not specified explicitly.

Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.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/28379)

(cherry picked from commit 0daaf33275196dd5af9535d69b0d521b9e4d03de)

3 weeks agocrypto/rand/randfile.c: avoid signed integer overflow in RAND_load_file
Eugene Syromiatnikov [Fri, 29 Aug 2025 08:02:39 +0000 (10:02 +0200)] 
crypto/rand/randfile.c: avoid signed integer overflow in RAND_load_file

If a file supplied to RAND_load_file is too big (more than INT_MAX bytes),
it is possible to trigger a signer integer overflow during ret calculation.
Avoid it by returning early when we are about to hit it on the next
iteration.

Reported-by: Liu-Ermeng <liuermeng2@huawei.com>
Resolves: https://github.com/openssl/openssl/issues/28375
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.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/28379)

(cherry picked from commit 35db6a15d436aa4d981ebcd581eded55fc8c8fb6)

3 weeks agoutil/find-doc-nits: do not check files in submodules in check_env_vars
Eugene Syromiatnikov [Fri, 29 Aug 2025 07:11:23 +0000 (09:11 +0200)] 
util/find-doc-nits: do not check files in submodules in check_env_vars

The reports about undocumented environment variables coming from files
in submodules are superfluous;  get the list of directories
from .gitmodules and exclude them from processing.

Resolves: https://github.com/openssl/openssl/issues/28109
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28378)

(cherry picked from commit 876188d8a308babf1d24f27f5a838bca044d1d32)

3 weeks agoMake the Unix build process more repeatable
Enji Cooper [Fri, 5 Sep 2025 03:22:00 +0000 (20:22 -0700)] 
Make the Unix build process more repeatable

Before this change all manpages would contain the date when pod2man was
run. This resulted in outputs that differed between builds--or
potentially across a single build if the host clock "ticked" to the next
day when the build was being run.

This commit modifies the manpage generation process as follows:
- The date all manpages were generated will be normalized to a single
  date.
- The release date specified in `VERSION.dat` is used instead of the
  date/time when `pod2man` was executed OR--in the event a date isn't
  specified in `VERSION.dat`--the time when the Makefiles were last
  regenerated.

Embedding a consistent date into the generated manpages helps ensure that
the build process as a whole is more repeatable and helps ensure that
release versions of OpenSSL create artifacts consistent with the date
that the official release was cut.

Co-authored-by: Richard Levitte <levitte@openssl.org>
Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28449)

(cherry picked from commit 2c0c9c83b292fdba001d968a8219db4083294003)

3 weeks agoopenssl-enc.pod.in: We actually use PKCS#7 padding
Sergey G. Brester [Wed, 27 Aug 2025 22:26:11 +0000 (00:26 +0200)] 
openssl-enc.pod.in: We actually use PKCS#7 padding

PKCS#5 padding is a subset for 8-bytes block ciphers only.

CLA: trivial

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

(cherry picked from commit 4e0c2d02a9a415823babf74106985352e7bbcdae)

3 weeks agoRISC-V: Use address for vlenb CSR
Hongren Zheng [Tue, 2 Sep 2025 14:00:10 +0000 (22:00 +0800)] 
RISC-V: Use address for vlenb CSR

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

(cherry picked from commit 1a278e765a5167368268cd3034649c2c5d504c11)

3 weeks agoAdd a helper function to delete the extension list
David Benjamin [Sun, 31 Aug 2025 22:09:52 +0000 (18:09 -0400)] 
Add a helper function to delete the extension list

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

(cherry picked from commit 9e8898b6b6032a69f1002ab823a1cc0bba109b50)

3 weeks agoClear the extension list when removing the last extension
David Benjamin [Sun, 31 Aug 2025 21:25:40 +0000 (17:25 -0400)] 
Clear the extension list when removing the last extension

The extensions list in a certificate, CRL, and CRL entry is defined as:

    ... extensions      [3]  EXPLICIT Extensions OPTIONAL ...
    ... crlEntryExtensions      Extensions OPTIONAL ...
    ... crlExtensions           [0]  EXPLICIT Extensions OPTIONAL ...

    Extensions  ::=  SEQUENCE SIZE (1..MAX) OF Extension

This means that a present but empty extensions list is actually invalid.
Rather, if you have no extensions to encode, you are meant to omit the
list altogether. Fix the delete_ext functions to handle this correctly.

This would mostly be moot, as an application adding extensions only to
delete them all would be unusual. However, #13658 implemented a slightly
roundabout design where, to omit SKID/AKID, the library first puts them
in and then the command-line tool detects some placeholder values and
deletes the extension again.

Fixes #28397

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

(cherry picked from commit 9a8d7dc14201aeeed1e77d54208e4af96916fc4f)

3 weeks agoFix typo in BN_generate_prime docs
Viperinius [Sun, 31 Aug 2025 16:09:11 +0000 (16:09 +0000)] 
Fix typo in BN_generate_prime docs

CLA: trivial

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28395)

(cherry picked from commit b64ac3cb8330d417a7fa859fe74e0bd41805a6db)

3 weeks agodoc: Update documentation of SSL_CTX_set_dh_auto()
Ryan Hooper [Thu, 28 Aug 2025 13:12:39 +0000 (09:12 -0400)] 
doc: Update documentation of SSL_CTX_set_dh_auto()

Update the documentation of the dh_tmp_auto argument in
regards to its behavior when the argument value is 2.

Fixes #27606

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

(cherry picked from commit 7600608eab0cd0a633e4d989d634590831b48a5d)

3 weeks agodocs: Be case specific with links to man headers
Norbert Pocs [Wed, 27 Aug 2025 13:45:45 +0000 (15:45 +0200)] 
docs: Be case specific with links to man headers

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
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/28356)

(cherry picked from commit 56ce30abb7bdf88a020557e70e0489eff541d097)

3 weeks agoPick libcrypto.num/libssl.num number assignments from 3.5
openssl-machine [Tue, 25 Mar 2025 15:01:21 +0000 (15:01 +0000)] 
Pick libcrypto.num/libssl.num number assignments from 3.5

This commit is a partial forward-port of the commit e5386cd2d71b
"make update" from the openssl-3.5 branch, that contains the assignments
of the ordinal function numbers for the module definition file of the libcrypto
and libssl Windows DLLs for the functions introduced in OpenSSL 3.5.

Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28380)

4 weeks agohmac: stop using secure memory for the HMAC key
Pauli [Mon, 1 Sep 2025 22:48:06 +0000 (08:48 +1000)] 
hmac: stop using secure memory for the HMAC key

Secure memory is design for long term storage of private material.
HMAC keys are not this.

Secure memory use was introduced in July 2020 by commit
3fddbb264e87a8cef2903cbd7b02b8e1a39a2a99.

Fixes #28346

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

(cherry picked from commit 362739d771f671b444cb9a12a34accf2dce8220e)

4 weeks agoslh-dsa: omit test of import PCT
Pauli [Thu, 4 Sep 2025 21:24:19 +0000 (07:24 +1000)] 
slh-dsa: omit test of import PCT

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

(cherry picked from commit c25db4f867c8adc9d1a3b5336743c428a2bb8ca2)

4 weeks agoimport pct: remove import PCTs for most algorithms
Pauli [Thu, 4 Sep 2025 21:23:28 +0000 (07:23 +1000)] 
import pct: remove import PCTs for most algorithms

This coveres DH, EC, RSA and SLH-DSA.

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

(cherry picked from commit 7f7f75816f2643daa9c1ba986aa17d50ae72dce7)

4 weeks agoOnly unlock in rsa_get_blinding when locking was successful
two-heart [Thu, 4 Sep 2025 10:20:53 +0000 (12:20 +0200)] 
Only unlock in rsa_get_blinding when locking was successful

CLA: trivial

Reviewed-by: Matt Caswell <matt@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/28438)

(cherry picked from commit dbad8448c2fc659de380204592f31901daebffb8)

4 weeks agoAdd missing unlock to ossl_provider_new
two-heart [Thu, 4 Sep 2025 09:18:01 +0000 (11:18 +0200)] 
Add missing unlock to ossl_provider_new

unlock on the early return path

CLA: trivial

Reviewed-by: Matt Caswell <matt@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/28437)

(cherry picked from commit c89b46826caff4ced320268f284d963ff06dee77)

4 weeks agoFIPS: Don't allow SHA512-224 and SHA512-256 for ECDSA/DSA signatures
slontis [Fri, 29 Aug 2025 04:11:59 +0000 (14:11 +1000)] 
FIPS: Don't allow SHA512-224 and SHA512-256 for ECDSA/DSA signatures

These algorithms do not have OIDS (Note that RSA does have OIDS),
and are not valid values for FIPS.
Note that this was only possible if the "ECDSA" algorithm is fetched.
Note that "ECDSA-SHA512-256" and "ECDSA-SHA512-224" are not currently
fetchable.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28377)

(cherry picked from commit 5ce54ae14bd1ad1934dfe493fe39d89eb1d5b72d)

4 weeks agoslh-dsa: enter FIPS error state if pairwise test fails
Pauli [Sun, 31 Aug 2025 07:21:42 +0000 (17:21 +1000)] 
slh-dsa: enter FIPS error state if pairwise test fails

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

(cherry picked from commit a7d2754661e85d14d9629fb4db0f8f5fcef28e61)

4 weeks agoPrepare for 3.6 alpha 2 28420/head
openssl-machine [Tue, 2 Sep 2025 13:07:25 +0000 (13:07 +0000)] 
Prepare for 3.6 alpha 2

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Release: yes

4 weeks agoPrepare for release of 3.6 alpha 1 openssl-3.6.0-alpha1
openssl-machine [Tue, 2 Sep 2025 13:07:16 +0000 (13:07 +0000)] 
Prepare for release of 3.6 alpha 1

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Release: yes

4 weeks agomake update
openssl-machine [Tue, 2 Sep 2025 13:07:15 +0000 (13:07 +0000)] 
make update

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Release: yes

4 weeks agoCopyright year updates
openssl-machine [Tue, 2 Sep 2025 13:05:45 +0000 (13:05 +0000)] 
Copyright year updates

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Release: yes

4 weeks agoRelease news and changelog for version 3.6
Norbert Pocs [Mon, 1 Sep 2025 12:38:51 +0000 (14:38 +0200)] 
Release news and changelog for version 3.6

Release: yes

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28403)

5 weeks agoMake update
Dmitry Belyavskiy [Thu, 28 Aug 2025 16:42:24 +0000 (18:42 +0200)] 
Make update

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28369)

5 weeks agoImplement EVP_KDF_CTX_set_SKEY
Simo Sorce [Fri, 10 Jan 2025 22:20:59 +0000 (17:20 -0500)] 
Implement EVP_KDF_CTX_set_SKEY

This allows to use a SKEY as input to a KDF derive operation.

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28369)

5 weeks agoImplement EVP_PKEY_derive_SKEY
Dmitry Belyavskiy [Fri, 15 Nov 2024 15:21:04 +0000 (16:21 +0100)] 
Implement EVP_PKEY_derive_SKEY

Signed-off-by: Dmitry Belyavskiy <beldmit@gmail.com>
Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28369)

5 weeks agoImplement EVP_KDF_derive_SKEY
Dmitry Belyavskiy [Fri, 10 Jan 2025 11:40:25 +0000 (12:40 +0100)] 
Implement EVP_KDF_derive_SKEY

Signed-off-by: Dmitry Belyavskiy <beldmit@gmail.com>
Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28369)

5 weeks agoWe use evp_skey_alloc from several source files
Dmitry Belyavskiy [Thu, 28 Aug 2025 16:29:46 +0000 (18:29 +0200)] 
We use evp_skey_alloc from several source files

It shouldn't be static

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28369)

5 weeks agoCorrectly dealing with refcount in EVP_SKEY
Dmitry Belyavskiy [Fri, 29 Aug 2025 13:42:04 +0000 (15:42 +0200)] 
Correctly dealing with refcount in EVP_SKEY

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28369)

5 weeks agoImplementation of EVP_SKEY_import_SKEYMGMT
Dmitry Belyavskiy [Fri, 29 Aug 2025 11:52:55 +0000 (13:52 +0200)] 
Implementation of EVP_SKEY_import_SKEYMGMT

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28369)

5 weeks agoAdd GENERIC SKEYMGMT to the legacy provider
Dmitry Belyavskiy [Wed, 27 Aug 2025 14:16:54 +0000 (16:16 +0200)] 
Add GENERIC SKEYMGMT to the legacy provider

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28369)

5 weeks agoDesign document of using opaque object as symmetric key
Dmitry Belyavskiy [Thu, 27 Jul 2023 10:12:40 +0000 (12:12 +0200)] 
Design document of using opaque object as symmetric key

Signed-off-by: Dmitry Belyavskiy <beldmit@gmail.com>
Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28369)

5 weeks agoFix typos and whitespace
Leonabcd123 [Thu, 28 Aug 2025 08:46:13 +0000 (11:46 +0300)] 
Fix typos and whitespace

Added "the" before "use"
Add missing whitespace
Removed unnecessary apostrophe in FIPS.md

CLA: trivial

Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28362)

5 weeks agoDocument the OSSL_SELF_TEST_TYPE_PCT_IMPORT failure state
Pauli [Fri, 29 Aug 2025 02:47:35 +0000 (12:47 +1000)] 
Document the OSSL_SELF_TEST_TYPE_PCT_IMPORT failure state

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28376)

5 weeks agoml-kem: convert to transient error state on import failure in FIPS provider
Pauli [Fri, 29 Aug 2025 02:43:09 +0000 (12:43 +1000)] 
ml-kem: convert to transient error state on import failure in FIPS provider

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28376)

5 weeks agoml-dsa: convert to transient error state on import failure in FIPS provider
Pauli [Fri, 29 Aug 2025 02:43:01 +0000 (12:43 +1000)] 
ml-dsa: convert to transient error state on import failure in FIPS provider

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28376)

5 weeks agoecx: convert to transient error state on import failure in FIPS provider
Pauli [Fri, 29 Aug 2025 02:42:46 +0000 (12:42 +1000)] 
ecx: convert to transient error state on import failure in FIPS provider

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28376)

5 weeks agoec: convert to transient error state on import failure in FIPS provider
Pauli [Fri, 29 Aug 2025 02:42:35 +0000 (12:42 +1000)] 
ec: convert to transient error state on import failure in FIPS provider

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28376)

5 weeks agodh: convert to transient error state on import failure in FIPS provider
Pauli [Fri, 29 Aug 2025 02:42:17 +0000 (12:42 +1000)] 
dh: convert to transient error state on import failure in FIPS provider

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28376)

5 weeks agorsa: convert to transient error state on import failure in FIPS provider
Pauli [Fri, 29 Aug 2025 02:42:00 +0000 (12:42 +1000)] 
rsa: convert to transient error state on import failure in FIPS provider

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28376)

5 weeks agoAdd OSSL_SELF_TEST_TYPE_PCT_IMPORT transient error state
Pauli [Fri, 29 Aug 2025 02:41:22 +0000 (12:41 +1000)] 
Add OSSL_SELF_TEST_TYPE_PCT_IMPORT transient error state

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28376)

5 weeks agoadd new error
Pauli [Fri, 29 Aug 2025 02:37:45 +0000 (12:37 +1000)] 
add new error

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28376)

5 weeks agotest/bioprinttest.c: move the %n result to the field that is later checked
Eugene Syromiatnikov [Fri, 29 Aug 2025 17:45:07 +0000 (19:45 +0200)] 
test/bioprinttest.c: move the %n result to the field that is later checked

The test_n test implicitly assumed a certain union layout, as the %n was
writing to the union field in accordance with the length modifier being
tested, but comparison of the expected value was dan agains the val field,
and that is incorrect, especially on big-endian architectures.  Fix that
by explicitly assigning the result to the val field of the union and
updating the expected values where the resulting value overflows
into negative.

Fixes: 9deaf8383338 "test/bioprinttest.c: add some checks for integer and string printing"
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28388)

5 weeks agotest/bioprinttest.c: fix sloppy length modifier usage in int_data
Eugene Syromiatnikov [Fri, 29 Aug 2025 17:39:53 +0000 (19:39 +0200)] 
test/bioprinttest.c: fix sloppy length modifier usage in int_data

Some test vectors used in int_data have mismatching (or, more
spercifically) missing length modifiers in conversion specifiers;
most of the time it has gone unnoticed, but on some architectures where
64-bit arguments supplied differently (sugh as mips and armv7) it led
to garbage being retrieved instead of the expected values.  Fix it
by properly providing proper length modifiers.

Fixes: 9deaf8383338 "test/bioprinttest.c: add some checks for integer and string printing"
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28388)

5 weeks agoslh-dsa: add a PCT for key import when in FIPS mode
Pauli [Thu, 14 Aug 2025 04:57:19 +0000 (14:57 +1000)] 
slh-dsa: add a PCT for key import when in FIPS mode

Fixes #28182

Co-Authored-By: slontis <shane.lontis@oracle.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28276)

5 weeks agotest/bioprinttest.c: add some checks for integer and string printing
Eugene Syromiatnikov [Tue, 5 Aug 2025 13:27:44 +0000 (15:27 +0200)] 
test/bioprinttest.c: add some checks for integer and string printing

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

5 weeks agotest/bioprinttest.c: check the output against libc's one as well
Eugene Syromiatnikov [Tue, 5 Aug 2025 13:27:06 +0000 (15:27 +0200)] 
test/bioprinttest.c: check the output against libc's one as well

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

5 weeks agotest/bioprinttest.c: constify test vectors
Eugene Syromiatnikov [Tue, 5 Aug 2025 13:26:42 +0000 (15:26 +0200)] 
test/bioprinttest.c: constify test vectors

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

5 weeks agotest/bioprinttest.c: use the whole buffer for checks
Eugene Syromiatnikov [Thu, 14 Aug 2025 07:58:01 +0000 (09:58 +0200)] 
test/bioprinttest.c: use the whole buffer for checks

There is no need to decrement the size of buffer by 1, snprintf should
terminate the output with a \0.

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

5 weeks agocrypto/bio/bio_print.c: handle the case of 0 with zero precision
Eugene Syromiatnikov [Fri, 15 Aug 2025 14:35:11 +0000 (16:35 +0200)] 
crypto/bio/bio_print.c: handle the case of 0 with zero precision

Per [1]:

    The result of converting zero with an explicit precision of zero
    shall be no characters.

[1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/printf.html

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

5 weeks agocrypto/bio/bio_print.c: improve the precision handling in fmtint
Eugene Syromiatnikov [Fri, 15 Aug 2025 14:28:11 +0000 (16:28 +0200)] 
crypto/bio/bio_print.c: improve the precision handling in fmtint

Per [1]:

    * A negative precision is taken as if the precision were omitted.
    * The default precision is 1.
    * For d, i, o, u, x, and X conversion specifiers, if a precision
      is specified, the '0' flag shall be ignored.

[1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/printf.html

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

5 weeks agocrypto/bio/bio_print.c: bring back the length modifier support for %n
Eugene Syromiatnikov [Fri, 15 Aug 2025 14:07:24 +0000 (16:07 +0200)] 
crypto/bio/bio_print.c: bring back the length modifier support for %n

For some reason, it has been removed in commit 15b337fa58ba "bio/b_print.c:
switch to int64_t as "greatest-width integer type".", despite being a part
of the standard in both ANSI C and POSIX.1-2001.  Bring it back for all
the supported length modifiers.

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

5 weeks agocrypto/bio/bio_print.c: make %n in line with other libc implementations
Eugene Syromiatnikov [Fri, 15 Aug 2025 14:00:50 +0000 (16:00 +0200)] 
crypto/bio/bio_print.c: make %n in line with other libc implementations

The standard[1] is pretty vague in its definition of the %n specifier
by using "the number of bytes written to the output so far", without
actually elaborating, whether only the actually written bytes, or the bytes
that would be written (but discarded) are used;  the consensus across
implementations, however, seems to gravitate towards the latter.  Track
the virtual "write position" separately and use its value when %n format
is occurred.  That also means that we cannot finish the output early
upon reach of the end of buffer (unless we made sure that no %n specifiers
occur in the remainder of the format string).

[1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/printf.html

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

5 weeks agocrypto/bio/bio_print.c: avoid integer overflow when reading width/precision
Eugene Syromiatnikov [Tue, 5 Aug 2025 12:51:22 +0000 (14:51 +0200)] 
crypto/bio/bio_print.c: avoid integer overflow when reading width/precision

Both width and precision are "decimal digit strings" of unspecified size,
but we can realistically cap it at INT_MAX.

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

5 weeks agocrypto/bio/bio_print.c: always terminate output with \0
Eugene Syromiatnikov [Wed, 27 Aug 2025 08:48:20 +0000 (10:48 +0200)] 
crypto/bio/bio_print.c: always terminate output with \0

Man page states that the result is terminated with \0 on error, however,
when the jump to the "out" label is performed in _dopr, writing out \0
is skipped.  Rearrange the end of the routine to make the "out" part
include the overflow calculation and the final \0 writing.

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

5 weeks agocrypto/bio/bio_print.c: consolidating print arguments in a structure
Eugene Syromiatnikov [Fri, 15 Aug 2025 12:18:11 +0000 (14:18 +0200)] 
crypto/bio/bio_print.c: consolidating print arguments in a structure

buffer/sbuffer/maxlen/currlen are passed together between _dopr, fmt*,
and doapr_outch;  consolidate them together in a structure and pass
it instead.  A preparatory commit before introducing a separate "write
position" parameter, that is also to be passed around.

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

5 weeks agocrypto/bio/bio_print.c: reset max to zero if empty precision string is provided
Eugene Syromiatnikov [Thu, 14 Aug 2025 17:15:09 +0000 (19:15 +0200)] 
crypto/bio/bio_print.c: reset max to zero if empty precision string is provided

Per [1]:

    a null digit string is treated as zero.

[1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/printf.html

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

5 weeks agocrypto/bio/bio_print.c: add 't' (ptrdiff_t) length modifier
Eugene Syromiatnikov [Thu, 14 Aug 2025 17:04:32 +0000 (19:04 +0200)] 
crypto/bio/bio_print.c: add 't' (ptrdiff_t) length modifier

As specified by POSIX.1-2001 and C99.

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

5 weeks agocrypto/bio/bio_print.c: fix space padding calculation
Eugene Syromiatnikov [Tue, 5 Aug 2025 13:19:12 +0000 (15:19 +0200)] 
crypto/bio/bio_print.c: fix space padding calculation

Sign, prefix, and zero padding should count towards precision.

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

5 weeks agocrypto/bio/bio_print.c: '-' flag has priority over '0'
Eugene Syromiatnikov [Tue, 5 Aug 2025 13:21:32 +0000 (15:21 +0200)] 
crypto/bio/bio_print.c: '-' flag has priority over '0'

Per [1]:

    If the '0' and '-' flags both appear, the '0' flag is ignored.

[1] https://pubs.opengroup.org/onlinepubs/9799919799//functions/printf.html

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

5 weeks agocrypto/bio/bio_print.c: avoid superfluous zero padding in %#o
Eugene Syromiatnikov [Tue, 5 Aug 2025 13:14:51 +0000 (15:14 +0200)] 
crypto/bio/bio_print.c: avoid superfluous zero padding in %#o

Zero prefix in the alternative octal form count towards precision,
per [1]:

    For o conversion, it **shall increase the precision**...

[1] https://pubs.opengroup.org/onlinepubs/9799919799//functions/printf.html

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

5 weeks agocrypto/bio/bio_print.c: no prefix for zero value in alternative form
Eugene Syromiatnikov [Tue, 5 Aug 2025 13:11:08 +0000 (15:11 +0200)] 
crypto/bio/bio_print.c: no prefix for zero value in alternative form

Per [1] (emphasis is added):

    - For o conversion, it shall increase the precision,
      **if and only if necessary**, to force the first digit of the result
      to be a zero (**if the value and precision are both 0,
      a single 0 is printed**).
    - For x or X conversion specifiers, a **non-zero** result shall have
      0x (or 0X) prefixed to it.

[1] https://pubs.opengroup.org/onlinepubs/9799919799//functions/printf.html

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

5 weeks agocrypto/bio/bio_print.c: handle negative width argument
Eugene Syromiatnikov [Tue, 5 Aug 2025 12:53:28 +0000 (14:53 +0200)] 
crypto/bio/bio_print.c: handle negative width argument

Per [1]:

    A negative field width is taken as a '-' flag followed by a positive field
    width.

So, printf("%-*d", -12, 34) should lead to a 123-wide left-aligned output,
"34          ".

[1] https://pubs.opengroup.org/onlinepubs/9799919799//functions/printf.html

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

5 weeks agocrypto/bio/bio_print.c: correctly print 0X prefix for X conversion
Eugene Syromiatnikov [Fri, 25 Jul 2025 17:00:22 +0000 (19:00 +0200)] 
crypto/bio/bio_print.c: correctly print 0X prefix for X conversion

Per [1]:

   For x or X conversion specifiers, a non-zero result shall have 0x (or 0X)
   prefixed to it.

[1] https://pubs.opengroup.org/onlinepubs/9799919799//functions/printf.html

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

5 weeks agocrypto/bio/bio_print.c: support hh length modifier in _dopr
Eugene Syromiatnikov [Fri, 25 Jul 2025 16:55:26 +0000 (18:55 +0200)] 
crypto/bio/bio_print.c: support hh length modifier in _dopr

Per [1]:

    hh
        Specifies that a following d, i, o, u, x, or X conversion specifier
        applies to a signed char or unsigned char argument

[1] https://pubs.opengroup.org/onlinepubs/9799919799//functions/printf.html

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

5 weeks agoAdd SKEYMGMT support to the FIPS provider
Pavol Žáčik [Wed, 20 Aug 2025 12:35:03 +0000 (14:35 +0200)] 
Add SKEYMGMT support to the FIPS provider

And extend the SKEY managers listing test with a FIPS case.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28339)

5 weeks agoNOTES-WINDOWS.md: correct the Windows context macro name
Eugene Syromiatnikov [Mon, 25 Aug 2025 14:02:37 +0000 (16:02 +0200)] 
NOTES-WINDOWS.md: correct the Windows context macro name

Fix incorrect Windows context macro spelling "OPENSSL_WINCTX"
by replacing it with "OSSL_WINCTX".

Reported-by: https://github.com/sjan1970
Resolves: https://github.com/openssl/openssl/issues/28329
Fixes: 630e3a168446 "Change WININSTALLCONTEXT to OSSL_WINCTX"
Complements: c2ab75e30a21 "doc: fix OSSL_WINCTX spelling windows notes"
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28338)

5 weeks agodoc: Fix function name in example code
Jakub Jelen [Mon, 25 Aug 2025 08:04:41 +0000 (10:04 +0200)] 
doc: Fix function name in example code

CLA: trivial
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28334)

5 weeks agoaes-s390x.pl: Initialize reserved and unused memory
Holger Dengler [Wed, 20 Aug 2025 15:55:43 +0000 (17:55 +0200)] 
aes-s390x.pl: Initialize reserved and unused memory

The reserved bytes in the parameter block (bytes 0-11) for the KMA
instruction should be set to zero to be compatible in case of future
architecture changes.

While at it, also the following unused parts of the parameter block
(bytes 48-63) are also cleared to avoid false positives with various
memory checkers like valgrind.

As it makes - performance wise - no difference to process 12, 48 or 64
bytes with one XC call, but two XC calls are slower than one call, the
first 64 bytes of the parameter block will be cleared with a single XC
call. This will also initialize the counter in the parameter block
(bytes 12-15), although it is not strictly necessary.

Co-developed-by: Juergen Christ <jchrist@linux.ibm.com>
Signed-off-by: Juergen Christ <jchrist@linux.ibm.com>
Signed-off-by: Holger Dengler <dengler@linux.ibm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28315)

5 weeks agodoc/man3/SSL_poll.pod: mention SSL_POLL_EVENT_{EL,IC} in SYNOPSIS
Eugene Syromiatnikov [Tue, 19 Aug 2025 13:27:39 +0000 (15:27 +0200)] 
doc/man3/SSL_poll.pod: mention SSL_POLL_EVENT_{EL,IC} in SYNOPSIS

While the constants are present since the initial commit 2a5ee0a08d2c "QUIC:
Add polling API", they weren't initially documented in c9b0df2250e2 "QUIC:
Add manpage for SSL_poll" (probably due to absence of the QUIC server
mode support at the time), and mentioned for the first time in b20f55702100
"QUIC: Update SSL_poll documentation", but without the accompanying update
of the SYNOPSIS section.  Rescind the omission by updating it as well.

Complements: b20f55702100 "QUIC: Update SSL_poll documentation"
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28303)

5 weeks agoAdd targets to skip build of non-installable programs
Pavol Žáčik [Tue, 19 Aug 2025 12:26:07 +0000 (14:26 +0200)] 
Add targets to skip build of non-installable programs

These make it possible to split the build into two
parts, e.g., when tests should be built with different
compiler flags than installed software.

Also use these as dependecies where appropriate.

Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28302)

5 weeks agorebase to master fixing some missing group references
Michael Baentsch [Wed, 16 Jul 2025 09:18:02 +0000 (11:18 +0200)] 
rebase to master fixing some missing group references

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26965)

5 weeks agoFix: Add free to avoid memory leak.
Nachel72 [Sun, 17 Aug 2025 06:08:38 +0000 (14:08 +0800)] 
Fix: Add free to avoid memory leak.

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28289)

5 weeks agoCorrect fixed cert validity end date in oqsprovider testing feature/evp_skey 28368/head
Michael Baentsch [Wed, 27 Aug 2025 05:43:13 +0000 (07:43 +0200)] 
Correct fixed cert validity end date in oqsprovider testing

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

5 weeks agoFix `VC-WIN64-CLANGASM-ARM` target
Anthony Roberts [Thu, 3 Jul 2025 10:21:37 +0000 (11:21 +0100)] 
Fix `VC-WIN64-CLANGASM-ARM` target

This was broken for Windows ARM64 in #22949

The comments were in the wrong format, and a define check of `_M_ARM64` was missed in places

Reviewed-by: Neil Horman <nhorman@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/27958)

6 weeks agoparams: add features to param parser generator
Pauli [Fri, 15 Aug 2025 03:34:04 +0000 (13:34 +1000)] 
params: add features to param parser generator

Support BN as an available type.

If a param name is repeated, use the extra fields for the first not the last.

Include the parameter name in a comment in the generated parser.  This
Fixes #28257

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

6 weeks agodh: add FIPS 140-3 PCT on key generation
Nikola Pajkovsky [Fri, 15 Aug 2025 12:02:44 +0000 (14:02 +0200)] 
dh: add FIPS 140-3 PCT on key generation

According to FIPS 140-3 IG 10.3.A Additonal Comment 1, a PCT shall be
performed.

Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/28280)

6 weeks agofix(pkcs12): prevent PKCS7 memleak in p12_npas.c
Nachel72 [Mon, 18 Aug 2025 07:53:48 +0000 (15:53 +0800)] 
fix(pkcs12): prevent PKCS7 memleak in p12_npas.c

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from https://github.com/openssl/openssl/pull/28292)

6 weeks agoAdd design doc for rfc4514 DN output format
Viktor Dukhovni [Mon, 28 Jul 2025 07:45:18 +0000 (17:45 +1000)] 
Add design doc for rfc4514 DN output format

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

6 weeks agocrypto\cms\cms_kem.c: Add ASN1_TYPE_free when EVP_CIPHER_param_to_asn1() fails
Nachel72 [Fri, 8 Aug 2025 11:40:46 +0000 (19:40 +0800)] 
crypto\cms\cms_kem.c: Add ASN1_TYPE_free when EVP_CIPHER_param_to_asn1() fails

Signed-off-by: Nachel72 <Nachel72@outlook.com>
CLA: trivial

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

6 weeks agoFix null pointer check in pkey_dh_derive to ensure both keys are set
ritoban23 [Wed, 13 Aug 2025 20:19:17 +0000 (01:49 +0530)] 
Fix null pointer check in pkey_dh_derive to ensure both keys are set

CLA: trivial

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

6 weeks agoFix: Check for wrong object. The converted sc should be checked instead of the original s
Nachel72 [Wed, 13 Aug 2025 15:15:05 +0000 (23:15 +0800)] 
Fix: Check for wrong object. The converted sc should be checked instead of the original s

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