]> git.ipfire.org Git - thirdparty/openssl.git/log
thirdparty/openssl.git
13 months agoOSSL_CMP_validate_msg(): fix check such that OSSL_CMP_OPT_PERMIT_TA_IN_EXTRACERTS_FOR...
Dr. David von Oheimb [Mon, 11 Mar 2024 11:48:26 +0000 (12:48 +0100)] 
OSSL_CMP_validate_msg(): fix check such that OSSL_CMP_OPT_PERMIT_TA_IN_EXTRACERTS_FOR_IR becomes usable again

Fixes #23706

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

13 months ago80-test_cmp_http_data/test_connection.csv: disable localhost test as not supported...
Dr. David von Oheimb [Wed, 6 Mar 2024 08:48:30 +0000 (09:48 +0100)] 
80-test_cmp_http_data/test_connection.csv: disable localhost test as not supported on some hosts

Fixes #22870

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

13 months agoConfigure: make absolutedir() use rel2abs() on Windows too
Richard Levitte [Wed, 5 Jun 2024 19:43:01 +0000 (21:43 +0200)] 
Configure: make absolutedir() use rel2abs() on Windows too

perl's realpath() seems to be buggy on Windows, so we turn to rel2abs()
there as well.

Fixes #23593

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

13 months agoFix memory leak in quic_trace.c
Amir Mohammadi [Wed, 5 Jun 2024 18:56:19 +0000 (22:26 +0330)] 
Fix memory leak in quic_trace.c

Fixes #24340

Reviewed-by: Ben Kaduk <kaduk@mit.edu>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24568)

13 months ago[Docs] Notes about freeing objects
Ruslan Baratov [Thu, 23 May 2024 14:03:12 +0000 (22:03 +0800)] 
[Docs] Notes about freeing objects

- Free objects returned from PEM read
- Free objects returned from d2i_*

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

13 months agotest/prov_config_test.c: Cleanup and fix potential leaks
Tomas Mraz [Thu, 11 Apr 2024 09:34:57 +0000 (11:34 +0200)] 
test/prov_config_test.c: Cleanup and fix potential leaks

Fixes #24106

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

13 months agoadd static analysis workflow for on-premise Coverity Connect
Dmitry Misharov [Thu, 30 May 2024 14:12:37 +0000 (16:12 +0200)] 
add static analysis workflow for on-premise Coverity Connect

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

13 months agoDrop the old PGP key fingerprint
Richard Levitte [Wed, 5 Jun 2024 08:22:22 +0000 (10:22 +0200)] 
Drop the old PGP key fingerprint

All public releases have the information of the new PGP key in
doc/fingerprints.txt, so it is finally time to drop the old.

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

13 months agoFix memory leak on error in crypto/conf/conf_mod.c
shridhar kalavagunta [Fri, 12 Apr 2024 01:42:37 +0000 (20:42 -0500)] 
Fix memory leak on error in crypto/conf/conf_mod.c

Fixes #24111

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

13 months agoAllow group methods to customize initialization for speed
Watson Ladd [Tue, 21 Nov 2023 17:59:05 +0000 (12:59 -0500)] 
Allow group methods to customize initialization for speed

This commit also adds an implementation for P256 that avoids some
expensive initialization of Montgomery arithmetic structures in favor
of precomputation. Since ECC groups are not always cached by higher
layers this brings significant savings to TLS handshakes.

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

13 months agoDisable 70-test_quic_multistream.t when building with PUT threads.
Randall S. Becker [Wed, 22 May 2024 23:34:45 +0000 (23:34 +0000)] 
Disable 70-test_quic_multistream.t when building with PUT threads.

The test recipe includes a TEST_skip when OpenSSL is built with _PUT_MODEL_
based on design assumptions for QUIC and incompatibility with PUT wrapper
methods.

Fixes: #24442
Fixes: #24431
Signed-off-by: Randall S. Becker <randall.becker@nexbridge.ca>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24468)

13 months agoUpdate CHANGES.md and NEWS.md for the upcoming release
Tomas Mraz [Mon, 3 Jun 2024 14:46:41 +0000 (16:46 +0200)] 
Update CHANGES.md and NEWS.md for the upcoming release

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

(cherry picked from commit 6152b08631568551f155f9d8219298f55aef5d94)

14 months agoSkip newly added blocked OAEP SHAKE testcases with old fips providers
Tomas Mraz [Wed, 29 May 2024 14:32:19 +0000 (16:32 +0200)] 
Skip newly added blocked OAEP SHAKE testcases with old fips providers

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

14 months agoRemove the dead store in EVP_DecryptFinal_ex
CoolThi [Wed, 29 May 2024 10:24:56 +0000 (18:24 +0800)] 
Remove the dead store in EVP_DecryptFinal_ex

CLA: trivial

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

