oweals/openssl.git
4 years agoAdd FFC param/key validation
Shane Lontis [Sun, 16 Feb 2020 03:03:46 +0000 (13:03 +1000)]
Add FFC param/key validation

Embed libctx in dsa and dh objects and cleanup internal methods to not pass libctx (This makes it consistent with the rsa changes)

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

4 years agox86_64: Add endbranch at function entries for Intel CET
H.J. Lu [Fri, 31 Jan 2020 12:17:26 +0000 (04:17 -0800)]
x86_64: Add endbranch at function entries for Intel CET

To support Intel CET, all indirect branch targets must start with
endbranch.  Here is a patch to add endbranch to function entries
in x86_64 assembly codes which are indirect branch targets as
discovered by running openssl testsuite on Intel CET machine and
visual inspection.

Verified with

$ CC="gcc -Wl,-z,cet-report=error" ./Configure shared linux-x86_64 -fcf-protection
$ make
$ make test

and

$ CC="gcc -mx32 -Wl,-z,cet-report=error" ./Configure shared linux-x32 -fcf-protection
$ make
$ make test # <<< passed with https://github.com/openssl/openssl/pull/10988

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10982)

4 years agoinclude/openssl/whrlpool.h: correct unbalanced deprecation guards
Richard Levitte [Thu, 13 Feb 2020 11:50:32 +0000 (12:50 +0100)]
include/openssl/whrlpool.h: correct unbalanced deprecation guards

Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/11087)

4 years agoDOC: document in more detail what a BIO_read_ex() via BIO_f_buffer() does
Richard Levitte [Sun, 19 Jan 2020 02:19:31 +0000 (03:19 +0100)]
DOC: document in more detail what a BIO_read_ex() via BIO_f_buffer() does

The BIO_f_buffer() documentation tells in enough detail how it affects
BIO_gets(), but not how it affects BIO_read_ex().  This change
remedies that.

Fixes #10859

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

4 years agoDocument OSSL_SERIALIZER_PUBKEY_TO_DER_PQ and friends
Richard Levitte [Wed, 12 Feb 2020 12:05:09 +0000 (13:05 +0100)]
Document OSSL_SERIALIZER_PUBKEY_TO_DER_PQ and friends

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

4 years agoPROV: Build the main FIPS module code with FIPS_MODE defined
Richard Levitte [Thu, 13 Feb 2020 17:17:43 +0000 (18:17 +0100)]
PROV: Build the main FIPS module code with FIPS_MODE defined

Without that, its main source wasn't compiled correctly.

Fixes #11089

Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/11090)

4 years agoapps x509: passing PKCS#11 URL as -signkey
Bastian Germann [Thu, 13 Feb 2020 10:58:27 +0000 (11:58 +0100)]
apps x509: passing PKCS#11 URL as -signkey

OpenSSL 1.1.0 has extended option checking, and rejects passing a PKCS#11
engine URL to "-signkey" option. The actual code is ready to take it.

Change the option parsing to allow an engine URL to be passed and modify
the manpage accordingly.

CLA: trivial

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

4 years agoMake secure-memory be a config option
Rich Salz [Wed, 5 Feb 2020 19:28:37 +0000 (14:28 -0500)]
Make secure-memory be a config option

Adding support for "no-secure-memory" was simple, a one-liner.
Fixing all the "ifdef OPENSSL_SECURE_MEMORY" to be "ifndef NO_xxx"
was a bit more work.  My original goof, for not following the OpenSSL
pattern "ifndef NO_" used everywhere else.

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

4 years agoAdapt i2d_PUBKEY for provider only keys
Richard Levitte [Wed, 12 Feb 2020 17:58:15 +0000 (18:58 +0100)]
Adapt i2d_PUBKEY for provider only keys

It uses EVP_PKEY serializers to get the desired results.

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

4 years agoAdapt i2d_PrivateKey for provider only keys
Richard Levitte [Tue, 11 Feb 2020 05:29:08 +0000 (06:29 +0100)]
Adapt i2d_PrivateKey for provider only keys

It uses EVP_PKEY serializers to get the desired results.

One might think that ddoing this might make things a bit dicy for
existing serializers, as they should obviously use i2d functions.
However, since our serializers use much more primitive functions
such as i2d_ASN1_INTEGER(), or keytype specific ones such as
i2d_RSAPrivateKey(), there is no clash.

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

4 years agoForgotten GOST2012 support in non-vital places
Nikolay Morozov [Wed, 12 Feb 2020 12:20:41 +0000 (15:20 +0300)]
Forgotten GOST2012 support in non-vital places

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/11072)

4 years agodsatest: fix the non-deprecated version of the test run.
Pauli [Wed, 12 Feb 2020 22:02:08 +0000 (08:02 +1000)]
dsatest: fix the non-deprecated version of the test run.

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

