]> git.ipfire.org Git - thirdparty/openssl.git/log
thirdparty/openssl.git
7 months agoCode & comments changes to make them in consistent
willmafh [Wed, 4 Dec 2024 03:00:35 +0000 (11:00 +0800)] 
Code & comments changes to make them in consistent

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

7 months agoone more empty line for code style consistency
willmafh [Tue, 3 Dec 2024 05:15:14 +0000 (13:15 +0800)] 
one more empty line for code style consistency

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

7 months agoChange all one's complement to ones' complement for consistency
willmafh [Tue, 3 Dec 2024 05:13:39 +0000 (13:13 +0800)] 
Change all one's complement to ones' complement for consistency

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

7 months agoBN_secure_new function indentation correction
willmafh [Tue, 3 Dec 2024 05:11:33 +0000 (13:11 +0800)] 
BN_secure_new function indentation correction

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

7 months agoDelete redundant parentheses for code consistency
willmafh [Tue, 3 Dec 2024 05:08:55 +0000 (13:08 +0800)] 
Delete redundant parentheses for code consistency

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

7 months agoDelete a redundant break
willmafh [Tue, 3 Dec 2024 05:06:46 +0000 (13:06 +0800)] 
Delete a redundant break

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

8 months agoRun interop tests on feature/quic-server branch
Neil Horman [Sun, 1 Dec 2024 21:11:28 +0000 (16:11 -0500)] 
Run interop tests on feature/quic-server branch

We currently run interop tests as a client only from the master branch.
While we are developing quic-server it would be beneficial to also get
interop test results from the quic-server branch run as both a client
and a server, until such time as the feature branch is merged.  Add
building and running of a container in the test harness to our CI set

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

8 months agoAdd handling for additional input in jitter rng
jsondevers [Thu, 28 Nov 2024 16:49:23 +0000 (11:49 -0500)] 
Add handling for additional input in jitter rng

Fixes #25917

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

8 months agofips: zeroization of ECX public keys
Joachim Vandersmissen [Sun, 27 Oct 2024 04:48:55 +0000 (23:48 -0500)] 
fips: zeroization of ECX public keys

Commit fa338aa7cd added zeroization of public security parameters as
required by ISO 19790:2012/Cor.1:2015 7.9. However, that commit
overlooked ECX keys, which are used for EdDSA and X25519/X448.

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

8 months agoproviders: stop probing for getentropy(3) on recent FreeBSD
Kyle Evans [Tue, 16 Jul 2024 05:21:58 +0000 (00:21 -0500)] 
providers: stop probing for getentropy(3) on recent FreeBSD

FreeBSD has supported both getrandom(2) and getentropy(3) since 12.0.
The last version which did *not* have these went EoL in September 2021.
Use getrandom(2) unconditionally and fallback to sysctl kern.arandom if
we do happen to have a FreeBSD that old.

This is generally a necessary step for FreeBSD's _FORTIFY_SOURCE
implementation, which needs to do some symbol renaming tricks with the
getentropy declaration that would otherwise add some platform-specific
hacks here to accommodate.  getentropy(3) uses getrandom(2) internally
on FreeBSD, so we just cut out the middleman.

While we're here, it doesn't seem to make sense to ever prefer the
sysctl on FreeBSD or NetBSD.  For both platforms, it's limited to 256
bytes in a single request while getrandom(2) will generally use the same
backend but service the entire request in one shot, even for larger
amounts of entropy, modulo the EINTR possibility that presents itself
with larger requests.

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

8 months agofips-label.yml: Fix ABI change label removal
Tomas Mraz [Thu, 28 Nov 2024 15:58:06 +0000 (16:58 +0100)] 
fips-label.yml: Fix ABI change label removal

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

8 months agoAvoid NULL dereference with PKCS7_OP_SET_DETACHED_SIGNATURE
Tomas Mraz [Thu, 28 Nov 2024 09:10:28 +0000 (10:10 +0100)] 
Avoid NULL dereference with PKCS7_OP_SET_DETACHED_SIGNATURE

We would dereference p7->d.sign pointer which can be NULL.

Reported by Han Zheng.

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

8 months agoDocument version-specific utility of EVP_PKEY_Q_keygen
Michael Baentsch [Sat, 23 Nov 2024 05:44:40 +0000 (06:44 +0100)] 
Document version-specific utility of EVP_PKEY_Q_keygen

Reviewed-by: Matt Caswell <matt@openssl.org>
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/26040)

8 months agoMinor nit fix to EVP_CipherFinal_ex() return code documentation.
Frederik Wedel-Heinen [Fri, 1 Nov 2024 13:18:38 +0000 (14:18 +0100)] 
Minor nit fix to EVP_CipherFinal_ex() return code documentation.

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