14 months ago[Docs] SSL_*_use will increment reference counter
Ruslan Baratov [Wed, 29 May 2024 00:36:53 +0000 (08:36 +0800)] 
[Docs] SSL_*_use will increment reference counter

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

14 months agoenable AES-XTS optimization for AIX
sanumesh [Tue, 28 May 2024 17:46:52 +0000 (12:46 -0500)] 
enable AES-XTS optimization for AIX

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

14 months agocmp_hdr_test.c: Fix leaks in error cases
shridhar kalavagunta [Mon, 27 May 2024 23:43:51 +0000 (18:43 -0500)] 
cmp_hdr_test.c: Fix leaks in error cases

Fixes #24475

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

14 months agouefi: move variables
Gerd Hoffmann [Wed, 22 May 2024 11:11:09 +0000 (13:11 +0200)] 
uefi: move variables

Fixes "unused variable" warnings with OPENSSL_SYS_UEFI.

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

14 months agouefi: add typedef for uintptr_t
Gerd Hoffmann [Wed, 22 May 2024 08:18:52 +0000 (10:18 +0200)] 
uefi: add typedef for uintptr_t

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

14 months agoFix potential memory leak in OSSL_IETF_ATTR_SYNTAX_add1_value()
sashan [Wed, 22 May 2024 04:40:41 +0000 (06:40 +0200)] 
Fix potential memory leak in OSSL_IETF_ATTR_SYNTAX_add1_value()

The function may leak memory if it deals with an unknown type.
Issue reported by LuMingYinDetect.

Fixes #24452

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

14 months agoCHANGES.md: add an entry about newly deprecated time-related functions
Alexander Kanavin [Fri, 17 May 2024 11:28:05 +0000 (13:28 +0200)] 
CHANGES.md: add an entry about newly deprecated time-related functions

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24307)

14 months agossl_sess.c: deprecate SSL_SESSION_get_time/SSL_SESSION_set_time
Alexander Kanavin [Tue, 30 Apr 2024 09:54:42 +0000 (11:54 +0200)] 
ssl_sess.c: deprecate SSL_SESSION_get_time/SSL_SESSION_set_time

Adjust the manpages at the same time so that only the new
functions are being presented.

Fixes: #23648
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24307)

14 months agossl_sess.c: deprecate SSL_CTX_flush_sessions in favour of _ex() replacement
Alexander Kanavin [Fri, 17 May 2024 11:49:21 +0000 (13:49 +0200)] 
ssl_sess.c: deprecate SSL_CTX_flush_sessions in favour of _ex() replacement

The original function is using long for time and is therefore
not Y2038-safe.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24307)

14 months agoinclude/openssl/macros.h: define deprecation macros for 3.4
Alexander Kanavin [Tue, 30 Apr 2024 09:31:49 +0000 (11:31 +0200)] 
include/openssl/macros.h: define deprecation macros for 3.4

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24307)

14 months agoutil/perl/OpenSSL/ParseC.pm: correctly parse OSSL_DEPRECATEDIN_..._FOR
Alexander Kanavin [Fri, 17 May 2024 11:17:16 +0000 (13:17 +0200)] 
util/perl/OpenSSL/ParseC.pm: correctly parse OSSL_DEPRECATEDIN_..._FOR

Suggested by Matt Caswell.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24307)

14 months agoRemoved hard coded value for cap in function ossl_rsa_multip_cap
Gopal Sharma [Tue, 16 Jan 2024 09:20:12 +0000 (14:50 +0530)] 
Removed hard coded value for cap in function ossl_rsa_multip_cap

As suggested at https://github.com/openssl/openssl/pull/23280#discussion_r1452113014, removing hard coded value for cap.

CLA: trivial

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

14 months agoVMS: Redefine _XOPEN_SOURCE_EXTENDED with the value 1
Richard Levitte [Thu, 23 May 2024 05:54:27 +0000 (07:54 +0200)] 
VMS: Redefine _XOPEN_SOURCE_EXTENDED with the value 1

Some versions if the VMS C system header files seem to require this.

Fixes #24466

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

14 months agoFix potential memory leak in test_bad_dtls
Amir Mohammadi [Wed, 22 May 2024 16:18:51 +0000 (19:48 +0330)] 
Fix potential memory leak in test_bad_dtls

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

14 months agoUpdate configurable sigalgs documentation for providers
Michael Baentsch [Mon, 27 May 2024 06:12:31 +0000 (08:12 +0200)] 
Update configurable sigalgs documentation for providers

also adding to SignatureAlgorithms section

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from https://github.com/openssl/openssl/pull/24499)

14 months agothreads_pthread.c: change inline to ossl_inline
sanumesh [Mon, 27 May 2024 10:00:00 +0000 (05:00 -0500)] 
threads_pthread.c: change inline to ossl_inline

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

