]> git.ipfire.org Git - thirdparty/openssl.git/log
thirdparty/openssl.git
6 months agokdf_scrypt_reset(): NULLify freed pointers
Tomas Mraz [Mon, 20 Jan 2025 07:53:21 +0000 (08:53 +0100)] 
kdf_scrypt_reset(): NULLify freed pointers

Otherwise doublefree happens with further usage.

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

6 months agoscrypt: Do not free the context itself when fetch fails
Tomas Mraz [Mon, 20 Jan 2025 07:50:48 +0000 (08:50 +0100)] 
scrypt: Do not free the context itself when fetch fails

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

6 months agoconfig.pod: Fix typo
Alexander Heinlein [Tue, 21 Jan 2025 07:34:53 +0000 (08:34 +0100)] 
config.pod: Fix typo

CLA: trivial

Signed-off-by: Alexander Heinlein <alexander.heinlein@web.de>
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/26497)

6 months agoRefactor MAKE_ENCODER in providers/implementations/encode_decode/encode_key2any.c
Richard Levitte [Thu, 9 Jan 2025 13:36:20 +0000 (14:36 +0100)] 
Refactor MAKE_ENCODER in providers/implementations/encode_decode/encode_key2any.c

It took a parameter 'evp_type', which isn't used.  The comment describing
it mentions a future refactoring, but it appears that this has already
happened.

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

6 months agoGive DTLS tests more time to complete
Bernd Edlinger [Tue, 21 Jan 2025 15:12:18 +0000 (16:12 +0100)] 
Give DTLS tests more time to complete

Increase the timeout for DTLS tests to 10 seconds.
But do that only for DTLS as this would waste time
for other tests, most of the TLS tests do not need
this at all.

Fixes #26491

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

6 months agoapps/cms.c: Cleanup for dead assignment to argc
Alex Prabhat Bara [Fri, 27 Dec 2024 06:37:11 +0000 (12:07 +0530)] 
apps/cms.c: Cleanup for dead assignment to argc

CLA: trivial

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

6 months agorcu: Ensure that updates to the ID field of a qp don't lose refs
Neil Horman [Sun, 19 Jan 2025 21:43:37 +0000 (16:43 -0500)] 
rcu: Ensure that updates to the ID field of a qp don't lose refs

ppc64le occasionally still fails the threadstest on __rcu_torture

From several days of debugging, I think I've landed on the problem.

Occasionally, under high load I observe the following pattern

CPU0                                     CPU1
update_qp                                get_hold_current_qp
  atomic_and_fetch(qp->users, ID_MASK, RELEASE)
                                         atomic_add_fetch(qp->users, 1, RELEASE
  atomic_or_fetch(qp->users, ID_VAL++, RELEASE)

When this pattern occurs, the atomic or operation fails to see the published
value of CPU1 and when the or-ed value is written back to ram, the incremented
value in get_hold_current_qp is overwritten, meaning the hold that the reader
placed on the rcu lock is lost, allowing the writer to complete early, freeing
memory before a reader is done reading any held memory.

Why this is only observed on ppc64le I'm not sure, but it seems like a pretty
clear problem.

fix it by implementing ATOMIC_COMPARE_EXCHANGE_N, so that, on the write side in
update_qp, we can ensure that updates are only done if the read side hasn't
changed anything.  If it has, retry the operation.

With this fix, I'm able to run the threads test overnight (4000 iterations and
counting) without failure.

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

6 months agobyteorder.h: Fix MSVC compiler error C2371
Kelvin Lee [Fri, 17 Jan 2025 13:26:21 +0000 (00:26 +1100)] 
byteorder.h: Fix MSVC compiler error C2371

Compiling byteorder_test.c with VS2022 produces the following warnings
and errors:

E:\build\kiyolee\openssl\include\openssl\byteorder.h(24,21): warning
C4164: '_byteswap_ushort': intrinsic function not declared
(compiling source file '../../../test/byteorder_test.c')
E:\build\kiyolee\openssl\include\openssl\byteorder.h(25,21): warning
C4164: '_byteswap_ulong': intrinsic function not declared
(compiling source file '../../../test/byteorder_test.c')
E:\build\kiyolee\openssl\include\openssl\byteorder.h(26,21): warning
C4164: '_byteswap_uint64': intrinsic function not declared
(compiling source file '../../../test/byteorder_test.c')
E:\build\kiyolee\openssl\include\openssl\byteorder.h(112,18): warning
C4013: '_byteswap_ushort' undefined; assuming extern returning int
(compiling source file '../../../test/byteorder_test.c')
E:\build\kiyolee\openssl\include\openssl\byteorder.h(144,18): warning
C4013: '_byteswap_ulong' undefined; assuming extern returning int
(compiling source file '../../../test/byteorder_test.c')
E:\build\kiyolee\openssl\include\openssl\byteorder.h(182,18): warning
C4013: '_byteswap_uint64' undefined; assuming extern returning int
(compiling source file '../../../test/byteorder_test.c')
C:\Program Files (x86)\Windows
Kits\10\Include\10.0.22621.0\ucrt\stdlib.h(298,41): error C2371:
'_byteswap_ushort': redefinition; different basic types
(compiling source file '../../../test/byteorder_test.c')
C:\Program Files (x86)\Windows
Kits\10\Include\10.0.22621.0\ucrt\stdlib.h(299,41): warning C4142:
'_byteswap_ulong': benign redefinition of type
(compiling source file '../../../test/byteorder_test.c')
C:\Program Files (x86)\Windows
Kits\10\Include\10.0.22621.0\ucrt\stdlib.h(300,41): error C2371:
'_byteswap_uint64': redefinition; different basic types
(compiling source file '../../../test/byteorder_test.c')