8 months agoFix memleak in dsa_gen()
Holger Dengler [Thu, 14 Nov 2024 08:55:50 +0000 (09:55 +0100)] 
Fix memleak in dsa_gen()

Free the stack return value `dsa` on each early exit.

Fixes #25905

Signed-off-by: Holger Dengler <dengler@linux.ibm.com>
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25948)

8 months agoFix EVP_PKEY_print_private() so that it works with non default providers.
slontis [Wed, 20 Nov 2024 01:39:35 +0000 (12:39 +1100)] 
Fix EVP_PKEY_print_private() so that it works with non default providers.

At some point in time it was decided that the EC keymanagers ec_export()
function would only allow the selection to be both the public + private
parts. If just the private element is selected it returns an error.
Many openssl commandline apps use EVP_PKEY_print_private() which passes
EVP_PKEY_PRIVATE_KEY to the encoder. This selection propagates to
encoder_construct_pkey(). For external providers (such as the fips
provider this will call the keymanagers export() with the selection set
to just the private part.

So we either need to
1) change the selection in EVP_PKEY_print_private() or
2) modify the selection used in the export used in
   encoder_construct_pkey
3) Change the ec_export to allow this.

I have chosen 2) but I am not sure if this is the correct thing to do
or whether it should conditionally do this when the output_type ==
'text'.

Issue was reported by Ilia Okomin (Oracle).

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

8 months agodie() in .tmpl file should not be silently ignored.
Alexandr Nedvedicky [Tue, 26 Nov 2024 08:05:09 +0000 (09:05 +0100)] 
die() in .tmpl file should not be silently ignored.

call to die() in perl templates is currently ignored.
any error printed by die() commad appears in template
output.

In order to make sure die() terminates processing we
must ensure we emite `undef` value. This is ensured
by adding a `BROKEN` callback to `fill_in()` Template
method. The callback must return undef to stop processing.

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

8 months agoapps/passwd.c: Convert a redundant check to assert
Bartel Artem [Mon, 25 Nov 2024 11:28:05 +0000 (14:28 +0300)] 
apps/passwd.c: Convert a redundant check to assert

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26053)

8 months agoFix solaris build in CRYPTO_atomic_store api
Neil Horman [Wed, 27 Nov 2024 17:22:19 +0000 (12:22 -0500)] 
Fix solaris build in CRYPTO_atomic_store api

Misnamed variable, just correct it to dst

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

8 months agoUse static array (length 256) for copy of OPENSSL_MALLOC_FAILURES
sftcd [Mon, 25 Nov 2024 16:01:39 +0000 (16:01 +0000)] 
Use static array (length 256) for copy of OPENSSL_MALLOC_FAILURES

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

8 months agoDeprecate all BIO_meth_get_*() functions
Tomas Mraz [Mon, 25 Nov 2024 15:06:47 +0000 (16:06 +0100)] 
Deprecate all BIO_meth_get_*() functions

Their use by applications is inherently unsafe.
Fixes #26047

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/26056)

8 months agoUse sk_X509_ATTRIBUTE_deep_copy() to copy attribute stacks in pk7_doit.c
Niels Dossche [Wed, 16 Oct 2024 18:37:29 +0000 (20:37 +0200)] 
Use sk_X509_ATTRIBUTE_deep_copy() to copy attribute stacks in pk7_doit.c

Clean up the code by using the dedicated stack copy function.

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

8 months agoci: add daily runcheckers to exercise the -DOPENSSL_PEDANTIC_ZEROIZATION option
Pauli [Wed, 27 Nov 2024 00:24:29 +0000 (11:24 +1100)] 
ci: add daily runcheckers to exercise the -DOPENSSL_PEDANTIC_ZEROIZATION option

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26068)

8 months agofips: change integrity check zeroization to use the OPENSSL_PEDANTIC_ZEROIZATION...
Pauli [Wed, 27 Nov 2024 00:21:08 +0000 (11:21 +1100)] 
fips: change integrity check zeroization to use the OPENSSL_PEDANTIC_ZEROIZATION define

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26068)

8 months agopbkdf2: change FIPS zeroization to use the OPENSSL_PEDANTIC_ZEROIZATION define
Pauli [Wed, 27 Nov 2024 00:19:32 +0000 (11:19 +1100)] 
pbkdf2: change FIPS zeroization to use the OPENSSL_PEDANTIC_ZEROIZATION define

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26068)

8 months agohkdf: change FIPS zeroization to use the OPENSSL_PEDANTIC_ZEROIZATION define
Pauli [Wed, 27 Nov 2024 00:19:19 +0000 (11:19 +1100)] 
hkdf: change FIPS zeroization to use the OPENSSL_PEDANTIC_ZEROIZATION define

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26068)

