Commit Graph

34896 Commits

Author SHA1 Message Date
Dr. David von Oheimb d6d9277b2e apps/cmp: improve -reqin option to read fallback public key from first request message file given
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/21660)
2024-03-06 08:49:28 +01:00
Dr. David von Oheimb bcd3707dba crypto/cmp: add OSSL_CMP_MSG_get0_certreq_publickey(); fix coding style nit
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/21660)
2024-03-06 08:49:28 +01:00
Dr. David von Oheimb 904ee65290 apps/cmp: extend documentation and diagnostics for using -reqin in special situations
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/21660)
2024-03-06 08:49:28 +01:00
Dr. David von Oheimb 2fbe23bbbe apps/cmp: add -reqout_only option for dumping/saving just the initial CMP request message
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/21660)
2024-03-06 08:49:28 +01:00
Dr. David von Oheimb a143e4e3c9 apps/cmp.c: refactor to fix some coding style nits and more convenient source-level debugging
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/21660)
2024-03-06 08:48:48 +01:00
Dr. David von Oheimb 5003abae02 cmperr.h: use free reason value 106 rather than 197 for CMP_R_UNEXPECTED_SENDER
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/21660)
2024-03-06 08:48:48 +01:00
Neil Horman 5677992679 Dump out qlog json if it is malformed
We're still seeing periodic failures in qlog from malformed json output,
so lets try to catch it.

Modify the verify-qlog.py script to, in the event of an exception in
json.loads, to replay the entire json file to the console, followed by
an exception indicating what line it died trying to parse.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23715)
2024-03-02 09:12:54 -05:00
pohsingwu fbce6ebf70 Implement PCT for EDDSA
According to FIPS 140-3 IG 10.3.A Additonal Comment 1, a PCT shall be
performed consistent with the intended use of the keys.

This commit implements PCT for EDDSA via performing sign and verify
operations after key generated.

Also use the same pairwise test logic in EVP_PKEY_keygen and
EVP_PKEY_pairwise_check for EDDSA in FIPS_MODULE.

Add OSSL_SELF_TEST_DESC_PCT_EDDSA to OSSL_PROVIDER-FIPS page.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23408)
2024-03-01 11:06:03 +01:00
Alexandr Nedvedicky c18c301deb demos/http3: Use `SSL_write_ex2()` together with `SSL_WRITE_FLAG_CONCLUDE`
These calls were introduced by PR #23343.

Change also does a minor tweak to Makefile so CFLAGS and LDFLAGS variables
from the environment are respected.

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23602)
2024-03-01 10:56:16 +01:00
shridhar kalavagunta c5cc9c419a Fix off by one issue in buf2hexstr_sep()
Fixes #23363

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23404)
2024-03-01 10:50:01 +01:00
Michael 2d70cc9cec Improve documentation of standard IANA cipher suite names.
Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23539)
2024-02-25 11:13:07 +01:00
Job Snijders eadd8c4727 Add appropriate lower bound checks for GeneralizedTime and UTCTime
ITU-T X.690 / ISO/IEC 8825-1 section 11.7 and section 11.8
impose specific constraints on how GeneralizedTime and UTCTime
can be encoded in BER/CER/DER. Following from these constraints
a minimum length can be derived.

Checking the length in this context can potentially help prevent
applications from interpreting an invalid GeneralizedTime as a
valid UTCTime.

Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23483)
2024-02-25 09:17:41 +01:00
Martin Oliveira 5d70f11823 apps/engine: add EC to list of capabilities
openssl engine -c wasn't showing if an engine implemented EC

cla: trivial

Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23538)
2024-02-25 09:10:13 +01:00
Hamilton Chapman aba6219346 Ensure `$(MAKE)` commands and `CFLAGS` are appropriately quoted in the Makefile.
If a user's `make` command came from a path that contained a space then both the
`$(MAKE)` variable (and parts of the generated `CFLAGS`, when building for iOS)
would not be properly quoted and the build would fail.

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23663)
2024-02-25 08:57:16 +01:00
Tom Cosgrove 11adf9a75d Apply the AES-GCM unroll8 optimisation to Microsoft Azure Cobalt 100
Performance improvements range from 18% to 32%.