4 years agoApps: don't build deprecated DH and DSA apps.
Pauli [Wed, 12 Feb 2020 10:05:29 +0000 (20:05 +1000)]
Apps: don't build deprecated DH and DSA apps.

This also means that there doesn't need to be any conditional checks in the .c
files to avoid deprecated builds.

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

4 years agoFix coverity issues
Shane Lontis [Mon, 10 Feb 2020 01:45:27 +0000 (11:45 +1000)]
Fix coverity issues

CID : 1458169 RESOURCE LEAK ffc_params_generate.c - False positive, but addressed another Leak in adjacent code
CID : 1458171 UNCHECKED RET apps/pkeyutl.c
CID : 1458173 DEAD CODE ffc_params_generate.c
CID : 1458174 RESOURCE LEAK ssl_lib.c

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

4 years agox86_64: Always generate .note.gnu.property section for ELF outputs
H.J. Lu [Fri, 31 Jan 2020 17:13:27 +0000 (09:13 -0800)]
x86_64: Always generate .note.gnu.property section for ELF outputs

We should always generate .note.gnu.property section in x86_64 assembly
codes for ELF outputs to mark Intel CET support since all input files
must be marked with Intel CET support in order for linker to mark output
with Intel CET support.  Also .note.gnu.property section in x32 should
be aligned to 4 bytes, not 8 bytes and .p2align should be used
consistently.

Verified with

$ CC="gcc -Wl,-z,cet-report=error" ./Configure shared linux-x86_64 -fcf-protection
$ make
$ make test

and

$ CC="gcc -mx32 -Wl,-z,cet-report=error" ./Configure shared linux-x32 -fcf-protection
$ make
$ make test # <<< 90-test_sslapi.t failed because 8-byte pointer size.

Fix #10896

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/10985)

4 years agoFix a mem leak in libssl
Matt Caswell [Wed, 12 Feb 2020 11:55:30 +0000 (11:55 +0000)]
Fix a mem leak in libssl

Make sure we free up any ENGINE references after we have finished using
them.

Fixes #11064

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

4 years agoAdd Asymmetric RSA cipher tests in FIPS provider
Matt Caswell [Fri, 17 Jan 2020 15:54:09 +0000 (15:54 +0000)]
Add Asymmetric RSA cipher tests in FIPS provider

We also add some DSA tests for code that is already in the FIPS provider.

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

4 years agoMake the RSA ASYM_CIPHER implementation available inside the FIPS module
Matt Caswell [Fri, 17 Jan 2020 14:47:18 +0000 (14:47 +0000)]
Make the RSA ASYM_CIPHER implementation available inside the FIPS module

RSA ASYM_CIPHER was already available within the default provider. We
now make it also available from inside the FIPS module.

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

4 years agoAdd assembly config targets for UEFI build
Christopher J Zurcher [Thu, 6 Feb 2020 02:56:53 +0000 (18:56 -0800)]
Add assembly config targets for UEFI build

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

4 years agoFix no-ec build
Matt Caswell [Wed, 12 Feb 2020 09:19:41 +0000 (09:19 +0000)]
Fix no-ec build

Don't attempt to build ecx related source files in a "no-ec" build.

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

4 years agoAdd OSSL_SERIALIZER_PUBKEY_TO_DER_PQ and friends
Richard Levitte [Tue, 11 Feb 2020 05:23:58 +0000 (06:23 +0100)]
Add OSSL_SERIALIZER_PUBKEY_TO_DER_PQ and friends

It's already used internally, there's no reason the DER serializer
propqueries shouldn't be present alongside the PEM and TEXT ones.

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

4 years agofix build for new HTTP client in case OPENSSL_NO_CMP or OPENSSL_NO_OCSP
Dr. David von Oheimb [Tue, 11 Feb 2020 15:07:00 +0000 (16:07 +0100)]
fix build for new HTTP client in case OPENSSL_NO_CMP or OPENSSL_NO_OCSP

fix also formatting nits w.r.t. #if indentations in ocsp.h

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/11058)

4 years agoRemove unused ossl_param_bld_to_param_ex() function.
Pauli [Mon, 10 Feb 2020 23:19:19 +0000 (09:19 +1000)]
Remove unused ossl_param_bld_to_param_ex() function.

The recently introduced ossl_param_bld_to_param_ex() function is only
called by the unit tests.

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

4 years agoRemove unused OSSL_PARAM_construct_from_text() function.
Pauli [Mon, 10 Feb 2020 23:13:33 +0000 (09:13 +1000)]
Remove unused OSSL_PARAM_construct_from_text() function.

This function is recently introduced and never called by the library or tests.

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

4 years agoAdd NEWS entry about deprecation of command line public tools
Pauli [Mon, 10 Feb 2020 00:23:57 +0000 (10:23 +1000)]
Add NEWS entry about deprecation of command line public tools

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