8 months agorsa: change FIPS zeroization to use the OPENSSL_PEDANTIC_ZEROIZATION define
Pauli [Wed, 27 Nov 2024 00:19:00 +0000 (11:19 +1100)] 
rsa: change FIPS zeroization to use the OPENSSL_PEDANTIC_ZEROIZATION define

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26068)

8 months agoffc: change FIPS zeroization to use the OPENSSL_PEDANTIC_ZEROIZATION define
Pauli [Wed, 27 Nov 2024 00:18:51 +0000 (11:18 +1100)] 
ffc: change FIPS zeroization to use the OPENSSL_PEDANTIC_ZEROIZATION define

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26068)

8 months agoec: change FIPS zeroization to use the OPENSSL_PEDANTIC_ZEROIZATION define
Pauli [Wed, 27 Nov 2024 00:18:38 +0000 (11:18 +1100)] 
ec: change FIPS zeroization to use the OPENSSL_PEDANTIC_ZEROIZATION define

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26068)

8 months agoA typo fix in a comment
willmafh [Wed, 27 Nov 2024 03:06:36 +0000 (11:06 +0800)] 
A typo fix in a comment

CLA: trivial

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

8 months agoDocument expected BIO operations for libssl
David Benjamin [Mon, 25 Nov 2024 16:01:17 +0000 (11:01 -0500)] 
Document expected BIO operations for libssl

If your custom BIO does not implement BIO_CTRL_FLUSH, it won't work, but
this is not document anywhere.

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

8 months agoUpgrade action/{upload,download}-artifact to v4
Richard Levitte [Mon, 11 Nov 2024 10:44:56 +0000 (11:44 +0100)] 
Upgrade action/{upload,download}-artifact to v4

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

8 months agofips-jitter: set provider into error state upon CRNG permanent failures
Dimitri John Ledkov [Fri, 15 Nov 2024 05:32:33 +0000 (05:32 +0000)] 
fips-jitter: set provider into error state upon CRNG permanent failures

With fips-jitter build time option, jitter can be inside FIPS
boundary.

Calls to jent_read_entropy() can return permanent failures for
Repetitive Count Test (RTC), Adaptive Proportion Test (APT), LAG
prediction test.

Ensure the module enters error state upon permanent jitter failures.

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

8 months agoFix potential memory leak on failure of ecx_gen_init()
Niels Dossche [Wed, 20 Nov 2024 18:57:38 +0000 (19:57 +0100)] 
Fix potential memory leak on failure of ecx_gen_init()

When ecx_gen_set_params() returns 0, it could have duplicated the memory
for the parameter OSSL_KDF_PARAM_PROPERTIES already in gctx->propq,
leading to a memory leak.

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

8 months agoFix potential memory leak on failure of dsa_gen_init()
Niels Dossche [Wed, 20 Nov 2024 19:22:43 +0000 (20:22 +0100)] 
Fix potential memory leak on failure of dsa_gen_init()

When dsa_gen_set_params()  returns 0, it could have duplicated the memory for the parameter
OSSL_PKEY_PARAM_FFC_DIGEST already in gctx->mdname, leading to a memory leak.

Allocated here: https://github.com/openssl/openssl/blob/47a80fd2034cd4314d3b4958539dcd3106087109/providers/implementations/keymgmt/dsa_kmgmt.c#L524
Can return 0 here: https://github.com/openssl/openssl/blob/47a80fd2034cd4314d3b4958539dcd3106087109/providers/implementations/keymgmt/dsa_kmgmt.c#L529-L536

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

8 months agoEnable AES and SHA3 optimisations on Apple Silicon M4-based macOS systems
Tom Cosgrove [Tue, 12 Nov 2024 08:27:27 +0000 (08:27 +0000)] 
Enable AES and SHA3 optimisations on Apple Silicon M4-based macOS systems

AES gets a performance enhancement of 7-33%.

Tested on an M4 Pro, but the CPU cores are the same on M4 and M4 Max.

Change-Id: I634c03f1d2b50fa5f8ca97dd65975e49d970c72b

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

8 months agofips: remove redundant RSA encrypt/decrypt KAT
Dimitri John Ledkov [Thu, 14 Nov 2024 12:03:10 +0000 (12:03 +0000)] 
fips: remove redundant RSA encrypt/decrypt KAT

