]> git.ipfire.org Git - thirdparty/openssl.git/log
thirdparty/openssl.git
5 months agoFurther decoder tuning possibly better perf
Viktor Dukhovni [Thu, 27 Feb 2025 17:17:08 +0000 (04:17 +1100)] 
Further decoder tuning possibly better perf

- The decoder should consider fewer options based on
  more precise tracking of the desired input type
  (DER, PVK, MSBLOB), algorithm (RSA, EC, ...),
  input structure (SPKI, P8, ...).

How much this affects actual use-cases is harder to estimate, we'll just
have to run before/after perf tests.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26927)

5 months agoFix `no-tls-deprecated-ec` documentation to match the actual option.
Geert Hendrickx [Fri, 28 Feb 2025 13:50:32 +0000 (14:50 +0100)] 
Fix `no-tls-deprecated-ec` documentation to match the actual option.

CLA: trivial

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

5 months agoDelete include/openssl/asn1_mac.h
Ian Spence [Tue, 25 Feb 2025 18:18:33 +0000 (10:18 -0800)] 
Delete include/openssl/asn1_mac.h

See https://github.com/openssl/openssl/discussions/26886

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

5 months agodoc: fix OSSL_WINCTX spelling windows notes
Hugo Beauzée-Luyssen [Mon, 27 Jan 2025 08:24:23 +0000 (09:24 +0100)] 
doc: fix OSSL_WINCTX spelling windows notes

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