4 years agodsa: deprecate applications that depend on the low level DSA functions.
Pauli [Thu, 6 Feb 2020 22:09:53 +0000 (08:09 +1000)]
dsa: deprecate applications that depend on the low level DSA functions.

speed is updated to not support DSA instead of being removed.

The dhparam, dsaparam, dsa and gendsa commands are deprecated but still
exist without NO_DEPRECATED defined.

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

4 years agoapp: add a deprecation warning to all deprecated commands.
Pauli [Wed, 5 Feb 2020 01:27:23 +0000 (11:27 +1000)]
app: add a deprecation warning to all deprecated commands.

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

4 years agotest/recipes/80-test_ssl_old.t: Replace 'openssl gendsa'
Richard Levitte [Thu, 6 Feb 2020 11:12:49 +0000 (12:12 +0100)]
test/recipes/80-test_ssl_old.t: Replace 'openssl gendsa'

Use 'openssl genpkey' instead.

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

4 years agotest_dsa: fix deprecation logic
Pauli [Thu, 6 Feb 2020 23:00:15 +0000 (09:00 +1000)]
test_dsa: fix deprecation logic

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

4 years agotest/recipes/15-test_dsa.t: Deal with deprecation of 'openssl dsa'
Richard Levitte [Thu, 6 Feb 2020 11:10:23 +0000 (12:10 +0100)]
test/recipes/15-test_dsa.t: Deal with deprecation of 'openssl dsa'

Do not run programs that depend on deprecated APIs when
'no-deprecated' is configured.

We still retain the conversion tests that use 'openssl pkey', and add
the one that's missing.

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

4 years agoDeprecate the low level DSA functions.
Pauli [Wed, 29 Jan 2020 21:23:39 +0000 (07:23 +1000)]
Deprecate the low level DSA functions.

Use of the low level DSA functions has been informally discouraged for a
long time. We now formally deprecate them.

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

4 years agodsa.h: fix preprocessor indentation
Pauli [Wed, 29 Jan 2020 04:40:43 +0000 (14:40 +1000)]
dsa.h: fix preprocessor indentation

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

4 years agoDSA: fix the DSA parameter logic in test.
Pauli [Mon, 3 Feb 2020 01:41:31 +0000 (11:41 +1000)]
DSA: fix the DSA parameter logic in test.

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

4 years agoAdd S390 support for provider based X25519/X448
Matt Caswell [Tue, 4 Feb 2020 16:41:19 +0000 (16:41 +0000)]
Add S390 support for provider based X25519/X448

Reviewed-by: Patrick Steuer <patrick.steuer@de.ibm.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/10964)

4 years agoAdd X25519/X448 Key Exchange to the default provider
Matt Caswell [Fri, 24 Jan 2020 17:13:40 +0000 (17:13 +0000)]
Add X25519/X448 Key Exchange to the default provider

Reviewed-by: Patrick Steuer <patrick.steuer@de.ibm.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/10964)

4 years agoImplement Provider side Key Management for X25519 and X448
Matt Caswell [Mon, 27 Jan 2020 16:57:03 +0000 (16:57 +0000)]
Implement Provider side Key Management for X25519 and X448

Reviewed-by: Patrick Steuer <patrick.steuer@de.ibm.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/10964)

4 years agoImplement a stricter ECX_KEY type
Matt Caswell [Mon, 27 Jan 2020 16:50:47 +0000 (16:50 +0000)]
Implement a stricter ECX_KEY type

Add ref counting and control how we allocate storage for the private key.
We will need this type in following commits where we move the ecx code
to be provider aware.

Reviewed-by: Patrick Steuer <patrick.steuer@de.ibm.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/10964)

4 years agoCheck that ed25519 and ed448 are allowed by the security level
Kurt Roeckx [Sun, 9 Feb 2020 18:28:15 +0000 (19:28 +0100)]
Check that ed25519 and ed448 are allowed by the security level

Signature algorithms not using an MD weren't checked that they're
allowed by the security level.

Reviewed-by: Matt Caswell <matt@openssl.org>
GH: #10785

4 years agoGenerate new Ed488 certificates
Kurt Roeckx [Thu, 2 Jan 2020 22:16:30 +0000 (23:16 +0100)]
Generate new Ed488 certificates

Create a whole chain of Ed488 certificates so that we can use it at security
level 4 (192 bit). We had an 2048 bit RSA (112 bit, level 2) root sign the
Ed488 certificate using SHA256 (128 bit, level 3).

Reviewed-by: Matt Caswell <matt@openssl.org>
GH: #10785

4 years agoAdd a minimal build target for Travis and Appveyor
Bernd Edlinger [Fri, 13 Sep 2019 07:24:53 +0000 (09:24 +0200)]
Add a minimal build target for Travis and Appveyor

[extended tests]

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

