Commit Graph

34049 Commits

Author SHA1 Message Date
Pauli
fb20e66c6b ossl_property_list_to_string: handle quoted strings
ossl_property_list_to_string() didn't quote strings correctly which
could result in a generated property string being unparsable.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22182)
2023-10-05 08:09:13 +11:00
dependabot[bot]
456e6ca5d7 Bump suisei-cn/actions-download-file from 1.3.0 to 1.4.0
Bumps [suisei-cn/actions-download-file](https://github.com/suisei-cn/actions-download-file) from 1.3.0 to 1.4.0.
- [Release notes](https://github.com/suisei-cn/actions-download-file/releases)
- [Commits](https://github.com/suisei-cn/actions-download-file/compare/v1.3.0...v1.4.0)

---
updated-dependencies:
- dependency-name: suisei-cn/actions-download-file
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

CLA: trivial

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22268)
2023-10-04 19:14:20 +02:00
Tomas Mraz
831602922f d2i_PKCS8PrivateKey_bio.pod: evp.h include is unnecessary
It is also not allowed by doc nits check to have
multiple includes.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/22276)
2023-10-04 13:02:46 +02:00
Frederik Wedel-Heinen
74f8d9ce08 Added info on change to HISTORY of SSL_CTX_set_msg_callback()
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22241)
2023-10-04 12:56:53 +02:00
Frederik Wedel-Heinen
fac54a65c0 Update documentation on SSL_CTX_set_msg_callback() to match the actual functionality.
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22241)
2023-10-04 12:56:53 +02:00
Frederik Wedel-Heinen
5f79670f7b Print record version for DTLSv1_listen()
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22241)
2023-10-04 12:56:53 +02:00
Frederik Wedel-Heinen
b31597d989 Pass the dtls record version to the record layer msg_callback function.
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22241)
2023-10-04 12:56:53 +02:00
Matthias St. Pierre
706512ecbc Don't (re-)initialize the FFC_PARAMs in dh_init and dsa_init
The initialization was introduced in commit dc8de3e6f1 and
changes the behaviour of the `init` method for DSA and DH
between 1.1.1 and 3.0, while the behaviour for RSA and EC_KEY
remains unchanged.

The initialization is not necessary in 3.x and master imho and
breaks the use-case of intercepting the methods of an existing
key.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22185)
2023-10-04 12:22:04 +02:00
Matthias St. Pierre
860e36d0dd test: evp_extra: test signing with legacy app method based keys
This commit adds `test_EVP_PKEY_sign_with_app_method`, a regression
test for the bug fix in commit 1acc3e8cc3 (pull request #22163).

It is analogous to `test_EVP_PKEY_sign`, only with a fake app method
based key. (The EC key test case was omitted, because there is no
`EC_KEY_METHOD_dup` method.)

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22185)
2023-10-04 12:22:04 +02:00
Matthias St. Pierre
b49cafd86b test: evp_extra: fix indentation error
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22185)
2023-10-04 12:22:04 +02:00
Sumitra Sharma
82496b8663 Correct documentation for PKCS5_PBKDF2_HMAC
In OpenSSL 3.x, the documentation for PKCS5_PBKDF2_HMAC incorrectly states
that an iter value less than 1 is treated as a single iteration. Upon further
investigation in providers/implementations/kdfs/pbkdf2.c, it appears that
invalid iter values will result in failure and raise the
PROV_R_INVALID_ITERATION_COUNT error. This commit corrects the documentation
to accurately reflect the behavior in OpenSSL 3.x.

Closes openssl#22168

Signed-off-by: Sumitra Sharma <sumitraartsy@gmail.com>

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22252)
2023-10-04 12:19:22 +02:00
Richard Levitte
1296c2ec78 Restore the meaning of EVP_PKEY_print_private()
With pre-3.0 OpenSSL, EVP_PKEY_print_private() calls the EVP_PKEY_ASN1_METHOD
function "priv_print", effectively asking the backend to print whatever it
regards as private key components.

In all backends that were built into libcrypto, this function printed what
was included in the private key structure, which usually includes the
public key components as well.

With OpenSSL 3.0, some of the corresponding key2text encoders got a
slightly different behavior, where the presence of the selector
OSSL_KEYMGMT_SELECT_PRIVATE_KEY without the presence of the selector
OSSL_KEYMGMT_SELECT_PUBLIC_KEY would only get what would intuitively be
regarded as private key components printed.  This isn't entirely consistent,
though, as the RSA key2text encoder will still print the public key
components regardless.

