openssl.git
2 years agoFix the symbol_presence test with a shlib_variant
Matt Caswell [Wed, 29 Dec 2021 14:44:00 +0000 (14:44 +0000)]
Fix the symbol_presence test with a shlib_variant

If a shlib_variant is used then the dynamic version information for
symbols will be different from what the symbol presence test was
expecting. We just make it more liberal about what it accepts as dynamic
version information.

Fixes #17366

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

2 years agoAPPS/cmp: improve diagnostics for presence of TLS options
Dr. David von Oheimb [Mon, 6 Dec 2021 13:18:27 +0000 (14:18 +0100)]
APPS/cmp: improve diagnostics for presence of TLS options

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

2 years agoOSSL_CMP_CTX: rename get/set function for trustedStore
Dr. David von Oheimb [Wed, 15 Dec 2021 19:28:34 +0000 (20:28 +0100)]
OSSL_CMP_CTX: rename get/set function for trustedStore

This makes the naming more consistent, in a backward-compatible way

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

2 years agoEnsure s_client sends SNI data when used with -proxy
Matt Caswell [Thu, 9 Dec 2021 16:27:47 +0000 (16:27 +0000)]
Ensure s_client sends SNI data when used with -proxy

The use of -proxy prevented s_client from correctly sending the target
hostname as SNI data.

Fixes #17232

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

2 years agoFix a misuse of NULL check
Weiguo Li [Mon, 27 Dec 2021 16:05:54 +0000 (00:05 +0800)]
Fix a misuse of NULL check

Fixes: #17356
CLA: trivial

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

2 years agodocument additional stack push error code
Michael Baentsch [Fri, 24 Dec 2021 07:23:00 +0000 (08:23 +0100)]
document additional stack push error code

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

(cherry picked from commit 0caf2813245f7141b982fcfd9bda402117da115c)

2 years agoimproving tests for adding sigalg with empty digest
Michael Baentsch [Mon, 20 Dec 2021 10:01:00 +0000 (11:01 +0100)]
improving tests for adding sigalg with empty digest

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

2 years agoAdd static check in BN_hex2bn
Kan [Thu, 16 Dec 2021 16:35:32 +0000 (00:35 +0800)]
Add static check in BN_hex2bn

Fixes #17298

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

2 years agoFix Configure variable spill
Alexandros Roussos [Mon, 20 Dec 2021 18:14:57 +0000 (19:14 +0100)]
Fix Configure variable spill

* Evaluating code-refs in Configure can sometimes set the default
variable `$_`
* Prevent spillage influencing the target property by using named
variable in loop

CLA: trivial

Fixes gh-17321

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

2 years agonamemap: handle a NULL return when looking for a non-legacy cipher/MD
Pauli [Mon, 20 Dec 2021 23:17:04 +0000 (10:17 +1100)]
namemap: handle a NULL return when looking for a non-legacy cipher/MD

Fixes #17313

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

2 years agoHTTP client: Fix cleanup of TLS BIO via 'bio_update_fn' callback function
Dr. David von Oheimb [Sun, 21 Nov 2021 19:55:35 +0000 (20:55 +0100)]
HTTP client: Fix cleanup of TLS BIO via 'bio_update_fn' callback function

Make app_http_tls_cb() tidy up on disconnect the SSL BIO it pushes on connect.
Make OSSL_HTTP_close() respect this.

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

2 years agoAdd support for BSD-riscv64 target
Piotr Kubaj [Sat, 18 Dec 2021 14:21:51 +0000 (15:21 +0100)]
Add support for BSD-riscv64 target

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

2 years agoHTTP client: Work around the 'gets' method not being supported by SSL BIOs
Dr. David von Oheimb [Thu, 18 Nov 2021 19:43:06 +0000 (20:43 +0100)]
HTTP client: Work around the 'gets' method not being supported by SSL BIOs

It turned out that loading non-ASN.1 contents using the HTTP client
fails over TLS because SSL BIOs do not support the gets method.

This PR provides a workaround by using the less efficient BIO_get_line() function
in case BIO_gets() returns -2, which means that it is not supported by the BIO.

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

2 years agohttp_test.c: Simplify constant init of 'server_args' struct for gcc-4.8.x
Dr. David von Oheimb [Sat, 18 Dec 2021 15:48:31 +0000 (16:48 +0100)]
http_test.c: Simplify constant init of 'server_args' struct for gcc-4.8.x

Reviewed-by: Ben Kaduk <kaduk@mit.edu>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17308)