4 years agoX509_PUBKEY_set(): Fix memory leak
Richard Levitte [Fri, 7 Feb 2020 08:13:21 +0000 (09:13 +0100)]
X509_PUBKEY_set(): Fix memory leak

With the provided method of creating the new X509_PUBKEY, an extra
EVP_PKEY is created and needs to be properly cleaned away.

(note: we could choose to keep it just as well, but there are
consequences, explained in a comment in the code)

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

4 years agoGeneralize the HTTP client so far implemented mostly in crypto/ocsp/ocsp_ht.c
Dr. David von Oheimb [Wed, 30 Oct 2019 22:39:35 +0000 (23:39 +0100)]
Generalize the HTTP client so far implemented mostly in crypto/ocsp/ocsp_ht.c
The new client has become an independent libcrpyto module in crypto/http/ and
* can handle any types of requests and responses (ASN.1-encoded and plain)
* does not include potentially busy loops when waiting for responses but
* makes use of a new timeout mechanism integrated with socket-based BIO
* supports the use of HTTP proxies and TLS, including HTTPS over proxies
* supports HTTP redirection via codes 301 and 302 for GET requests
* returns more useful diagnostics in various error situations
Also adapts - and strongly simplifies - hitherto uses of HTTP in crypto/ocsp/,
crypto/x509/x_all.c, apps/lib/apps.c, and apps/{ocsp,s_client,s_server}.c

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/10667)

4 years agoadd BIO_socket_wait(), BIO_wait(), and BIO_connect_retry() improving timeout support
Dr. David von Oheimb [Tue, 4 Feb 2020 08:55:35 +0000 (09:55 +0100)]
add BIO_socket_wait(), BIO_wait(), and BIO_connect_retry() improving timeout support

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/10667)

4 years agoPROV: Ensure the AlgorithmIdentifier registers in DSA signature impl
Richard Levitte [Fri, 7 Feb 2020 08:09:50 +0000 (09:09 +0100)]
PROV: Ensure the AlgorithmIdentifier registers in DSA signature impl

When setting up the hash function for DSA signature, the encoded
AlgorithmIdentifier for the DSA+hash combination is queried, but not
stored, which leads to problems when signing ASN.1 items in libcrypto.

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

4 years agoMemory allocator code cleanup
Davide Galassi [Mon, 10 Feb 2020 06:49:10 +0000 (16:49 +1000)]
Memory allocator code cleanup

Typedefs of CRYPTO malloc, realloc and free.

MEM_CHECK "modes" are used only as a CRYPTO_mem_ctrl() parameter

The CRYPTO_mem_ctrl is defined only if OPENSSL_NO_CRYPTO_MDEBUG is
defined, thus define the MEM_CHECK modes under the same condition.

Maybe the macros can be removed at all since:
1. CRYPTO_mem_ctrl() just returns -1 and ignores the parameter
2. CRYPTO_mem_ctr() is declared as DEPRECATED by 3.0

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

4 years agox86: Always generate .note.gnu.property section for ELF outputs
H.J. Lu [Sat, 14 Dec 2019 17:48:18 +0000 (09:48 -0800)]
x86: Always generate .note.gnu.property section for ELF outputs

We should always generate .note.gnu.property section in x86 assembly
codes for ELF outputs to mark Intel CET support since all input files
must be marked with Intel CET support in order for linker to mark output
with Intel CET support.

Verified with

$ CC="gcc -Wl,-z,cet-report=error" ./Configure shared linux-x86 -fcf-protection
$ make
$ make test

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

4 years agoDon't compile AESNI code if we're not AESNI capable
Matt Caswell [Wed, 5 Feb 2020 17:42:40 +0000 (17:42 +0000)]
Don't compile AESNI code if we're not AESNI capable

Compile failures were occuring on systems that weren't AESNI capable
because the detection wasn't quite right in a couple of files.

This fixes a run-checker build failure for the 386 compile option.

Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/11022)

4 years agoFix no-des
Matt Caswell [Thu, 6 Feb 2020 16:59:49 +0000 (16:59 +0000)]
Fix no-des

Don't attempt to self-test DES in the FIPS provider if we have been built
without FIPS support.

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

4 years agoFix no-engine
Matt Caswell [Thu, 6 Feb 2020 15:54:09 +0000 (15:54 +0000)]
Fix no-engine

We don't need to check if an engine has a cipher/digest in a no-engine
build.

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

4 years agoFix no-dh
Matt Caswell [Thu, 6 Feb 2020 15:30:24 +0000 (15:30 +0000)]
Fix no-dh

Don't use DH specific macros that might need to be used in a no-dh build.

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

4 years agoFix no-ec
Matt Caswell [Thu, 6 Feb 2020 15:17:28 +0000 (15:17 +0000)]
Fix no-ec

Recent SM2 related changes were not properly guarded with OPENSSL_NO_EC

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

