openssl.git
12 months agoRevert "Adding Control Flow guard to Windows Builds"
Mathias Berchtold [Sat, 22 Apr 2023 00:04:49 +0000 (18:04 -0600)]
Revert "Adding Control Flow guard to Windows Builds"

Reasons:
- The patch was missing the linker flag /guard:cf
  As a result no binary with CFG was ever built
- /guard:cf is incompatible with NASM
  If the linker flag is added, the resulting binary fails with this exception:
  Unhandled exception at 0x00007FFFB8B93C90 (ntdll.dll) in openssl.exe: Indirect call guard check detected invalid control transfer.

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

12 months agoFix calling pthread_key_delete on uninitialized data
Petr Mikhalicin [Fri, 21 Apr 2023 09:25:43 +0000 (12:25 +0300)]
Fix calling pthread_key_delete on uninitialized data

default_context_do_init may be never called and CRYPTO_THREAD_init_local
inside it may be never called too. But corresponding
CRYPTO_THREAD_cleanup_local is always called at cleanup stage. This lead
to undefined behavior.

So, add flag to check that default_context_do_init will be called
successfully or not.

Fix: #20697

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

12 months agofips: setup the FIPS provider in pendantic mode for testing
Pauli [Tue, 18 Apr 2023 01:11:17 +0000 (11:11 +1000)]
fips: setup the FIPS provider in pendantic mode for testing

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

12 months agotest: update ssl_new tests in line with pedantic FIPS policy
Pauli [Tue, 18 Apr 2023 04:41:17 +0000 (14:41 +1000)]
test: update ssl_new tests in line with pedantic FIPS policy