5 months agoEVP_DecodeUpdate() should not produce padding zeros to the decoded output (Fixes...
Valerii Krygin [Tue, 25 Feb 2025 15:57:26 +0000 (15:57 +0000)] 
EVP_DecodeUpdate() should not produce padding zeros to the decoded output (Fixes #26677)

EVP_DecodeUpdate() should not produce zeros for input padding `=` signs to avoid writing to non-allocated memory regions.

To achieve this:
- Add `eof` parameter to `evp_decodeblock_int` function in `openssl/crypto/evp`. The parameter should either contain the number of the input padding characters to ignore or `-1` if the function has to count them.
- Use precalculated `eof` in `EVP_DecodeUpdate` to fix its behaviour.
- Use `eof = -1` in `EVP_DecodeFinal` to count it in `evp_decodeblock_int`.
- Do not ignore padding in `EVP_DecodeBlock` (`eof = 0`) because it should write padding zeros according to the documentation.
- Add the HISTORY section to EVP_EncodeInit documentation to describe the fix.

Other changes:
- Update AUTHORS.md
- Update the copyright date in the documentation.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26678)

5 months agoCheck full ML-KEM encoded key
Viktor Dukhovni [Wed, 26 Feb 2025 02:04:12 +0000 (13:04 +1100)] 
Check full ML-KEM encoded key

When both seed and key are provided compare the full ML-KEM private key
with the seed keygen output, not just the public key.

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

5 months agodoc/, CHANGES, NEWS: add missing entries and fix existing ones when which CMP feature...
Dr. David von Oheimb [Wed, 26 Feb 2025 08:17:25 +0000 (09:17 +0100)] 
doc/, CHANGES, NEWS: add missing entries and fix existing ones when which CMP feature was added

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

5 months agoUpdate slh_dsa_test.c
Andrew Dinh [Wed, 26 Feb 2025 14:39:20 +0000 (21:39 +0700)] 
Update slh_dsa_test.c

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

5 months agoUpdate slh_dsa_test.c
Andrew Dinh [Wed, 26 Feb 2025 14:35:47 +0000 (21:35 +0700)] 
Update slh_dsa_test.c

Fix https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1642943

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

5 months agoQUIC NULL checks
Andrew Dinh [Wed, 26 Feb 2025 14:30:18 +0000 (21:30 +0700)] 
QUIC NULL checks

- Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643029
- Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643030
- Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643141

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

5 months agoAdd a note about avx-512 support for XTS to CHANGES.md
Dan Pittman [Tue, 25 Feb 2025 16:31:08 +0000 (08:31 -0800)] 
Add a note about avx-512 support for XTS to CHANGES.md

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

5 months agofix windows calling convention in aesni-xts-avx512
dan pittman [Tue, 25 Feb 2025 01:29:15 +0000 (17:29 -0800)] 
fix windows calling convention in aesni-xts-avx512

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

5 months agoadd an AVX-512-optimized ASM XTS implementation for x86_64
Dan Pittman [Wed, 26 Jun 2024 15:11:42 +0000 (08:11 -0700)] 
add an AVX-512-optimized ASM XTS implementation for x86_64

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

5 months agoEncoder : Fix floating pointer when OSSL_ENCODER_to_data() is called
slontis [Tue, 25 Feb 2025 06:03:38 +0000 (17:03 +1100)] 
Encoder : Fix floating pointer when OSSL_ENCODER_to_data() is called
twice.

Fixes #26862

This only happens when using the FIPS provider, since it needs to export
the key.

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

5 months agoOptimize ossl_namemap_name2num_n to avoid strndup
Andrew Dinh [Fri, 21 Feb 2025 16:55:58 +0000 (23:55 +0700)] 
Optimize ossl_namemap_name2num_n to avoid strndup

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

5 months agoOlder FIPS providers require a kemop 26926/head
Viktor Dukhovni [Wed, 26 Feb 2025 00:43:35 +0000 (11:43 +1100)] 
Older FIPS providers require a kemop

Don't expect success with dated FIPS modules.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26904)

5 months agoUse better data type info in decoders
Viktor Dukhovni [Tue, 25 Feb 2025 07:17:02 +0000 (18:17 +1100)] 
Use better data type info in decoders

The decoders in some cases failed to capture or propagate
information about what is being decoded, causing more work
happen to try unrelated decoders as a fallback.

We now try harder to keep track of the expected object (private key or
public key, if known), and the algorithm determined from the OID of a
PKCS8 object or SPKI.  This leads in many cases to fewer decoder
invocations.  With so many more algorithms now, trying every decoder
is increasingly best avoided.

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

5 months agoAllow 0 length plaintext and aad for aes-siv
SaEvangelista [Tue, 4 Feb 2025 02:19:28 +0000 (21:19 -0500)] 
Allow 0 length plaintext and aad for aes-siv

Test vectors taken from wycheproof:

https://github.com/C2SP/wycheproof/blob/master/testvectors/aes_siv_cmac_test.json

Fixes #26580

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

5 months agoML-DSA Add Wycheproof test vectors.
slontis [Mon, 24 Feb 2025 23:06:26 +0000 (10:06 +1100)] 
ML-DSA Add Wycheproof test vectors.

Added a python script to convert the json files into evp_test data.
Added a EVP_TEST_METHOD "KeyFromData" that can test failures when
loading raw keys. (The existing "PrivateKeyRaw" and "PublicKeyRaw"
were not fit for this purpose).

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

5 months agoMake RFC8422 deprecated TLS EC curves disablable
Viktor Dukhovni [Sun, 23 Feb 2025 08:46:24 +0000 (19:46 +1100)] 
Make RFC8422 deprecated TLS EC curves disablable

Also move the deprecated curves to the end of the list, and order the
soon most preferred groups first.

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

5 months agoFIPS POST: Change PBKDF2 CAST to use less iterations.
slontis [Tue, 25 Feb 2025 02:31:46 +0000 (13:31 +1100)] 
FIPS POST: Change PBKDF2 CAST to use less iterations.

Fixes #26876

The issue here is that the pbkdf2 'lower_bounds_checks' currently errors by default
in FIPS mode if iterations < 1000.
i.e. the "pkcs5" flag = 0 triggers an error..
Turning the flag on means the FIPS indicator is triggered (which is probably correct behaviour)
Not sure testing the fips state here is a good idea (i.e. taking a TSAN hit).

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

5 months agofix slh-dsa incorrect prediction of result code
Neil Horman [Mon, 24 Feb 2025 12:55:33 +0000 (07:55 -0500)] 
fix slh-dsa incorrect prediction of result code

The slh_dsa fuzzer predicts failure in EVP_message_sign_init in the
event we pass a context_string param of more than 255 bytes.  That makes
for an accurate prediction, but only if we actually create  the param.

augment the setting of exepct_rc_init to be determined not only by our
allocation of a > 255 byte message, but also on selector bit 1, which
determines if we create the parameter at all.

Fixes https://oss-fuzz.com/testcase-detail/4807793999937536

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

5 months agoAdd record overflow test to tlsfuzzer external tests
Neil Horman [Mon, 24 Feb 2025 13:14:36 +0000 (08:14 -0500)] 
Add record overflow test to tlsfuzzer external tests

Add this to our regression test suite for tlsfuzzer, since it recently
caught an error

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

5 months agoChange cipher suite alert for 0 length cipher_suites
Neil Horman [Sun, 16 Feb 2025 13:35:38 +0000 (08:35 -0500)] 
Change cipher suite alert for 0 length cipher_suites

From RFC 8446:

Note: TLS defines two generic alerts (see Section 6) to use upon
   failure to parse a message.  Peers which receive a message which
   cannot be parsed according to the syntax (e.g., have a length
   extending beyond the message boundary or contain an out-of-range
   length) MUST terminate the connection with a "decode_error" alert.
   Peers which receive a message which is syntactically correct but
   semantically invalid (e.g., a DHE share of p - 1, or an invalid enum)
   MUST terminate the connection with an "illegal_parameter" alert.

A zero length cipher suite list I think is considered out of range, and
so we should return "decode_error" rather than "illegal_parameter"

Fixes #25309

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

5 months agoAdd ifndef to seed-src_jitter too
Dimitri John Ledkov [Sun, 23 Feb 2025 17:50:21 +0000 (17:50 +0000)] 
Add ifndef to seed-src_jitter too

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

5 months agofips-jitter: Force use jitter entropy in the FIPS 3.0.9 provider callback
Dimitri John Ledkov [Sat, 9 Nov 2024 21:32:48 +0000 (21:32 +0000)] 
fips-jitter: Force use jitter entropy in the FIPS 3.0.9 provider callback

FIPS 3.0.9 provider does not honor runtime seed configuration, thus if
one desires to use JITTER entropy source with FIPS 3.0.9 provider
something like this needs to be applied to the core (libcrypto) build.

Not sure if this is at all suitable for upstream.

With fips-jitter (3.5+) config, also ensure that core<->provider
callback for entropy uses jitter entropy source, rather than os seed
(getrandom syscall).

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

5 months agoFix read out of buffer bounds when dealing with BIO_ADDR
Alexandr Nedvedicky [Mon, 23 Dec 2024 16:03:32 +0000 (17:03 +0100)] 
Fix read out of buffer bounds when dealing with BIO_ADDR

This issue was discoevered while I was testing SSL_new_from_listener()
using a newly created unit test. It has turned out the QUIC stack
at few places contain pattern as follows:
foo(QUIC_WHATEVER *q, BIO_ADDR *a)
{
   q->a = *a;
}

The problem is that derefencning a that way is risky. If the address `a`
comes from BIO_lookup_ex() it may actually be shorter than sizeof(BIO_ADDR).
Using BIO_ADDR_copy() is the right thing to do here.

Fixes #26241

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

5 months agoFix potential memory leak in policy_section()
Niels Dossche [Tue, 21 Jan 2025 11:04:44 +0000 (12:04 +0100)] 
Fix potential memory leak in policy_section()

If sk_POLICYQUALINFO_push() fails, qual is not freed.
Fix it by adding POLICYQUALINFO_free() to the error path.

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

5 months agoadd_uris_recursive(): Avoid OSSL_STORE_INFO leak on error
Tomas Mraz [Wed, 22 Jan 2025 08:57:36 +0000 (09:57 +0100)] 
add_uris_recursive(): Avoid OSSL_STORE_INFO leak on error

Fixes #26480

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26511)