4 years agoUse swapcontext for Intel CET
H.J. Lu [Sat, 14 Dec 2019 00:46:07 +0000 (16:46 -0800)]
Use swapcontext for Intel CET

When Intel CET is enabled, makecontext will create a different shadow
stack for each context.  async_fibre_swapcontext cannot use _longjmp.
It must call swapcontext to swap shadow stack as well as normal stack.

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

4 years agoAdapt all build.info and test recipes to the new $disabled{'deprecated-x.y'}
Richard Levitte [Thu, 6 Feb 2020 10:31:41 +0000 (11:31 +0100)]
Adapt all build.info and test recipes to the new $disabled{'deprecated-x.y'}

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

4 years agoConfigure: Add easy to use disabled deprecated functionality indicators
Richard Levitte [Thu, 6 Feb 2020 10:26:22 +0000 (11:26 +0100)]
Configure: Add easy to use disabled deprecated functionality indicators

In C, we have macros like OPENSSL_NO_DEPRECATED_3_0 to check if some
section of code should be disabled to simulate a removal of things
deprecated in the version.

In perl, we had to check $disabled{deprecated} and compare
$config{api} with the proper version code, which is doable but tedious
and error prone.

This change adds $disabled{'deprecated-x.y'} (x.y being a version
number) which directly corresponds to OPENSSL_NO_DEPRECATED_x_y, for
use in build.info conditions, test recipes and other perl stuff.

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

4 years agotests/drbgtest: use new RAND_DRBG callback_data API instead of ex_data
Dr. Matthias St. Pierre [Fri, 31 Jan 2020 12:32:11 +0000 (13:32 +0100)]
tests/drbgtest: use new RAND_DRBG callback_data API instead of ex_data

It took me a little while to realize why the test_rand_drbg_reseed test
kept crashing after replacing the RAND_DRBG_{gs}et_ex_data() calls by
RAND_DRBG_{gs}et_callback_data().

The reason was that the ex_data API prohibits modifying the callbacks
or callback data of chained DRBGs and returned an error which was
ignored by the `test_rand_drbg_reseed` test, for good reasons.

The `test_rand_drbg_reseed` test is special in this respect, because
it needs to install callbacks for all DRBGs, in order to intercept
and count the reseeding events.

Since the drbgtest module has access to the internal structures of
the DRBG anyway, the problem could be solved by accessing the members
directly. I added a warning comment in hook_drbg().

[extended tests]

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

4 years agoRAND_DRBG: add a callback data for entropy and nonce callbacks
Dr. Matthias St. Pierre [Sun, 26 Jan 2020 21:18:23 +0000 (22:18 +0100)]
RAND_DRBG: add a callback data for entropy and nonce callbacks

The callback data allows passing context specific data from the
application of the DRBG to to the entropy callbacks.
This a rather specialized feature which is useful for implementing
known answer tests (KATs) or deterministic signatures (RFC6979),
which require passing a specified entropy and nonce for instantiating
the DRBG.

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

4 years agoAppveyor: update to Visual Studio 2017.
FdaSilvaYY [Sat, 19 Oct 2019 16:24:49 +0000 (18:24 +0200)]
Appveyor: update to Visual Studio 2017.

Default image was currently "Visual Studio 2015"

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/10327)

4 years agoKEYMGMT: Require both get_params and gettable_params, or none
Richard Levitte [Tue, 4 Feb 2020 16:49:28 +0000 (17:49 +0100)]
KEYMGMT: Require both get_params and gettable_params, or none

The same go for the pairs import + import_types and export + export_types.

This required some additional changes in our KEYMGMT implementations.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/11006)

4 years agoAdapt existing SERIALIZER implementations to the redesigned interface
Richard Levitte [Mon, 3 Feb 2020 15:36:24 +0000 (16:36 +0100)]
Adapt existing SERIALIZER implementations to the redesigned interface

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/11006)

4 years agoAdapt test/keymgmt_internal_test.c to the redesigned interface
Richard Levitte [Mon, 3 Feb 2020 14:36:15 +0000 (15:36 +0100)]
Adapt test/keymgmt_internal_test.c to the redesigned interface

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/11006)

4 years agoAdapt existing KEYMGMT implementations to the redesigned interface
Richard Levitte [Mon, 3 Feb 2020 11:00:53 +0000 (12:00 +0100)]
Adapt existing KEYMGMT implementations to the redesigned interface

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/11006)

4 years agoRedesign the KEYMGMT libcrypto <-> provider interface - the basics
Richard Levitte [Sun, 2 Feb 2020 17:56:07 +0000 (18:56 +0100)]
Redesign the KEYMGMT libcrypto <-> provider interface - the basics

The KEYMGMT libcrypto <-> provider interface currently makes a few
assumptions:

