openssl.git
2 years agotest/crltest.c: Add check for glue2bio
Jiasheng Jiang [Thu, 17 Feb 2022 09:47:00 +0000 (17:47 +0800)]
test/crltest.c: Add check for glue2bio

As the glue2bio() could return NULL pointer if fails,
it should be better to check the return value in order
to avoid the use of NULL pointer.

Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17718)

2 years agobio_enc.c: add check for BIO_new_mem_buf
Jiasheng Jiang [Fri, 18 Feb 2022 02:13:08 +0000 (10:13 +0800)]
bio_enc.c: add check for BIO_new_mem_buf

Since the memory allocation may fail, the BIO_new_mem_buf() may
return NULL pointer.
Therefore, it should be better to check it and return error if fails.

Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17730)

2 years agoX509_VERIFY_PARAM_set_flags.pod: fix typos
Carlo Teubner [Fri, 18 Feb 2022 10:00:52 +0000 (10:00 +0000)]
X509_VERIFY_PARAM_set_flags.pod: fix typos

CLA: trivial

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

2 years agoAdd -quiet option to pkcs7 for -print_certs
Raul Ferrando [Tue, 15 Feb 2022 15:02:41 +0000 (16:02 +0100)]
Add -quiet option to pkcs7 for -print_certs

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

2 years agoUndeprecate OPENSSL_VERSION_NUMBER and OpenSSL_version_num()
Matt Caswell [Tue, 22 Feb 2022 11:49:04 +0000 (11:49 +0000)]
Undeprecate OPENSSL_VERSION_NUMBER and OpenSSL_version_num()

This macro and function were deprecated in the documentation but not in
the source.

Following an OTC vote the deprecation has been removed from the
documentation.

See https://github.com/openssl/technical-policies/issues/26

Fixes #17517

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

2 years agodoc: Fix KDF example for scrypt
msa42 [Mon, 21 Feb 2022 18:23:34 +0000 (18:23 +0000)]
doc: Fix KDF example for scrypt

CLA: trivial

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

2 years agoFix a failure in sslapitest
Matt Caswell [Wed, 23 Feb 2022 11:16:07 +0000 (11:16 +0000)]
Fix a failure in sslapitest

The SNI test in test_cert_cb_int() was always failing because it used
SSL_CTX_new() instead of SSL_CTX_new_ex() and was therefore not using the
correct libctx. PR #17739 amended the test to check the return value from
SSL_CTX_new() which made the failure obvious.

Fixes #17757

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/17758)

2 years agocheck *libctx which is allocated by OSSL_LIB_CTX_new()
xkernel [Mon, 21 Feb 2022 07:29:25 +0000 (15:29 +0800)]
check *libctx which is allocated by OSSL_LIB_CTX_new()

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

2 years agotest/sslapitest.c: Add check for SSL_CTX_new
Jiasheng Jiang [Mon, 21 Feb 2022 02:54:29 +0000 (10:54 +0800)]
test/sslapitest.c: Add check for SSL_CTX_new

As the potential failure of the memory allocation, it should
be better to check the return value of SSL_CTX_new() and return
error if fails, like SSL_CTX_new_ex().

Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17739)

2 years agoX509V3_get_d2i.pod: use I<> for arguments and remove B<> around NULL
Dr. David von Oheimb [Fri, 18 Feb 2022 08:36:00 +0000 (09:36 +0100)]
X509V3_get_d2i.pod: use I<> for arguments and remove B<> around NULL

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

2 years agoX509V3_get_d2i.pod: Fix glitch on X509V3_get{,_ext}_d2i and align order
Dr. David von Oheimb [Thu, 17 Feb 2022 18:43:55 +0000 (19:43 +0100)]
X509V3_get_d2i.pod: Fix glitch on X509V3_get{,_ext}_d2i and align order

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

2 years agoCMP: add subject of any provided CSR as default message sender
Dr. David von Oheimb [Thu, 17 Feb 2022 18:46:29 +0000 (19:46 +0100)]
CMP: add subject of any provided CSR as default message sender

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

2 years agochacha20 performance optimizations for ppc64le with 8x lanes,
Deepankar Bhattacharjee [Mon, 20 Sep 2021 14:45:15 +0000 (10:45 -0400)]
chacha20 performance optimizations for ppc64le with 8x lanes,
Performance increase around 50%.

Co-authored-by: Madhusudhanan Duraisamy <madurais@in.ibm.com>
Co-authored-by: Nilamjyoti Goswami <nilamgoswami@in.ibm.com>
Co-authored-by: Siva Sundar Anbareeswaran <srisivasundar@in.ibm.com>
Reviewed-by: Danny Tsen <dtsen@us.ibm.com>
Tested-by: Danny Tsen <dtsen@us.ibm.com>
Signed-off-by: Danny <dtsen@us.ibm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16637)