14 months agoecstresstest.c: Fix memory leak on error
Nek Saikou [Fri, 24 May 2024 10:45:01 +0000 (17:45 +0700)] 
ecstresstest.c: Fix memory leak on error

Fixes #24476
CLA: trivial

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

14 months agoFurther extend the SSL_free_buffers testing
Matt Caswell [Fri, 26 Apr 2024 12:58:29 +0000 (13:58 +0100)] 
Further extend the SSL_free_buffers testing

We extend the testing to test what happens when pipelining is in use.

Follow on from CVE-2024-4741

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

14 months agoMove the ability to load the dasync engine into ssltestlib.c
Matt Caswell [Fri, 26 Apr 2024 10:05:52 +0000 (11:05 +0100)] 
Move the ability to load the dasync engine into ssltestlib.c

The sslapitest has a helper function to load the dasync engine which is
useful for testing pipelining. We would like to have the same facility
from sslbuffertest, so we move the function to the common location
ssltestlib.c

Follow on from CVE-2024-4741

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

14 months agoExtend the SSL_free_buffers testing
Matt Caswell [Thu, 25 Apr 2024 08:34:16 +0000 (09:34 +0100)] 
Extend the SSL_free_buffers testing

Test that attempting to free the buffers at points where they should not
be freed works as expected.

Follow on from CVE-2024-4741

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

14 months agoSet rl->packet to NULL after we've finished using it
Matt Caswell [Tue, 23 Apr 2024 15:36:11 +0000 (16:36 +0100)] 
Set rl->packet to NULL after we've finished using it

In order to ensure we do not have a UAF we reset the rl->packet pointer
to NULL after we free it.

Follow on from CVE-2024-4741

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

14 months agoOnly free the read buffers if we're not using them
Matt Caswell [Tue, 23 Apr 2024 15:34:46 +0000 (16:34 +0100)] 
Only free the read buffers if we're not using them

If we're part way through processing a record, or the application has
not released all the records then we should not free our buffer because
they are still needed.

CVE-2024-4741

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

14 months agoMove stack of compression methods from libssl to OSSL_LIB_CTX
sashan [Thu, 16 May 2024 04:33:55 +0000 (06:33 +0200)] 
Move stack of compression methods from libssl to OSSL_LIB_CTX

The compression methods are now a global variable in libssl.
This change moves it into OSSL library context.

It is necessary to eliminate atexit call from libssl.

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

14 months agospeed: Fix regression of measuring shake with -evp
Ingo Franzki [Wed, 22 May 2024 14:15:34 +0000 (16:15 +0200)] 
speed: Fix regression of measuring shake with -evp

After commit b911fef216d1386210ec24e201d54d709528abb4 speed with shake128 or
shake256 does not run anymore:

  # openssl speed -seconds 1 -evp shake128 -bytes 256
  Doing shake128 ops for 1s on 256 size blocks: shake128 error!
  000003FF9B7F2080:error:1C8000A6:Provider routines:keccak_final:invalid digest
                     length:providers/implementations/digests/sha3_prov.c:117:
  version: 3.4.0-dev
  ...
  type            256 bytes
  shake128             0.00

Function EVP_Digest_loop() must use EVP_DigestInit_ex2(), EVP_DigestUpdate(),
and EVP_DigestFinalXOF() in case of shake instead of just EVP_Digest() to get
around this.

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

14 months agorand: remove unimplemented librandom stub code 24493/head
Dimitri John Ledkov [Wed, 22 May 2024 19:05:07 +0000 (20:05 +0100)] 
rand: remove unimplemented librandom stub code

Clean up of unsuable / no-op code.

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

14 months agoEVP_CIPHER_CTX_get_key_length(): Add null check of ctx->cipher
Max Ammann [Tue, 7 May 2024 22:06:39 +0000 (23:06 +0100)] 
EVP_CIPHER_CTX_get_key_length(): Add null check of ctx->cipher

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

14 months agoAdd provider fuzzer
Max Ammann [Tue, 3 Oct 2023 11:22:02 +0000 (12:22 +0100)] 
Add provider fuzzer

Test recipe 99-test_fuzz_provider.t added.

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

14 months agoAdded an explicit yield (OP_SLEEP) to QUIC testing for cooperative threading.
Randall S. Becker [Mon, 20 May 2024 22:23:04 +0000 (22:23 +0000)] 
Added an explicit yield (OP_SLEEP) to QUIC testing for cooperative threading.

Fixes: #24442
Signed-off-by: Randall S. Becker <randall.becker@nexbridge.ca>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/24443)

14 months agotest: remove the just added, but now unrealistic, shake128 OAEP tests
Dimitri John Ledkov [Wed, 22 May 2024 14:30:33 +0000 (15:30 +0100)] 
test: remove the just added, but now unrealistic, shake128 OAEP tests