5 months agoFix potential leak in error path in cert_response()
Niels Dossche [Wed, 22 Jan 2025 13:35:25 +0000 (14:35 +0100)] 
Fix potential leak in error path in cert_response()

get1_cert_status() returns an object that must be freed,
but the error path does not do that.
Fix it by adding a call to X509_free() in the error path.

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

5 months agoEVP_PKEY_derive_set_peer_ex(): Don't free peer on error
Andrew Dinh [Wed, 19 Feb 2025 06:29:07 +0000 (13:29 +0700)] 
EVP_PKEY_derive_set_peer_ex(): Don't free peer on error

In EVP_PKEY_derive_set_peer_ex, don't free peer
on error. Revert to existing functionality.

Bug was introduced with
https://github.com/openssl/openssl/pull/26294

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

5 months agoRename fnv1a_hash() to ossl_fnv1a_hash()
Tomas Mraz [Mon, 24 Feb 2025 08:47:13 +0000 (09:47 +0100)] 
Rename fnv1a_hash() to ossl_fnv1a_hash()

It is no longer static.

Also add it to libssl only with quic enabled.

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

5 months agoFix potential memory leaks in error paths in ossl_rsa_multiprime_derive()
Niels Dossche [Wed, 22 Jan 2025 14:43:14 +0000 (15:43 +0100)] 
Fix potential memory leaks in error paths in ossl_rsa_multiprime_derive()