2 years agoadd OSSL_STACK_OF_X509_free() for commonly used pattern
Dr. David von Oheimb [Sat, 18 Dec 2021 15:15:49 +0000 (16:15 +0100)]
add OSSL_STACK_OF_X509_free() for commonly used pattern

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

2 years agoFix fixup postrelease scripts to avoid creating errors
Tomas Mraz [Fri, 17 Dec 2021 16:42:33 +0000 (17:42 +0100)]
Fix fixup postrelease scripts to avoid creating errors

Otherwise the NEWS.md and CHANGES.md will contain trailing spaces.

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

(cherry picked from commit 132ab70fd852729e7ce41ac7ef2cb2f9969f8b7e)

2 years agocrypto/dsa.h: fix include guard name
Carlo Teubner [Fri, 17 Dec 2021 10:57:46 +0000 (10:57 +0000)]
crypto/dsa.h: fix include guard name

The current include guard name is a duplicate of the one in dsaerr.h.

Noticed via https://lgtm.com/projects/g/openssl/openssl

CLA: trivial

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

2 years agoFix the null pointer dereference
Kan [Thu, 16 Dec 2021 16:05:24 +0000 (00:05 +0800)]
Fix the null pointer dereference

Fixes #17296

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

2 years agoFix deref after null
ABautkin [Thu, 16 Dec 2021 12:59:14 +0000 (15:59 +0300)]
Fix deref after null

ctx may be NULL at 178 line

CLA: trivial

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

2 years agocmp_ctx.c: Remove redundancy form the defs of many getters and setters
Dr. David von Oheimb [Wed, 15 Dec 2021 07:37:49 +0000 (08:37 +0100)]
cmp_ctx.c: Remove redundancy form the defs of many getters and setters

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

2 years agorsa exp: move declarations before code
Pauli [Thu, 16 Dec 2021 09:12:25 +0000 (20:12 +1100)]
rsa exp: move declarations before code

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

2 years agocontext_init: Fix cleanup in error handling
Tomas Mraz [Thu, 16 Dec 2021 15:06:34 +0000 (16:06 +0100)]
context_init: Fix cleanup in error handling

Also never use OSSL_LIB_CTX_free() on incompletely initialized context.

Fixes #17291

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

2 years agoossl_provider_add_to_store: Avoid use-after-free
Tomas Mraz [Thu, 16 Dec 2021 15:24:44 +0000 (16:24 +0100)]
ossl_provider_add_to_store: Avoid use-after-free

Avoid freeing a provider that was not up-ref-ed before.

Fixes #17292

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

2 years agoX509_STORE_new: memory needs to be freed
Peiwei Hu [Wed, 15 Dec 2021 08:24:21 +0000 (16:24 +0800)]
X509_STORE_new: memory needs to be freed

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

2 years agoget_ecdsa_sig_rs_bytes: free value of d2i_ECDSA_SIG() before return
Peiwei Hu [Wed, 15 Dec 2021 09:46:04 +0000 (17:46 +0800)]
get_ecdsa_sig_rs_bytes: free value of d2i_ECDSA_SIG() before return

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

2 years agotest/cmp_vfy_test.c: free before return
Peiwei Hu [Wed, 15 Dec 2021 09:29:49 +0000 (17:29 +0800)]
test/cmp_vfy_test.c: free before return

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

2 years agoAdd test case to verify that the use after free issue is fixed.
Pauli [Tue, 14 Dec 2021 00:08:00 +0000 (11:08 +1100)]
Add test case to verify that the use after free issue is fixed.

Test case based on reproducer by Guido Vranken.

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

2 years agoevp: address a use after free state when using HMAC and MD copy.
Pauli [Mon, 13 Dec 2021 01:16:18 +0000 (12:16 +1100)]
evp: address a use after free state when using HMAC and MD copy.

Fixes #17261

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

2 years agoEC_POINT_hex2point: forget to free pt
Peiwei Hu [Wed, 15 Dec 2021 06:53:53 +0000 (14:53 +0800)]
EC_POINT_hex2point: forget to free pt

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17276)

2 years agoDocumentation for RNDR and RNDRRS
Orr Toledano [Thu, 20 May 2021 22:13:30 +0000 (22:13 +0000)]
Documentation for RNDR and RNDRRS

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

2 years agoAdd tests for RNDR and combine tests with RDRAND
Orr Toledano [Thu, 6 May 2021 18:46:27 +0000 (18:46 +0000)]
Add tests for RNDR and combine tests with RDRAND