These were added as a POC in #24387. However, such combinations are no
longer unusable since #24105 got merged.

This should unbreak all build failures on mainline.

Partially reverts: 1bfc8d17f3 (rsa-oaep: block SHAKE usage in FIPS
mode, 2024-05-13)

Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@surgut.co.uk>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24463)

14 months agosignal.h included two times
PiotrBzdrega [Tue, 21 May 2024 05:13:31 +0000 (07:13 +0200)] 
signal.h included two times

CLA: trivial

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

14 months agorsa-oaep: block SHAKE usage in FIPS mode
Dimitri John Ledkov [Mon, 13 May 2024 17:07:40 +0000 (18:07 +0100)] 
rsa-oaep: block SHAKE usage in FIPS mode

NIST SP 800-56 rev2 only allows using approved hash algorithms in
OAEP. Unlike FIPS 186-5 it doesn't have text allowing to use XOF SHAKE
functions. Maybe future revisions of SP 800-56 will adopt similar text
to FIPS 186-5 and allow XOF as MD and MGF (not MGF1).

RFC documents do not specify if SHAKE is allowed or blocked for usage
(i.e. there is no equivalent of RFC 8692 or RFC 8702 for OAEP). Status
quo allows their usage.

Add test cases for SHAKE in RSA-OAEP as allowed in default provider,
and blocked in fips.

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

14 months agorsa-pss: add tests checking for SHAKE usage in RSA-PSS
Dimitri John Ledkov [Sat, 11 May 2024 00:26:55 +0000 (01:26 +0100)] 
rsa-pss: add tests checking for SHAKE usage in RSA-PSS

FIPS 186-5, RFC 8692, RFC 8702 all agree and specify that Shake shall
be used directly as MGF (not as a hash in MGF1). Add tests that try to
specify shake hash as MGF1 to ensure that fails.

Separately the above standards specify how to use SHAKE as a message
digest with either fixed or minimum output lengths. However, currently
shake is not part of allowed hashes.

Note that rsa_setup_md()/rsa_setup_mgf1_md() call
ossl_digest_rsa_sign_get_md_nid() ->
ossl_digest_get_approved_nid_with_sha1() ->
ossl_digest_get_approved_nid() which only contain sha1/sha2/sha3
digests without XOF.

The digest test case will need to be replace if/when shake with
minimum output lengths is added to ossl_digest_get_approved_nid().

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

14 months agofix crash in ecp_nistz256_point_add_affine()
Alexandr Nedvedicky [Sun, 21 Apr 2024 07:41:58 +0000 (09:41 +0200)] 
fix crash in ecp_nistz256_point_add_affine()

The .rodata section with precomputed constant `ecp_nistz256_precomputed` needs to be
terminated by .text, because the ecp_nistz256_precomputed' happens to be the
first section in the file. The lack of .text makes code to arrive into the same
.rodata section where ecp_nistz256_precomputed is found. The exception is raised
as soon as CPU attempts to execute the code from read only section.

Fixes #24184

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

14 months ago[Docs] Default value for verification flags is 'SSL_VERIFY_NONE'
Ruslan Baratov [Sat, 18 May 2024 15:34:19 +0000 (23:34 +0800)] 
[Docs] Default value for verification flags is 'SSL_VERIFY_NONE'

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

14 months agoAdd installation documentation and notes on ANSI C and POSIX
Richard Levitte [Wed, 17 Apr 2024 11:56:26 +0000 (13:56 +0200)] 
Add installation documentation and notes on ANSI C and POSIX

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

14 months agoWhen defining ossl_ssize_t = ssize_t, remember to include sys/types.h
Richard Levitte [Wed, 17 Apr 2024 11:52:20 +0000 (13:52 +0200)] 
When defining ossl_ssize_t = ssize_t, remember to include sys/types.h

ssize_t isn't a C language type in any C language level, but is a POSIX type
defined in <sys/types.h>, so make sure to include that before use.

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

14 months agoFor Unix, refactor OSSL_sleep() to use nanosleep() instead of usleep()
Richard Levitte [Wed, 17 Apr 2024 11:45:32 +0000 (13:45 +0200)] 
For Unix, refactor OSSL_sleep() to use nanosleep() instead of usleep()

usleep() is obsolete since POSIX.1-2001 and removed in POSIX.1-2008,
in favor of nanosleep(), which has been present since POSIX.1-2001.

The exceptions for DJGPP and TANDEM are preserved.  Also, just in case
nanosleep() turns out to be unavailable on any Unix machinery that we
are unaware of, we allow a revert to using usleep() by defining
OPENSSL_USE_USLEEP.

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

14 months agoWork on ANSI C compatibility: modifying the github workflow
Richard Levitte [Wed, 17 Apr 2024 11:35:51 +0000 (13:35 +0200)] 
Work on ANSI C compatibility: modifying the github workflow