Add a new option to the `test' section of SSL test data structure.
This contains a space separated list of version checks, all of which must
pass.

Note that the version checks are as they as because:

- 3.1.0 doesn't have mandatory EMS support, so it can run the old tests.
- 3.1.1 (& later) will have mandatory EMS support, so they can't run them.

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

12 months agotest: update TLS PDF tests in line with pedantic FIPS policy
Pauli [Tue, 18 Apr 2023 02:59:06 +0000 (12:59 +1000)]
test: update TLS PDF tests in line with pedantic FIPS policy

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

12 months agotest: update evprand tests in line with pedantic FIPS policy
Pauli [Tue, 18 Apr 2023 02:55:25 +0000 (12:55 +1000)]
test: update evprand tests in line with pedantic FIPS policy

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

12 months agosslapi: use correct fipsmodule.cnf
Pauli [Tue, 18 Apr 2023 07:20:40 +0000 (17:20 +1000)]
sslapi: use correct fipsmodule.cnf

The SSL API tests copies fipsmodule.cnf and modifies it.  Unfortunately, it
grabbed the wrong instance of this file.

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

12 months agoBump actions/setup-python from 4.5.0 to 4.6.0
dependabot[bot] [Fri, 21 Apr 2023 14:22:29 +0000 (14:22 +0000)]
Bump actions/setup-python from 4.5.0 to 4.6.0

Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.5.0 to 4.6.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4.5.0...v4.6.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  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/20792)

12 months agoReplaced '{ 0, NULL }' with OSSL_DISPATCH_END in OSSL_DISPATCH arrays
Irak Rigia [Wed, 19 Apr 2023 14:08:22 +0000 (19:38 +0530)]
Replaced '{ 0, NULL }' with OSSL_DISPATCH_END in OSSL_DISPATCH arrays

Fixes #20710

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

12 months agoAdded a macro OSSL_DISPATCH_END as marker of the end of OSSL_DISPATCH arrays
Irak Rigia [Wed, 19 Apr 2023 14:06:29 +0000 (19:36 +0530)]
Added a macro OSSL_DISPATCH_END as marker of the end of OSSL_DISPATCH arrays

Also updated the corresponding documentations.

Fixes #20710

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

12 months agoFix checking return code of EVP_PKEY_get_int_param at check_curve
Petr Mikhalicin [Wed, 19 Apr 2023 11:43:02 +0000 (14:43 +0300)]
Fix checking return code of EVP_PKEY_get_int_param at check_curve

According to docs, EVP_PKEY_get_int_param should return 1 on Success, and
0 on Failure. So, fix checking of this return value at check_curve

CLA: trivial

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

12 months agoMinor refactoring of the Argon2 derive function
Tomas Mraz [Fri, 17 Mar 2023 15:13:35 +0000 (16:13 +0100)]
Minor refactoring of the Argon2 derive function

Cache the fetched MAC and MD implementation until propq changes.
No need to keep the output stored in the context.

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

12 months agoBump coverallsapp/github-action from 2.1.0 to 2.1.2
dependabot[bot] [Thu, 20 Apr 2023 16:15:30 +0000 (16:15 +0000)]
Bump coverallsapp/github-action from 2.1.0 to 2.1.2

Bumps [coverallsapp/github-action](https://github.com/coverallsapp/github-action) from 2.1.0 to 2.1.2.
- [Release notes](https://github.com/coverallsapp/github-action/releases)
- [Commits](https://github.com/coverallsapp/github-action/compare/v2.1.0...v2.1.2)

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

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

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

12 months agoaesv8-armx.pl: Avoid buffer overrread in AES-XTS decryption
Tomas Mraz [Mon, 17 Apr 2023 14:51:20 +0000 (16:51 +0200)]
aesv8-armx.pl: Avoid buffer overrread in AES-XTS decryption

Original author: Nevine Ebeid (Amazon)
Fixes: CVE-2023-1255
The buffer overread happens on decrypts of 4 mod 5 sizes.
Unless the memory just after the buffer is unmapped this is harmless.

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

12 months agotest: test -pedantic option in fipsinstall
Pauli [Mon, 17 Apr 2023 05:53:13 +0000 (15:53 +1000)]
test: test -pedantic option in fipsinstall

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

12 months agodoc: document the -pedantic option to fipsinstall.
Pauli [Mon, 17 Apr 2023 05:39:24 +0000 (15:39 +1000)]
doc: document the -pedantic option to fipsinstall.

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

12 months agofipsinstall: add -pedantic option
Pauli [Mon, 17 Apr 2023 05:31:29 +0000 (15:31 +1000)]
fipsinstall: add -pedantic option

This adds a -pedantic option to fipsinstall that adjusts the various
settings to ensure strict FIPS compliance rather than backwards
compatibility.

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

12 months agoAdding Control Flow guard to Windows Builds
gakamath [Fri, 14 Apr 2023 16:16:24 +0000 (21:46 +0530)]
Adding Control Flow guard to Windows Builds

Control flow guard is a code security implementation: https://learn.microsoft.com/en-us/windows/win32/secbp/control-flow-guard
We identified it with BlackDuck security scan utility
CLA: trivial

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20739)

12 months agoConfigurations/descrip.mms.tmpl: Fix a few typos
Richard Levitte [Fri, 14 Apr 2023 11:47:34 +0000 (13:47 +0200)]
Configurations/descrip.mms.tmpl: Fix a few typos

These typos caused failed propagation of the 'cflags' attribute from
Configurations/10-main.conf.

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

12 months agoFix broken links in crypto manpage
Ladislav Marko [Sat, 15 Apr 2023 08:52:26 +0000 (10:52 +0200)]
Fix broken links in crypto manpage

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

12 months agofix test failure on Kunpeng-920
zhangzhilei [Mon, 17 Apr 2023 04:57:47 +0000 (12:57 +0800)]
fix test failure on Kunpeng-920

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

12 months agocrmf_lib.c: clean up coments on OSSL_CRMF_CERTTEMPLATE*()
Dr. David von Oheimb [Fri, 14 Apr 2023 13:00:39 +0000 (15:00 +0200)]
crmf_lib.c: clean up coments on OSSL_CRMF_CERTTEMPLATE*()

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/20736)

12 months agoOSSL_CRMF_CERTTEMPLATE_get0_publicKey(): fix return type and doc
Dr. David von Oheimb [Fri, 14 Apr 2023 11:09:01 +0000 (13:09 +0200)]
OSSL_CRMF_CERTTEMPLATE_get0_publicKey(): fix return type and doc

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/20736)

12 months agocrypto/cmp: fix CertReqId to use in p10cr transactions acc. to RFC 4210
Dr. David von Oheimb [Wed, 15 Feb 2023 14:38:35 +0000 (15:38 +0100)]
crypto/cmp: fix CertReqId to use in p10cr transactions acc. to RFC 4210

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/20298)

12 months agobn_local: remove unused `PTR_SIZE_INT` definition
Alois Klink [Sun, 16 Apr 2023 18:19:04 +0000 (19:19 +0100)]
bn_local: remove unused `PTR_SIZE_INT` definition

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20748)

12 months agobn_nist: remove unused type-punning union `u`
Alois Klink [Sun, 16 Apr 2023 16:03:23 +0000 (17:03 +0100)]
bn_nist: remove unused type-punning union `u`

We no longer need to cast function pointers to PTR_SIZE_INT.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20748)

12 months agobn_nist: replace pointer bit-fiddling with ternary
Alois Klink [Sun, 16 Apr 2023 14:40:01 +0000 (15:40 +0100)]
bn_nist: replace pointer bit-fiddling with ternary

Bit-fiddling pointers is technically implementation defined behavior
in the C specification so the following code is not supported in all
platforms:

    PTR_SIZE_INT mask;
    void * a, b, c;
    int boolean_flag;

    mask = 0 - boolean_flag;
    /* Not guaranteed to be a valid ptr to a or b on all platforms  */
    a = (void *)
        ((((PTR_SIZE_INT) b & ~mask) | (((PTR_SIZE_INT)) c & mask)));

Using a ternary conditional operator is supported on all platforms
(i.e. `a = boolean_flag ? b : c;`).

On most modern compilers/CPUs, this will be faster, since it will
get converted to a CMOV instruction.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20748)

12 months agoadding provider_unload functions for cmp_ tests
Danny Carpenter [Thu, 13 Apr 2023 19:16:44 +0000 (19:16 +0000)]
adding provider_unload functions for cmp_ tests

CLA: trivial

Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20731)

12 months agoList also non-fetchable hashes in openssl dgst -list
GauriSpears [Thu, 30 Mar 2023 11:30:59 +0000 (16:30 +0500)]
List also non-fetchable hashes in openssl dgst -list

CLA: trivial

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

12 months agoFix a HPKE API to put libctx, propq as last (optional parameters).
slontis [Thu, 23 Mar 2023 01:07:03 +0000 (11:07 +1000)]
Fix a HPKE API to put libctx, propq as last (optional parameters).

This keeps the interface consistent with other HPKE API's.

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

12 months agoFix the LCM computation in the RSA multiprime key check
Tomas Mraz [Tue, 11 Apr 2023 14:24:44 +0000 (16:24 +0200)]
Fix the LCM computation in the RSA multiprime key check

Fixes #20693

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

12 months agoFix typo in ssl_ciph.c
Ladislav Marko [Tue, 11 Apr 2023 13:44:03 +0000 (15:44 +0200)]
Fix typo in ssl_ciph.c

CLA: trivial

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

12 months agoFix UEFI support on win32
Aidan Khoury [Tue, 11 Apr 2023 15:31:57 +0000 (12:31 -0300)]
Fix UEFI support on win32

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

12 months agodoc: Fix incorrect pairing of functions
Ladislav Marko [Tue, 11 Apr 2023 13:51:06 +0000 (15:51 +0200)]
doc: Fix incorrect pairing of functions

CLA: trivial

The functions that should be implemented together are `OSSL_FUNC_signature_verify_recover_init` and `OSSL_FUNC_signature_verify_recover` and not  `OSSL_FUNC_signature_verify_recover_init` with ` OSSL_FUNC_signature_verify_init`

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

12 months agodoc: Fix misleading stucture info
Ladislav Marko [Tue, 11 Apr 2023 13:56:11 +0000 (15:56 +0200)]
doc: Fix misleading stucture info

CLA: trivial

The thing created by `OSSL_FUNC_signature_newctx()` and `OSSL_FUNC_signature_dupctx()` is a signature context, not a signature. It's in the name of the function and surrounding documentation.

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

12 months agoFixes #19580 ECX keygen
Yuan, Shuai [Tue, 4 Apr 2023 05:42:38 +0000 (01:42 -0400)]
Fixes #19580 ECX keygen

Signed-off-by: Yuan, Shuai <shuai.yuan@intel.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/20680)

12 months agoAllow partially releasing a record for TLS
Matt Caswell [Mon, 27 Feb 2023 09:19:16 +0000 (09:19 +0000)]
Allow partially releasing a record for TLS

This enables the cleansing of plaintext to occur in the record layer and
avoids the need to cast away const above the record layer.

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

12 months agoMake the data field for get_record() const
Matt Caswell [Thu, 23 Feb 2023 17:02:54 +0000 (17:02 +0000)]
Make the data field for get_record() const

Improves consistency with the QUIC rstream implementation - and improves
the abstraction between the TLS implementation and the abstract record
layer. We should not expect that the TLS implementation should be able to
change the underlying buffer. Future record layers may not expect that.

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

12 months agoAdd support for rstream get/release record in the QUIC TLS layer
Matt Caswell [Thu, 23 Feb 2023 16:31:49 +0000 (16:31 +0000)]
Add support for rstream get/release record in the QUIC TLS layer

The QUIC TLS layer was taking an internal copy of rstream data while
reading. The QUIC rstream code has recently been extended to enable a
get/release model which avoids the need for this internal copy, so we use
that instead.

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

12 months agoUpdated return value of PEM_write_TYPE() and PEM_write_bio_TYPE() in man-pages.
Jeeban Sethi [Mon, 3 Apr 2023 08:46:24 +0000 (14:16 +0530)]
Updated return value of PEM_write_TYPE() and PEM_write_bio_TYPE() in man-pages.

Fixes #20218

CLA: trivial

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

12 months agoCI: Checkout submodules to make the regression fuzz tests run
Tomas Mraz [Wed, 5 Apr 2023 11:39:23 +0000 (13:39 +0200)]
CI: Checkout submodules to make the regression fuzz tests run

Otherwise the fuzz/corpora won't be present.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20683)

12 months agoAdd openssl/fuzz-corpora repository as submodule
Tomas Mraz [Wed, 5 Apr 2023 11:00:25 +0000 (13:00 +0200)]
Add openssl/fuzz-corpora repository as submodule

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20683)

12 months agoRemove fuzz corpora data from the repository
Tomas Mraz [Tue, 4 Apr 2023 14:15:37 +0000 (16:15 +0200)]
Remove fuzz corpora data from the repository

To be replaced with a git submodule.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20683)

12 months agoBump coverallsapp/github-action from 1.2.4 to 2.1.0
dependabot[bot] [Tue, 11 Apr 2023 02:31:02 +0000 (02:31 +0000)]
Bump coverallsapp/github-action from 1.2.4 to 2.1.0

Bumps [coverallsapp/github-action](https://github.com/coverallsapp/github-action) from 1.2.4 to 2.1.0.
- [Release notes](https://github.com/coverallsapp/github-action/releases)
- [Commits](https://github.com/coverallsapp/github-action/compare/v1.2.4...v2.1.0)

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

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

12 months agoRemove FIPS cross version check of 3.0.0 provider against current
Pauli [Wed, 29 Mar 2023 23:34:13 +0000 (10:34 +1100)]
Remove FIPS cross version check of 3.0.0 provider against current

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

12 months agoRemove old FIPS provider cross version check
Pauli [Thu, 23 Mar 2023 23:16:57 +0000 (10:16 +1100)]
Remove old FIPS provider cross version check

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

12 months agoAdd action to cross validate FIPS providers
Pauli [Tue, 21 Mar 2023 23:42:11 +0000 (10:42 +1100)]
Add action to cross validate FIPS providers

Tests all released FIPS approved (or in progress) versions against
all development branches and each other.

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

13 months agoIgnore SIGPIPE if client closes connection abruptly
Vishwa Pravin [Mon, 3 Apr 2023 06:46:33 +0000 (12:16 +0530)]
Ignore SIGPIPE if client closes connection abruptly

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

13 months agoAlternative fix for CVE-2022-4304
Bernd Edlinger [Mon, 13 Feb 2023 16:46:41 +0000 (17:46 +0100)]
Alternative fix for CVE-2022-4304

This is about a timing leak in the topmost limb
of the internal result of RSA_private_decrypt,
before the padding check.

There are in fact at least three bugs together that
caused the timing leak:

First and probably most important is the fact that
the blinding did not use the constant time code path
at all when the RSA object was used for a private
decrypt, due to the fact that the Montgomery context
rsa->_method_mod_n was not set up early enough in
rsa_ossl_private_decrypt, when BN_BLINDING_create_param
needed it, and that was persisted as blinding->m_ctx,
although the RSA object creates the Montgomery context
just a bit later.

Then the infamous bn_correct_top was used on the
secret value right after the blinding was removed.

And finally the function BN_bn2binpad did not use
the constant-time code path since the BN_FLG_CONSTTIME
was not set on the secret value.

In order to address the first problem, this patch
makes sure that the rsa->_method_mod_n is initialized
right before the blinding context.

And to fix the second problem, we add a new utility
function bn_correct_top_consttime, a const-time
variant of bn_correct_top.

Together with the fact, that BN_bn2binpad is already
constant time if the flag BN_FLG_CONSTTIME is set,
this should eliminate the timing oracle completely.

In addition the no-asm variant may also have
branches that depend on secret values, because the last
invocation of bn_sub_words in bn_from_montgomery_word
had branches when the function is compiled by certain
gcc compiler versions, due to the clumsy coding style.

So additionally this patch stream-lined the no-asm
C-code in order to avoid branches where possible and
improve the resulting code quality.

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

13 months agoRevert "Fix Timing Oracle in RSA decryption"
Bernd Edlinger [Mon, 13 Feb 2023 17:05:18 +0000 (18:05 +0100)]
Revert "Fix Timing Oracle in RSA decryption"

This reverts commit b1892d21f8f0435deb0250f24a97915dc641c807.

Except for the moving derive_kdk to a separate function.

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

13 months agoErase temporary buffer in EVP_PKEY_get_bn_param()
Anatolii Lishchynskyi [Wed, 29 Mar 2023 14:16:48 +0000 (17:16 +0300)]
Erase temporary buffer in EVP_PKEY_get_bn_param()

Function EVP_PKEY_get_bn_param() uses temporary buffer (on stack or
heap allocated) to store serialized bignum, but after deserializing it
into BIGNUM*, the buffer is not erased and may contain sensitive data.

This change makes sure the buffer is erased if it was successfully
filled before. Unfortunately, it does not distinguish between public and
private key components, and will always erase the buffer.

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

13 months agoDon't call OPENSSL_init_crypto from inside a RUN_ONCE
Matt Caswell [Fri, 31 Mar 2023 09:35:32 +0000 (10:35 +0100)]
Don't call OPENSSL_init_crypto from inside a RUN_ONCE

Calling OPENSSL_init_crypto from inside a RUN_ONCE seems like a bad idea.
This is especially bad if OPENSSL_init_crypto can recursively end up
attempting to call the RUN_ONCE that we're already inside.

The initialisation in OPENSSL_init_crypto is already "run once" protected.
There is no need to protect it "twice".

Fixes #20653

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

(cherry picked from commit a9745427cd5d44a76b31690b4a2c6bef2ee677c4)

13 months agoUpdate the documentation for SSL_version et al
Matt Caswell [Thu, 30 Mar 2023 07:52:51 +0000 (08:52 +0100)]
Update the documentation for SSL_version et al

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

13 months agoAdd a test for SSL_version(), SSL_get_version() etc
Matt Caswell [Wed, 29 Mar 2023 15:50:49 +0000 (16:50 +0100)]
Add a test for SSL_version(), SSL_get_version() etc

We also test SSL_is_dtls(), SSL_is_tls() and SSL_is_quic().

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

13 months agoMake sure we can query the SSL object for version info when using QUIC
Matt Caswell [Wed, 29 Mar 2023 15:25:00 +0000 (16:25 +0100)]
Make sure we can query the SSL object for version info when using QUIC

We have the existing functions SSL_version(), SSL_get_version() and
SSL_is_dtls(). We extend the first two to return something sensible when
using QUIC. We additionally provide the new functions SSL_is_tls() and
SSL_is_quic() to provide a mechanism to figure out what protocol we are
using.

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

13 months agoFFC cleanups
slontis [Wed, 22 Feb 2023 04:16:05 +0000 (14:16 +1000)]
FFC cleanups

Discovered during coverage testing.

Remove unneccesary check when using ossl_dh_get0_params() and
ossl_dsa_get0_params(). These point to addresses and can not fail
for any existing calls.

Make dsa keygen tests only available in the FIPS module - as they are
not used in the default provider.

Change ossl_ffc_set_digest() to return void as it cannot fail.

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

13 months agoAvoid calling into provider with the same iv_len or key_len
Tomas Mraz [Fri, 31 Mar 2023 13:46:15 +0000 (15:46 +0200)]
Avoid calling into provider with the same iv_len or key_len

Fixes #20625

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20664)

13 months agoFix compilation error when using clang-cl 16 or higher
Anthony Roberts [Thu, 30 Mar 2023 14:19:53 +0000 (15:19 +0100)]
Fix compilation error when using clang-cl 16 or higher

Fixes a "Incompatible function pointer types" error.

In prior versions, this was a warning, but is now an error.

CLA: trivial

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

13 months agoMake DSA_sign() test for negative p,q,g values.
slontis [Tue, 21 Mar 2023 05:52:34 +0000 (15:52 +1000)]
Make DSA_sign() test for negative p,q,g values.

Related to #20268

DSA_sign() assumes that the signature passed in is related to DSA_size().
If q is negative then DSA_size() actually fails and returns 0.

A test that tries to allocate the signature buffer using DSA_size() and then
pass it to DSA_sign() will then either.

(1) Have a signature buffer of NULL. In this case it was leaking data
returned via i2d_DSA_SIG.

(2) Cause a seg fault because we created a buffer that was not large
enough to hold the signature. As it already checked zero we also now
check for negative values also.

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

13 months agoIncorrect null pointer check
afshinpir [Wed, 29 Mar 2023 22:26:44 +0000 (11:26 +1300)]
Incorrect null pointer check

CLA: trivial
There is an incorrect null pointer check and this ccommit resolves it.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from https://github.com/openssl/openssl/pull/20646)

13 months agoFix mem leak in ECDSA_sign().
slontis [Tue, 21 Mar 2023 06:06:06 +0000 (16:06 +1000)]
Fix mem leak in ECDSA_sign().

Similiar to the issue found in PR #20553 for DSA_sign().
ECDSA_sign() leaked memory if the signature was NULL
when i2d_ECDSA_SIG was called.

Note that this does not affect the higher level EVP
functions as they correctly handle NULL.

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

13 months agodoc: Fix typo in EVP_EncryptInit.pod
Samuel Lee (ENS/CRYPTO) [Wed, 29 Mar 2023 20:02:38 +0000 (13:02 -0700)]
doc: Fix typo in EVP_EncryptInit.pod

CLA: trivial

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from https://github.com/openssl/openssl/pull/20645)

13 months agoProvider-based KEM and SIG alg speed testing added
Michael Baentsch [Sat, 24 Dec 2022 08:20:44 +0000 (09:20 +0100)]
Provider-based KEM and SIG alg speed testing added

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

13 months ago/dev/crypto: Suppress warning when open /dev/crypto fails with ENXIO.
Taylor R Campbell [Wed, 29 Mar 2023 13:21:02 +0000 (13:21 +0000)]
/dev/crypto: Suppress warning when open /dev/crypto fails with ENXIO.

On NetBSD the device node is essentially always present, but these
days it's mostly not useful except for testing the kernel crypto
stack since the cost of CPU crypto has gone down much faster than the
cost of I/O to external crypto engines.  So on most systems it is
disabled in a way that makes open fail with ENXIO.  NetBSD has had
this warning for ENXIO patched away for years.

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

13 months agoAdd a test for an app data record appearing before epoch change in DTLS
Matt Caswell [Tue, 28 Mar 2023 15:25:22 +0000 (16:25 +0100)]
Add a test for an app data record appearing before epoch change in DTLS

We had a test for a handshake record appearing before epoch change, and
a test for an app data record appearing before Finished - but not one for
the app data record appearing before epoch change.

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

13 months agoHandle app data records from the next epoch
Matt Caswell [Mon, 27 Mar 2023 14:59:41 +0000 (15:59 +0100)]
Handle app data records from the next epoch

It is possible that DTLS records are received out of order such that
records from the next epoch arrive before we have finished processing the
current epoch. We are supposed to buffer such records but for some reason
we only did that for handshake and alert records. This is incorrect since
it is perfectly possible for app data records to arrive early too.

Fixes #20597

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

13 months agoCoverity 1524597: null pointer dereference
Pauli [Tue, 28 Mar 2023 22:22:23 +0000 (09:22 +1100)]
Coverity 1524597: null pointer dereference

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20629)

13 months agoUse correct function to wait for condvar
Hugo Landau [Mon, 27 Mar 2023 15:03:32 +0000 (16:03 +0100)]
Use correct function to wait for condvar

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

13 months agoRevise build.info
Hugo Landau [Fri, 24 Mar 2023 16:23:40 +0000 (16:23 +0000)]
Revise build.info

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

13 months agoQUIC: Ensure locking when injecting datagrams
Hugo Landau [Fri, 24 Mar 2023 12:03:32 +0000 (12:03 +0000)]
QUIC: Ensure locking when injecting datagrams

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

13 months agoQUIC test fix
Hugo Landau [Wed, 22 Mar 2023 18:46:55 +0000 (18:46 +0000)]
QUIC test fix

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

13 months agoQUIC Thread Assisted mode: miscellaneous fixes
Hugo Landau [Tue, 21 Mar 2023 15:19:34 +0000 (15:19 +0000)]
QUIC Thread Assisted mode: miscellaneous fixes

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

13 months agoRefactor build.info
Hugo Landau [Mon, 13 Mar 2023 18:53:49 +0000 (18:53 +0000)]
Refactor build.info

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

13 months agoQUIC Thread Assisted Mode: Refactor locking to be infallible
Hugo Landau [Thu, 23 Feb 2023 05:06:59 +0000 (05:06 +0000)]
QUIC Thread Assisted Mode: Refactor locking to be infallible

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

13 months agoQUIC Thread Assisted Mode: Fix typos and use of CRYPTO_RWLOCK type
Hugo Landau [Thu, 23 Feb 2023 05:02:29 +0000 (05:02 +0000)]
QUIC Thread Assisted Mode: Fix typos and use of CRYPTO_RWLOCK type

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

13 months agoQUIC Thread Assisted Mode: Support Windows XP
Hugo Landau [Wed, 22 Feb 2023 19:15:16 +0000 (19:15 +0000)]
QUIC Thread Assisted Mode: Support Windows XP

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

13 months agoAvoid races in tserver test code
Hugo Landau [Wed, 22 Feb 2023 17:01:28 +0000 (17:01 +0000)]
Avoid races in tserver test code

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

13 months agoMinor fixes to thread assisted mode
Hugo Landau [Wed, 22 Feb 2023 16:08:26 +0000 (16:08 +0000)]
Minor fixes to thread assisted mode

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

13 months agoQUIC Thread Assisted Mode: Add design document
Hugo Landau [Wed, 22 Feb 2023 05:55:23 +0000 (05:55 +0000)]
QUIC Thread Assisted Mode: Add design document

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

13 months agoEnhance quic_tserver test to fully test thread assisted mode
Hugo Landau [Tue, 21 Feb 2023 10:18:59 +0000 (10:18 +0000)]
Enhance quic_tserver test to fully test thread assisted mode

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

13 months agoQUIC CHANNEL: Fix idle timeout handling
Hugo Landau [Tue, 21 Feb 2023 10:18:59 +0000 (10:18 +0000)]
QUIC CHANNEL: Fix idle timeout handling

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

13 months agoQUIC CHANNEL: Allow time source to be overridden
Hugo Landau [Tue, 21 Feb 2023 10:18:59 +0000 (10:18 +0000)]
QUIC CHANNEL: Allow time source to be overridden

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

13 months agoQUIC TXP: Allow caller to determine if an ACK-eliciting packet was sent
Hugo Landau [Tue, 21 Feb 2023 10:18:59 +0000 (10:18 +0000)]
QUIC TXP: Allow caller to determine if an ACK-eliciting packet was sent

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

13 months agoAdd basic test for thread assisted mode
Hugo Landau [Tue, 21 Feb 2023 10:18:59 +0000 (10:18 +0000)]
Add basic test for thread assisted mode

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

13 months agoSwitch to using ossl_crypto_mutex from CRYPTO_RWLOCK
Hugo Landau [Tue, 21 Feb 2023 10:18:59 +0000 (10:18 +0000)]
Switch to using ossl_crypto_mutex from CRYPTO_RWLOCK

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

13 months agoAdd channel-only tick mode and use it for thread assisted mode
Hugo Landau [Tue, 21 Feb 2023 10:18:59 +0000 (10:18 +0000)]
Add channel-only tick mode and use it for thread assisted mode

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

13 months agoFront End for QUIC Thread Assisted Mode
Hugo Landau [Tue, 21 Feb 2023 10:18:59 +0000 (10:18 +0000)]
Front End for QUIC Thread Assisted Mode

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

13 months agoQUIC Thread Assist Core
Hugo Landau [Tue, 21 Feb 2023 10:18:59 +0000 (10:18 +0000)]
QUIC Thread Assist Core

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

13 months agoFix handshake locking
Hugo Landau [Tue, 21 Feb 2023 10:18:59 +0000 (10:18 +0000)]
Fix handshake locking

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

13 months agoAdd mutex to tserver
Hugo Landau [Tue, 21 Feb 2023 10:18:58 +0000 (10:18 +0000)]
Add mutex to tserver

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

13 months agoAdd locking to QUIC front-end
Hugo Landau [Tue, 21 Feb 2023 10:18:58 +0000 (10:18 +0000)]
Add locking to QUIC front-end

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

13 months agoMove channel mutex out of QUIC_CHANNEL for init/teardown flexibility
Hugo Landau [Tue, 21 Feb 2023 10:18:58 +0000 (10:18 +0000)]
Move channel mutex out of QUIC_CHANNEL for init/teardown flexibility

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

13 months agoAnnotate functions needing locking
Hugo Landau [Tue, 21 Feb 2023 10:18:58 +0000 (10:18 +0000)]
Annotate functions needing locking

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

13 months agoQUIC Channel: Add a mutex
Hugo Landau [Tue, 21 Feb 2023 10:18:58 +0000 (10:18 +0000)]
QUIC Channel: Add a mutex

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

13 months agoQUIC Reactor: Allow a mutex to be released during waits
Hugo Landau [Tue, 21 Feb 2023 10:18:58 +0000 (10:18 +0000)]
QUIC Reactor: Allow a mutex to be released during waits

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

13 months agothreading: Add ossl_crypto_condvar_wait_timeout
Hugo Landau [Tue, 21 Feb 2023 10:18:58 +0000 (10:18 +0000)]
threading: Add ossl_crypto_condvar_wait_timeout

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

13 months agoAdd some documentation for the new advanced s_client command mode
Matt Caswell [Tue, 21 Mar 2023 16:06:58 +0000 (16:06 +0000)]
Add some documentation for the new advanced s_client command mode

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

13 months agoAdd a new advanced command mode to s_client
Matt Caswell [Thu, 16 Mar 2023 15:08:04 +0000 (15:08 +0000)]
Add a new advanced command mode to s_client

The s_client command mode just looks at the first letter on a line
and if it is one that maps to a "command" then that command is executed
and everything else on the line is ignored.

This means it is impossible to send anything over s_client that starts with
one of the "magic" letters unless you switch off command processing
entirely.

With the forthcoming quic support that will be added to s_client we expect
a significant new number of commands being added (for example to send fin
on a stream, or to list or swap between different streams, etc). This will
use up more "letters" and reduces the usability of s_client.

This PR adds a new "advanced" command processing mode. Commands are enclosed
in braces {}, and can appear anywhere in the text typed into s_client. A
brace can be escaped by sending a double {{. This gives much more
flexibility without reducing the usability of s_client. Commands can also
have "arguments" which also extends the scope of what they can be used for.

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

13 months agoremove DSA512 from speed testing
Michael Baentsch [Sat, 25 Mar 2023 12:06:46 +0000 (13:06 +0100)]
remove DSA512 from speed testing

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

13 months agoSM4 check should be for __aarch64__, not __ARM_MAX_ARCH__ >= 8
Tom Cosgrove [Mon, 27 Mar 2023 14:42:20 +0000 (15:42 +0100)]
SM4 check should be for __aarch64__, not __ARM_MAX_ARCH__ >= 8

(And then __arm__ and __arm tests are redundant)

Fixes #20604

Change-Id: I4308e75b7fbf3be7b46490c3ea4125e2d91b00b8

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