Add test cases for RNDR and RNDRRS. Combine tests for RDRAND and RNDR to
share common logic.

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

2 years agoAdd support for RNDRRS Provider
Orr Toledano [Thu, 6 May 2021 21:32:49 +0000 (21:32 +0000)]
Add support for RNDRRS Provider

Create new provider for RNDRRS. Modify support for rand_cpu to default to
RDRAND/RDSEED on x86 and RNDRRS on aarch64.

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

2 years agoAdd Arm Assembly (aarch64) support for RNG
Orr Toledano [Wed, 19 May 2021 18:54:20 +0000 (18:54 +0000)]
Add Arm Assembly (aarch64) support for RNG

Include aarch64 asm instructions for random number generation using the
RNDR and RNDRRS instructions. Provide detection functions for RNDR and
RNDRRS getauxval.

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

2 years agoAPPS/cmp: Fix logic and doc of mutually exclusive -server/-use_mock_srv/-port/-rspin...
Dr. David von Oheimb [Tue, 7 Dec 2021 18:07:43 +0000 (19:07 +0100)]
APPS/cmp: Fix logic and doc of mutually exclusive -server/-use_mock_srv/-port/-rspin options

Ignore -server with -rspin and exclude all of -use_mock_srv/-port/-rspin.
On the other hand, -server is required if no -use_mock_srv/-port/-rspin is given.
Ignore -tls_used with -use_mock_srv and -rspin; it is not supported with -port.
If -server is not given, ignore -proxy, -no_proxy, and -tls_used.
Also slightly improve the documentation of the two mock server variants.

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

2 years agoNEWS.md: Add missing empty line
Tomas Mraz [Tue, 14 Dec 2021 17:10:44 +0000 (18:10 +0100)]
NEWS.md: Add missing empty line

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

2 years agoAdd some CHANGES entries for 3.0.1
Richard Levitte [Tue, 14 Dec 2021 13:54:55 +0000 (14:54 +0100)]
Add some CHANGES entries for 3.0.1

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

2 years agoAdd some CHANGES.md entries for the 3.0.1 release
Tomas Mraz [Mon, 13 Dec 2021 14:27:20 +0000 (15:27 +0100)]
Add some CHANGES.md entries for the 3.0.1 release

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

2 years agoAdd a test case for the name constraints bug
Matt Caswell [Fri, 3 Dec 2021 15:28:31 +0000 (15:28 +0000)]
Add a test case for the name constraints bug

Where a chain has name constraints but a certificate does not have a SAN
extension but the CN meets the constraints, then this should be acceptable.
However, and OpenSSL bug meant that an internal error was being reported.
This adds a test case for that scenario.

Test for CVE-2021-4044

Reviewed-by: Tomas Mraz <tomas@openssl.org>
2 years agoAdd a TLS test for name constraints with an EE cert without a SAN
Matt Caswell [Fri, 3 Dec 2021 15:18:27 +0000 (15:18 +0000)]
Add a TLS test for name constraints with an EE cert without a SAN

It is valid for name constraints to be in force but for there to be no
SAN extension in a certificate. Previous versions of OpenSSL mishandled
this.

Test for CVE-2021-4044

Reviewed-by: Tomas Mraz <tomas@openssl.org>
2 years agoAdd a new Name Constraints test cert
Matt Caswell [Thu, 2 Dec 2021 17:26:15 +0000 (17:26 +0000)]
Add a new Name Constraints test cert

Add a cert which complies with the name constraints but has no
SAN extension

Reviewed-by: Tomas Mraz <tomas@openssl.org>
2 years agoFix infinite verification loops due to has_san_id
Tobias Nießen [Mon, 29 Nov 2021 03:41:20 +0000 (03:41 +0000)]
Fix infinite verification loops due to has_san_id

Where name constraints apply, X509_verify() would incorrectly report an
internal error in the event that a certificate has no SAN extension.

CVE-2021-4044

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
2 years agoFix invalid handling of verify errors in libssl
Matt Caswell [Fri, 3 Dec 2021 15:56:58 +0000 (15:56 +0000)]
Fix invalid handling of verify errors in libssl

In the event that X509_verify() returned an internal error result then
libssl would mishandle this and set rwstate to SSL_RETRY_VERIFY. This
subsequently causes SSL_get_error() to return SSL_ERROR_WANT_RETRY_VERIFY.
That return code is supposed to only ever be returned if an application
is using an app verify callback to complete replace the use of
X509_verify(). Applications may not be written to expect that return code
and could therefore crash (or misbehave in some other way) as a result.