The github workflow that attempts to check that OpenSSL ANSI C compatible
defined '_DEFAULT_SOURCE', which effectively turns gcc and clang into a C99
compiler...  perhaps not with regard to pure language features, but it enables
a few too many types and functions that aren't defined in ANSI C library, or
in some cases, in any C language level library.

Instead of '_DEFAULT_SOURCE', this modification defines '_XOPEN_SOURCE=1' and
'_POSIX_SOURCE=200809L', to enable the use of 'timezone', 'ssize_t' and 'strdup()'.

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

14 months agofips provider: explicitly setup cpuid when initializing
Hongren Zheng [Thu, 16 May 2024 08:41:25 +0000 (16:41 +0800)] 
fips provider: explicitly setup cpuid when initializing

Fixes: #23979
Previously fips module relied on OPENSSL_cpuid_setup
being used as constructor by the linker to correctly
setup the capability vector, either via .section .init
(for x86_64) or via __attribute__((constructor)).

This would make ld.so call OPENSSL_cpuid_setup before
the init function for fips module. However, this early
constructing behavior has several disadvantages:

1. Not all platform/toolchain supports such behavior

2. Initialisation sequence is not well defined, and
some function might not be initialized when cpuid_setup
is called

3. Implicit path is hard to maintain and debug

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

14 months agoFix mem leak in threadpool_test.c
shridhar kalavagunta [Tue, 30 Apr 2024 01:59:57 +0000 (20:59 -0500)] 
Fix mem leak in threadpool_test.c

Fixes #24104

Added a goto label for cleanup.

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

14 months agoFix typo in CONTRIBUTING.md
James Muir [Thu, 16 May 2024 02:07:58 +0000 (22:07 -0400)] 
Fix typo in CONTRIBUTING.md

CLA: trivial

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

14 months agoCheck DSA parameters for excessive sizes before validating
Tomas Mraz [Wed, 8 May 2024 13:23:45 +0000 (15:23 +0200)] 
Check DSA parameters for excessive sizes before validating

This avoids overly long computation of various validation
checks.

Fixes CVE-2024-4603

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

14 months agoSync up CHANGES.md with 3.3 branch
Tomas Mraz [Wed, 8 May 2024 12:58:49 +0000 (14:58 +0200)] 
Sync up CHANGES.md with 3.3 branch

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

14 months agoAdditional testcases for bn_gcd
Andrew Golovashevich [Sat, 11 May 2024 09:58:03 +0000 (12:58 +0300)] 
Additional testcases for bn_gcd

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

14 months agoOptimizated calculation of shared power of 2 in bn_gcd
Andrew Golovashevich [Sun, 5 May 2024 11:27:26 +0000 (14:27 +0300)] 
Optimizated calculation of shared power of 2 in bn_gcd

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

14 months agoUpdate openssl-smime.pod.in
DominikN [Fri, 5 Apr 2024 21:06:41 +0000 (23:06 +0200)] 
Update openssl-smime.pod.in

Remove duplicate entries for -nocerts and -noattr

CLA:trivial

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

14 months ago[Docs] 'SSL_CTX_set_cert_store' ownership of 'store'
Ruslan Baratov [Sun, 12 May 2024 08:33:59 +0000 (16:33 +0800)] 
[Docs] 'SSL_CTX_set_cert_store' ownership of 'store'

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

14 months agoSuppress a spurious error from the sysdefault test
Matt Caswell [Mon, 13 May 2024 09:45:24 +0000 (10:45 +0100)] 
Suppress a spurious error from the sysdefault test

Running the sysdefault test results in spurious error output - even
though the test has actually passed

Fixes #24383

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

14 months agoDocument that SHAKE-128 and SHAKE-256 have no default digest length
Tomas Mraz [Wed, 24 Apr 2024 16:42:39 +0000 (18:42 +0200)] 
Document that SHAKE-128 and SHAKE-256 have no default digest length

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

14 months agoIntentionally break EVP_DigestFinal for SHAKE128 and SHAKE256
Tomas Mraz [Thu, 11 Apr 2024 08:29:23 +0000 (10:29 +0200)] 
Intentionally break EVP_DigestFinal for SHAKE128 and SHAKE256

It will work only if OSSL_DIGEST_PARAM_XOFLEN is set.

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

14 months agofix sm2 encryption implementation bug.
Liu-Ermeng [Mon, 8 Jan 2024 04:01:29 +0000 (20:01 -0800)] 
fix sm2 encryption implementation bug.

According to the "GB/T 32918.4-2016"
section 6.1 encryption, step A5:
If result of the "KDF" is all zeros, we should go back to
the begin(step A1).

section 7.1 decryption, step B4:
If result of the "KDF" is all zeros, we should raise error and exit.