CLA: trivial

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

6 months agoproviders/implementations/keymgmt/ec_kmgmt.c: Remove unused variable
Jiasheng Jiang [Thu, 9 Jan 2025 16:13:55 +0000 (16:13 +0000)] 
providers/implementations/keymgmt/ec_kmgmt.c: Remove unused variable

Remove unused variable "group".

CLA: trivial

Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26293)

6 months agoImprove ASN1_TIME_print documentation and output
Michael Baentsch [Wed, 8 Jan 2025 11:57:28 +0000 (12:57 +0100)] 
Improve ASN1_TIME_print documentation and output

This adds missing GMT indication when printing the local time as
it is converted to the UTC timezone before printing.

Also fixing the fractional seconds printing on EBCDIC platforms.

Fixes #26313

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

6 months agokeymgmt: refactor fips indicator check
Dimitri John Ledkov [Sun, 20 Oct 2024 02:34:27 +0000 (03:34 +0100)] 
keymgmt: refactor fips indicator check

Currently direct call to ossl_ec_check_security_strength is used,
instead of ossl_fips_ind_ec_key_check() like in all other places.

Make keymgmt do the same check as ecdh_exch and ecdsa_sig do.

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

6 months agos_socket: naccept: close listening socket after accepting clients
Nadav Tasher [Fri, 20 Dec 2024 15:59:01 +0000 (17:59 +0200)] 
s_socket: naccept: close listening socket after accepting clients

When `-naccept` is passed (i.e with `s_server`), the listening socket remains open while handling
client, even after `naccept` is supposed to reach `0`.

This is caused to to the decrementation of `naccept` and closing of the socket
happening a little too late in the `do_server` function.

Signed-off-by: Nadav Tasher <tashernadav@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26228)

6 months agoSupport boolean queries against provider config
Viktor Dukhovni [Fri, 17 Jan 2025 11:58:43 +0000 (22:58 +1100)] 
Support boolean queries against provider config

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

6 months agoRevert "Move rodata to .rodata section for armv8"
Alexey Moksyakov [Tue, 21 Jan 2025 09:24:27 +0000 (12:24 +0300)] 
Revert "Move rodata to .rodata section for armv8"

This reverts commit 5b36728d974578f2c74e9f3d2ee6472187084882.

Issue #26458

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

6 months agoRestore correct registers in aarch64 AES-CTR code
Julian Andres Klode [Sat, 18 Jan 2025 20:12:45 +0000 (21:12 +0100)] 
Restore correct registers in aarch64 AES-CTR code

Commit 1d1ca79fe35dbe5c05faed5a2ef8c4de9c5adc49 introduced
save and restore for the registers, saving them as