CVE-2021-4044

Reviewed-by: Tomas Mraz <tomas@openssl.org>
2 years agoUpdate CHANGES and NEWS for new release
Matt Caswell [Tue, 14 Dec 2021 13:15:58 +0000 (13:15 +0000)]
Update CHANGES and NEWS for new release

Reviewed-by: Richard Levitte <levitte@openssl.org>
2 years agoFix VMS installation - Document in CHANGES.md
Richard Levitte [Mon, 13 Dec 2021 07:44:54 +0000 (08:44 +0100)]
Fix VMS installation - Document in CHANGES.md

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

(cherry picked from commit 2daa2a0d00c39e9ff1d79d296c3d48b3db1e72ce)

2 years agoFix VMS installation - Override the openssl logical name in descrip.mms.tmpl
Richard Levitte [Fri, 10 Dec 2021 15:56:39 +0000 (16:56 +0100)]
Fix VMS installation - Override the openssl logical name in descrip.mms.tmpl

This was part of 0cbb6f6a9ac5aa3ff813ef2e5afe6e443708ee20, but was
incomplete in that commit.

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

(cherry picked from commit 71a78784e8f000703267276b2f87d055bfa0e00e)

2 years agoFix VMS installation - Check the presence of providers in the IVP script
Richard Levitte [Fri, 15 Oct 2021 10:40:49 +0000 (12:40 +0200)]
Fix VMS installation - Check the presence of providers in the IVP script

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

(cherry picked from commit fe27680fc6395f661f3949e9e1ef0a83e499e87b)

2 years agoFix VMS installation - deassign the same logical names that were defined
Richard Levitte [Fri, 15 Oct 2021 10:37:56 +0000 (12:37 +0200)]
Fix VMS installation - deassign the same logical names that were defined

The logical name for the engines directory is named one way in
VMS/openssl_startup.com.in, but a different name was deassigned in
VMS/openssl_shutdown.com.in.

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

(cherry picked from commit 73e47e39a52d8e1c7515e140b8613304b8abe7ac)

2 years agoFix VMS installation - use platform->shlib_version_as_filename() consistently
Richard Levitte [Fri, 15 Oct 2021 10:36:15 +0000 (12:36 +0200)]
Fix VMS installation - use platform->shlib_version_as_filename() consistently

It's used in Configurations/descrip.mms.tmpl, but was forgotten in the
VMS installation scripts.

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

(cherry picked from commit 883008b21ba076b7d87aa8bec1419e8036539a3e)

2 years agoFix VMS installation - Define the logical name OSSL$MODULES
Richard Levitte [Fri, 15 Oct 2021 10:32:43 +0000 (12:32 +0200)]
Fix VMS installation - Define the logical name OSSL$MODULES

Also, the modules installation directory is version agnostic on other
platforms, there's no real reason why it shouldn't be on VMS.

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

(cherry picked from commit a4f1e23e6cffdf2ef1aadf96572c251e07869787)

2 years agoFix VMS installation - $config{pointer_size} -> $target{pointer_size}
Richard Levitte [Fri, 15 Oct 2021 10:27:50 +0000 (12:27 +0200)]
Fix VMS installation - $config{pointer_size} -> $target{pointer_size}

Configurations/descrip.mms.tmpl uses $target{pointer_size}, not
$config{pointer_size}, so the same should be used in installation
scripts, for consistency.

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

(cherry picked from commit e30545e9bd84e3ace70fb1e1c5ad6d824545fe36)

2 years agoFix VMS installation - consistent program names with version info
Richard Levitte [Fri, 15 Oct 2021 10:22:04 +0000 (12:22 +0200)]
Fix VMS installation - consistent program names with version info

The program name version info is supposed to be the major release
version number.  This was forgotten when the versioning scheme was
changed for 3.0, so the minor release version number slipped in as
well.

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

(cherry picked from commit 3c9293b4715229dc7ea2116d22c623c2a92ac69a)

2 years agoRemove some unnecessary undefs in bn_asm.c
Bernd Edlinger [Sat, 11 Dec 2021 20:25:23 +0000 (21:25 +0100)]
Remove some unnecessary undefs in bn_asm.c

This is likely the leftover of a previous hack,
and thus should be removed now.

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

2 years agoFix a carry overflow bug in bn_sqr_comba4/8 for mips 32-bit targets
Bernd Edlinger [Sat, 11 Dec 2021 19:28:11 +0000 (20:28 +0100)]
Fix a carry overflow bug in bn_sqr_comba4/8 for mips 32-bit targets