FIPS 140-2 IG D.9 has become FIPS 140-3 D.G (see "Mapping FIPS 140-2
IGs to FIPS 140-3" in the FIPS 140-3 IG).

The requirements w.r.t. RSA KATs have now been relaxed, meaning that
existing full-message RSA signature verification (which is performed
separately) is sufficient to meet KAT requirements for all RSA
usecases (KEM/Encrypt/Decrypt/Sign/Verify).

Dropping this KAT is very useful, because it is large/expensive on
module startup, but also because it enables in the future to block RSA
Encrypt/Decrypt operations with paddings other than OAEP, which are
legacy or deprecated by either current or draft algorithm transition
SP.

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

8 months agofips: zeroize temporary self-check out MD variable
Dimitri John Ledkov [Thu, 14 Nov 2024 04:38:27 +0000 (04:38 +0000)] 
fips: zeroize temporary self-check out MD variable

At least this is done on module startup only.

To satisfy ISO/IEC 19790:2012/Cor.1:2015(E) Section 7.5 [05.10]
requirement.

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

8 months ago.gitignore: Ignoring demo executables
Dmitry Belyavskiy [Wed, 20 Nov 2024 13:48:32 +0000 (14:48 +0100)] 
.gitignore: Ignoring demo executables

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

8 months agoRemove the negative return values of EVP_KDF_* functions in documents
Peiwei Hu [Tue, 19 Nov 2024 09:19:02 +0000 (17:19 +0800)] 
Remove the negative return values of EVP_KDF_* functions in documents

None of the EVP_KDF_* functions will ever return a negative value.

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

8 months agoFix wrong return value checks for some functions
Peiwei Hu [Sun, 27 Oct 2024 09:53:53 +0000 (17:53 +0800)] 
Fix wrong return value checks for some functions

- in particular in use of X509_LOOKUP_load_file, EVP_PKEY_print_params,
EVP_PKEY_keygen, X509_CRL_add1_ext_i2d, EVP_PKEY_keygen_init

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

8 months agoFix multiple wrong use of BN_check_prime
Peiwei Hu [Sun, 27 Oct 2024 09:37:48 +0000 (17:37 +0800)] 
Fix multiple wrong use of BN_check_prime

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

8 months agoFix multiple wrong checks of EVP_PKEY_set1_encoded_public_key
Peiwei Hu [Sun, 27 Oct 2024 09:04:15 +0000 (17:04 +0800)] 
Fix multiple wrong checks of EVP_PKEY_set1_encoded_public_key

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

8 months agoapps/lib/apps.c: fix the wrong check in check_cert_attributes
Peiwei Hu [Sun, 27 Oct 2024 09:02:32 +0000 (17:02 +0800)] 
apps/lib/apps.c: fix the wrong check in check_cert_attributes

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

8 months agoMark OPENSSL_armcap_P .hidden in arm asm
Kai Pastor [Sat, 23 Sep 2023 18:22:03 +0000 (20:22 +0200)] 
Mark OPENSSL_armcap_P .hidden in arm asm

Fixes #25601
Fixes #22414

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

8 months agoFix SSL_write_[ex|ex2] on blocking quic streams
Neil Horman [Tue, 19 Nov 2024 16:58:30 +0000 (11:58 -0500)] 
Fix SSL_write_[ex|ex2] on blocking quic streams

When writing to a blocking quic stream, we sometimes get duplicate
transmitted data.  This occurs when a call to quic_write_blocking has to
wait for space to become available in the ring buffer.  When we do a
wait, the call sets *written to the value returned in args.total_written
as filled out by the calls to block_until_pred->quic_write_again.
However, the value there is based on the amount we requested, which is
only the remaining data that we didn't append in xso_sstream_write.  So
if we call quic_write_blocking with a buffer of length X, and initially
append Y bytes, and write the remainig X-Y bytes via a block_until_pred
call, then *written will return with the value X-Y, even though we wrote
the full X bytes to the ring buffer.

Fix it by recording the initial amount appended into *written, and then
add the args.total_written value if we have to wait on more space

Fixes openssl/project#924

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

8 months agosm2_sig_verify(): Do not call BN_CTX_end() without BN_CTX_start()
Tomas Mraz [Tue, 19 Nov 2024 10:09:58 +0000 (11:09 +0100)] 
sm2_sig_verify(): Do not call BN_CTX_end() without BN_CTX_start()

In case of memory allocation failure this
could happen.

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

8 months agoadd new keytype test for EVP_PKEY_Q_keygen
Michael Baentsch [Sat, 16 Nov 2024 16:12:18 +0000 (17:12 +0100)] 
add new keytype test for EVP_PKEY_Q_keygen

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

8 months agopkeyutl.c: Avoid freeing pkey at multiple places
Tomas Mraz [Mon, 18 Nov 2024 19:56:34 +0000 (20:56 +0100)] 
pkeyutl.c: Avoid freeing pkey at multiple places

Also fixes a leak of pkey in error case for -verifyrecover.

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

8 months agoREADME.md: Fix typo. Change 'the are' to 'there are'
spectre [Sun, 17 Nov 2024 18:15:48 +0000 (19:15 +0100)] 
README.md: Fix typo. Change 'the are' to 'there are'

This pull request fixes a typo in the documentation.
The phrase "the are" has been corrected to "there are".

CLA: trivial

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

8 months agos_cb.c: Move the negotiated group output
Michael Baentsch [Fri, 15 Nov 2024 08:49:43 +0000 (09:49 +0100)] 
s_cb.c: Move the negotiated group output

It needs to be always displayed not just with -brief.

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

8 months agoAdd CTX copy function for EVP_MD to optimize the performance of EVP_MD_CTX_copy_ex.
wangcheng [Sat, 26 Oct 2024 09:10:38 +0000 (17:10 +0800)] 
Add CTX copy function for EVP_MD to optimize the performance of EVP_MD_CTX_copy_ex.

1. Add OSSL_FUNC_digest_copyctx_fn function for EVP_MD, which is used to copy algctx from the old EVP_MD_CTX to the new one.

2. Add implementation of OSSL_FUNC_digest_copyctx_fn function for default providers.

3. Modify EVP_MD_CTX_copy_ex: When the fetched digest is the same in in and out contexts, use the copy function to copy the members in EVP_MD_CTX if the OSSL_FUNC_digest_copyctx_fn function exists. Otherwise, use the previous method to copy.

4. Add documentation for OSSL_FUNC_digest_copyctx function in doc/man7/provider-digest.pod.

5. Add testcase.

Fixes #25703

Signed-off-by: wangcheng <bangwangnj@163.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25726)