stp d8,d9,[sp, #16]
stp d10,d11,[sp, #32]
stp d12,d13,[sp, #48]
stp d14,d15,[sp, #64]

But the restore code was inadvertently typoed:

ldp d8,d9,[sp, #16]
ldp d10,d11,[sp, #32]
ldp d12,d13,[sp, #48]
ldp d15,d16,[sp, #64]

Restoring [sp, #64] into d15,d16 instead of d14,d15.

Fixes: #26466
CLA: trivial

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

6 months agoMove some encode helpers to crypt/encode_decode/
Viktor Dukhovni [Mon, 20 Jan 2025 06:25:03 +0000 (17:25 +1100)] 
Move some encode helpers to crypt/encode_decode/

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

6 months agoCheck return of OSSL_PROVIDER_do_all to avoid coverity noise
Viktor Dukhovni [Sat, 18 Jan 2025 07:34:54 +0000 (18:34 +1100)] 
Check return of OSSL_PROVIDER_do_all to avoid coverity noise

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

6 months agoDon't promise a non-zero return size in error cases.
Viktor Dukhovni [Thu, 16 Jan 2025 08:45:50 +0000 (19:45 +1100)] 
Don't promise a non-zero return size in error cases.

When a requested parameter has a non-NULL result pointer,
and the error isn't simply that the result buffer is too
small, don't return a non-zero result size.

Returning a non-zero result size that isn't larger than the
user's provided space is an indication that a result of
that size was actually written, inviting trouble if the
error indication was inadvertenly lost.

Also, in such cases (wrong type, data can't be converted to the
requested type when otherwise supported, ...) there is nothing useful to
be done with the return size value, it can't help to address the
problem.

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

6 months agoMake the provider context available to encoders
Viktor Dukhovni [Sun, 19 Jan 2025 15:51:07 +0000 (02:51 +1100)] 
Make the provider context available to encoders

At the moment the provider context is only available to
encoders that encrypt, but it is useful more generally.

A similar change has already been merged to "master" on the
decoder side, this is the mirror change for encoders.  The
only significant difference is that PEM_ASN1_write_bio needed
to be "extended" (cloned) to allow it to pass the provider context
down to the `k2d` function it uses to encode the data.

I had to "hold my nose" and live with the random "20" added to the data
size in order to accomodate encryption with padding, which may produce
one more cipher block than the input length.  This really should ask
the EVP layer about the block length of the cipher, and allocate the
right amount.  This should be a separate fix for both the old
PEM_ASN1_write_bio() and the new PEM_ASN1_write_bio_ctx().

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

6 months agoAdd CHANGES.md and NEWS.md updates for CVE-2024-13176
Tomas Mraz [Wed, 15 Jan 2025 17:29:52 +0000 (18:29 +0100)] 
Add CHANGES.md and NEWS.md updates for CVE-2024-13176

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

6 months agoFix timing side-channel in ECDSA signature computation
Tomas Mraz [Wed, 15 Jan 2025 17:27:02 +0000 (18:27 +0100)] 
Fix timing side-channel in ECDSA signature computation

There is a timing signal of around 300 nanoseconds when the top word of
the inverted ECDSA nonce value is zero. This can happen with significant
probability only for some of the supported elliptic curves. In particular
the NIST P-521 curve is affected. To be able to measure this leak, the
attacker process must either be located in the same physical computer or
must have a very fast network connection with low latency.

Attacks on ECDSA nonce are also known as Minerva attack.

Fixes CVE-2024-13176

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

6 months agofix X509_PURPOSE_add() to take |sname| as primary key and handle |id| in a backwd...
Dr. David von Oheimb [Fri, 20 Dec 2024 09:07:15 +0000 (10:07 +0100)] 
fix X509_PURPOSE_add() to take |sname| as primary key and handle |id| in a backwd compat way for new purpose

Fixes #25873

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

6 months agofix X509_PURPOSE_set() to support clearing the purpose requirement as needed for...
Dr. David von Oheimb [Fri, 20 Dec 2024 08:12:43 +0000 (09:12 +0100)] 
fix X509_PURPOSE_set() to support clearing the purpose requirement as needed for X509_VERIFY_PARAM_set_purpose()

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

6 months agoIf you call X509_add_cert with cert == NULL and the X509_ADD_FLAG_UP_REF
otherddn1978 [Thu, 26 Dec 2024 10:26:34 +0000 (13:26 +0300)] 
If you call X509_add_cert with cert == NULL and the X509_ADD_FLAG_UP_REF
flag, it will сrash to X509_up_ref.  Passing NULL here is not valid,
return 0 if cert == NULL.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/26267)

6 months agoFix documentation of OSSL_ASYM_CIPHER_PARAM_IMPLICIT_REJECTION
Richard Levitte [Wed, 15 Jan 2025 09:14:41 +0000 (10:14 +0100)] 
Fix documentation of OSSL_ASYM_CIPHER_PARAM_IMPLICIT_REJECTION

This drops OSSL_PKEY_PARAM_IMPLICIT_REJECTION - which is a meaningless
name - everywhere apart from still existing (for API stability, in
case someone uses that macro).

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

6 months agotest: aAissuingDistributionPoint X.509v3 extension
Jonathan M. Wilbur [Fri, 13 Dec 2024 06:52:25 +0000 (06:52 +0000)] 
test: aAissuingDistributionPoint X.509v3 extension

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

6 months agodoc: aAissuingDistributionPoint X.509v3 extension
Jonathan M. Wilbur [Fri, 13 Dec 2024 06:52:17 +0000 (06:52 +0000)] 
doc: aAissuingDistributionPoint X.509v3 extension

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

6 months agofeat: support the aAissuingDistributionPoint X.509v3 extension
Jonathan M. Wilbur [Fri, 13 Dec 2024 06:36:24 +0000 (06:36 +0000)] 
feat: support the aAissuingDistributionPoint X.509v3 extension

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

6 months agoSupport CLI and API setting of provider configuration parameters
Viktor Dukhovni [Thu, 16 Jan 2025 08:44:14 +0000 (19:44 +1100)] 
Support CLI and API setting of provider configuration parameters

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

6 months agoWork around to get llvm-mingw working on aarch64
Alexandr Nedvedicky [Wed, 15 Jan 2025 15:41:33 +0000 (16:41 +0100)] 
Work around to get llvm-mingw working on aarch64

It looks like llvm-mingw tool chain does not understand `.previous` asm
directive (see https://sourceware.org/binutils/docs/as/Previous.html).
As a workaround for win64 flavor (llvm-mingw toolchain) we let xlate
to emit .text instead of emitting .previous.

We also need to revisit usage of win64 flavor here in aarch64. We should
perhaps introduce a mingw flavour on aarch64 as well. win assembly
flavour should be used for microsoft assembler.

Fixes #26415

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

6 months agoMove rodata to .rodata section for armv8
Alexey Moksyakov [Thu, 16 Jan 2025 11:21:30 +0000 (14:21 +0300)] 
Move rodata to .rodata section for armv8

Adds missing files where asm code is generated by
perl scripts and read only constant is used

PR #24137

closes #23312

Signed-off-by: Alexey Moksyakov <yavtuk@yandex.ru>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26440)

6 months agoMissing .gitignore entries
Dmitry Belyavskiy [Tue, 14 Jan 2025 20:24:16 +0000 (21:24 +0100)] 
Missing .gitignore entries

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

6 months ago`atoi` should be allowed
Dmitry Belyavskiy [Tue, 14 Jan 2025 20:19:59 +0000 (21:19 +0100)] 
`atoi` should be allowed

When we compile with -O0 for Linux, the command
`./util/checkplatformsyms.pl ./util/platform_symbols/unix-symbols.txt ./libcrypto.so ./libssl.so`
complains to the lack of `atoi`

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

6 months agoprovider_deactivate(): Check return value of CRYPTO_atomic_add()
onexyoung [Mon, 23 Dec 2024 11:49:27 +0000 (14:49 +0300)] 
provider_deactivate(): Check return value of CRYPTO_atomic_add()

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

6 months agoWorkaround for RSA on AArch64 Big Endian
Nikolay Nikolaev [Tue, 24 Dec 2024 11:26:09 +0000 (13:26 +0200)] 
Workaround for RSA on AArch64 Big Endian

10646160125 introduced and optimized RSA NEON implementation
for AArch64 architecture, namely Cortex-A72 and Neoverse N1.
This implementation is broken in Big Endian mode, which is not
widely used, therefore not properly verified.
Here we disable this optimized implementation when Big Endian
platform is used.

Fixes: #22687
CLA: trivial

Signed-off-by: Nikolay Nikolaev <nicknickolaev@gmail.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26257)

6 months agoRemove non-existing error code.
Peter Bierma [Sun, 12 Jan 2025 16:12:18 +0000 (11:12 -0500)] 
Remove non-existing error code.

CLA: trivial

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

6 months agoSynchronize openssl.txt with comperr.h
Peter Bierma [Sat, 11 Jan 2025 17:02:45 +0000 (12:02 -0500)] 
Synchronize openssl.txt with comperr.h

CLA: trivial

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

6 months agoFix dtls tests
Bernd Edlinger [Fri, 10 Jan 2025 07:45:20 +0000 (08:45 +0100)] 
Fix dtls tests

The dtls server process exits too early when the input
has an EOF condition.

Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@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/26374)

6 months agoRevert "Use open2 instead of open for s_server instance"
Bernd Edlinger [Thu, 9 Jan 2025 20:26:12 +0000 (21:26 +0100)] 
Revert "Use open2 instead of open for s_server instance"

This reverts commit 4439ed16c5742e5ffb0417d45677900e77b299f2.

Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@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/26374)

6 months agoRevert "chomp does not work on windows."
Bernd Edlinger [Thu, 9 Jan 2025 20:25:55 +0000 (21:25 +0100)] 
Revert "chomp does not work on windows."

This reverts commit 3e94e2b11d73ed22c601f818b31b7c4ca281f5d1.

Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@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/26374)

6 months agoRevert "Do not confuse TAP::Parser by mixing up stderr with stdout."
Bernd Edlinger [Thu, 9 Jan 2025 20:24:44 +0000 (21:24 +0100)] 
Revert "Do not confuse TAP::Parser by mixing up stderr with stdout."

This reverts commit 3d3bb26a13dcc67f99e66de6a44ae9ced117f64b.

Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@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/26374)

6 months agoCorrect documented KEM ids for OSSL_HPKE_str2suite
Tom Fay [Thu, 12 Dec 2024 09:38:54 +0000 (09:38 +0000)] 
Correct documented KEM ids for OSSL_HPKE_str2suite

CLA: trivial

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

6 months agoAdd a GitHub workflow to make a release
Dmitry Misharov [Thu, 10 Oct 2024 14:15:55 +0000 (16:15 +0200)] 
Add a GitHub workflow to make a release

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

6 months agogenpkey: Avoid leaving empty file if encryption passphrase does not match
shridhar kalavagunta [Thu, 28 Nov 2024 17:30:50 +0000 (11:30 -0600)] 
genpkey: Avoid leaving empty file if encryption passphrase does not match

Fixes #25440

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

6 months agoFix test failure in 30-test_evp_pkey_provided.t
Bernd Edlinger [Fri, 10 Jan 2025 18:58:46 +0000 (19:58 +0100)] 
Fix test failure in 30-test_evp_pkey_provided.t

In this test there is a random test output corruption.
`make test TESTS=test_evp_pkey_provided V=1` has some random output,
that can with a certain probability start a line with "ok" or so:

    # Setting up a OSSL_ENCODER context with passphrase
    # Testing with no encryption
jLixONcRPi/m64CGie4KKKDuGeTjtYwfima3BNYCGlgbLGeK3yYxBfZb9JjviOJ4
    # nHaNsRsONTAKyg==

This happens because large random data is output to bio_out
but some data remains buffered, and then test_note() is used to print
some comments on the bio_err file.  This causes output corruption that
confuses the TAP parser.
Fix that by flushing any pending output with test_flush_stdout() first.

Fixes #23992

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

6 months agoBig and little-endian load and store support
Viktor Dukhovni [Fri, 10 Jan 2025 08:00:15 +0000 (19:00 +1100)] 
Big and little-endian load and store support

These are needed in ML-KEM and ML-DSA, and are likely generally useful,
so public.

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

6 months agoFinishing touch to perlasm update to make it work on OpenBSD
sashan [Mon, 29 Apr 2024 12:04:56 +0000 (14:04 +0200)] 
Finishing touch to perlasm update to make it work on OpenBSD

This changeset brings a finishing touch to stuff we got from botovoq@
Changes to `crypto/perlasm/arm-xlate.pl` deal with verious assembler
flavours to keep various assembler compilers happy.

We also need to keep original code for 32-bit flavour in
`crypto/aes/asm/aesv8-armx.pl`.

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

6 months agoMake it able to run asm code on OpenBSD (arm64)
Theo Buehler [Sun, 14 Apr 2024 23:23:36 +0000 (01:23 +0200)] 
Make it able to run asm code on OpenBSD (arm64)

In order to get asm code running on OpenBSD we must place
all constants into .rodata sections.

The change to crypto/perlasm/arm-xlate.pl adjusts changes
from Theo for additional assembler variants/flavours we
use for building OpenSSL.

Fixes #23312

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

6 months agodrbg: provide requested amount of entropy, rather than self-strength
Dimitri John Ledkov [Fri, 1 Nov 2024 14:16:18 +0000 (14:16 +0000)] 
drbg: provide requested amount of entropy, rather than self-strength

Parent DRBG can be seed source (os or jitter) and thus able to provide
unlimited entropy.

get_entropy is documented to provide at least the request amount of
entropy. If requested amount of entropy is same as, or less than
drbg->strength, everything is compliant. However, if requested entropy
is more than drbg->strength (unlikely, but possible), the returned
amount of entropy will be insufficient and additional repeated calls
to get_entropy will be required.

Reading history of refactors, it seems to me that this function call
previouslly had assumptions and usecases that couldn't ever request or
require more than strength amount of entropy.

If entropy is set, request that amount, otherwise request
drbg->strength amount.

Reviewed-by: Hugo Landau <hlandau@devever.net>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/25850)

6 months agoFix obvious misspelling of ASN1_VALUE
Tom Cosgrove [Tue, 10 Dec 2024 11:31:11 +0000 (11:31 +0000)] 
Fix obvious misspelling of ASN1_VALUE

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

6 months agoFix double 'the's
Tom Cosgrove [Thu, 5 Dec 2024 09:08:42 +0000 (09:08 +0000)] 
Fix double 'the's

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

6 months agoLoongArch: we should access global symbol by la.global instead of
Wang Xin [Wed, 8 Jan 2025 01:18:47 +0000 (01:18 +0000)] 
LoongArch: we should access global symbol by la.global instead of
la.pcrel

openssl will not be built successfully with binutils-2.43.50.20241230
which checks if global symbols are accessed by PC-relative in shared
library.

CLA: trivial

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

6 months agoFix premature reuse of qp's in rcu locks
Neil Horman [Fri, 10 Jan 2025 19:37:28 +0000 (14:37 -0500)] 
Fix premature reuse of qp's in rcu locks

An intermittent failure was noted on our new ppc64le CI runner, in which
what appeared to be a corrupted or invalid value getting returned from a
shared pointer under rcu protection

Investigation showed that the problem was with our small number of qp's
in a lock, and slightly incorrect accounting of the number of qp's
available we were prematurely recycling qp's, which led in turn to
premature completion of synchronization states, resulting in readers
reading memory that may have already been freed.

Fix it by:
a) Ensuring that we account for the fact that the first qp in an rcu
lock is allocated at the time the lock is created

and

b) Ensuring that we have a minimum number of 3 qp's:
1 that is free for write side allocation
1 that is in use by the write side currently
1 "next" qp that the read side can update while the prior qp is being
retired