bn_sqr_comba8 does for instance compute a wrong result for the value:
a=0x4aaac919 62056c84 fba7334e 1a6be678 022181ba fd3aa878 899b2346 ee210f45

The correct result is:
r=0x15c72e32 605a3061 d11b1012 3c187483 6df96999 bd0c22ba d3e7d437 4724a82f
    912c5e61 6a187efe 8f7c47fc f6945fe5 75be8e3d 97ed17d4 7950b465 3cb32899

but the actual result was:
r=0x15c72e32 605a3061 d11b1012 3c187483 6df96999 bd0c22ba d3e7d437 4724a82f
    912c5e61 6a187efe 8f7c47fc f6945fe5 75be8e3c 97ed17d4 7950b465 3cb32899

so the forth word of the result was 0x75be8e3c but should have been
0x75be8e3d instead.

Likewise bn_sqr_comba4 has an identical bug for the same value as well:
a=0x022181ba fd3aa878 899b2346 ee210f45

correct result:
r=0x00048a69 9fe82f8b 62bd2ed1 88781335 75be8e3d 97ed17d4 7950b465 3cb32899

wrong result:
r=0x00048a69 9fe82f8b 62bd2ed1 88781335 75be8e3c 97ed17d4 7950b465 3cb32899

Fortunately the bn_mul_comba4/8 code paths are not affected.

Also the mips64 target does in fact not handle the carry propagation
correctly.

Example:
a=0x4aaac91900000000 62056c8400000000 fba7334e00000000 1a6be67800000000
    022181ba00000000 fd3aa87800000000 899b234635dad283 ee210f4500000001

correct result:
r=0x15c72e32272c4471 392debf018c679c8 b85496496bf8254c d0204f36611e2be1
    0cdb3db8f3c081d8 c94ba0e1bacc5061 191b83d47ff929f6 5be0aebfc13ae68d
    3eea7a7fdf2f5758 42f7ec656cab3cb5 6a28095be34756f2 64f24687bf37de06
    2822309cd1d292f9 6fa698c972372f09 771e97d3a868cda0 dc421e8a00000001

wrong result:
r=0x15c72e32272c4471 392debf018c679c8 b85496496bf8254c d0204f36611e2be1
    0cdb3db8f3c081d8 c94ba0e1bacc5061 191b83d47ff929f6 5be0aebfc13ae68d
    3eea7a7fdf2f5758 42f7ec656cab3cb5 6a28095be34756f2 64f24687bf37de06
    2822309cd1d292f8 6fa698c972372f09 771e97d3a868cda0 dc421e8a00000001

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

2 years agoOSSL_HTTP_proxy_connect(): Fix glitch in response HTTP header parsing
Dr. David von Oheimb [Sun, 21 Nov 2021 10:51:09 +0000 (11:51 +0100)]
OSSL_HTTP_proxy_connect(): Fix glitch in response HTTP header parsing

Fixes #17247

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

2 years agobn2binpad: Use memset as the buffer will be used later
Tomas Mraz [Wed, 8 Dec 2021 17:26:03 +0000 (18:26 +0100)]
bn2binpad: Use memset as the buffer will be used later

Apparently using OPENSSL_cleanse() confuses the fuzzer so it
makes the buffer to appear uninitialized. And memset can be
safely used here and it is also potentially faster.

Fixes #17237

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

2 years agoAPPS/cmp: Simplify read_write_req_resp() - 'req' arg must not be NULL anyway
Dr. David von Oheimb [Tue, 7 Dec 2021 17:02:19 +0000 (18:02 +0100)]
APPS/cmp: Simplify read_write_req_resp() - 'req' arg must not be NULL anyway

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

2 years agoossl_cmp_msg_check_update(): align recipNone check with improved transactionID check
Dr. David von Oheimb [Thu, 9 Dec 2021 19:52:59 +0000 (20:52 +0100)]
ossl_cmp_msg_check_update(): align recipNone check with improved transactionID check

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

2 years agoCMP test_commands.csv: improve test for -reqin, adding -reqin_new_tid
Dr. David von Oheimb [Thu, 9 Dec 2021 19:28:08 +0000 (20:28 +0100)]
CMP test_commands.csv: improve test for -reqin, adding -reqin_new_tid

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

2 years agoCMP test_verification.csv: add missing test case for -untrusted with non-matching...
Dr. David von Oheimb [Thu, 9 Dec 2021 19:25:19 +0000 (20:25 +0100)]
CMP test_verification.csv: add missing test case for -untrusted with non-matching cert

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