8 months agox509_vfy.c and x509_lu.c: refactor find_issuer(), X509_STORE_CTX_get1_issuer(), etc.
Dr. David von Oheimb [Sat, 9 Jul 2022 08:23:33 +0000 (10:23 +0200)] 
x509_vfy.c and x509_lu.c: refactor find_issuer(), X509_STORE_CTX_get1_issuer(), etc.

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

8 months agoos-zoo CI: Replace macos-12 run with macos-15
Tomas Mraz [Wed, 16 Oct 2024 19:49:50 +0000 (21:49 +0200)] 
os-zoo CI: Replace macos-12 run with macos-15

macos-12 runners will be removed in December.

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

8 months agoAdd docs for OSSL_PARAM_print_to_buf
Neil Horman [Mon, 14 Oct 2024 17:34:38 +0000 (13:34 -0400)] 
Add docs for OSSL_PARAM_print_to_buf

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

8 months agoMake ossl_trace_param_values an official api function
Neil Horman [Mon, 14 Oct 2024 17:23:33 +0000 (13:23 -0400)] 
Make ossl_trace_param_values an official api function

lots of people may want to print params to a buffer.  Make it part of
our api

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

8 months agoAdd QUERY trace points
Neil Horman [Sun, 6 Oct 2024 17:16:16 +0000 (13:16 -0400)] 
Add QUERY trace points

Adds trace messages for method store add/remove and fetch operations

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

8 months agoAdd a QUERY trace category
Neil Horman [Sat, 5 Oct 2024 13:51:00 +0000 (09:51 -0400)] 
Add a QUERY trace category

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

8 months agoAdd tracing messages to the provider api
Neil Horman [Sat, 5 Oct 2024 13:44:11 +0000 (09:44 -0400)] 
Add tracing messages to the provider api

Adds tracing messages to the
init/teardown/gettable_params/get_params/query/unquery operations for a
provider

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

8 months agoAdding a trace category for PROVIDER calls
Neil Horman [Fri, 4 Oct 2024 11:01:30 +0000 (07:01 -0400)] 
Adding a trace category for PROVIDER calls

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

8 months agoremove ternary from runs-on, security repo is hosted on github.com
Dmitry Misharov [Wed, 13 Nov 2024 14:35:43 +0000 (15:35 +0100)] 
remove ternary from runs-on, security repo is hosted on github.com

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

8 months agoman ECDSA_sign(3): fix wrong variable names
Alicja Kario [Mon, 11 Nov 2024 13:33:46 +0000 (14:33 +0100)] 
man ECDSA_sign(3): fix wrong variable names

the parameters in the function definitions use `siglen` not `sig_len`,
this fixes the doc text.

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

8 months agoChange "a SSL" to "an SSL"
Andrew Dinh [Thu, 7 Nov 2024 20:47:32 +0000 (12:47 -0800)] 
Change "a SSL" to "an SSL"

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/25868)

8 months agotest_hashtable_multithread(): Stress it more
Tomas Mraz [Fri, 11 Oct 2024 15:25:49 +0000 (17:25 +0200)] 
test_hashtable_multithread(): Stress it more

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

8 months agoUse test_random() in hashtable mt test for reproducibility
Tomas Mraz [Fri, 11 Oct 2024 15:13:40 +0000 (17:13 +0200)] 
Use test_random() in hashtable mt test for reproducibility

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