With this change, the rcu threadstest runs indefinately in my testing

Fixes #26356

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

6 months agoFix intermittent test failure in 80-test_cmp_http.t
Bernd Edlinger [Thu, 9 Jan 2025 14:14:15 +0000 (15:14 +0100)] 
Fix intermittent test failure in 80-test_cmp_http.t

output to stderr is unbuffered bypassing the normal output, which does
not happen at line boundaries and is therefore confusing the TAP parser.
This is known to cause random test failures like this one:

80-test_cmp_http.t                    (Wstat: 0 Tests: 5 Failed: 0)
  Parse errors: Tests out of sequence.  Found (6) but expected (5)
                Bad plan.  You planned 6 tests but ran 5.

Fixes #23992

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26363)

6 months agocoveralls.yml: Avoid excluding subdirectories of already excluded dirs
Tomas Mraz [Mon, 13 Jan 2025 13:24:22 +0000 (14:24 +0100)] 
coveralls.yml: Avoid excluding subdirectories of already excluded dirs

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

6 months agospeed: Pass IV to EVP_CipherInit_ex for -evp runs with non-AEAD ciphers
Ingo Franzki [Wed, 8 Jan 2025 15:00:33 +0000 (16:00 +0100)] 
speed: Pass IV to EVP_CipherInit_ex for -evp runs with non-AEAD ciphers