2 years agoCMP test_enrollment.csv: clean up test cases regarding (non-existing) directories
Dr. David von Oheimb [Thu, 9 Dec 2021 11:40:08 +0000 (12:40 +0100)]
CMP test_enrollment.csv: clean up test cases regarding (non-existing) directories

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

2 years agotest/evp_extra_test.c: Add EVP_PKEY comparisons in test_EC_priv_pub()
Richard Levitte [Fri, 10 Dec 2021 12:18:42 +0000 (13:18 +0100)]
test/evp_extra_test.c: Add EVP_PKEY comparisons in test_EC_priv_pub()

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

2 years agotest/evp_extra_test.c: Refactor test_fromdata()
Richard Levitte [Fri, 10 Dec 2021 12:15:10 +0000 (13:15 +0100)]
test/evp_extra_test.c: Refactor test_fromdata()

test_fromdata() turns out to be a bit inflexible, so we split it into
two functions, make_key_fromdata() and test_selection(), and adjust
test_EVP_PKEY_ffc_priv_pub() and test_EC_priv_pub() accordingly.  This
allows us to check the resulting keys further, not only to check that
the bits we expect are there, but also that the bits that we expect
not to be there to actually not be there!

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

2 years agoEnhance the explanation of selector bits in provider-keymgmt(7)
Richard Levitte [Wed, 29 Sep 2021 11:45:55 +0000 (13:45 +0200)]
Enhance the explanation of selector bits in provider-keymgmt(7)

This uncovers what has been a mere comment in an attempt to clarify
that the use of selector bits is very much at the discretion of the
provider implementation.

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

2 years agoAdapt our OSSL_FUNC_keymgmt_match() implementations to the EVP_PKEY_eq() fix
Richard Levitte [Wed, 29 Sep 2021 09:05:41 +0000 (11:05 +0200)]
Adapt our OSSL_FUNC_keymgmt_match() implementations to the EVP_PKEY_eq() fix

The match function (called OSSL_FUNC_keymgmt_match() in our documentation)
in our KEYMGMT implementations were interpretting the selector bits a
bit too strictly, so they get a bit relaxed to make it reasonable to
match diverse key contents.

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

2 years agoFix EVP_PKEY_eq() to be possible to use with strictly private keys
Richard Levitte [Wed, 29 Sep 2021 08:58:21 +0000 (10:58 +0200)]
Fix EVP_PKEY_eq() to be possible to use with strictly private keys

EVP_PKEY_eq() assumed that an EVP_PKEY always has the public key
component if it has a private key component.  However, this assumption
no longer strictly holds true, at least for provider backed keys.
EVP_PKEY_eq() therefore needs to be modified to specify that the
private key should be checked too (at the discretion of what's
reasonable for the implementation doing the actual comparison).

Fixes #16267

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

2 years agoFix Coverity 1494385 logically dead code.
Pauli [Wed, 24 Nov 2021 01:38:51 +0000 (11:38 +1000)]
Fix Coverity 1494385 logically dead code.

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/17123)

2 years agoFix faulty detail in BN_rand() manual
Richard Levitte [Thu, 25 Nov 2021 07:58:21 +0000 (08:58 +0100)]
Fix faulty detail in BN_rand() manual

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

2 years agoTeach OpenSSL::ParseC about OPENSSL_EXPORT and OPENSSL_EXTERN
Richard Levitte [Mon, 6 Dec 2021 20:06:06 +0000 (21:06 +0100)]
Teach OpenSSL::ParseC about OPENSSL_EXPORT and OPENSSL_EXTERN

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

2 years agoMake OSSL_provider_init() OPENSSL_EXPORT, not just extern
Richard Levitte [Mon, 6 Dec 2021 19:54:17 +0000 (20:54 +0100)]
Make OSSL_provider_init() OPENSSL_EXPORT, not just extern

On non-Windows systems, there's no difference at all.  On Windows systems,
__declspec(dllexport) is added, which ensures it gets exported no matter
what.

Fixes #17203

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

2 years agoapps/s_server: Correct s_server to return the correct file path
Tianjia Zhang [Wed, 8 Dec 2021 07:53:49 +0000 (15:53 +0800)]
apps/s_server: Correct s_server to return the correct file path

When s_server responds to a file data with the -WWW parameter, it
always gets a path named "GET". In this case, we need to skip the
"GET /" character to get the correct file path.

Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17231)