1.  provider side domain parameters and key data isn't mutable. In
    other words, as soon as a key has been created in any (loaded,
    imported data, ...), it's set in stone.
2.  provider side domain parameters can be strictly separated from the
    key data.

This does work for the most part, but there are places where that's a
bit too rigid for the functionality that the EVP_PKEY API delivers.
Key data needs to be mutable to allow the flexibility that functions
like EVP_PKEY_copy_parameters promise, as well as to provide the
combinations of data that an EVP_PKEY is generally assumed to be able
to hold:

- domain parameters only
- public key only
- public key + private key
- domain parameters + public key
- domain parameters + public key + private key

To remedy all this, we:

1.  let go of the distinction between domain parameters and key
    material proper in the libcrypto <-> provider interface.

    As a consequence, functions that still need it gain a selection
    argument, which is a set of bits that indicate what parts of the
    key object are to be considered in a specific call.  This allows
    a reduction of very similar functions into one.

2.  Rework the libcrypto <-> provider interface so provider side key
    objects are created and destructed with a separate function, and
    get their data filled and extracted in through import and export.

(future work will see other key object constructors and other
functions to fill them with data)

Fixes #10979

squash! Redesign the KEYMGMT libcrypto <-> provider interface - the basics

Remedy 1 needs a rewrite:

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/11006)

4 years agoReorganize the internal evp_keymgmt functions
Richard Levitte [Mon, 3 Feb 2020 04:42:48 +0000 (05:42 +0100)]
Reorganize the internal evp_keymgmt functions

Some of the evp_keymgmt_ functions are just wrappers around the
EVP_KEYMGMT function pointers.  We move those from keymgmt_lib.c to
keymgmt_meth.c.

Other evp_keymgmt_ functions are utility functions to help the rest of
the EVP functions.  Since their names are easily confused with the
functions that were moved to keymgmt_meth.c, we rename them so they
all start with evp_keymgmt_util_.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/11006)

4 years agoTemporariy add ASN1_item_verify_ctx() missingcrypto.txt
Matt Caswell [Tue, 4 Feb 2020 14:33:21 +0000 (14:33 +0000)]
Temporariy add ASN1_item_verify_ctx() missingcrypto.txt

PR #10942 introduced the new function ASN1_item_verify_ctx(), but did
not document it with the promise that documentation would follow soon.
We temporarily add this function to missingcrypto.txt until it has been
done.

Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/10980)

4 years agoDon't ignore ASN1 when checking for undocumented symbols
Matt Caswell [Fri, 31 Jan 2020 09:43:35 +0000 (09:43 +0000)]
Don't ignore ASN1 when checking for undocumented symbols

When we run "make doc-nits" (which happens during travis runs) it will
complain if we add any new symbols that aren't documented. However it
was suppressing anything starting with ASN1. There's no reason why we
should allow ASN1 symbols to go undocumented any more than any others.
Therefore we remove that exception.

Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/10980)

4 years agoRemove unused HAS_LFN_SUPPORT
Rich Salz [Mon, 27 Jan 2020 20:39:17 +0000 (15:39 -0500)]
Remove unused HAS_LFN_SUPPORT

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/10959)

4 years agoFix misspelling errors and typos reported by codespell
Dr. Matthias St. Pierre [Sun, 2 Feb 2020 21:54:01 +0000 (22:54 +0100)]
Fix misspelling errors and typos reported by codespell

Fixes #10998

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

4 years agoMore accurate doc of -ssl_config option
Rich Salz [Mon, 3 Feb 2020 21:06:42 +0000 (16:06 -0500)]
More accurate doc of -ssl_config option

Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/10972)

4 years agoUpdate command list
Rich Salz [Thu, 30 Jan 2020 17:19:13 +0000 (12:19 -0500)]
Update command list

Add -standard-commands option to list command (documented)
Update standard commands list in openssl.pod

Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/10972)

4 years agoAdd cmd-nits to travis build
Rich Salz [Wed, 29 Jan 2020 16:18:39 +0000 (11:18 -0500)]
Add cmd-nits to travis build

Update CHANGES to have a complete and uniform description.

Fixes #9730

Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/10972)

4 years agoThe -hmac option to speed is now #ifdef'd
Rich Salz [Wed, 29 Jan 2020 18:21:19 +0000 (13:21 -0500)]
The -hmac option to speed is now #ifdef'd

Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/10972)

4 years agoAdd missing s_client options
Rich Salz [Wed, 29 Jan 2020 16:18:24 +0000 (11:18 -0500)]
Add missing s_client options

Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/10972)

4 years agoPrevent compiler warning for unused static function.
Davide Galassi [Sat, 25 Jan 2020 11:56:44 +0000 (12:56 +0100)]
Prevent compiler warning for unused static function.

Prepend missing ossl_unused in front of lh_type_new to make the compiler
happy.

CLA: trivial

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/10946)