2 years agox509: handle returns from X509_TRUST_get_by_id() more consistently
Pauli [Tue, 15 Feb 2022 23:41:58 +0000 (10:41 +1100)]
x509: handle returns from X509_TRUST_get_by_id() more consistently

Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/17709)

2 years agorand: Add missing check for rand_get_global
Jiasheng Jiang [Tue, 15 Feb 2022 09:45:04 +0000 (17:45 +0800)]
rand: Add missing check for rand_get_global

As the potential failure of the rand_get_global(),
for example fail to get lock, 'dgbl' could be NULL
pointer and be dereferenced later.
Therefore, it should be better to check it and return
error if fails, like RAND_get0_primary() and other callers.

Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/17690)

2 years agofuzz/asn1.c: Add missing check for BIO_new
Jiasheng Jiang [Sat, 12 Feb 2022 11:27:09 +0000 (19:27 +0800)]
fuzz/asn1.c: Add missing check for BIO_new

Since the BIO_new may fail, the 'bio' could be NULL pointer and be used.
Therefore, it should be better to check it and skip the print if fails.

Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/17690)

2 years agotest/mdc2test.c: Add check for OSSL_PROVIDER_load
Jiasheng Jiang [Fri, 18 Feb 2022 01:15:50 +0000 (09:15 +0800)]
test/mdc2test.c: Add check for OSSL_PROVIDER_load

Since the potential failure of the OSSL_PROVIDER_load(),
for example there is no lock, the provider could fail to
be loaded into the library context.
Therefore, it should be better to check it and return error
if fails.
Also, in order to avoid free unknown pointer, 'c' should be
initialized as NULL.

Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/17729)

2 years agodoc: Refactored the example in crypto.pod
yangyangtiantianlonglong [Wed, 16 Feb 2022 15:33:17 +0000 (23:33 +0800)]
doc: Refactored the example in crypto.pod

Added return value and error code in the sample

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17721)

2 years agodoc: Update "SSL/TLS" old documentation description in openssl.pod
yangyangtiantianlonglong [Wed, 16 Feb 2022 15:01:38 +0000 (23:01 +0800)]
doc: Update "SSL/TLS" old documentation description in openssl.pod

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17721)

2 years agoFix typo
Dimitris Apostolou [Wed, 16 Feb 2022 08:05:35 +0000 (10:05 +0200)]
Fix typo

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

2 years agoAdd changes logs caption for the next release 1.1.1n
Oleg Pekar [Wed, 16 Feb 2022 16:58:14 +0000 (18:58 +0200)]
Add changes logs caption for the next release 1.1.1n

Co-authored-by: Matthias St. Pierre <matthias.st.pierre@ncp-e.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/17714)

2 years agoFixed the date of changes of 1.1.1m
Oleg Pekar [Wed, 16 Feb 2022 11:59:01 +0000 (13:59 +0200)]
Fixed the date of changes of 1.1.1m

Fixed the date in the heading of "Changes between 1.1.1l and 1.1.1m" to 14 Dec 2021

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/17714)

2 years agoenc : add support for wrap mode
EasySec [Sat, 12 Feb 2022 01:07:34 +0000 (02:07 +0100)]
enc : add support for wrap mode

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

2 years agoPrefix output to avoid random ok to confuse test parser
Armin Fuerst [Fri, 11 Feb 2022 18:46:12 +0000 (19:46 +0100)]
Prefix output to avoid random ok to confuse test parser

Prefix output of generated dh parameters to avoid misinterpretation
of lines beginning with ok[^a-zA-Z0-9] as a testresult.

Also corrected indent and removed useless comma after last item.

Fixes #17480

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

2 years agoapps/s_server: Add missing check for BIO_new
Jiasheng Jiang [Wed, 16 Feb 2022 03:27:23 +0000 (11:27 +0800)]
apps/s_server: Add missing check for BIO_new

As the potential failure of the BIO_new(), it should be better to check the return value and return error if fails in order to avoid the dereference of NULL pointer.
And because 'bio_s_msg' is checked before being used everytime, which has no need to add the check.
But 'bio_s_out' is not.
And since the check 'if (bio_s_out == NULL)' is redundant, it can be removed to make the code succincter.
Also the 'sbio' and so forth should be checked like the other places in the same file.

Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17710)

2 years agoapps/ocsp: Add check for OPENSSL_strdup
Jiasheng Jiang [Thu, 10 Feb 2022 07:41:40 +0000 (15:41 +0800)]
apps/ocsp: Add check for OPENSSL_strdup