There are several cases where new BIGNUM instances are created, not
using the context, but not freed when an error occurs.
Fix this by adding the necessary calls to BN_free().

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

5 months agoAdd CHANGES.md entry for changed default TLS group list
Tomas Mraz [Mon, 24 Feb 2025 09:33:08 +0000 (10:33 +0100)] 
Add CHANGES.md entry for changed default TLS group list

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26801)

5 months agotls1_set_groups_list(): Update raised errors
Tomas Mraz [Mon, 24 Feb 2025 08:21:00 +0000 (09:21 +0100)] 
tls1_set_groups_list(): Update raised errors

Do not raise ERR_LIB_CONF codes from libssl.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26801)

5 months agotls_construct_ctos_key_share(): Fix handling of HRR without key share request
Tomas Mraz [Fri, 21 Feb 2025 18:28:26 +0000 (19:28 +0100)] 
tls_construct_ctos_key_share(): Fix handling of HRR without key share request

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26801)

5 months agoConvert test_bio_ssl to use fake time
Neil Horman [Fri, 21 Feb 2025 17:22:17 +0000 (12:22 -0500)] 
Convert test_bio_ssl to use fake time

The test_bio_ssl test in quicapitest is failing on windows.  Something
about the timing there is causing wide variance in how long it takes to
establish a handshake (between 130-6500 iterations).

Convert it to use fake time to make it run consistently.

Reviewed-by: Tim Hudson <tjh@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/26801)

5 months ago28-seclevel.cnf.in: Enable some groups required for high SECLEVELs
Tomas Mraz [Fri, 21 Feb 2025 16:09:22 +0000 (17:09 +0100)] 
28-seclevel.cnf.in: Enable some groups required for high SECLEVELs

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26801)

5 months ago70-test_tls13cookie.t: Change the order of the test cases
Tomas Mraz [Fri, 21 Feb 2025 15:47:44 +0000 (16:47 +0100)] 
70-test_tls13cookie.t: Change the order of the test cases

As the COOKIE_ONLY cannot run on no-ecx build.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26801)

5 months agoTserver must keep fake time ticking to complete a handshake
sashan [Fri, 21 Feb 2025 01:04:03 +0000 (02:04 +0100)] 
Tserver must keep fake time ticking to complete a handshake

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26801)

5 months agoNo valid groups is not an error
Tomas Mraz [Thu, 20 Feb 2025 15:53:10 +0000 (16:53 +0100)] 
No valid groups is not an error

Of course TLS-1.3 won't be usable with such configuration.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26801)

5 months agoHave the same default groups list for QUIC and TLS
Tomas Mraz [Thu, 20 Feb 2025 15:25:41 +0000 (16:25 +0100)] 
Have the same default groups list for QUIC and TLS

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26801)

5 months agocompare_with_file(): ? at EOL matches any number of characters
Tomas Mraz [Thu, 20 Feb 2025 15:24:44 +0000 (16:24 +0100)] 
compare_with_file(): ? at EOL matches any number of characters

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26801)

5 months agoFix quic multistream test
Sasha Nedvedicky [Tue, 18 Feb 2025 23:03:39 +0000 (00:03 +0100)] 
Fix quic multistream test

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26801)

5 months agoAdd hybrid ML-KEM based groups to default TLS groups
Viktor Dukhovni [Mon, 17 Feb 2025 15:41:51 +0000 (02:41 +1100)] 
Add hybrid ML-KEM based groups to default TLS groups

- send two key shares by default
- trim down the list of default groups

The default TLS group list setting is now:
?*X25519MLKEM768 / ?*X25519:?secp256r1 / ?X448:?secp384r1:?secp521r1 / ?ffdhe2048:?ffdhe3072

Reviewed-by: Tim Hudson <tjh@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/26801)