To compensate for the changed backend behavior, EVP_PKEY_print_private()
was made to ask the encoder to print the keypair rather than just the
private key, thereby moving the backend semantics to the application API.
Unfortunately, this causes confusion for providers where the key2text
encoder really should print the private key only.

This change restores the built-in 1.1.1 backend behavior in the encoders
that OpenSSL provides, and renders EVP_PKEY_print_private() more true to its
documented behavior, leaving it to the backend to decide what it regards as
"private key components".

Fixes #22233

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22237)
2023-10-04 08:10:55 +02:00
Dmitry Belyavskiy
2b74e75331 Improved detection of engine-provided private "classic" keys
Resolves #17092 (?)
Resolves #17286 (?)

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19965)
2023-10-04 11:02:00 +11:00
Frederik Wedel-Heinen
5c20c20269 Remove duplicates of EVP_aes_xxx_wrap() from EVP_aes_128_gcm.pod
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22236)
2023-10-04 10:54:46 +11:00
Frederik Wedel-Heinen
1d3f266446 Call post_process_record for dtls records
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22239)
2023-10-04 10:54:01 +11:00
Matthias St. Pierre
515856f5ce doc/man3: fix misnamed function name
Rename `DSA_generate_prime[_ex]` to `DSA_generate_parameters[_ex]`,
fixing a copy&paste error from the `BN_generate_prime[_ex]` paragraph
in commit b3696a55a5.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22242)
2023-10-04 10:52:32 +11:00
Matt Caswell
21d2041da0 Back off on generating noise in the event of a PING frame
If either endpoint issues a PING frame while we are introducing noise
into the communication then there is a danger that the connection itself
will fail. We detect the PING and then back off on generating noise for a
short while. It should be sufficient to just ensure that the next datagram
does not get dropped for each endpoint.

Fixes #22199

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22243)
2023-10-04 10:51:51 +11:00
Tomas Mraz
3f8b7b9875 CHANGES.md: Mention new features added after 3.2 alpha1
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22251)
2023-10-04 10:51:01 +11:00
Sumitra Sharma
cda2e7c914 Add openssl/pem.h inclusion for d2i_PKCS8PrivateKey
Include the necessary header file openssl/pem.h in the
documentation to ensure that all functions related to
d2i_PKCS8PrivateKey are correctly defined.

Closes openssl#22188

Signed-off-by: Sumitra Sharma <sumitraartsy@gmail.com>

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22253)
2023-10-04 07:54:17 +11:00
Frederik Wedel-Heinen
4b5b2239d8 Occupy the rec_version field of a decoded dtls record
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22238)
2023-10-04 07:53:30 +11:00
Tomas Mraz
6f66602eaa macros.h: There are just 3.1 deprecations, no 3.2 deprecations
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22247)
2023-10-04 07:52:41 +11:00
Tomas Mraz
6a92159d01 All lh_stats functions were deprecated in 3.1
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22247)
2023-10-04 07:52:41 +11:00
Tomas Mraz
d2751ee393 quicapitest: Enable test_ssl_trace with enable-zlib
To improve Coverage mapping in Coveralls make it
possible to run test_ssl_trace() with enable-zlib

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22222)
2023-10-03 17:23:58 +02:00
Tomas Mraz
4a1bdb0b7a coveralls: Drop no-shared and -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22222)
2023-10-03 17:23:58 +02:00
Dmitry Misharov
2d374e1c66 GH action workflows: Add cpu report before 'make test'
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22232)
2023-10-03 15:53:25 +02:00
Tomas Mraz
07829409b6 coveralls: Fix invocation of lcov
Fixes recent regression from commit febe8cf4de

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22258)
2023-10-03 08:39:49 +02:00
dependabot[bot]
f7e7bbcd78 Bump actions/setup-python from 4.7.0 to 4.7.1
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.7.0 to 4.7.1.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4.7.0...v4.7.1)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
CLA: trivial

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22254)
2023-10-03 08:32:51 +02:00
Matt Caswell
ad4af6dfca Fix timeouts in the quic_multistream test script 13
Script 13 is a stress test which can timeout on some low powered platforms
or with some options that significantly slow performance.