Just assert 'bn' to be non-NULL is not enough.
The check for 'itmp' is still needed.
If 'bn' is 0, the 'itmp' is assigned by OPENSSL_strdup().
Since OPENSSL_strdup() may fail because of the lack of memory,
the 'itmp' will be NULL and be an valid parameter hashed in
TXT_DB_get_by_index(), returning a wrong result.

Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17677)

2 years agos_server: Add check for OPENSSL_strdup
Jiasheng Jiang [Wed, 9 Feb 2022 15:04:25 +0000 (23:04 +0800)]
s_server: Add check for OPENSSL_strdup

Since the OPENSSL_strdup() may return NULL if allocation
fails, the 'port' could be NULL.
And then it will be used in do_server(), which can accept
NULL as an valid parameter.
That means that the system could run with a wrong parameter.
Therefore it should be better to check it, like the other
memory allocation.

Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17673)

2 years agoAdd back check for the DH public key size
Tomas Mraz [Thu, 10 Feb 2022 10:49:37 +0000 (11:49 +0100)]
Add back check for the DH public key size

This is needed for TLS-1.3.

Also add check for uncompressed point format for ECDHE as
the other formats are not allowed by RFC 8446.

Fixes #17667

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

2 years agoAdd define guards to avoid multi-inclusion
Weiguo Li [Wed, 9 Feb 2022 18:30:25 +0000 (02:30 +0800)]
Add define guards to avoid multi-inclusion

This header files are included by multiple other headers.
It's better to add define guards to prevent multi-inclusion.
Adhere to the coding style, all preprocessor directives inside
the guards gain a space.

Signed-off-by: Weiguo Li <liwg06@foxmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/17666)

2 years agotest/helpers/handshake.c: Add check for OPENSSL_strdup
Jiasheng Jiang [Tue, 15 Feb 2022 02:46:38 +0000 (10:46 +0800)]
test/helpers/handshake.c: Add check for OPENSSL_strdup

As the potential failure of the memory allocation, the OPENSSL_strdup()
could return NULL pointer and then be assigned to 'server_ctx'.
In order to tell the callers the failure of the configuration, it should
be better to return error.

Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
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/17705)

2 years agoForce macOS 10.15 or later to be 64-bit
Todd Short [Wed, 9 Feb 2022 20:59:37 +0000 (15:59 -0500)]
Force macOS 10.15 or later to be 64-bit

macOS Catalina (10.15) no longer supports 32-bit applications.
Do not wait 5 seconds to give the user the option of using KERNEL_BITS=32
Do not accept the KERNEL_BITS=32 option

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

2 years agoAdd tests for do_updatedb
Armin Fuerst [Fri, 4 Feb 2022 19:35:54 +0000 (20:35 +0100)]
Add tests for do_updatedb

Fixes #13944

Moved "opt_printf_stderr" out of apps.c to avoid duplicate definition in tests.

Added function "asn1_string_to_time_t" including tests.

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

2 years agodh_exch.c: Add check for OPENSSL_strdup
Jiasheng Jiang [Mon, 7 Feb 2022 11:13:43 +0000 (19:13 +0800)]
dh_exch.c: Add check for OPENSSL_strdup

Since the OPENSSL_strdup() may return NULL if allocation
fails, it should be better to check the return value.

Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17651)

2 years agoApply the correct Apache v2 license
Tomas Mraz [Fri, 11 Feb 2022 08:44:52 +0000 (09:44 +0100)]
Apply the correct Apache v2 license

There were still a few files mentioning the old OpenSSL license.

Fixes #17684

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

2 years agoopenssl rehash: add check for OPENSSL_strdup
Jiasheng Jiang [Thu, 10 Feb 2022 03:21:47 +0000 (11:21 +0800)]
openssl rehash: add check for OPENSSL_strdup

As the potential failure of the memory allocation,
it should be better to check the return value of
OPENSSL_strdup() and return error if fails.
Also, we need to restore the 'ep' to be NULL if fails.

Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17676)

2 years agoImplement a new flag for running s_client in a non-interactive mode
Rami Khaldi [Tue, 23 Nov 2021 22:27:35 +0000 (23:27 +0100)]
Implement a new flag for running s_client in a non-interactive mode

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

2 years agoUse C locale in Bash scripts.
Daniel [Wed, 9 Feb 2022 15:23:46 +0000 (16:23 +0100)]
Use C locale in Bash scripts.

Fixes openssl#17228.

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

2 years agoCleanup record length checks for KTLS
Bernd Edlinger [Fri, 14 Jan 2022 09:01:29 +0000 (10:01 +0100)]
Cleanup record length checks for KTLS