5 months agoFix AEAD validation of initial packets in port
Alexandr Nedvedicky [Tue, 18 Feb 2025 00:34:04 +0000 (01:34 +0100)] 
Fix AEAD validation of initial packets in port

The interoperability tests disable client ip address
validation done by RETRY packet. All tests done in CI
take code path which sends a retry packet.

The first initial packet sent by client uses a different
initial encryption level keys to protect packet integrity.
The keys are derived from DCID chosen by client.

When server accepts connection on behalf of initial packet,
the 'DCID' gets changed which means the initial level encryption keys
are changing too. So when server skips sending a retry packet,
it must forget the qrx which was used to validate initial
packet sent by client.

Forgetting qrx is not straightforward, we must salvage the
unencrypted packets left there after they were validated.
Those unencrypted packets must be injected to newly created channel.

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

5 months agoPerform initial AEAD validation before creating a channel
Alexandr Nedvedicky [Tue, 18 Feb 2025 00:32:47 +0000 (01:32 +0100)] 
Perform initial AEAD validation before creating a channel

We let port to create qrx object and use it for
packet validation. If packet validates, we then
create channel and pass pre-created qrx to channel's
constructor.

Co-authored-by: Andrew Dinh <andrewd@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26808)

5 months agoriscv: add dl_hwcap for capability detection
daichengrong [Tue, 18 Feb 2025 08:19:01 +0000 (16:19 +0800)] 
riscv: add dl_hwcap for capability detection

Availability of ZVK* should be determined with dl_hwcap and hwcap.

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

5 months agofix: add OOM handler for x509 fuzz test
Burkov Egor [Wed, 19 Feb 2025 13:42:07 +0000 (16:42 +0300)] 
fix: add OOM handler for x509 fuzz test

CLA: trivial

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

5 months agoMake the KEM operating mode optional
Viktor Dukhovni [Sun, 23 Feb 2025 04:21:14 +0000 (15:21 +1100)] 
Make the KEM operating mode optional

There is only one operating mode supported for each of RSA, EC and ECX.
We should not require an explicit setting for the obvious default.

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

5 months agodoc: document that the FIPS provider doesn't support deterministic ECDSA sigs
Pauli [Mon, 24 Feb 2025 04:20:34 +0000 (15:20 +1100)] 
doc: document that the FIPS provider doesn't support deterministic ECDSA sigs

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

5 months agoRevert wrong macos RCU fix
Bernd Edlinger [Mon, 24 Feb 2025 06:51:16 +0000 (07:51 +0100)] 
Revert wrong macos RCU fix

This reverts #23974 which seems to be no longer needed now,
due to other fixes nearby.  Most likely the change did just
slightly decrease the performance of the reader threads, and
did therefore create the wrong impression that it fixed the issue.

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

5 months agoCoverity fixes
Andrew Dinh [Thu, 20 Feb 2025 07:24:21 +0000 (14:24 +0700)] 
Coverity fixes

Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643042
Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643047
Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643089
Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643091
Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643095

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

5 months agoMore seed and private key checks for ML-DSA
Viktor Dukhovni [Fri, 21 Feb 2025 08:47:36 +0000 (19:47 +1100)] 
More seed and private key checks for ML-DSA

- Check seed/key consistency when generating from a seed and the private
  key is also given.
- Improve error reporting when the private key does not match an
  explicit public key.

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

5 months agoFix ci break on building quic with no-siphash
Neil Horman [Sun, 23 Feb 2025 21:03:28 +0000 (16:03 -0500)] 
Fix ci break on building quic with no-siphash

SHARED_SOURCE doesn't pull in siphash if its disabled in the
configuration leading to undefined symbols, which we need for quic.

If siphash is disabled in the build, then pull it in via a SOURCE
addition, otherwise pull it in via SHARED_SOURCE

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26874)

5 months agoseparate intval into separate variable in OSSL_PARAMS
Neil Horman [Thu, 20 Feb 2025 14:15:26 +0000 (09:15 -0500)] 
separate intval into separate variable in OSSL_PARAMS

construction of int params holds a pointer to an int rather than an int
value, so we need to use separate variables when constructing separate
int params.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26851)

5 months agoFix slh-dsa fuzzer on invalid param inputs
Neil Horman [Thu, 20 Feb 2025 12:45:50 +0000 (07:45 -0500)] 
Fix slh-dsa fuzzer on invalid param inputs