Some (non-AEAD) ciphers require an IV to be used. Always pass a (dummy) IV
when setting the key. It is ignored by ciphers that do not use an IV.

Commit 607a46d003f472d4bce646f3df6e85725094d68a corrected the use of AEAD
ciphers, but removed the IV from being passed to EVP_CipherInit_ex() for
non-AEAD ciphers.

Fixes: https://github.com/openssl/openssl/commit/607a46d003f472d4bce646f3df6e85725094d68a
Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Hugo Landau <hlandau@devever.net>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26346)

6 months agoTweak case of [fs] variant letter in SLH-DSA algorithms
Viktor Dukhovni [Thu, 9 Jan 2025 13:09:09 +0000 (00:09 +1100)] 
Tweak case of [fs] variant letter in SLH-DSA algorithms

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

6 months agocoveralls.yml: Add --ignore-errors mismatch
Tomas Mraz [Fri, 10 Jan 2025 15:10:46 +0000 (16:10 +0100)] 
coveralls.yml: Add --ignore-errors mismatch

Once lcov is updated to 2.2 version or later, it could be dropped.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/26381)

6 months agoPre-ML-KEM/DSA decoder/encoder refactor
Viktor Dukhovni [Thu, 9 Jan 2025 03:33:18 +0000 (14:33 +1100)] 
Pre-ML-KEM/DSA decoder/encoder refactor