We increase the timeout.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22214)
2023-10-02 15:59:24 +02:00
Dmitry Misharov
febe8cf4de remove files under test directory from coverage report
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22212)
2023-10-02 15:56:25 +02:00
Matthias St. Pierre
92986c0be5 doc: correct the SSL_CTX_set_info_callback(3) manual page
The info callback is not prototyped correctly, and the code
example fails to compile because of const-incorrectness.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22224)
2023-10-02 14:12:39 +02:00
Danny Tsen
3d3a7ecd1a Improve performance for 6x unrolling with vpermxor instruction
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21812)
2023-10-02 14:00:23 +02:00
Mathieu Tortuyaux
fd27a7e4f8 test: add verify test for EC cert signed with SHA3
Signed-off-by: Mathieu Tortuyaux <mathieu.tortuyaux@gmail.com>

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22147)
2023-10-02 12:46:24 +02:00
Mathieu Tortuyaux
de4aa81faa obj_xref.h: make update
Signed-off-by: Mathieu Tortuyaux <mathieu.tortuyaux@gmail.com>

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22147)
2023-10-02 12:46:24 +02:00
Mathieu Tortuyaux
98e0755511 obj_xref: ecdsa support sha3 hash function
Signed-off-by: Mathieu Tortuyaux <mathieu.tortuyaux@gmail.com>

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22147)
2023-10-02 12:46:24 +02:00
Richard Levitte
0c74339c73 Configurations/unix-Makefile.tmpl: Ensure that md-nits always works
The body of the "md-nits" Makefile target assumed an in source build tree.
This change ensures that it works correctly when called from an out-of-source
build tree as well.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/22240)
2023-10-02 12:38:51 +02:00
Richard Levitte
5995dc3719 [DOCS] Fix table inconsistencies detected by mdl
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/22240)
2023-10-02 12:38:51 +02:00
Tomas Mraz
b07a0b1ac2 Avoid having ecp_sm2p256-armv8.pl in fips.module.sources
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/22194)
2023-10-02 12:37:17 +02:00
Pauli
6bd07949e5 Coverity 1545175: use after free
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/22211)
2023-10-02 19:18:21 +11:00
Pauli
eaf0879439 Coverity 1545174: calling risky function
Remove the call to rand() and replace with an xor-shift RNG.
There are no security implications to worry about here.  This RNG is
used during testing only.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/22211)
2023-10-02 19:18:21 +11:00
Pauli
15410839c6 Coverity 1545176: dereference before NULL check
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/22211)
2023-10-02 19:18:21 +11:00
Tomas Mraz
8ed76c62b5 Optimize out unneeded up_ref/free of EVP_CIPHER
Fixes #22189

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22198)
2023-09-29 15:22:38 +02:00
Tomas Mraz
9f6eb62221 Test client certificate authentication with QUIC
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22207)
2023-09-29 11:29:19 +02:00
Matt Caswell
219bd6ac70 Prepare for 3.2 alpha 3
Reviewed-by: Richard Levitte <levitte@openssl.org>
Release: yes
2023-09-28 14:24:47 +01:00
Matt Caswell
1e6b4baf54 Prepare for release of 3.2 alpha 2
Reviewed-by: Richard Levitte <levitte@openssl.org>
Release: yes
2023-09-28 14:24:32 +01:00
Matt Caswell
746b95cc38 make update
Reviewed-by: Richard Levitte <levitte@openssl.org>
Release: yes
2023-09-28 14:24:31 +01:00
Matt Caswell
556009c596 Copyright year updates
Reviewed-by: Richard Levitte <levitte@openssl.org>
Release: yes
2023-09-28 14:23:29 +01:00
Matt Caswell
7f5b29c4bf Fix no-ssl-trace
Ensure we use OPENSSL_NO_SSL_TRACE guards where appropriate.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22193)
2023-09-28 09:49:49 +01:00
Randall S. Becker
b07107e311 Move e_os2.h up in quictestlib.c to allow symbol definition consistency.
Fixes: #22178

Signed-of-by: Randall S. Becker <randall.becker@nexbridge.ca>

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22179)
2023-09-27 17:34:28 +01:00
Matt Caswell
be203ea3d3 Fix a mem leak when the FIPS provider is used in a different thread
We were neglecting to register the main thread to receive thread stop
notifications. This is important if the thread that starts the FIPS
provider is not the same one that is used when OPENSSL_cleanup() is
called.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21964)
2023-09-27 17:23:04 +01:00
Pauli
1a18596149 evp_test: recondition cipher dupctx FIPS version check.
Until the cipher dupctx is properly implemented in 3.1 and 3.0 the check is
wrong.  This should be reverted once the implemenation has been done.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21964)
2023-09-27 17:23:04 +01:00