In some corner cases the check for packets
which exceed the allowed record length was missing
when KTLS is initially enabled, when some
unprocessed packets are still pending.

Add at least some tests for KTLS, since we have
currently not very much test coverage for KTLS.

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

2 years agoAdd test of FIPS provider from the master branch with 3.0 build
Tomas Mraz [Wed, 9 Feb 2022 11:03:16 +0000 (12:03 +0100)]
Add test of FIPS provider from the master branch with 3.0 build

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

2 years agoevp_test: Skip testcase if r parameter is unsupported
Tomas Mraz [Wed, 9 Feb 2022 10:23:01 +0000 (11:23 +0100)]
evp_test: Skip testcase if r parameter is unsupported

The r parameter of the KBKDF is unsupported by 3.0 FIPS module.

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

2 years agoAdd test of FIPS provider from the 3.0 branch with master build
Tomas Mraz [Tue, 8 Feb 2022 14:42:31 +0000 (15:42 +0100)]
Add test of FIPS provider from the 3.0 branch with master build

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

2 years agoChange condition to avoid spurious compiler complaints.
Pauli [Wed, 9 Feb 2022 00:17:57 +0000 (11:17 +1100)]
Change condition to avoid spurious compiler complaints.

X509_TRUST_get0() is checking < 0, the code here was checking == -1.  Both are
equivalent in this situation but gcc-12 has conniptions about a subsequent
possible NULL dereference (which isn't possible).

Fixes #17665

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

2 years agoAdded checking for buflen overflow due to MAX_MISALIGNMENT.
Kevin K Biju [Sat, 5 Feb 2022 12:39:45 +0000 (18:09 +0530)]
Added checking for buflen overflow due to MAX_MISALIGNMENT.

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

2 years agobn_lib.c: Change Endianess check to as a binary condition.
Kelvin Lee [Sat, 22 Jan 2022 00:22:31 +0000 (11:22 +1100)]
bn_lib.c: Change Endianess check to as a binary condition.

This prevents VS2022 from mis-identify an uninitialized local pointer
variable.

CLA: trivial

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

2 years agoAES-GCM enabled with AVX512 vAES and vPCLMULQDQ.
Andrey Matyukov [Wed, 9 Jun 2021 21:38:40 +0000 (14:38 -0700)]
AES-GCM enabled with AVX512 vAES and vPCLMULQDQ.

Vectorized 'stitched' encrypt + ghash implementation of AES-GCM enabled
with AVX512 vAES and vPCLMULQDQ instructions (available starting Intel's
IceLake micro-architecture).

The performance details for representative IceLake Server and Client
platforms are shown below

Performance data:
OpenSSL Speed KBs/Sec
Intel(R) Xeon(R) Platinum 8380 CPU @ 2.30GHz (1Core/1Thread)
Payload in Bytes       16          64        256         1024        8192      16384
AES-128-GCM
  Baseline      478708.27   1118296.96  2428092.52  3518199.4   4172355.99  4235762.07
  Patched       534613.95   2009345.55  3775588.15  5059517.64  8476794.88  8941541.79
  Speedup            1.12         1.80        1.55        1.44        2.03        2.11

AES-256-GCM
  Baseline      399237.27   961699.9    2136377.65  2979889.15  3554823.37  3617757.5
  Patched       475948.13   1720128.51  3462407.12  4696832.2   7532013.16  7924953.91
  Speedup            1.19        1.79         1.62        1.58        2.12        2.19
Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz (1Core/1Thread)
Payload in Bytes       16          64        256         1024        8192      16384
AES-128-GCM
  Baseline      259128.54   570756.43   1362554.16  1990654.57  2359128.88  2401671.58
  Patched       292139.47   1079320.95  2001974.63  2829007.46  4510318.59  4705314.41
  Speedup            1.13        1.89         1.47        1.42        1.91        1.96
AES-256-GCM
  Baseline      236000.34   550506.76   1234638.08  1716734.57  2011255.6   2028099.99
  Patched       247256.32   919731.34   1773270.43  2553239.55  3953115.14  4111227.29
  Speedup            1.05        1.67         1.44        1.49        1.97        2.03

Reviewed-by: TJ O'Dwyer, Marcel Cornu, Pablo de Lara
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17239)

2 years agoFix outdated comments
Weiguo Li [Wed, 9 Feb 2022 08:12:30 +0000 (16:12 +0800)]
Fix outdated comments

Update the comment "../md32_common.h" to "crypto/md32_common.h".

CLA: trivial

Signed-off-by: Weiguo Li <liwg06@foxmail.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/17670)