Simplify some decoder/encoder internals to facilitate upcoming support
for ML-KEM and ML-DSA.

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

6 months agoFix buildinf.h generation for space and backslash
Kai Pastor [Sat, 4 Jan 2025 10:48:26 +0000 (11:48 +0100)] 
Fix buildinf.h generation for space and backslash

Builds may be configured with CC or CFLAGS containing space and
double quotes. In particular on Windows, this may lead to passing
more than two arguments into mkbuildinf.pl.
In addition, backslashes must be escaped for constructing the C string.

Fixes #26253.

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

6 months agoUpdate error codes in "crypto/err/openssl.txt"
Michael Baentsch [Tue, 7 Jan 2025 09:30:56 +0000 (10:30 +0100)] 
Update error codes in "crypto/err/openssl.txt"

Fixes #26316

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

6 months agoReplace self-hosted runners with GitHub hosted
Dmitry Misharov [Thu, 2 Jan 2025 14:32:41 +0000 (15:32 +0100)] 
Replace self-hosted runners with GitHub hosted

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

6 months agoFix memory leaks from missing checks of return value from sk_OPENSSL_STRING_push()
Frederik Wedel-Heinen [Sat, 21 Dec 2024 20:15:36 +0000 (21:15 +0100)] 
Fix memory leaks from missing checks of return value from sk_OPENSSL_STRING_push()

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

6 months agoFix the use of OPENSSL_HTTP_PROXY / OPENSSL_HTTPS_PROXY
Richard Levitte [Wed, 8 Jan 2025 09:15:02 +0000 (10:15 +0100)] 
Fix the use of OPENSSL_HTTP_PROXY / OPENSSL_HTTPS_PROXY

Fixes #26337

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

6 months agoFix encryption level ordering
Neil Horman [Tue, 7 Jan 2025 14:12:03 +0000 (09:12 -0500)] 
Fix encryption level ordering

It was noticed recently that the enum for QUIC encryption levels doesn't
match the ordering that is outlined in the RFC.  RFC 9000 s. 12.2 and
RFC 9002 s 14.4.1 indicate that encryption level ordering is
INITIAL/0RTT/HANDSHAKE/1RTT, but our enum is in the order
INITAL/HANDSHAKE/0RTT/1RTT.

Our enum isn't a direct wire translation, so as long as the wire->enum
mapping done in ossl_quic_pkt_type_to_enc_level is done consistently it
ideally wouldn't matter, but because we do coalescing in
ossl_quic_tx_packetiser_generate by iterating through all the values in
the enum, its possible we may coalesce in the wrong order when we do
start implementing 0RTT support.

Fix it by adjusting the enum properly to match the RFC order.  This also
necessitates and adjustment to the archetypes array, which is a two
dimensional array indexed by encryption level and frame archetype
(PROBE/NORMAL/ACK ONLY).  Moving the 0RTT enc level to index 1 requires
moving the (formerly) index 2 0RTT array row to be at index 1.

Fixes #26324

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

6 months agoFree data if sk_OPENSSL_STRING_push fails.
Frederik Wedel-Heinen [Fri, 20 Dec 2024 14:45:53 +0000 (15:45 +0100)] 
Free data if sk_OPENSSL_STRING_push fails.

Fixes #26203

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

6 months agoReturn NULL from ossl_lib_ctx_get_concrete() when it is uninitialized
Frederik Wedel-Heinen [Sun, 5 Jan 2025 19:42:51 +0000 (20:42 +0100)] 
Return NULL from ossl_lib_ctx_get_concrete() when it is uninitialized

When default_context_inited is set to false we return NULL instead of
the global default context.

Fixes #25442

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

6 months agoAdded configuration for Embarcadero-Borland Clang Compiler 64 (BCC64)
Семенов Герман [Tue, 26 Mar 2024 11:06:57 +0000 (14:06 +0300)] 
Added configuration for Embarcadero-Borland Clang Compiler 64 (BCC64)

Signed-off-by: Герман Семенов <GermanAizek@yandex.ru>
Signed-off-by: Herman Semenov <GermanAizek@yandex.ru>
Reviewed-by: Hugo Landau <hlandau@devever.net>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23377)

6 months agoCheck returns of various sk_*_push functions
Frederik Wedel-Heinen [Sat, 21 Dec 2024 14:15:11 +0000 (15:15 +0100)] 
Check returns of various sk_*_push functions

Check returns of sk_POLICY_MAPPING_push, sk_GENERAL_NAME_push,
sk_ACCESS_DESCRIPTION_push, sk_X509_push, sk_X509_NAME_push,
sk_OPENSSL_CSTRING_push, sk_SCT_push, sk_DIST_POINT_push,
sk_OSSL_CMP_CRLSTATUS_push, sk_ASN1_UTF8STRING_push and
sk_ASN1_OBJECT_push and handle appropriately.

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

6 months agoPass functions with correct signatures to the evp_generic_fetch_xxx methods
Frederik Wedel-Heinen [Sat, 4 Jan 2025 18:27:37 +0000 (19:27 +0100)] 
Pass functions with correct signatures to the evp_generic_fetch_xxx methods

UBSan complains about functions being called with incorrect signatures.
Relates to #22896

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

6 months agoFix a funding.json error
Matt Caswell [Mon, 6 Jan 2025 15:28:27 +0000 (15:28 +0000)] 
Fix a funding.json error