4 years agoRemoved unused ssl_dane struct declaration.
Davide Galassi [Sat, 25 Jan 2020 11:50:41 +0000 (12:50 +0100)]
Removed unused ssl_dane struct declaration.

The actually used structure is named ssl_dane_st.

CLA: trivial

Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/10945)

4 years agodoc: Fix typo in EVP_DigestSignInit manpage
Jakub Jelen [Tue, 14 Jan 2020 15:03:23 +0000 (16:03 +0100)]
doc: Fix typo in EVP_DigestSignInit manpage

CLA: trivial

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/10841)

4 years agoFix small misspelling in doc for OCSP_response_status
thekuwayama [Sat, 11 Jan 2020 11:20:20 +0000 (20:20 +0900)]
Fix small misspelling in doc for OCSP_response_status

CLA: trivial

Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/10810)

4 years agoFix no-sm2
Matt Caswell [Tue, 4 Feb 2020 17:29:37 +0000 (17:29 +0000)]
Fix no-sm2

Fix ecdsatest to not run the SM2 test if SM2 has been disabled.

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

4 years agoAdd FFC param/key generation
Shane Lontis [Thu, 6 Feb 2020 12:28:36 +0000 (22:28 +1000)]
Add FFC param/key generation

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

4 years agoFix no-tls1_3
Matt Caswell [Tue, 4 Feb 2020 17:11:07 +0000 (17:11 +0000)]
Fix no-tls1_3

The hostname_cb in sslapitest.c was originally only defined if TLSv1.3
was enabled. A recently added test now uses this unconditionally, so we
move the function implementation earlier in the file, and always compile
it in.

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

4 years agoFix builds with no-dh
Matt Caswell [Fri, 31 Jan 2020 23:28:45 +0000 (23:28 +0000)]
Fix builds with no-dh

The various functions in bn_const.c return primes that are
specified for use in DH. However they were not being excluded from
a no-dh build - and was therefore causing the build to fail.

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

4 years agoAdd a test for SSL_CTX_new_with_libctx()
Matt Caswell [Wed, 15 Jan 2020 14:48:57 +0000 (14:48 +0000)]
Add a test for SSL_CTX_new_with_libctx()

We test that SSL_CTX_new_with_libctx() can be used to control the libctx
that is in use for SSL operations.

Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/10854)

4 years agoUse the OPENSSL_CTX and property query string in EVP_PKEY_CTX
Matt Caswell [Wed, 15 Jan 2020 11:20:58 +0000 (11:20 +0000)]
Use the OPENSSL_CTX and property query string in EVP_PKEY_CTX

When we use an EVP_PKEY_CTX in libssl we should be doing so with the
OPENSSL_CTX and property query string that were specified when the
SSL_CTX object was first created.

Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/10854)

4 years agoExplicitly fetch ciphers and digests in libssl
Matt Caswell [Thu, 16 Jan 2020 12:14:27 +0000 (12:14 +0000)]
Explicitly fetch ciphers and digests in libssl

We modify libssl to use explicitly fetched ciphers, digests and other
algorithms as required based on the configured library context and
property query string for the SSL_CTX that is being used.

Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/10854)

4 years agoParams: change UTF8 construct calls to avoid explicit strlen(3) calls.
Pauli [Wed, 5 Feb 2020 05:13:49 +0000 (15:13 +1000)]
Params: change UTF8 construct calls to avoid explicit strlen(3) calls.

It is better, safer and smaller to let the library routine handle the
strlen(3) call.

Added a note to the documentation suggesting this.

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

4 years agoStop accepting certificates signed using SHA1 at security level 1
Kurt Roeckx [Thu, 2 Jan 2020 22:25:27 +0000 (23:25 +0100)]
Stop accepting certificates signed using SHA1 at security level 1

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
GH: #10786

4 years agoCreate a new embeddedSCTs1 that's signed using SHA256
Kurt Roeckx [Wed, 22 Jan 2020 23:24:35 +0000 (00:24 +0100)]
Create a new embeddedSCTs1 that's signed using SHA256

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
GH: #10786

4 years agoFix no-multiblock
Matt Caswell [Mon, 3 Feb 2020 15:30:05 +0000 (15:30 +0000)]
Fix no-multiblock

Minor fixes to resolve compilation errors with the no-multiblock
Configure option.

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

4 years agoAuthor: Ross Kinsey <RossIKinsey@gmail.com>
Ross Kinsey [Wed, 5 Feb 2020 03:47:05 +0000 (13:47 +1000)]
Author: Ross Kinsey <RossIKinsey@gmail.com>
Date:   Wed Jan 29 00:19:40 2020 -0500

Removed unnecessary switch statements from bio/bf_* callback_ctrl functions

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/10967)

4 years agox86: Add endbranch to indirect branch targets for Intel CET
H.J. Lu [Fri, 31 Jan 2020 13:07:01 +0000 (05:07 -0800)]
x86: Add endbranch to indirect branch targets for Intel CET