Change-Id: Ifb89eeac3c0625a582a25ff07cf7f9c9ec8f5ba6

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23651)
2024-02-22 16:07:02 +01:00
响马 1afb326da4 chachap10-ppc.pl: Fix truncated relocation
Fix error: relocation truncated to fit: R_PPC64_REL14 (stub)
against symbol `ChaCha20_ctr32_vsx_8x'

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/23618)
2024-02-22 13:11:24 +01:00
Michael Baentsch f4ed6eed2c SSL_set1_groups_list(): Fix memory corruption with 40 groups and more
Fixes #23624

The calculation of the size for gid_arr reallocation was wrong.
A multiplication by gid_arr array item size was missing.

Testcase is added.

Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23625)
2024-02-22 12:48:21 +01:00
MrRurikov db511578f7 s_cb.c: Add missing return value checks
Return value of function 'SSL_CTX_ctrl', that is called from
SSL_CTX_set1_verify_cert_store() and SSL_CTX_set1_chain_cert_store(),
is not checked, but it is usually checked for this function.

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

(cherry picked from commit 6f794b461c)
2024-02-22 12:45:59 +01:00
Tomas Mraz 9dc2269829 Minor wording fixes related to no-atexit
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/23642)

(cherry picked from commit 66e6f72c3e)
2024-02-22 10:37:13 +01:00
Matt Caswell 4a6f70c031 Don't print excessively long ASN1 items in fuzzer
Prevent spurious fuzzer timeouts by not printing ASN1 which is excessively
long.

This fixes a false positive encountered by OSS-Fuzz.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/23640)
2024-02-21 16:45:33 +00:00
Ijtaba Hussain ffc853bcb5 Extended SSL_SESSION functions using time_t
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21206)
2024-02-21 10:28:17 +01:00
Frederik Wedel-Heinen 709637c876 Future proof RLAYER_USE_EXPLICIT_IV by checking dtls versions directly.
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23611)
2024-02-20 11:07:01 +01:00
Bernd Ritter 5e5c256bba Correct the defined name of the parameter "micalg" in the documentation
The EVP_DigestInit(3) manual page contains wrong name for the define
macro for the OSSL_DIGEST_PARAM_MICALG param.

Fixes #23580

CLA: trivial

Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23615)
2024-02-20 09:08:56 +01:00
Hugo Landau a768a796f2 Minor updates
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/23535)
2024-02-19 10:15:46 +01:00
Hugo Landau 8c09d69883 Fix warning
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/23535)
2024-02-19 10:15:46 +01:00
Hugo Landau 5fd1f46fb0 JSON_ENC: Ensure ossl_json_flush() really flushes the BIO
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/23535)
2024-02-19 10:15:46 +01:00
Hugo Landau e825599213 QUIC CHANNEL: Defer QLOG instantiation until first event
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/23535)
2024-02-19 10:15:46 +01:00
Hugo Landau 6f09c8071a QUIC TXP: Allow QLOG instance retrieval via callback
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/23535)
2024-02-19 10:15:46 +01:00
Hugo Landau 9f2349aebe QUIC QTX: Allow QLOG instance retrieval via callback
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/23535)
2024-02-19 10:15:46 +01:00
Hugo Landau 410270d1ac QUIC FIFD: Allow QLOG instance retrieval via callback
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/23535)
2024-02-19 10:15:46 +01:00
Hugo Landau 4a2e39dc1c Add entry to CHANGES.md
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/23535)
2024-02-19 10:15:46 +01:00
Hugo Landau 9d90b65888 QUIC MULTISTREAM TEST: Test explicit event handling mode
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/23535)
2024-02-19 10:15:46 +01:00
Hugo Landau 965f68f3e9 QUIC APL: Add implementation of SSL_VALUE_EVENT_HANDLING_MODE
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/23535)
2024-02-19 10:15:46 +01:00
Hugo Landau 8c13e08513 QUIC: Add API for SSL_VALUE_EVENT_HANDLING_MODE
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/23535)
2024-02-19 10:15:46 +01:00
Hugo Landau 40c457029e QUIC: Add docs for SSL_VALUE_EVENT_HANDLING_MODE
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/23535)
2024-02-19 10:15:46 +01:00
Shakti Shah e5313f2048 OpenSSL License is applied for some source files, change to Apache 2
The following files

include/openssl/hpke.h
crypto/hpke/hpke.c
crypto/ec/asm/ecp_sm2p256-armv8.pl
crypto/chacha/asm/chacha-loongarch64.pl
still seem to be released under the OpenSSL License instead of the Apache 2 license.

Fixes #23570

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23576)
2024-02-19 10:06:04 +01:00
Marcel Gosmann c3e8d67885 Fixed Visual Studio 2008 compiler errors
CLA: trivial

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23586)
2024-02-16 16:34:29 +01:00
Frederik Wedel-Heinen 715a74a6ad Removes record_queue struct which is no longer useful.
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23571)
2024-02-16 16:33:14 +01:00
Hugo Landau 28c7f52612 QUIC: Test that SSL_ctrl, SSL_set_mode are routed correctly on QSSOs
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23581)
2024-02-16 16:15:38 +01:00
Hugo Landau 5c16e9d384 QUIC: Fix SSL_ctrl operation for QSSOs
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23581)
2024-02-16 16:15:38 +01:00
Neil Horman cf57c3ecfa Check for NULL cleanup function before using it in encoder_process
encoder_process assumes a cleanup function has been set in the currently
in-use encoder during processing, which can lead to segfaults if said
function hasn't been set

Add a NULL check for this condition, returning -1 if it is not set

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23069)
2024-02-16 08:34:11 -05:00
Hugo Landau d597b46f9b Add CHANGES: Fixed SSL_export_keying_material for QUIC.
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23567)

(cherry picked from commit a2ccaa6665)
2024-02-14 18:16:51 +01:00
Hugo Landau 12c0d72c4a Fix SSL_export_keying_material for QUIC
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23567)

(cherry picked from commit 498d4e4c4f)
2024-02-14 18:14:52 +01:00
Neil Horman 53273092f6 Skip shlibload tests if no-atexit is configured
the shared library load tests fail if no-atexit is configured.  The
entire test suite relies on atexit handling to indicate an at exit
handler has run, by producing a file that the test recipe then reads.
With no-atexit that never happens, and the test fails

If no-atexit is specified, skip all the tests

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23523)
2024-02-14 18:05:44 +01:00
Shakti Shah 4f6133f9db KDF_CTX_new API has incorrect signature (const should not be there)
https://www.openssl.org/docs/man3.1/man3/EVP_KDF_CTX.html

The pages for 3.0/3.1/master seem to have the following
EVP_KDF_CTX *EVP_KDF_CTX_new(const EVP_KDF *kdf);

which does not match with the actual header which is
EVP_KDF_CTX *EVP_KDF_CTX_new(EVP_KDF *kdf);

Fixes #23532

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23541)
2024-02-14 09:48:09 +01:00
Dimitri Papadopoulos 39fe3e5de1 Fix the grammar as suggsted in the review
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23545)
2024-02-14 09:36:11 +01:00
Dimitri Papadopoulos f7241edda4 Fix new typos found by codespell
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23545)
2024-02-14 09:36:11 +01:00
Dr. David von Oheimb 0969375060 test_cmp_http: decrease risk of timeouts due to delays caused by the underlying system running tests
Fixes #22870

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/23502)
2024-02-13 11:31:59 +01:00
Tomas Mraz ace3afa087 os-zoo.yml: Do not add enable-unstable-qlog as this CI tests all branches
The enable-unstable-qlog is enabled in windows.yml,
which is sufficient for testing it on Windows.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23550)
2024-02-12 10:59:27 +01:00
Hugo Landau 925118e8c3 Fix nit
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23495)
2024-02-10 11:37:14 +00:00