oss-fuzz issue:
https://issues.oss-fuzz.com/issues/397734693

Fails because the fuzzer occasionaly provides inputs which drives the
fuzzer to create an octet-string for the context_string param which
violates the 255 byte constraint documented on that parameter.

Fix it by detecting that condition, expecting failure in the call to
EVP_sign_message_init, and bailing out when it occurs.

Fixes openssl/project#1109

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26851)

5 months agoUse siphash to implement lcidm hash function
Neil Horman [Thu, 20 Feb 2025 15:37:30 +0000 (10:37 -0500)] 
Use siphash to implement lcidm hash function

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

5 months agoAdd siphash to shared source for quic
Neil Horman [Thu, 20 Feb 2025 14:55:21 +0000 (09:55 -0500)] 
Add siphash to shared source for quic

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

5 months agoUpdate LCIDM lookups to include hash keys
Neil Horman [Wed, 19 Feb 2025 21:38:40 +0000 (16:38 -0500)] 
Update LCIDM lookups to include hash keys

In preparation for using siphash in our hash function

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

5 months agoAdd random hash key value to lcidm struct
Neil Horman [Wed, 19 Feb 2025 21:17:45 +0000 (16:17 -0500)] 
Add random hash key value to lcidm struct

This is in preparation for using siphash to compute lcidm hash table
values

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

5 months agoRe-enable RCU torture test on MACOSX
Bernd Edlinger [Wed, 19 Feb 2025 17:55:42 +0000 (18:55 +0100)] 
Re-enable RCU torture test on MACOSX

This test was disabled due to "Stochastic failures in
the RCU test on MACOSX" by #23967, which sounds like an
issue that is probably fixed now.

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

5 months agoSLH-DSA - restrict keygen seed length to exact value of 3*n
slontis [Thu, 20 Feb 2025 21:54:36 +0000 (08:54 +1100)] 
SLH-DSA - restrict keygen seed length to exact value of 3*n

It was allowing the seed to be larger, and then just ignoring the
trailing bytes.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26858)

5 months agoSLH-DSA fixup tests to adjust the private key getter returning the
slontis [Thu, 20 Feb 2025 02:39:48 +0000 (13:39 +1100)] 
SLH-DSA fixup tests to adjust the private key getter returning the
public component

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26839)

5 months agoSLH-DSA Update private key getter to also return public components.
slontis [Thu, 20 Feb 2025 01:31:23 +0000 (12:31 +1100)] 
SLH-DSA Update private key getter to also return public components.

The private key is defined in FIPS 205 as containing the public key,
so we return this also. This also matches what happens in fromdata.

Updated Documentation for SLH_DSA.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26839)

5 months agodoc: fixup FIPS self test names
Pauli [Fri, 21 Feb 2025 01:22:15 +0000 (12:22 +1100)] 
doc: fixup FIPS self test names

Missing names and categories in the documentation

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26859)

5 months agofipsinstall: update tests to use corrent key gen test name
Pauli [Fri, 21 Feb 2025 01:21:48 +0000 (12:21 +1100)] 
fipsinstall: update tests to use corrent key gen test name

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26859)

5 months agofips: update FIPS self test defines
Pauli [Fri, 21 Feb 2025 01:21:26 +0000 (12:21 +1100)] 
fips: update FIPS self test defines

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26859)

5 months agofips: refactor to unify the ST_KAT_PARAM -> OSSL_PARAM code
Pauli [Fri, 21 Feb 2025 00:37:43 +0000 (11:37 +1100)] 
fips: refactor to unify the ST_KAT_PARAM -> OSSL_PARAM code

This code was duplicated multiple times throughout the self tests.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26859)

5 months agofips: refactor ML-KEM tests so that key generation is separate
Pauli [Fri, 21 Feb 2025 00:36:56 +0000 (11:36 +1100)] 
fips: refactor ML-KEM tests so that key generation is separate

Encapsulation and decapsulation remain as their own CAST.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26859)

5 months agofips: add key generation name for ML-KEM CASTs
Pauli [Fri, 21 Feb 2025 00:36:48 +0000 (11:36 +1100)] 
fips: add key generation name for ML-KEM CASTs

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26859)