2 years agoFix small typo in EVP_KEYEXCH-ECDH.html doc example
EasySec [Mon, 7 Feb 2022 22:16:39 +0000 (23:16 +0100)]
Fix small typo in EVP_KEYEXCH-ECDH.html doc example

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

2 years agoaarch64: fix branch target indications in arm64cpuid.pl and keccak1600
Tom Cosgrove [Mon, 7 Feb 2022 14:44:56 +0000 (14:44 +0000)]
aarch64: fix branch target indications in arm64cpuid.pl and keccak1600

Add missing AARCH64_VALID_CALL_TARGET to armv8_rng_probe(). Also add
these to the functions defined by gen_random(), and note that this Perl
sub prints the assembler out directly, not going via the $code xlate
mechanism (and therefore coming before the include of arm_arch.h). So
fix this too.

In KeccakF1600_int, AARCH64_SIGN_LINK_REGISTER functions as
AARCH64_VALID_CALL_TARGET on BTI-only builds, so it needs to come before
the 'adr' line.

Change-Id: If241efe71591c88253a3e36647ced00300c3c1a3

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

2 years agoAdd the check after calling OPENSSL_strdup
Jiasheng Jiang [Sat, 5 Feb 2022 11:31:11 +0000 (19:31 +0800)]
Add the check after calling OPENSSL_strdup

Since the potential failure of the memory allocation, the
OPENSSL_strdup() could return NULL pointer.
Therefore, it should be better to check it in order to guarantee the
success of the configuration, same as the check for
SSL_CTX_set_srp_username().

Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17643)

2 years agoFix an enginetest failure when compiled with no-deprecated --api=1.1.1
Matt Caswell [Mon, 7 Feb 2022 10:32:08 +0000 (10:32 +0000)]
Fix an enginetest failure when compiled with no-deprecated --api=1.1.1

Fixes #17649

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

2 years agoSend auxiliary messages to bio_err.
Daniel [Sun, 6 Feb 2022 14:01:14 +0000 (15:01 +0100)]
Send auxiliary messages to bio_err.

Fixes openssl#17613.

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

2 years agorsa: add check after calling BN_BLINDING_lock
Jiasheng Jiang [Sat, 5 Feb 2022 10:00:51 +0000 (18:00 +0800)]
rsa: add check after calling BN_BLINDING_lock

As the potential failure of getting lock, we need to check the return
value of the BN_BLINDING_lock() in order to avoid the dirty data.

Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17642)

2 years agoCheck for presence of 1.1.x openssl runtime
Bernd Edlinger [Sun, 16 Jan 2022 16:59:17 +0000 (17:59 +0100)]
Check for presence of 1.1.x openssl runtime

if the newly loaded engine contains the symbol
EVP_PKEY_base_id, we know it is linked to 1.1.x openssl.
Abort loading this engine, as it will definitely crash.

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

2 years agoPrevent crash with engine using different openssl runtime
Bernd Edlinger [Mon, 22 Nov 2021 20:50:04 +0000 (21:50 +0100)]
Prevent crash with engine using different openssl runtime

This problem happens usually because an application
links libcrypto and/or libssl statically which
installs an atexit handler, but later an engine using
a shared instance of libcrypto is installed.
The problem is in simple words that both instances
of libcrypto have an atexit handler installed,
but both are unable to coordinate with each other,
which causes a crash, typically a use-after-free
in the engine's destroy function.

Work around that by preventing the engine's
libcrypto to install the atexit handler.
This may result in a small memory leak, but that
memory is still reachable.

Fixes #15898

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

2 years agoAdd testcases for EVP_PKEY_set1_encoded_public_key()
Tomas Mraz [Thu, 3 Feb 2022 15:30:21 +0000 (16:30 +0100)]
Add testcases for EVP_PKEY_set1_encoded_public_key()

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

2 years agoReplace size check with more meaningful pubkey check
Tomas Mraz [Wed, 2 Feb 2022 16:47:26 +0000 (17:47 +0100)]
Replace size check with more meaningful pubkey check

It does not make sense to check the size because this
function can be used in other contexts than in TLS-1.3 and
the value might not be padded to the size of p.

However it makes sense to do the partial pubkey check because
there is no valid reason having the pubkey value outside the
1 < pubkey < p-1 bounds.

Fixes #15465

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

2 years agodoc: Add hint to use EVP_PKEY_get_bn_param to retrieve big integers
Tomas Mraz [Wed, 5 Jan 2022 10:18:27 +0000 (11:18 +0100)]
doc: Add hint to use EVP_PKEY_get_bn_param to retrieve big integers

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