8 months agoFix doc and use of_X509v3_add_extensions() in case sk_X509_EXTENSION_num(exts) <= 0
Dr. David von Oheimb [Mon, 7 Oct 2024 20:08:08 +0000 (22:08 +0200)] 
Fix doc and use of_X509v3_add_extensions() in case sk_X509_EXTENSION_num(exts) <= 0

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

8 months agoAdd test for SSL_stream_reset
Neil Horman [Fri, 8 Nov 2024 14:49:46 +0000 (09:49 -0500)] 
Add test for SSL_stream_reset

Add a test to the quic_multistream test suite to reset a stream after
all data has been received by a given stream, ensuring that we don't
crash in the reset operation

Fixes #25410

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

8 months agoFix SSL_stream_reset for stream objects which have FIN bit set
Neil Horman [Fri, 8 Nov 2024 01:01:48 +0000 (20:01 -0500)] 
Fix SSL_stream_reset for stream objects which have FIN bit set

When calling SSL_stream_reset on a QUIC stream object that has received
all data that is expected to be sent (i.e. when the sender has sent a
STREAM frame with the FIN bit set), we encounter the following segfault:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7f0bd28 in ossl_quic_sstream_get_final_size (qss=0x0, final_size=0x0) at ssl/quic/quic_sstream.c:273
273     if (!qss->have_final_size)
(gdb) bt
0)  0x00007ffff7f0bd28 in ossl_quic_sstream_get_final_size (qss=0x0, final_size=0x0) at ssl/quic/quic_sstream.c:273
1)  0x00007ffff7ef65bf in quic_validate_for_write (xso=0x5555555efcb0, err=0x7fffffffd5e0) at ssl/quic/quic_impl.c:2513
2)  0x00007ffff7ef8ae3 in ossl_quic_stream_reset (ssl=0x5555555efcb0, args=0x0, args_len=0) at ssl/quic/quic_impl.c:3657
3)  0x00007ffff7ebdaa6 in SSL_stream_reset (s=0x5555555efcb0, args=0x0, args_len=0) at ssl/ssl_lib.c:7635
4)  0x0000555555557527 in build_request_set (
    req_list=0x55555555ebd0 "neil1.txt neil2.txt neil3.txt neil4.txt neil5.txt neil6.txt neil7.txt neil8.txt neil9.txt neil10.txt neil11.txt neil12.txt neil13.txt neil14.txt neil15.txt neil16.txt neil17.txt neil18.txt neil19.txt "..., ssl=0x5555555b6f80)
    at demos/guide/quic-hq-interop.c:545
5)  0x00005555555587b2 in main (argc=4, argv=0x7fffffffe568) at demos/guide/quic-hq-interop.c:941

This occurs because:
1) When the stream FIN bit is set, the quic stack frees the underlying
   stream structures immediately within the QUIC stack
and
2) when SSL_stream_reset is called, the call stack indicates we call
   quic_validate_for_write, which attempts to access the
   xso->stream->sstream QUIC_SSTREAM object, which was already freed in
   (1)

The fix I think is pretty straightforward.  On receipt of a STREAM frame
with a FIN bit set, the QUIC stack sets the QUIC_STREAM object state to
QUIC_SSTREAM_STATE_DATA_RECVD, which means we can use that state to
simply assert that the stream is valid for write, which allows it to be
reset properly.

Fixes #25410

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

8 months agoAdjustments for the on schedule workflows
Tomas Mraz [Tue, 22 Oct 2024 12:25:24 +0000 (14:25 +0200)] 
Adjustments for the on schedule workflows

Run them all after 02:00 UTC.
Add possibility to run them on workflow_dispatch.
Add branch 3.4 to the coveralls.yml.
Remove the branches from os-zoo.yml as it is
possible to run on them manually from workflow_dispatch.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/25765)

8 months agoFix memleaks in cmd_RecordPadding()
Holger Dengler [Mon, 11 Nov 2024 10:29:12 +0000 (11:29 +0100)] 
Fix memleaks in cmd_RecordPadding()

Free the internal copy of parameter `value` on each early
exit.

Fixes #25906

Signed-off-by: Holger Dengler <dengler@linux.ibm.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25926)

8 months agofeat: define and use ossl_bio_print_hex
Jonathan M. Wilbur [Thu, 12 Sep 2024 23:22:42 +0000 (23:22 +0000)] 
feat: define and use ossl_bio_print_hex

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

8 months agotest: the attributeDescriptor X.509v3 extension
Jonathan M. Wilbur [Wed, 11 Sep 2024 11:56:38 +0000 (11:56 +0000)] 
test: the attributeDescriptor 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/25429)

8 months agodoc: the attributeDescriptor X.509v3 extension
Jonathan M. Wilbur [Wed, 11 Sep 2024 11:56:29 +0000 (11:56 +0000)] 
doc: the attributeDescriptor 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/25429)