5 months agoUse linux-arm64 or the public ubuntu-24.04-arm runner image
Bernd Edlinger [Thu, 20 Feb 2025 12:52:19 +0000 (13:52 +0100)] 
Use linux-arm64 or the public ubuntu-24.04-arm runner image

dependent on whether this runs on the openssl/openssl repository
or a clone.

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

5 months agoVarious NULL checks
Andrew Dinh [Thu, 20 Feb 2025 05:24:00 +0000 (12:24 +0700)] 
Various NULL checks

Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643035
Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643039
Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643041
Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643044
Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643045
Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643046

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

5 months agoEVP_SKEY_get_raw_key => EVP_SKEY_get0_raw_key
Dmitry Belyavskiy [Wed, 19 Feb 2025 14:40:00 +0000 (15:40 +0100)] 
EVP_SKEY_get_raw_key => EVP_SKEY_get0_raw_key

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

5 months agoUpdate oqsprovider git submodule and start testing with it again
Michael Baentsch [Thu, 20 Feb 2025 10:35:09 +0000 (11:35 +0100)] 
Update oqsprovider git submodule and start testing with it again

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26848)

5 months agoProvide aliases to ML-DSA without dashes
Clemens Lang [Thu, 20 Feb 2025 14:04:51 +0000 (15:04 +0100)] 
Provide aliases to ML-DSA without dashes

oqsprovider did not use dashes in the algorithm names for ML-DSA. Make
the transition smoother by also accepting the names without dashes as
aliases.

See also #26326 for the same thing for ML-KEM.

Signed-off-by: Clemens Lang <cllang@redhat.com>
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/26853)

5 months agoMake CRYPTO_atomic_load/store use the same preprocessor guards
Bernd Edlinger [Wed, 19 Feb 2025 13:40:44 +0000 (14:40 +0100)] 
Make CRYPTO_atomic_load/store use the same preprocessor guards

as the other CRYPTO_atomic_X functions.
All CRYPTO_atomic functions should use the same logic here,
just in case...

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

5 months agoCleanup atomic fallbacks in threads_pthread.c
Bernd Edlinger [Tue, 18 Feb 2025 11:37:42 +0000 (12:37 +0100)] 
Cleanup atomic fallbacks in threads_pthread.c

the unused atomic stub functions make clang issue
unused function warnings -Wunused-function

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

5 months agoEnhance thread sanitizer CI tests
Bernd Edlinger [Tue, 18 Feb 2025 11:05:07 +0000 (12:05 +0100)] 
Enhance thread sanitizer CI tests

Related to issue #26798

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

5 months agocross-compiles.yml: Disable FIPS for cross compiles
Tomas Mraz [Wed, 19 Feb 2025 14:03:35 +0000 (15:03 +0100)] 
cross-compiles.yml: Disable FIPS for cross compiles

When running tests things are too slow due to SLH-DSA POST.

Reviewed-by: Tim Hudson <tjh@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/26820)

5 months agorun-checker-daily.yml: Add memory sanitizer run with SLH-DSA enabled
Tomas Mraz [Wed, 19 Feb 2025 13:57:12 +0000 (14:57 +0100)] 
run-checker-daily.yml: Add memory sanitizer run with SLH-DSA enabled

Reviewed-by: Tim Hudson <tjh@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/26820)

5 months agomake-test: No verbose tar output
Tomas Mraz [Wed, 19 Feb 2025 13:56:19 +0000 (14:56 +0100)] 
make-test: No verbose tar output

This just clutters the logs otherwise.

Reviewed-by: Tim Hudson <tjh@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/26820)

5 months agorun-checker-daily.yml: Adjust the list of jobs
Tomas Mraz [Wed, 19 Feb 2025 13:49:43 +0000 (14:49 +0100)] 
run-checker-daily.yml: Adjust the list of jobs

Some of the disablables are already disabled by default.

Reviewed-by: Tim Hudson <tjh@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/26820)

5 months agoDisable SLH-DSA in memory sanitizer
Tomas Mraz [Tue, 18 Feb 2025 17:13:22 +0000 (18:13 +0100)] 
Disable SLH-DSA in memory sanitizer

Reviewed-by: Tim Hudson <tjh@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/26820)

5 months agoAdded new API to enable 0-RTT for 3rd party QUIC stacks.
Cheng Zhang [Thu, 20 Feb 2025 02:28:35 +0000 (10:28 +0800)] 
Added new API to enable 0-RTT for 3rd party QUIC stacks.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26842)