Signed-off-by: Liu-Ermeng <liuermeng2@huawei.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23210)

14 months agosslapitest.c: With fips skip tests depending on X25519 and X448
Tomas Mraz [Thu, 9 May 2024 08:48:56 +0000 (10:48 +0200)] 
sslapitest.c: With fips skip tests depending on X25519 and X448

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

14 months ago90-test_sslapi.t: Fix execution of sslapitest with fips provider
Tomas Mraz [Fri, 10 May 2024 12:50:46 +0000 (14:50 +0200)] 
90-test_sslapi.t: Fix execution of sslapitest with fips provider

Default configuration of the fips provider for tests is pedantic
which means that sslapitest was not fully executed with fips provider.

The ems check must be switched off for full execution.

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

14 months agoAdd 3.2 and 3.3 branches to Provider compat CI
Tomas Mraz [Wed, 8 May 2024 13:38:48 +0000 (15:38 +0200)] 
Add 3.2 and 3.3 branches to Provider compat CI

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

14 months agoRelease pkey_ctx on initialization failure
irosay [Fri, 10 May 2024 16:37:52 +0000 (17:37 +0100)] 
Release pkey_ctx on initialization failure

CLA: trivial

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

14 months agofix: extension critical definition to default false
Jonathan M. Wilbur [Sun, 18 Jun 2023 12:57:25 +0000 (12:57 +0000)] 
fix: extension critical definition to default false

Signed-off-by: Jonathan M. Wilbur <jonathan@wilbur.space>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21230)

14 months agoevp_test: Added the special private key that triggers bug (CVE-2011-4354)
Trust-Worthy [Mon, 22 Apr 2024 18:59:31 +0000 (14:59 -0400)] 
evp_test: Added the special private key that triggers bug (CVE-2011-4354)

The bug triggers in 32 bit linux distros running openssl 0.9.8g.

This adds a regression test case.

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

14 months agozeroize rsa->p,rsa->q on error
Alexandr Nedvedicky [Fri, 10 May 2024 07:07:35 +0000 (09:07 +0200)] 
zeroize rsa->p,rsa->q on error

this is rquired by fipd-186-5 section A.1.6, step 7:
Zeroize the internally generated values that are not returned

In OpenSSL code we need to zero p, q members of rsa structure. The rsa
structure is provided by ossl_rsa_fips186_4_gen_prob_primes() caller.

The remaining values (variables) mentioned by standard are zeroed
already in functions we call from ossl_rsa_fips186_4_gen_prob_primes().

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

14 months agoAdd support for integrity-only cipher suites for TLS v1.3
Rajeev Ranjan [Fri, 1 Dec 2023 11:47:07 +0000 (12:47 +0100)] 
Add support for integrity-only cipher suites for TLS v1.3

- add test vectors for tls1_3 integrity-only ciphers
- recmethod_local.h: add new member for MAC
- tls13_meth.c: add MAC only to tls 1.3
- tls13_enc.c: extend function to add MAC only
- ssl_local.h: add ssl_cipher_get_evp_md_mac()
- s3_lib.c: add the new ciphers and add #ifndef OPENSSL_NO_INTEGRITY_ONLY_CIPHERS
- ssl_ciph.c : add ssl_cipher_get_evp_md_mac() and use it
- tls13secretstest.c: add dummy test function
- Configure: add integrity-only-ciphers option
- document the new ciphers

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

14 months agocipher_null.c: add NULL check
Rajeev Ranjan [Mon, 4 Mar 2024 10:41:01 +0000 (11:41 +0100)] 
cipher_null.c: add NULL check

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

14 months agoapps/pkcs12: Not writing the private key file until the import password is verified
naaysayer [Sat, 2 Mar 2024 09:35:35 +0000 (13:35 +0400)] 
apps/pkcs12: Not writing the private key file until the import password is verified

Fixes #904

CLA: trivial

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

14 months agoRemove SSL_ENC_FLAG_EXPLICIT_IV which is only set and never read.
Frederik Wedel-Heinen [Thu, 4 Apr 2024 11:30:59 +0000 (13:30 +0200)] 
Remove SSL_ENC_FLAG_EXPLICIT_IV which is only set and never read.

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

14 months agoAdd reason codes with the correct offset for two alerts
Jacob Champion [Mon, 6 May 2024 16:50:11 +0000 (09:50 -0700)] 
Add reason codes with the correct offset for two alerts

Fixes #24300. The current values of SSL_R_NO_APPLICATION_PROTOCOL and
SSL_R_PSK_IDENTITY_NOT_FOUND don't allow for a correct lookup of the
corresponding reason strings.

CLA: trivial

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

14 months agothreads_win: fix build error with VS2010
Georgi Valkov [Fri, 3 May 2024 04:51:08 +0000 (07:51 +0300)] 
threads_win: fix build error with VS2010