2 years agoFix SIZE_MAX not defined on z/OS etc
Ankit Das [Wed, 2 Feb 2022 18:08:41 +0000 (23:38 +0530)]
Fix SIZE_MAX not defined on z/OS etc

Fixes openssl#17629 by including internal/numbers.h which defines SIZE_MAX

CLA: trivial

Fixes #17629

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

2 years agoCorrect return type for BIO_ptr_ctrl
Thomas1664 [Thu, 20 Jan 2022 09:02:59 +0000 (10:02 +0100)]
Correct return type for BIO_ptr_ctrl

Fixes #17549
CLA: trivial

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

2 years agoFixed counter overflow
Danny Tsen [Fri, 28 Jan 2022 00:49:59 +0000 (18:49 -0600)]
Fixed counter overflow

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

2 years agoevp_test: Add the missing check after calling OPENSSL_strdup and sk_OPENSSL_STRING_ne...
Jiasheng Jiang [Wed, 2 Feb 2022 11:45:59 +0000 (19:45 +0800)]
evp_test: Add the missing check after calling OPENSSL_strdup and sk_OPENSSL_STRING_new_null

Since the memory allocation may fail, the 'mac_name' and 'controls'
could be NULL.
And the 'mac_name' will be printed in mac_test_run_mac() without check.
Also the result of 'params_n +
sk_OPENSSL_STRING_num(expected->controls)' in
mac_test_run_mac() will be 'params_n - 1' if allocation fails , which
does not make sense.
Therefore, it should be better to check them in order to guarantee the
complete success of initiation.
If fails, we also need to free the 'mdat' to avoid the memory leak.

Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17628)

2 years agoFix typos
Dimitris Apostolou [Thu, 3 Feb 2022 16:51:26 +0000 (18:51 +0200)]
Fix typos

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

2 years agoevp enc: cache cipher key length
Pauli [Thu, 27 Jan 2022 02:33:36 +0000 (13:33 +1100)]
evp enc: cache cipher key length

Instead of doing a heavy params based query every time a context is
asked for its key length, this value is cached in the context and only
queried if it could have been modified.

Fixes #17064

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

2 years agoevp enc: cache cipher IV length
Pauli [Wed, 26 Jan 2022 04:04:51 +0000 (15:04 +1100)]
evp enc: cache cipher IV length

Instead of doing a heavy params based query every time a context is asked for
its IV length, this value is cached in the context and only queried if it could
have been modified.

Fixes #17064

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

2 years agoaes: avoid accessing key length field directly
Pauli [Thu, 27 Jan 2022 01:51:13 +0000 (12:51 +1100)]
aes: avoid accessing key length field directly

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

2 years agoMove e_os.h to include/internal
Richard Levitte [Fri, 4 Feb 2022 14:13:01 +0000 (15:13 +0100)]
Move e_os.h to include/internal

Including e_os.h with a path from a header file doesn't work well on
certain exotic platform.  It simply fails to build.

Since we don't seem to be able to stop ourselves, the better move is
to move e_os.h to an include directory that's part of the inclusion
path given to the compiler.

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

2 years agoAdd support for Chacha20-Poly1305 to kernel TLS on FreeBSD.
John Baldwin [Wed, 23 Dec 2020 22:09:51 +0000 (14:09 -0800)]
Add support for Chacha20-Poly1305 to kernel TLS on FreeBSD.

FreeBSD's kernel TLS supports Chacha20 for both TLS 1.2 and TLS 1.3.

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

2 years agoAdd missing CRYPTO_THREAD_cleanup_local of default_context_thread_local
Harry Sintonen [Tue, 1 Feb 2022 21:48:19 +0000 (23:48 +0200)]
Add missing CRYPTO_THREAD_cleanup_local of default_context_thread_local

CLA: trivial

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

2 years agoFix builds with DJGPP
Juan Manuel Guerrero [Tue, 1 Feb 2022 23:41:02 +0000 (00:41 +0100)]
Fix builds with DJGPP

CLA: trivial

To get the master branch compiled with DJGPP some minor
adjustments are required. They will have no impact on any other ports.
The DJGPP port uses the Watt-32 library to provide the required network
functionality and some of its headers need to be included.

Neither DJGPP nor the Watt-32 library provide in_addr_t thus it must be
provided as it is done for OPENSSL_SYS_WINDOWS in crypto/bio/b_addr.c.

In the DJGPP section of include/internal/sockets.h the following Watt-32
headers must be added:

  -  arpa/inet.h: to provide declaration of inet_ntoa required in crypto/bio/b_addr.c
  -  netinet/tcp.h: to provide defintion of TCP_NODELAY required in crypto/bio/b_sock2.c

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