5 months agoUse OPENSSL_strdup instead of strdup
Andrew Dinh [Thu, 20 Feb 2025 06:59:07 +0000 (13:59 +0700)] 
Use OPENSSL_strdup instead of strdup

Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643038

Also NULL check for the allocation.

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

5 months agofips: change SLH-DSA key generation to use a fast algorithm flavour
Pauli [Wed, 19 Feb 2025 23:34:36 +0000 (10:34 +1100)] 
fips: change SLH-DSA key generation to use a fast algorithm flavour

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

5 months agoslh-dsa: avoid pairwise test when doing key generation CAST
Pauli [Wed, 19 Feb 2025 23:48:55 +0000 (10:48 +1100)] 
slh-dsa: avoid pairwise test when doing key generation CAST

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

5 months agoml-kem: avoid pairwise test when doing key generation CAST
Pauli [Wed, 19 Feb 2025 23:48:37 +0000 (10:48 +1100)] 
ml-kem: avoid pairwise test when doing key generation CAST

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

5 months agoml-dsa: avoid pairwise test when doing key generation CAST
Pauli [Wed, 19 Feb 2025 23:48:25 +0000 (10:48 +1100)] 
ml-dsa: avoid pairwise test when doing key generation CAST

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

5 months agofips: add function to detect if the self tests are running
Pauli [Wed, 19 Feb 2025 23:41:56 +0000 (10:41 +1100)] 
fips: add function to detect if the self tests are running

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

5 months agoSLH-DSA coverity fixes.
slontis [Wed, 19 Feb 2025 20:54:54 +0000 (07:54 +1100)] 
SLH-DSA coverity fixes.

Fixes 1643092 and 1643093

Neither of these are major issues, but fixed anyway..

i.e. 1<<hm is bounded by the parameter set so this is not an issue
Not checking an error from WPACKET_memcpy() would also not cause an
issue.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/26835)

5 months agoRefactor EVP_SKEY initialization
Tomas Mraz [Mon, 17 Feb 2025 11:06:30 +0000 (12:06 +0100)] 
Refactor EVP_SKEY initialization

Enforce that skeymgmt cannot ever be NULL in EVP_SKEY.

Also add missing allocation checks.

Fixes multiple issues found by Coverity.

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/26795)

5 months agoMake org.openssl.winstore: work in openssl-ts
Shakti Shah [Wed, 19 Feb 2025 16:08:36 +0000 (21:38 +0530)] 
Make org.openssl.winstore: work in openssl-ts

Fixes #26739

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

5 months agoSet op_num to 0
Andrew Dinh [Wed, 19 Feb 2025 11:24:47 +0000 (18:24 +0700)] 
Set op_num to 0

Here, op_num is just used for logging purposes (number of completed operations), so start it at 0

Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643034

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

5 months agoFix coverity finding
Dmitry Belyavskiy [Wed, 19 Feb 2025 14:27:57 +0000 (15:27 +0100)] 
Fix coverity finding

Coverity ID: 1643094

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26831)

5 months agossl_lib.c: Check for NULL from SSL_CONNECTION_FROM_SSL()
Andrew Dinh [Wed, 19 Feb 2025 06:41:03 +0000 (13:41 +0700)] 
ssl_lib.c: Check for NULL from SSL_CONNECTION_FROM_SSL()

Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643027
Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643028

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26824)

5 months agoEC_get_buildin_curves does not return an error, this check is unnecessary.
otherddn1978 [Wed, 12 Feb 2025 10:54:46 +0000 (13:54 +0300)] 
EC_get_buildin_curves does not return an error, this check is unnecessary.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

unused code has been removed

delete whitespace

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

5 months agoNULL checks for QUIC code
Andrew Dinh [Wed, 19 Feb 2025 06:49:06 +0000 (13:49 +0700)] 
NULL checks for QUIC code

Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643033
Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643032
Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643031
Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643030
Fixes https://scan5.scan.coverity.com/#/project-view/62507/10222?selectedIssue=1643029

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

5 months agoCI: ssl-trace is enabled by default
Tomas Mraz [Tue, 18 Feb 2025 07:44:40 +0000 (08:44 +0100)] 
CI: ssl-trace is enabled by default

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