"Active" should be "active"

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/26327)

6 months agoSome PQ-related CSOR OIDs
Viktor Dukhovni [Mon, 6 Jan 2025 04:04:58 +0000 (15:04 +1100)] 
Some PQ-related CSOR OIDs

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

6 months agoFix potential memory leak in PKCS12_add_key_ex()
Niels Dossche [Mon, 28 Oct 2024 16:04:03 +0000 (17:04 +0100)] 
Fix potential memory leak in PKCS12_add_key_ex()

p8 is allocated using EVP_PKEY2PKCS8(), but when PKCS8_add_keyusage()
fails this memory is not freed. Fix this by adding a call to
PKCS8_PRIV_KEY_INFO_free().

Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com>
Reviewed-by: Hugo Landau <hlandau@devever.net>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25818)

6 months agoFix a potential misaligned memory access
Bernd Edlinger [Thu, 2 Jan 2025 15:17:46 +0000 (16:17 +0100)] 
Fix a potential misaligned memory access

in test/wpackettest.c:593:18: runtime error: load of misaligned address
for type 'uint64_t', which requires 8 byte alignment.

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

6 months agoFix the sporadic test failure in 30-test_evp_extra.t
Bernd Edlinger [Sun, 29 Dec 2024 15:43:34 +0000 (16:43 +0100)] 
Fix the sporadic test failure in 30-test_evp_extra.t

Fixes #26276

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

6 months agoRun fuzz-checker workflow on ubuntu-24.04
Bernd Edlinger [Thu, 26 Dec 2024 15:30:16 +0000 (16:30 +0100)] 
Run fuzz-checker workflow on ubuntu-24.04

Fix missing afl++-clang package
Use clang-18
Configure ubsan with -fno-sanitize=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/26269)

6 months agoFix test failure in 90-test_memleak.t
Bernd Edlinger [Fri, 27 Dec 2024 22:02:47 +0000 (23:02 +0100)] 
Fix test failure in 90-test_memleak.t

recent gcc versions can optimize the memory leak away,
avoid that by declaring the lost variable to be volatile.

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

6 months agouse-of-uninitialized-value in quic_tserver_test
Bernd Edlinger [Fri, 27 Dec 2024 12:56:06 +0000 (13:56 +0100)] 
use-of-uninitialized-value in quic_tserver_test

Fixes #26277

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

6 months agoFix a minor memory sanitizer issue
Bernd Edlinger [Thu, 26 Dec 2024 10:56:17 +0000 (11:56 +0100)] 
Fix a minor memory sanitizer issue

Here the undefined value "npa" passed to a function
WPACKET_sub_memcpy_u16(pkt, npa, npalen).
However the value is not really used, because "npalen" is zero,
but the call statememt itself is considered an invalid operation
by the new sanitizer.

The original sanitizer error report was:

==49175==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x55a276b29d6f in tls_construct_stoc_next_proto_neg /home/runner/work/openssl/openssl/ssl/statem/extensions_srvr.c:1518:21
    #1 0x55a276b15d7d in tls_construct_extensions /home/runner/work/openssl/openssl/ssl/statem/extensions.c:909:15
    #2 0x55a276b513dc in tls_construct_server_hello /home/runner/work/openssl/openssl/ssl/statem/statem_srvr.c:2471:10
    #3 0x55a276b2e160 in write_state_machine /home/runner/work/openssl/openssl/ssl/statem/statem.c:896:26
    #4 0x55a276b2e160 in state_machine /home/runner/work/openssl/openssl/ssl/statem/statem.c:490:21
    #5 0x55a276b2f562 in ossl_statem_accept /home/runner/work/openssl/openssl/ssl/statem/statem.c:309:12
    #6 0x55a276a9f867 in SSL_do_handshake /home/runner/work/openssl/openssl/ssl/ssl_lib.c:4890:19
    #7 0x55a276a9f605 in SSL_accept /home/runner/work/openssl/openssl/ssl/ssl_lib.c:2169:12
    #8 0x55a276a3d4db in create_bare_ssl_connection /home/runner/work/openssl/openssl/test/helpers/ssltestlib.c:1281:24
    #9 0x55a276a3d7cb in create_ssl_connection /home/runner/work/openssl/openssl/test/helpers/ssltestlib.c:1350:10
    #10 0x55a276a64c0b in test_npn /home/runner/work/openssl/openssl/test/sslapitest.c:12266:14
    #11 0x55a276b9fc20 in run_tests /home/runner/work/openssl/openssl/test/testutil/driver.c:377:21
    #12 0x55a276ba0b10 in main /home/runner/work/openssl/openssl/test/testutil/main.c:31:15

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

6 months agoTry to work around the llvm-symbolizer failure
Bernd Edlinger [Fri, 27 Dec 2024 07:49:13 +0000 (08:49 +0100)] 
Try to work around the llvm-symbolizer failure

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

6 months agoAdd __isoc23_strtol to unix-symbols.txt
Bernd Edlinger [Thu, 26 Dec 2024 20:02:58 +0000 (21:02 +0100)] 
Add __isoc23_strtol to unix-symbols.txt

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

6 months agoAdd -fno-sanitize=function to ubsan
Bernd Edlinger [Wed, 16 Oct 2024 14:37:32 +0000 (16:37 +0200)] 
Add -fno-sanitize=function to ubsan

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