2 years agoopenssl-dgst.pod.in: Fix documentation of -list option
EasySec [Wed, 2 Feb 2022 00:42:27 +0000 (01:42 +0100)]
openssl-dgst.pod.in: Fix documentation of -list option

Mention openssl list -digest-algorithms, NOT -digest-commands.

Move option -list just after the related option -digest.

Fix HTML formatting of section 'Examples' by adding missing
newlines and add 2 examples variant to clarify syntax of the
command.

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

2 years agoFix copyrights
Todd Short [Thu, 27 Jan 2022 19:18:28 +0000 (14:18 -0500)]
Fix copyrights

Add copyright to files that were missing it.
Update license from OpenSSL to Apache as needed.

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

2 years agoUse opt_int_arg() to parse integers in apps/speed.c
Kevin K Biju [Tue, 1 Feb 2022 05:34:35 +0000 (11:04 +0530)]
Use opt_int_arg() to parse integers in apps/speed.c

We use opt_int_arg() to prevent malformed processing of
hexadecimal input to some command line options.

Updated help to mention the change.

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

2 years agoFix EVP todata and fromdata when used with selection of EVP_PKEY_PUBLIC_KEY.
slontis [Sun, 5 Dec 2021 23:27:12 +0000 (09:27 +1000)]
Fix EVP todata and fromdata when used with selection of EVP_PKEY_PUBLIC_KEY.

The private key for rsa, dsa, dh and ecx was being included when the
selector was just the public key. (ec was working correctly).
This matches the documented behaviour.

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

2 years agoadd SSL_get0_iana_groups() & SSL_client_hello_get_extension_order()
Phus Lu [Mon, 25 Oct 2021 10:47:00 +0000 (18:47 +0800)]
add SSL_get0_iana_groups() & SSL_client_hello_get_extension_order()

The function/macro allow user get groups/extensions without memory allcations.
So we could calculate the ssl fignerprint(ja3) in low cost.

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

2 years agoapps/progs.pl: use SOURCE_DATE_EPOCH if defined for copyright year
Ross Burton [Thu, 27 Jan 2022 12:03:11 +0000 (12:03 +0000)]
apps/progs.pl: use SOURCE_DATE_EPOCH if defined for copyright year

As with 11d7d903, use SOURCE_DATE_EPOCH for the copyright year if it is
defined, to avoid reproducibility problems.

CLA: trivial

Signed-off-by: Ross Burton <ross.burton@arm.com>
Change-Id: I1bea19070411a69155c43de7082350fb2c499da3

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

2 years agoUpdate the comment on ssl3_write_pending()
yangyangtiantianlonglong [Sat, 29 Jan 2022 09:08:50 +0000 (17:08 +0800)]
Update the comment on ssl3_write_pending()

The struct s->s3 has been modified.

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

2 years agoRevert dropped usage of var thiswr in do_ssl3_write()
yangyangtiantianlonglong [Sat, 29 Jan 2022 08:49:00 +0000 (16:49 +0800)]
Revert dropped usage of var thiswr in do_ssl3_write()

The var 'thiswr' is an unwanted modification,
it was submitted in #5253.

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

2 years agoindentation fix
Pauli [Wed, 26 Jan 2022 01:01:57 +0000 (12:01 +1100)]
indentation fix

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/17572)

2 years agotls1 prf: implement ctx dup operation
Pauli [Tue, 25 Jan 2022 00:54:56 +0000 (11:54 +1100)]
tls1 prf: implement ctx dup operation

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/17572)

2 years agopkcs12 kdf: implement ctx dup operation
Pauli [Tue, 25 Jan 2022 00:54:42 +0000 (11:54 +1100)]
pkcs12 kdf: implement ctx dup operation

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/17572)

2 years agotest: change pkey kdf dup fail test to a pkey kdf dup success test
Pauli [Tue, 25 Jan 2022 00:47:23 +0000 (11:47 +1100)]
test: change pkey kdf dup fail test to a pkey kdf dup success test

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/17572)

2 years agok942 kdf: implement ctx dup operation
Pauli [Mon, 24 Jan 2022 06:38:57 +0000 (17:38 +1100)]
k942 kdf: implement ctx dup operation

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/17572)

2 years agoss KDF: implement ctx dup operation
Pauli [Mon, 24 Jan 2022 06:32:16 +0000 (17:32 +1100)]
ss KDF: implement ctx dup operation

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/17572)

2 years agossh kdf: implement ctx dup operation
Pauli [Mon, 24 Jan 2022 06:22:37 +0000 (17:22 +1100)]
ssh kdf: implement ctx dup operation

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/17572)