VC 2010 or earlier compilers do not support static inline.
To work around this problem, we can use the ossl_inline macro.

Fixes:
crypto\threads_win.c(171) : error C2054: expected '(' to follow 'inline'
crypto\threads_win.c(172) : error C2085: 'get_hold_current_qp' : not in formal parameter list
crypto\threads_win.c(172) : error C2143: syntax error : missing ';' before '{'
crypto\threads_win.c(228) : warning C4013: 'get_hold_current_qp' undefined; assuming extern returning int
crypto\threads_win.c(228) : warning C4047: '=' : 'rcu_qp *' differs in levels of indirection from 'int'

Signed-off-by: Georgi Valkov <gvalkov@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/24370)

14 months agocrypto/riscvcap: fix function declaration for hwprobe_to_cap
Hongren Zheng [Sun, 12 May 2024 07:18:44 +0000 (15:18 +0800)] 
crypto/riscvcap: fix function declaration for hwprobe_to_cap

error: function declaration isn't a prototype [-Werror=strict-prototypes]

Fixes: 66ad636b9 ("riscv: use hwprobe syscall for capability detection")
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24373)

14 months agodoc: Fix description of EVP_CIPHER_CTX_dup
Daiki Ueno [Mon, 13 May 2024 00:07:57 +0000 (09:07 +0900)] 
doc: Fix description of EVP_CIPHER_CTX_dup

This fixes a couple of copy and paste error from EVP_MD_CTX_dup,
where: EVP_CIPHER_CTX_dup is useful to avoid multiple
EVP_CIPHER_fetch (instead of EVP_MD_fetch) and returns
EVP_CIPHER_CTX (instead of EVP_MD_CTX).

Signed-off-by: Daiki Ueno <dueno@redhat.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/24376)

14 months agoquic_multistream_test: fix undefined symbol snprintf with VS2010
Georgi Valkov [Sat, 4 May 2024 08:24:08 +0000 (11:24 +0300)] 
quic_multistream_test: fix undefined symbol snprintf with VS2010

As snprintf is not available everywhere, use BIO_snprintf instead.

Fixes:
        IF EXIST test\quic_multistream_test.exe.manifest DEL /F /Q test\quic_multistream_test.exe.manifest
        "link" /nologo /debug setargv.obj /subsystem:console /opt:ref  /nologo /debug @V:\_tmp\nm4.tmp
quic_multistream_test-bin-quic_multistream_test.obj : error LNK2019: unresolved external symbol _snprintf referenced in function _helper_init
test\quic_multistream_test.exe : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: '"E:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\link.EXE"' : return code '0x460'

Signed-off-by: Georgi Valkov <gvalkov@gmail.com>
Reviewed-by: Paul Dale <ppzgs1@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/24369)

14 months agofips: zeroization of public security parameters (PSPs)
Dimitri John Ledkov [Sun, 28 Apr 2024 18:40:26 +0000 (19:40 +0100)] 
fips: zeroization of public security parameters (PSPs)

ISO 19790:2012/Cor.1:2015 7.9 requires cryptographic module to provide
methods to zeroise all unproctected security sensitive parameters
(which inclues both Critical/Private **and** Public security
parameters). And those that are temprorarly stored are required to be
zeroised after they are no longer needed at security levels 2 and
higher.

Comply with the above requirements by always zeroising public security
parameters whenever they are freed.

This is currently done under the FIPS feature, however the requirement
comes from the ISO 19790:2012 which may also be needed in other
jurisdictions. If not always. Note FIPS 140-3 includes ISO 19790:2012
by reference.

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

14 months agoTypo fixes
willmafh [Fri, 1 Mar 2024 13:12:21 +0000 (21:12 +0800)] 
Typo fixes

and an addition of an empty line to follow the code style

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

14 months agoImplement riscv_vlen_asm for riscv32
Hongren Zheng [Fri, 26 Apr 2024 06:03:43 +0000 (06:03 +0000)] 
Implement riscv_vlen_asm for riscv32

riscvcap.c: undefined reference to 'riscv_vlen_asm'

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

14 months agotls_provider_init(): Rename prov_ctx to xor_prov_ctx to clarify
Tomas Mraz [Fri, 12 Apr 2024 09:16:17 +0000 (11:16 +0200)] 
tls_provider_init(): Rename prov_ctx to xor_prov_ctx to clarify

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

14 months agotls_provider_init(): Fix leaks in error cases
Tomas Mraz [Thu, 11 Apr 2024 08:05:04 +0000 (10:05 +0200)] 
tls_provider_init(): Fix leaks in error cases

Fixes #24101

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

14 months agossl_cipher_get_overhead(): Replace size_t with int and add the checks
Jiasheng Jiang [Fri, 22 Mar 2024 15:15:09 +0000 (15:15 +0000)] 
ssl_cipher_get_overhead(): Replace size_t with int and add the checks