6 months agoAdd linux ppc64le runner
Dmitry Misharov [Fri, 3 Jan 2025 14:56:23 +0000 (15:56 +0100)] 
Add linux ppc64le runner

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

6 months agoClean up ASN1_STRING comment and improve example in docs
Job Snijders [Tue, 17 Dec 2024 13:05:49 +0000 (13:05 +0000)] 
Clean up ASN1_STRING comment and improve example in docs

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

6 months agoadd multiplexing test for quic server to ci
Neil Horman [Tue, 17 Dec 2024 17:08:15 +0000 (12:08 -0500)] 
add multiplexing test for quic server to ci

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

6 months ago80-test_cms.t: Fix incorrect plan from bad merge
Tomas Mraz [Mon, 6 Jan 2025 12:03:59 +0000 (13:03 +0100)] 
80-test_cms.t: Fix incorrect plan from bad merge

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

6 months agoFix CMS encryption with key agreement when originator set
Jakub Zelenka [Fri, 13 Dec 2024 12:48:23 +0000 (13:48 +0100)] 
Fix CMS encryption with key agreement when originator set

OpenSSL currently does not support encryption with originator flag so it
should fail nicely instead of segfaulting.

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

6 months agoFix originator cert leak in cms app
Jakub Zelenka [Fri, 13 Dec 2024 12:47:25 +0000 (13:47 +0100)] 
Fix originator cert leak in cms app

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

6 months agoOptimize x86/aarch64 MD5 implementation
Jonathan Swinney [Fri, 18 Oct 2024 16:55:07 +0000 (11:55 -0500)] 
Optimize x86/aarch64 MD5 implementation

As suggested in https://github.com/animetosho/md5-optimisation?tab=readme-ov-file#dependency-shortcut-in-g-function,
we can delay the dependency on 'x' by recognizing that ((x & z) | (y & ~z))
is equivalent to ((x & z) + (y + ~z)) in this scenario, and we can perform
those additions independently, leaving our dependency on x to the final
addition. This speeds it up around 5% on both platforms.

Signed-off-by: Oli Gillespie <ogillesp@amazon.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Hugo Landau <hlandau@devever.net>
(Merged from https://github.com/openssl/openssl/pull/25737)

6 months agoopenssl-pkeyutl.pod.in: update from SHA-1 to SHA256, fixing default values and examples
Dr. David von Oheimb [Fri, 15 Nov 2024 07:49:33 +0000 (08:49 +0100)] 
openssl-pkeyutl.pod.in: update from SHA-1 to SHA256, fixing default values and examples

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

6 months agoopenssl-pkeyutl.pod.in: various fixes
Dr. David von Oheimb [Thu, 14 Nov 2024 08:43:21 +0000 (09:43 +0100)] 
openssl-pkeyutl.pod.in: various fixes

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

6 months agoapps/pkeyutl: Fix checks and documentation regarding -peerkey
Dr. David von Oheimb [Thu, 14 Nov 2024 08:28:16 +0000 (09:28 +0100)] 
apps/pkeyutl: Fix checks and documentation regarding -peerkey

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

6 months agoAdd a funding.json file
Matt Caswell [Mon, 23 Dec 2024 11:25:02 +0000 (11:25 +0000)] 
Add a funding.json file

For details about this file format see:
https://floss.fund/funding-manifest/

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Hugo Landau <hlandau@devever.net>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26247)

7 months agoCorrect return value documentation for X509V3_set_ctx()
Michael Baentsch [Wed, 1 Jan 2025 18:27:45 +0000 (19:27 +0100)] 
Correct return value documentation for X509V3_set_ctx()

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

7 months agoAvoid leaking memory when realloc fails
Frederik Wedel-Heinen [Sun, 22 Dec 2024 12:35:00 +0000 (13:35 +0100)] 
Avoid leaking memory when realloc fails

In ossl_property_merge() we can drop the realloc because it just makes
the allocation smaller.

In quic-hq-interop.c we check the realloc result.

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

7 months agotest: allowedAttributeAssignments X.509v3 extension
Jonathan M. Wilbur [Fri, 13 Dec 2024 07:00:58 +0000 (07:00 +0000)] 
test: allowedAttributeAssignments X.509v3 extension

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

7 months agodoc: the allowedAttributeAssignments X.509v3 extension
Jonathan M. Wilbur [Thu, 12 Dec 2024 14:52:37 +0000 (14:52 +0000)] 
doc: the allowedAttributeAssignments X.509v3 extension

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

7 months agofeat: support the allowedAttributeAssignments X.509v3 extension
Jonathan M. Wilbur [Thu, 12 Dec 2024 14:29:50 +0000 (14:29 +0000)] 
feat: support the allowedAttributeAssignments X.509v3 extension

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

7 months agoReject invalid FFDHE and ECDHE key shares with SSL_AD_ILLEGAL_PARAMETER alert
cx [Thu, 26 Sep 2024 03:27:14 +0000 (11:27 +0800)] 
Reject invalid FFDHE and ECDHE key shares with SSL_AD_ILLEGAL_PARAMETER alert

This changes the alert according to RFC 8446.

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

7 months agoFix potential memory leak in BIO_get_accept_socket()
Niels Dossche [Mon, 28 Oct 2024 15:34:55 +0000 (16:34 +0100)] 
Fix potential memory leak in BIO_get_accept_socket()

When BIO_parse_hostserv() fails it may still have allocated memory, yet
this memory is not freed. Fix it by jumping to the err label.

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