2 years agoscrypt: implement ctx dup operation
Pauli [Mon, 24 Jan 2022 06:17:58 +0000 (17:17 +1100)]
scrypt: implement ctx dup operation

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/17572)

2 years agopvk kdf: implement ctx dup operation
Pauli [Mon, 24 Jan 2022 06:08:58 +0000 (17:08 +1100)]
pvk kdf: implement ctx dup operation

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/17572)

2 years agokrb5kdf: implement ctx dup operation
Pauli [Mon, 24 Jan 2022 06:02:29 +0000 (17:02 +1100)]
krb5kdf: implement ctx dup operation

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/17572)

2 years agokbkdf: implement ctx dup operation
Pauli [Mon, 24 Jan 2022 05:58:54 +0000 (16:58 +1100)]
kbkdf: implement ctx dup operation

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/17572)

2 years agohkdf: implement ctx dup operation
Pauli [Mon, 24 Jan 2022 05:51:24 +0000 (16:51 +1100)]
hkdf: implement ctx dup operation

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/17572)

2 years agopbkdf2: implement ctx dup operation
Pauli [Mon, 24 Jan 2022 05:22:54 +0000 (16:22 +1100)]
pbkdf2: implement ctx dup operation

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/17572)

2 years agopbkdf1: implement ctx dup operation
Pauli [Mon, 24 Jan 2022 05:17:44 +0000 (16:17 +1100)]
pbkdf1: implement ctx dup operation

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/17572)

2 years agoevp_test: add a ctx dup operation to the KDF tests
Pauli [Mon, 24 Jan 2022 05:17:25 +0000 (16:17 +1100)]
evp_test: add a ctx dup operation to the KDF tests

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/17572)

2 years agoprov: add a safe memdup function for context cloning
Pauli [Wed, 26 Jan 2022 04:21:51 +0000 (15:21 +1100)]
prov: add a safe memdup function for context cloning

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/17572)

2 years agoFix bad HTML formatting in EVP_KEYEXCH-DH.html because of missing newline in pod...
EasySec [Fri, 28 Jan 2022 23:59:24 +0000 (00:59 +0100)]
Fix bad HTML formatting in EVP_KEYEXCH-DH.html because of missing newline in pod file

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17609)

2 years agoFix endianness problem in params_api_test
Juergen Christ [Fri, 28 Jan 2022 09:53:43 +0000 (10:53 +0100)]
Fix endianness problem in params_api_test

On a big endian machine, we get test failures in params_api_test like

        # ERROR: (memory) 'buf1 == buf2' failed @ test/params_api_test.c:473
        # --- buf1
        # +++ buf2
        # 0000:-e901
        # 0000:+01e9
        #       ^^^^
        #
        # OPENSSL_TEST_RAND_ORDER=1643313367
        not ok 157 - iteration 3

They are due to an additional conversion copy.  Remove this copy to solve the
problem.

Signed-off-by: Juergen Christ <jchrist@linux.ibm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17608)

2 years agoaes: make the no-asm constant time code path not the default
Pauli [Thu, 27 Jan 2022 04:05:48 +0000 (15:05 +1100)]
aes: make the no-asm constant time code path not the default

After OMC and OTC discussions, the 95% performance loss resulting from
the constant time code was deemed excessive for something outside of
our security policy.

The option to use the constant time code exists as it was in OpenSSL 1.1.1.

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

2 years agoInclude the modules directory in openssl.pc
Richard Levitte [Thu, 27 Jan 2022 16:26:06 +0000 (17:26 +0100)]
Include the modules directory in openssl.pc

Affected file: Configurations/unix-Makefile.tmpl

Fixes #17602

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

2 years agoapps: Add option -no_ems to s_client/s_server apps
yangyangtiantianlonglong [Wed, 26 Jan 2022 14:08:05 +0000 (22:08 +0800)]
apps: Add option -no_ems to s_client/s_server apps

The option SSL_OP_NO_EXTENDED_MASTER_SECRET was added in #3910.
And it is valid for versions below (D)TLS 1.2.

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

2 years agoAdd -verbose/-queit flags to dhparam
Philip Prindeville [Wed, 22 Dec 2021 03:44:07 +0000 (20:44 -0700)]
Add -verbose/-queit flags to dhparam

Allow dhparam to run quietly in scripts, etc.

For other commands that took a -verbose flag already, also support -quiet.

For genpkey which only supported -quiet, add the -verbose flag.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17336)

2 years agoUse progress_cb in genrsa
Philip Prindeville [Wed, 26 Jan 2022 03:42:18 +0000 (20:42 -0700)]
Use progress_cb in genrsa

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17336)