Replace the type of "mac", "out", and "blk" with int to avoid implicit
conversion when it is assigned by EVP_MD_get_size(),
EVP_CIPHER_get_iv_length(), and EVP_CIPHER_get_block_size().
Moreover, add the checks to avoid integer overflow.

Fixes: 045bd04706 ("Add DTLS_get_data_mtu() function")
Signed-off-by: Jiasheng Jiang <jiasheng@purdue.edu>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23935)

14 months agoAdd OPENSSL_riscvcap man page
Hongren Zheng [Mon, 22 Apr 2024 04:50:21 +0000 (12:50 +0800)] 
Add OPENSSL_riscvcap man page

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

14 months agoPrint CPUINFO also for riscv processors
Hongren Zheng [Thu, 18 Apr 2024 03:59:03 +0000 (11:59 +0800)] 
Print CPUINFO also for riscv processors

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

14 months agoriscv: use hwprobe syscall for capability detection
Hongren Zheng [Wed, 17 Apr 2024 09:21:53 +0000 (17:21 +0800)] 
riscv: use hwprobe syscall for capability detection

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

14 months agoDependabot update: Bump coverallsapp/github-action
dependabot[bot] [Wed, 8 May 2024 17:11:38 +0000 (17:11 +0000)] 
Dependabot update: Bump coverallsapp/github-action

CLA: trivial

(deps): Bump coverallsapp/github-action

Bumps [coverallsapp/github-action](https://github.com/coverallsapp/github-action) from 2.2.3 to 2.3.0.
- [Release notes](https://github.com/coverallsapp/github-action/releases)
- [Commits](https://github.com/coverallsapp/github-action/compare/v2.2.3...v2.3.0)

---
updated-dependencies:
- dependency-name: coverallsapp/github-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24350)

14 months agoOSSL_LIB_CTX_load_config() must not be called concurrently on same libctx
Tomas Mraz [Thu, 2 May 2024 15:31:22 +0000 (17:31 +0200)] 
OSSL_LIB_CTX_load_config() must not be called concurrently on same libctx

The semantics of such concurrent call is not defined.

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

14 months agoAdd tests for conf_diagnostics
Tomas Mraz [Thu, 2 May 2024 13:58:11 +0000 (15:58 +0200)] 
Add tests for conf_diagnostics

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

14 months agoDo not overwrite conf diagnostics in OSSL_LIB_CTX if not set in config file
Tomas Mraz [Thu, 2 May 2024 12:31:14 +0000 (14:31 +0200)] 
Do not overwrite conf diagnostics in OSSL_LIB_CTX if not set in config file

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

14 months agoAdd documentation for OSSL_LIB_CTX_set/get_conf_diagnostics
Tomas Mraz [Thu, 2 May 2024 12:30:30 +0000 (14:30 +0200)] 
Add documentation for OSSL_LIB_CTX_set/get_conf_diagnostics

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

14 months agoSet SSL_CONF_FLAG_SHOW_ERRORS when conf_diagnostics is enabled
Tomas Mraz [Wed, 1 May 2024 16:48:01 +0000 (18:48 +0200)] 
Set SSL_CONF_FLAG_SHOW_ERRORS when conf_diagnostics is enabled

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

14 months agoDo not use bit fields for context data flag variables
Tomas Mraz [Wed, 1 May 2024 16:42:57 +0000 (18:42 +0200)] 
Do not use bit fields for context data flag variables

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

14 months agoMake conf_diagnostics apply also to the SSL conf errors
Tomas Mraz [Fri, 26 Apr 2024 15:23:13 +0000 (17:23 +0200)] 
Make conf_diagnostics apply also to the SSL conf errors

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

14 months agochacha-riscv64-v-zbb.pl: better format
Yangyu Chen [Mon, 22 Apr 2024 02:40:25 +0000 (10:40 +0800)] 
chacha-riscv64-v-zbb.pl: better format

This patch merged the `add` and `xor` part of chacha_sub_round, which are
same in RISC-V Vector only and Zvkb implementation. There is no change to
the generated ASM code except for the indent.

Signed-off-by: Yangyu Chen <cyy@cyyself.name>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24069)

14 months agochacha-riscv64-v-zbb.pl: add comment about vector register allocation
Yangyu Chen [Fri, 19 Apr 2024 13:49:44 +0000 (21:49 +0800)] 
chacha-riscv64-v-zbb.pl: add comment about vector register allocation

Since we can do group operations on vector registers in RISC-V, some vector
registers will be used without being explicitly referenced. Thus, comments
on vector register allocation should be added to improve the code
readability and maintainability.

Signed-off-by: Yangyu Chen <cyy@cyyself.name>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24069)