8 months agofeat: support the attributeDescriptor X.509v3 extension
Jonathan M. Wilbur [Wed, 11 Sep 2024 02:24:12 +0000 (02:24 +0000)] 
feat: support the attributeDescriptor 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/25429)

8 months agotxp_generate_stream_frames(): Set stream id in header early enough
Tomas Mraz [Mon, 11 Nov 2024 13:33:57 +0000 (14:33 +0100)] 
txp_generate_stream_frames(): Set stream id in header early enough

Otherwise we will calculate an incorrect header
size for higher stream ids and won't fit the
frame into the packet.

Fixes #25417

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

8 months agoAPPS/load_key_certs_crls(): refactor to clean up the code a little and add clarifying...
Dr. David von Oheimb [Fri, 27 Oct 2023 06:40:07 +0000 (08:40 +0200)] 
APPS/load_key_certs_crls(): refactor to clean up the code a little and add clarifying comments

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

8 months agoopenssl-pkeyutl.pod.in: improve description of -rawin and -digest options
Dr. David von Oheimb [Wed, 30 Oct 2024 19:37:38 +0000 (20:37 +0100)] 
openssl-pkeyutl.pod.in: improve description of -rawin and -digest options

Fixes #25827

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

8 months agoopenssl-pkeyutl.pod.in: add that -sign is default op, update claim on hash needed...
Dr. David von Oheimb [Tue, 29 Oct 2024 18:20:59 +0000 (19:20 +0100)] 
openssl-pkeyutl.pod.in: add that -sign is default op, update claim on hash needed for -sign/-verify, etc.

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

8 months agoAPPS/pkeyutl: add missing high-level check for -verifyrecover being usable only with RSA
Dr. David von Oheimb [Thu, 7 Nov 2024 21:01:41 +0000 (22:01 +0100)] 
APPS/pkeyutl: add missing high-level check for -verifyrecover being usable only with RSA

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

8 months agoAPPS/pkeyutl: remove wrong check for -verifyrecover regarding too long sign/verify...
Dr. David von Oheimb [Thu, 7 Nov 2024 20:55:53 +0000 (21:55 +0100)] 
APPS/pkeyutl: remove wrong check for -verifyrecover regarding too long sign/verify input

Fixed #25898

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

8 months agoAdd a test for setting TLSv1.2 ciphersuites on a QUIC object
Matt Caswell [Wed, 6 Nov 2024 09:59:46 +0000 (09:59 +0000)] 
Add a test for setting TLSv1.2 ciphersuites on a QUIC object

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

8 months agoDon't complain with "no cipher match" for QUIC objects
Matt Caswell [Wed, 6 Nov 2024 09:53:11 +0000 (09:53 +0000)] 
Don't complain with "no cipher match" for QUIC objects

Calling the functions SSL_CTX_set_cipher_list() or SSL_set_cipher_list() will
return the error "no cipher match" if no TLSv1.2 (or below) ciphers are enabled
after calling them. However this is normal behaviour for QUIC objects which do
not support TLSv1.2 ciphers. Therefore we should suppress that error in this
case.

Fixes #25878

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

8 months agoAdd a test for the new_session_cb from a QUIC object
Matt Caswell [Tue, 5 Nov 2024 10:00:56 +0000 (10:00 +0000)] 
Add a test for the new_session_cb from a QUIC object

Setting a new_session_cb should work for a QUIC object just as it does
with a normal TLS object.

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

8 months agoMake sure we use the correct SSL object when making a callback
Matt Caswell [Tue, 5 Nov 2024 09:12:35 +0000 (09:12 +0000)] 
Make sure we use the correct SSL object when making a callback

When processing a callback within libssl that applies to TLS the original
SSL object may have been created for TLS directly, or for QUIC. When making
the callback we must make sure that we use the correct SSL object. In the
case of QUIC we must not use the internal only SSL object.

Fixes #25788

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

8 months agoKeep hold of a reference to the user SSL in QUIC
Matt Caswell [Mon, 4 Nov 2024 15:16:18 +0000 (15:16 +0000)] 
Keep hold of a reference to the user SSL in QUIC

In some cases a QUIC SSL_CONNECTION object needs to get hold of a reference
to the original SSL object as created by the user. We should keep a
reference to it.

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

8 months agoBugfixes for params to legacy control translations for EC parameters
Vladimirs Ambrosovs [Wed, 1 Nov 2023 11:18:14 +0000 (13:18 +0200)] 
Bugfixes for params to legacy control translations for EC parameters

param->ctrl translation: Fix fix_ecdh_cofactor()

In POST_PARAMS_TO_CTRL state the fix_ecdh_cofactor() function should
return value in ctx->p1