To support Intel CET, all indirect branch targets must start with
endbranch.  Here is a patch to add endbranch to all function entries
in x86 assembly codes which are indirect branch targets as discovered
by running openssl testsuite on Intel CET machine and visual inspection.

Since x86 cbc.pl uses indirect branch with a jump table, we also need
to add endbranch to all jump targets.

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

4 years agoMake minimum size for secure memory a size_t.
Pauli [Tue, 4 Feb 2020 23:09:29 +0000 (09:09 +1000)]
Make minimum size for secure memory a size_t.

The minimum size argument to CRYPTO_secure_malloc_init() was an int but ought
to be a size_t since it is a size.

From an API perspective, this is a change.  However, the minimum size is
verified as being a positive power of two and it will typically be a small
constant.

Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from #11003)

4 years agoEVP_MD_CTX_ctrl(): Remove unnecessary control
Richard Levitte [Sun, 2 Feb 2020 12:09:29 +0000 (13:09 +0100)]
EVP_MD_CTX_ctrl(): Remove unnecessary control

A check was present as to what operation is performed with this
context.  It may have been useful at some point, but isn't any more.

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

4 years agoPROV: Fix the DSA SIGNATURE implementation for better digests handling
Richard Levitte [Sun, 2 Feb 2020 12:09:23 +0000 (13:09 +0100)]
PROV: Fix the DSA SIGNATURE implementation for better digests handling

Refactor the DSA SIGNATURE digest setup to be uniform, and to happen
in two places:

1. when given through the digestsign and digestverify inits
2. when given through the set_ctx_params function.

When setting up the digest, we also check that the digest is one of
the officially accepted for DSA.

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

4 years agoPROV: Implement padding mode words in the RSA ASYM_CIPHER implementation
Richard Levitte [Sun, 2 Feb 2020 12:09:09 +0000 (13:09 +0100)]
PROV: Implement padding mode words in the RSA ASYM_CIPHER implementation

Because the libcrypto code has relinquished control of exact words to
express padding mode choices, we re-implement them in the appropriate
provider implementation.

For the sake of legacy controls, we maintain support for the numeric
form of the padding mode, but leave that support otherwise undeclared.

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

4 years agoDon't pass a digest-size to signature implementations
Richard Levitte [Sun, 2 Feb 2020 11:55:05 +0000 (12:55 +0100)]
Don't pass a digest-size to signature implementations

It turns out this was never necessary, as the implementation should
always check the default digest size anyway.

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

4 years agoDecentralize legacy_ctrl_str_to_param()
Richard Levitte [Sat, 25 Jan 2020 11:27:47 +0000 (12:27 +0100)]
Decentralize legacy_ctrl_str_to_param()

This function did a bit too much in terms of central control, actually
more so than the legacy counterpart, where all the string processing
is done in the diverse *_pmeth.c.  Furthermore, there was no room
whatsoever for control keys that libcrypto isn't centrally aware of.

This function is changed to simply translating keys and values to
OSSL_PARAM form and then sent on their merry way to the provider
implementations through EVP_PKEY_CTX_set_params().  It translates
selected well known legacy names to their core name counterpart, and
that's as far as centralized control should extend.

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

4 years agoTeach more BIOs how to handle BIO_CTRL_EOF
Matt Caswell [Fri, 24 Jan 2020 16:07:51 +0000 (16:07 +0000)]
Teach more BIOs how to handle BIO_CTRL_EOF

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

4 years agoDetect EOF while reading in libssl
Matt Caswell [Fri, 17 Jan 2020 17:39:19 +0000 (17:39 +0000)]
Detect EOF while reading in libssl

If we hit an EOF while reading in libssl then we will report an error
back to the application (SSL_ERROR_SYSCALL) but errno will be 0. We add
an error to the stack (which means we instead return SSL_ERROR_SSL) and
therefore give a hint as to what went wrong.

Contains a partial fix for #10880

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

4 years agoDeprecate the ECDSA and EV_KEY_METHOD functions.
Pauli [Tue, 28 Jan 2020 05:14:18 +0000 (15:14 +1000)]
Deprecate the ECDSA and EV_KEY_METHOD functions.

Use of the low level ECDSA and EC_KEY_METHOD functions has been informally discouraged for a
long time. We now formally deprecate them.

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

4 years agoDeprecate the ECDH functions.
Pauli [Tue, 28 Jan 2020 02:38:47 +0000 (12:38 +1000)]
Deprecate the ECDH functions.

Use of the low level ECDH functions has been informally discouraged for a
long time. We now formally deprecate them.

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

4 years agoec.h: fix preprocessor indentation
Pauli [Tue, 28 Jan 2020 02:37:28 +0000 (12:37 +1000)]
ec.h: fix preprocessor indentation

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