2 years agoWindows CI: explicitly use windows-2019 instead of using windows-latest
Tomas Mraz [Wed, 8 Dec 2021 11:54:52 +0000 (12:54 +0100)]
Windows CI: explicitly use windows-2019 instead of using windows-latest

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

2 years agoremove redundant ERR_raise
x2018 [Wed, 1 Dec 2021 08:15:44 +0000 (16:15 +0800)]
remove redundant ERR_raise

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

2 years agocheck the return value of BIO_new() in t_x509.c:471 & cmp_vfy.c:36
x2018 [Wed, 1 Dec 2021 06:29:58 +0000 (14:29 +0800)]
check the return value of BIO_new() in t_x509.c:471 & cmp_vfy.c:36

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

2 years agochanges opensssl typos to openssl
Sam Eaton [Fri, 3 Dec 2021 22:47:26 +0000 (14:47 -0800)]
changes opensssl typos to openssl

CLA: trivial

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

2 years agofix Coverity 1494649: dead code
Pauli [Wed, 8 Dec 2021 01:16:42 +0000 (12:16 +1100)]
fix Coverity 1494649: dead code

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

2 years agoAPPS/cmp: Fix use of OPENSSL_NO_SOCK: options like -server do not make sense with...
Dr. David von Oheimb [Tue, 7 Dec 2021 06:32:12 +0000 (07:32 +0100)]
APPS/cmp: Fix use of OPENSSL_NO_SOCK: options like -server do not make sense with no-sock

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

2 years agoMinor code cleanup in o_names_init
Bernd Edlinger [Wed, 8 Dec 2021 13:14:48 +0000 (14:14 +0100)]
Minor code cleanup in o_names_init

This might result in a small memory leak.

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

2 years agoOSSL_HTTP_get(): Fix timeout handling on redirection
Dr. David von Oheimb [Mon, 29 Nov 2021 09:07:08 +0000 (10:07 +0100)]
OSSL_HTTP_get(): Fix timeout handling on redirection

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

2 years agoCMP check_msg_find_cert(): improve diagnostics on transactionID mismatch
Dr. David von Oheimb [Tue, 7 Dec 2021 12:11:27 +0000 (13:11 +0100)]
CMP check_msg_find_cert(): improve diagnostics on transactionID mismatch

On this occasion, make use of i2s_ASN1_OCTET_STRING() wherever possible

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

2 years ago80-test_cmp_http_data/test_commands.csv: fix minor glitch in column alignment
Dr. David von Oheimb [Tue, 7 Dec 2021 11:41:13 +0000 (12:41 +0100)]
80-test_cmp_http_data/test_commands.csv: fix minor glitch in column alignment

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

2 years agoAPPS/cmp: fix -rspin option such that it works again without -reqin
Dr. David von Oheimb [Tue, 7 Dec 2021 10:35:42 +0000 (11:35 +0100)]
APPS/cmp: fix -rspin option such that it works again without -reqin

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

2 years agoOSSL_CMP_MSG_read(): Fix mem leak on file read error
Dr. David von Oheimb [Tue, 7 Dec 2021 16:49:05 +0000 (17:49 +0100)]
OSSL_CMP_MSG_read(): Fix mem leak on file read error

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

2 years agoAdd support for BSD-ppc, BSD-ppc64 and BSD-ppc64le configurations
pkubaj [Sat, 20 Nov 2021 20:40:06 +0000 (20:40 +0000)]
Add support for BSD-ppc, BSD-ppc64 and BSD-ppc64le configurations

OpenSSL assumes AT_HWCAP = 16 (as on Linux), but on FreeBSD AT_HWCAP = 25
Switch to using AT_HWCAP, and setting it to 16 if it is not defined.

CLA: trivial

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

2 years agorename MIN() macro
Gerd Hoffmann [Tue, 7 Dec 2021 09:22:38 +0000 (10:22 +0100)]
rename MIN() macro

MIN is a rather generic name and results in a name clash when trying to
port tianocore over to openssl 3.0.  Use the usual ossl prefix and
rename the macro to ossl_min() to solve this.

CLA: trivial

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17219)

2 years agobio_enc.c: add memory allocation check
Peiwei Hu [Mon, 6 Dec 2021 09:33:42 +0000 (17:33 +0800)]
bio_enc.c: add memory allocation check

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

2 years agoFix Markdown links in SUPPORT.md
Alex Pawelko [Sat, 4 Dec 2021 05:41:10 +0000 (00:41 -0500)]
Fix Markdown links in SUPPORT.md