param->ctrl translation: fix evp_pkey_ctx_setget_params_to_ctrl
 return

Since some of the ctrl operations may return 0 as valid value
(e.g. ecdh_cofactor value 0 is valid setting), before colling
POST_PARAMS_TO_CTRL, we need to check return value for 0 as well
otherwise the evp_pkey_ctx_setget_params_to_ctrl function fails
without a chance to fix the return value

param->ctrl translation: Set ecdh_cofactor default action_type GET

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

8 months agoAdjust naming authority formatting when printing out admission extension
oleg.hoefling [Mon, 28 Oct 2024 08:23:59 +0000 (09:23 +0100)] 
Adjust naming authority formatting when printing out admission extension

Indent namingAuthority section with two spaces to match the parent
node.

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25814)

8 months agoFix memory leak on failure in copy_issuer()
Niels Dossche [Tue, 5 Nov 2024 15:11:56 +0000 (16:11 +0100)] 
Fix memory leak on failure in copy_issuer()

When sk_GENERAL_NAME_reserve() fails, ialt is not freed.
Add the freeing operation in the common error path.

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

8 months agoRemove unnecessary sk_GENERAL_NAME_free() calls on NULL
Niels Dossche [Tue, 5 Nov 2024 15:14:40 +0000 (16:14 +0100)] 
Remove unnecessary sk_GENERAL_NAME_free() calls on NULL

There are several calls to sk_GENERAL_NAME_free() where the argument is
actually NULL, there are not necessary.

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

8 months agox509: add a newline after printing Full Name
Celeste Liu [Sat, 2 Nov 2024 09:46:05 +0000 (17:46 +0800)] 
x509: add a newline after printing Full Name

We forget it in 58301e24f66aa74b13b85a171dd14e6088c35662.

Fixes #25853

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

8 months agointerop-tests.yml: Update to Fedora 40 and fix provisioning breakage
Tomas Mraz [Fri, 1 Nov 2024 08:47:42 +0000 (09:47 +0100)] 
interop-tests.yml: Update to Fedora 40 and fix provisioning breakage

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

8 months agoFix uses of `EVP_PKEY_Q_keygen` with `size_t` variadic argument
ArtSin [Mon, 4 Nov 2024 08:56:52 +0000 (12:56 +0400)] 
Fix uses of `EVP_PKEY_Q_keygen` with `size_t` variadic argument

Fix cases where `int` argument was passed instead of `size_t`.

CLA: trivial

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

8 months agoFix the default_md example in the ca docs
Matt Caswell [Mon, 4 Nov 2024 09:00:32 +0000 (09:00 +0000)] 
Fix the default_md example in the ca docs

We should not have an example showing the default_md as md5.

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

9 months agoDocument extensibility of -groups parameter via providers
Michael Baentsch [Tue, 29 Oct 2024 08:42:40 +0000 (09:42 +0100)] 
Document extensibility of -groups parameter via providers

Also add brainpool curves

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

9 months agoRemove two unused union members from struct x509_object_st.
Gábor Tóthvári [Tue, 29 Oct 2024 19:28:04 +0000 (20:28 +0100)] 
Remove two unused union members from struct x509_object_st.

CLA: trivial

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

9 months agoUse correct alerts for some cert comp errors
Todd Short [Thu, 31 Oct 2024 18:33:45 +0000 (14:33 -0400)] 
Use correct alerts for some cert comp errors

Fixes #25471

Signed-off-by: Todd Short <todd.short@me.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25845)

9 months agoSupport DEFAULT keyword and '-' prefix in SSL_CTX_set1_groups_list()
Frederik Wedel-Heinen [Mon, 28 Oct 2024 07:32:42 +0000 (08:32 +0100)] 
Support DEFAULT keyword and '-' prefix in SSL_CTX_set1_groups_list()

Fixes #25790

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

9 months agoAPPS/pkeyutl: strengthen error message on too long sign/verify input
Dr. David von Oheimb [Tue, 29 Oct 2024 18:41:02 +0000 (19:41 +0100)] 
APPS/pkeyutl: strengthen error message on too long sign/verify input

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

9 months agoAPPS/pkeyutl: -digest implies -rawin and can only be used with -sign and -verify
Dr. David von Oheimb [Tue, 29 Oct 2024 18:21:14 +0000 (19:21 +0100)] 
APPS/pkeyutl: -digest implies -rawin and can only be used with -sign and -verify

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

9 months agoAPPS/pkeyutl: improve -rawin usability (implied by Ed25519 and Ed448) and doc
Dr. David von Oheimb [Sat, 2 Dec 2023 13:50:36 +0000 (14:50 +0100)] 
APPS/pkeyutl: improve -rawin usability (implied by Ed25519 and Ed448) and doc

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