Add link to CONTRIBUTING and fix (presumably broken?) link to Github issues

CLA: trivial

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

2 years agoAPPS: Improve diagnostics on missing/extra args and unknown cipher/digest
Dr. David von Oheimb [Fri, 27 Aug 2021 13:33:18 +0000 (15:33 +0200)]
APPS: Improve diagnostics on missing/extra args and unknown cipher/digest

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

2 years agoFix documentation for tlsext_ticket_key
Matt Caswell [Mon, 6 Dec 2021 11:37:26 +0000 (11:37 +0000)]
Fix documentation for tlsext_ticket_key

The tlsext_ticket_key functions are documented as returning 0 on success.
In fact they return 1 on success.

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

2 years agoX509V3_set_ctx(): Clarify subject/req parameter for constructing SAN email addresses...
Dr. David von Oheimb [Wed, 10 Nov 2021 08:39:55 +0000 (09:39 +0100)]
X509V3_set_ctx(): Clarify subject/req parameter for constructing SAN email addresses from subject DN

Also slightly improve the style of the respective code in crypto/x509/v3_san.c.

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

2 years agoX509V3_set_ctx(): Clarify use of subject/req parameter for constructing SKID by hash...
Dr. David von Oheimb [Wed, 10 Nov 2021 08:31:11 +0000 (09:31 +0100)]
X509V3_set_ctx(): Clarify use of subject/req parameter for constructing SKID by hash of pubkey

This does not change the semantics of expected usage because only either one may be given.

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

2 years agoDon't free the EVP_PKEY on error in set0_tmp_dh_pkey() functions
Matt Caswell [Mon, 6 Dec 2021 11:13:02 +0000 (11:13 +0000)]
Don't free the EVP_PKEY on error in set0_tmp_dh_pkey() functions

We should not be freeing the caller's key in the event of error.

Fixes #17196

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

2 years agoOSSL_HTTP_open(): clarify doc of 'server' arg and its use of BIO_new_connect()
Dr. David von Oheimb [Fri, 3 Dec 2021 10:34:23 +0000 (11:34 +0100)]
OSSL_HTTP_open(): clarify doc of 'server' arg and its use of BIO_new_connect()

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

2 years agoOSSL_HTTP_open(): Complete documentation of checks for server and proxy args
Dr. David von Oheimb [Wed, 1 Dec 2021 07:01:31 +0000 (08:01 +0100)]
OSSL_HTTP_open(): Complete documentation of checks for server and proxy args

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

2 years agoOSSL_HTTP_set1_request(): Fix check for presence of port option and its documentation
Dr. David von Oheimb [Tue, 30 Nov 2021 19:06:09 +0000 (20:06 +0100)]
OSSL_HTTP_set1_request(): Fix check for presence of port option and its documentation

For HTTP (not HTTPS) with proxy, server must be given, port is optional

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

2 years agoOBJ_obj2txt(): fix off-by-one documentation of the result
Dr. David von Oheimb [Fri, 3 Dec 2021 12:40:20 +0000 (13:40 +0100)]
OBJ_obj2txt(): fix off-by-one documentation of the result

Also remove the outdated BUGS section and fix the coding style of the function.

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

2 years agoDon't run the symbol presence test on windows
Matt Caswell [Tue, 23 Nov 2021 15:22:27 +0000 (15:22 +0000)]
Don't run the symbol presence test on windows

Fixes #17109

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

2 years agotest_rsa: Test for PVK format conversion
Tomas Mraz [Thu, 2 Dec 2021 21:08:25 +0000 (22:08 +0100)]
test_rsa: Test for PVK format conversion

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

2 years agokey_to_type_specific_pem_bio_cb: Use passphrase callback from the arguments
Tomas Mraz [Thu, 2 Dec 2021 21:07:38 +0000 (22:07 +0100)]
key_to_type_specific_pem_bio_cb: Use passphrase callback from the arguments

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

2 years agoPVK decoder: prompt for PVK passphrase and not PEM
Tomas Mraz [Thu, 2 Dec 2021 21:06:36 +0000 (22:06 +0100)]
PVK decoder: prompt for PVK passphrase and not PEM

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

2 years agoFix pvk encoder to properly query for the passphrase
Tomas Mraz [Thu, 2 Dec 2021 21:04:21 +0000 (22:04 +0100)]
Fix pvk encoder to properly query for the passphrase

The passphrase callback data was not properly initialized.

Fixes #17054

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