openssl.git
2 years agoDECODER: use property definitions instead of getting implementation parameters
Richard Levitte [Tue, 1 Jun 2021 18:04:59 +0000 (20:04 +0200)]
DECODER: use property definitions instead of getting implementation parameters

The OSSL_DECODER library used to ask each decoder implementation for
certain data in form of parameters to place them correctly in the
decoder chain, if at all.  These parameters were duplicates of
properties of those same implementations, and therefore unnecessarily
redundant.

Now that we have functionality to query property definition values,
those duplicates are no longer needed, and are therefore not looked at
any more.

This adds the "global" error reason ERR_R_INVALID_PROPERTY_DEFINITION,
which can be re-used elsewhere.

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

2 years agoproperty: Add functionality to query data from a property definition
Richard Levitte [Tue, 1 Jun 2021 18:02:24 +0000 (20:02 +0200)]
property: Add functionality to query data from a property definition

This required making some OSSL_PROPERTY types a little less private.

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

2 years agomake update-fips-checksums
Richard Levitte [Fri, 4 Jun 2021 08:25:00 +0000 (10:25 +0200)]
make update-fips-checksums

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

2 years agoFIPS: don't include crypto/passphrase.c in libfips.a
Richard Levitte [Fri, 4 Jun 2021 08:19:40 +0000 (10:19 +0200)]
FIPS: don't include crypto/passphrase.c in libfips.a

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

2 years agoAdd documentation for newly added ASN1 functions
Matt Caswell [Tue, 1 Jun 2021 14:17:38 +0000 (15:17 +0100)]
Add documentation for newly added ASN1 functions

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

2 years agoEnsure libctx/propq is propagated when handling X509_REQ
Matt Caswell [Thu, 27 May 2021 14:03:06 +0000 (15:03 +0100)]
Ensure libctx/propq is propagated when handling X509_REQ

When we create via d2i or dup an X509_REQ we should ensure that the libctx
is properly propagated. We also ensure we create X509_REQ objects with the
proper libctx assigned in the CMP tests.

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

2 years agoGive ASN.1 objects the ability to report their libctx/propq
Matt Caswell [Thu, 27 May 2021 09:56:02 +0000 (10:56 +0100)]
Give ASN.1 objects the ability to report their libctx/propq

Some ASN.1 objects have an embedded libctx/propq. If they have one we
give the ASN.1 code the ability to find these values and use them where
needed. This is used for OSSL_CMP_MSG_dup() and X509_dup().

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

2 years agoMake sure X509_dup() also dup's any associated EVP_PKEY
Matt Caswell [Thu, 27 May 2021 08:00:47 +0000 (09:00 +0100)]
Make sure X509_dup() also dup's any associated EVP_PKEY

Otherwise we can end up with a blank EVP_PKEY. If it is later recreated
it can end up with the wrong libctx/propq.

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

2 years agoUse the new ASN.1 libctx aware capabilities in CMP
Matt Caswell [Wed, 26 May 2021 16:18:13 +0000 (17:18 +0100)]
Use the new ASN.1 libctx aware capabilities in CMP

Make sure we pass the libctx/propq around everywhere that we need it to
ensure we get provider keys when needed.

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

2 years agoUse the new ASN.1 libctx aware functions in CMS
Matt Caswell [Tue, 25 May 2021 16:46:11 +0000 (17:46 +0100)]
Use the new ASN.1 libctx aware functions in CMS

Make sure we pass the libctx around when working with CMS structures

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

2 years agoTeach more of the ASN.1 code about libctx/propq
Matt Caswell [Tue, 25 May 2021 16:16:18 +0000 (17:16 +0100)]
Teach more of the ASN.1 code about libctx/propq

Make sure we pass libctx/propq down to all the layers so that objects that
are created during parsing have the right values. Then use this new
capability for PKCS7.

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

2 years agoTeach the ASN.1 code how to create embedded objects with libctx/propq
Matt Caswell [Fri, 21 May 2021 16:25:05 +0000 (17:25 +0100)]
Teach the ASN.1 code how to create embedded objects with libctx/propq

An ASN.1 object such as an X509 may have embedded objects in it such as
an X509_PUBKEY. If there is a libctx/propq in use then we need to make sure
we pass these down to the constructors of these embedded objects.

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

2 years agoFix evp_extra_test to use libctx in an X509_PUBKEY
Matt Caswell [Fri, 21 May 2021 14:50:43 +0000 (15:50 +0100)]
Fix evp_extra_test to use libctx in an X509_PUBKEY

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

2 years agoProvide the ability to create an X509_PUBKEY with a libctx/propq
Matt Caswell [Fri, 21 May 2021 14:50:09 +0000 (15:50 +0100)]
Provide the ability to create an X509_PUBKEY with a libctx/propq

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

2 years agoTest a bad SmtpUTF8Mailbox name constraint
Matt Caswell [Thu, 3 Jun 2021 10:50:48 +0000 (11:50 +0100)]
Test a bad SmtpUTF8Mailbox name constraint

We add a verify test with a cert with a SAN and a bad SmtpUTF8Mailbox
entry, with an intermediate certificate with email name constraints.

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

2 years agoCheck that we got the expected name type when verifying name constraints
Matt Caswell [Thu, 3 Jun 2021 10:08:25 +0000 (11:08 +0100)]
Check that we got the expected name type when verifying name constraints

If a SAN field contains an SmtpUTF8Mailbox name then it is expected to
have a UTF8String type. We should verify that it really does before we
attempt to use the value in it.

Reported by Corey Bonnell

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

2 years agoUpdate fips checksums to drop the ssl headers
Tomas Mraz [Thu, 3 Jun 2021 13:26:52 +0000 (15:26 +0200)]
Update fips checksums to drop the ssl headers

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

2 years agoMove libssl related defines used by fips provider to prov_ssl.h
Tomas Mraz [Thu, 3 Jun 2021 13:22:05 +0000 (15:22 +0200)]
Move libssl related defines used by fips provider to prov_ssl.h

This nicely reduces the number of files considered as fips
provider sources.

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

2 years agoreq: detect a bad choice of digest early
Pauli [Thu, 3 Jun 2021 04:27:28 +0000 (14:27 +1000)]
req: detect a bad choice of digest early

This is a regression against 1.1.1 when an unknown digest was detected
early.

Fixes #15285

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

2 years agoreq: fix default bits handling for -newkey
Tomas Mraz [Wed, 2 Jun 2021 07:35:44 +0000 (09:35 +0200)]
req: fix default bits handling for -newkey

Fixes #15569

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

2 years ago80-test_http.t: Rename to 79-test_http.t, add basic HTTP server ACCEPT test
Dr. David von Oheimb [Wed, 2 Jun 2021 14:47:58 +0000 (16:47 +0200)]
80-test_http.t: Rename to 79-test_http.t, add basic HTTP server ACCEPT test

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

2 years ago80-test_cmp_http.t: Improve comparison on server_port variable
Dr. David von Oheimb [Wed, 2 Jun 2021 13:52:26 +0000 (15:52 +0200)]
80-test_cmp_http.t: Improve comparison on server_port variable

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

2 years agoAdd md-nits task
Rich Salz [Wed, 2 Jun 2021 13:38:01 +0000 (09:38 -0400)]
Add md-nits task

Assumes that Ruby is installed

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

2 years agoOnly call dtls1_start_timer() once
Matt Caswell [Wed, 2 Jun 2021 16:19:23 +0000 (17:19 +0100)]
Only call dtls1_start_timer() once

The function dtls1_handle_timeout() calls dtls1_double_timeout() which
was calling dtls1_start_timer(). However dtls1_start_timer() is also
called directly by dtls1_handle_timeout(). We only need to start the timer
once.

Fixes #15561

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

2 years agoCI windows.yml: Silence 'nmake' builds except 'minimal'; ci.yml: make 'minimal' build...
Dr. David von Oheimb [Wed, 2 Jun 2021 15:26:02 +0000 (17:26 +0200)]
CI windows.yml: Silence 'nmake' builds except 'minimal'; ci.yml: make 'minimal' build verbose

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

2 years agoTeach ASN1_item_verify_ctx() how to handle provided keys
Matt Caswell [Tue, 25 May 2021 11:38:19 +0000 (12:38 +0100)]
Teach ASN1_item_verify_ctx() how to handle provided keys

We need to special case RSA-PSS because that uses X509_ALGOR style
parameters and we have no support for this on the provider side at this
stage.

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

2 years agoopenssl spkac: Fix reading SPKAC data from stdin
Tomas Mraz [Wed, 2 Jun 2021 15:01:41 +0000 (17:01 +0200)]
openssl spkac: Fix reading SPKAC data from stdin

Fixes #15367

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

2 years agoOPENSSL_init_crypto must return 0 when cleanup was done
Tomas Mraz [Wed, 2 Jun 2021 13:15:45 +0000 (15:15 +0200)]
OPENSSL_init_crypto must return 0 when cleanup was done

Fixes #15581

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

2 years agoCheck the return value of ASN1_STRING_length
bonniegong [Wed, 2 Jun 2021 07:35:18 +0000 (15:35 +0800)]
Check the return value of ASN1_STRING_length

ASN1_STRING_length gets the field 'length' of msg, which
can be manipulated through a crafted input.
Add a check to avoid error execution of OPENSSL_malloc().

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

2 years ago80-test_cmp_http.t: Re-enable CMP tests for AIX, removing some inessential test cases
Jon Spillett [Wed, 2 Jun 2021 01:20:25 +0000 (11:20 +1000)]
80-test_cmp_http.t: Re-enable CMP tests for AIX, removing some inessential test cases

Remove negative test cases which simulate an attempt to write file contents to a directory
using a path ending in '/' as this is not compatible with fopen on all platforms, e.g., AIX.

Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/15575)

2 years agoDeprecate EVP_CIPHER_impl_ctx_size and EVP_CIPHER_CTX_buf_noconst
Richard Levitte [Wed, 2 Jun 2021 09:07:20 +0000 (11:07 +0200)]
Deprecate EVP_CIPHER_impl_ctx_size and EVP_CIPHER_CTX_buf_noconst

Fixes #15519

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

2 years agoRestore all the ? in util/libcrypto.num
Richard Levitte [Wed, 2 Jun 2021 06:45:28 +0000 (08:45 +0200)]
Restore all the ? in util/libcrypto.num

They will become numbers again when beta1 is actually released.

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

2 years agoutil/mknum.pl: Really allow unset ordinals in development
Richard Levitte [Wed, 2 Jun 2021 04:20:05 +0000 (06:20 +0200)]
util/mknum.pl: Really allow unset ordinals in development

Any pre-release tag that includes '-dev' is development.  The ordinals
don't need to be finalized before '-dev' is removed (i.e. a release is
made).

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

2 years agoFix errors found by parfait static analyser.
Shane Lontis [Wed, 2 Jun 2021 04:42:56 +0000 (14:42 +1000)]
Fix errors found by parfait static analyser.

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

2 years agorsa: make the maximum key strength check FIPS only.
Pauli [Tue, 1 Jun 2021 08:35:15 +0000 (18:35 +1000)]
rsa: make the maximum key strength check FIPS only.

To be reverted once key generation checks are added everywhere and a way to
disable them implemented.

Fixes #15502

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

2 years agoAdd an EVP demo for signatures using EC
yuechen-chen [Mon, 24 May 2021 06:33:55 +0000 (23:33 -0700)]
Add an EVP demo for signatures using EC

Fixes #14115

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

2 years agoupdate checksums
Pauli [Wed, 2 Jun 2021 00:54:56 +0000 (10:54 +1000)]
update checksums

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

2 years agoutil: update FIPS checksumming script to be more aggressive with whitespace
Pauli [Wed, 2 Jun 2021 00:37:10 +0000 (10:37 +1000)]
util: update FIPS checksumming script to be more aggressive with whitespace

Fixes #15562

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

2 years agoAdd enable-fips to CI configuration
Jon Spillett [Mon, 31 May 2021 03:50:02 +0000 (13:50 +1000)]
Add enable-fips to CI configuration

Reviewed-by: Richard Levitte <levitte@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/15537)

2 years agoDisable tracing within the FIPS module
Jon Spillett [Mon, 31 May 2021 03:14:24 +0000 (13:14 +1000)]
Disable tracing within the FIPS module

Reviewed-by: Richard Levitte <levitte@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/15537)

2 years agoed25519 and ed448: fix incorrect OSSL_PKEY_PARAM_MAX_SIZE
Tomas Mraz [Tue, 1 Jun 2021 12:54:43 +0000 (14:54 +0200)]
ed25519 and ed448: fix incorrect OSSL_PKEY_PARAM_MAX_SIZE

Fixes #15552

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

2 years ago80-test_cms.t: Replace use of ee-self-signed.pem by more suitable smrsa1.pem
Dr. David von Oheimb [Thu, 27 May 2021 13:11:31 +0000 (15:11 +0200)]
80-test_cms.t: Replace use of ee-self-signed.pem by more suitable smrsa1.pem

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

2 years agoee-self-signed.pem: Restore original version, adding -attime to 25-test_verify.t
Dr. David von Oheimb [Thu, 27 May 2021 12:10:58 +0000 (14:10 +0200)]
ee-self-signed.pem: Restore original version, adding -attime to 25-test_verify.t

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

2 years agolist: update to not use XXX_get_number() calls
Pauli [Tue, 1 Jun 2021 11:48:29 +0000 (21:48 +1000)]
list: update to not use XXX_get_number() calls

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

2 years agostore: include internal header
Pauli [Tue, 1 Jun 2021 11:48:11 +0000 (21:48 +1000)]
store: include internal header

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

2 years agodoc: fix OSSL_(EN|DE)CODER_get0_name function names
Pauli [Tue, 1 Jun 2021 11:19:39 +0000 (21:19 +1000)]
doc: fix OSSL_(EN|DE)CODER_get0_name function names

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

2 years agolibcrypto: make XXX_get_number() internal
Pauli [Tue, 1 Jun 2021 11:18:04 +0000 (21:18 +1000)]
libcrypto: make XXX_get_number() internal

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

2 years agodoc: make XXX_get_number() internal
Pauli [Tue, 1 Jun 2021 11:17:47 +0000 (21:17 +1000)]
doc: make XXX_get_number() internal

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

2 years agoAdd internal get_number functions to internal headers
Pauli [Tue, 1 Jun 2021 02:53:31 +0000 (12:53 +1000)]
Add internal get_number functions to internal headers

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

2 years agoadd internal get_number functons to crypto/evp.h
Pauli [Tue, 1 Jun 2021 02:51:45 +0000 (12:51 +1000)]
add internal get_number functons to crypto/evp.h

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

2 years agodoc: move XXX_get_number() documentation to internal
Pauli [Tue, 1 Jun 2021 02:44:26 +0000 (12:44 +1000)]
doc: move XXX_get_number() documentation to internal

These functions are effectively useless for users outside of libcrypto.

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

2 years agoutils: remove TODO
Pauli [Mon, 31 May 2021 04:37:37 +0000 (14:37 +1000)]
utils: remove TODO

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

2 years agocrypto: remove TODOs
Pauli [Mon, 31 May 2021 04:30:07 +0000 (14:30 +1000)]
crypto: remove TODOs

Fixes #15451

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

2 years agohttp: remove TODOs
Pauli [Mon, 31 May 2021 04:29:55 +0000 (14:29 +1000)]
http: remove TODOs

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

2 years agoevp: remove TODOs
Pauli [Mon, 31 May 2021 04:29:55 +0000 (14:29 +1000)]
evp: remove TODOs

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

2 years agoerr: remove TODOs
Pauli [Mon, 31 May 2021 04:29:55 +0000 (14:29 +1000)]
err: remove TODOs

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

2 years agoec: remove TODOs
Pauli [Mon, 31 May 2021 04:29:55 +0000 (14:29 +1000)]
ec: remove TODOs

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

2 years agodso: remove TODOs
Pauli [Mon, 31 May 2021 04:29:55 +0000 (14:29 +1000)]
dso: remove TODOs

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

2 years agobn: remove TODOs
Pauli [Mon, 31 May 2021 04:29:55 +0000 (14:29 +1000)]
bn: remove TODOs

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

2 years agorsa: remove TODOs
Pauli [Mon, 31 May 2021 04:29:34 +0000 (14:29 +1000)]
rsa: remove TODOs

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

2 years agostore: remove TODOs
Pauli [Mon, 31 May 2021 04:29:34 +0000 (14:29 +1000)]
store: remove TODOs

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

2 years agopem: remove TODOs
Pauli [Mon, 31 May 2021 04:29:34 +0000 (14:29 +1000)]
pem: remove TODOs

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

2 years agoocsp: remove TODOs
Pauli [Mon, 31 May 2021 04:29:34 +0000 (14:29 +1000)]
ocsp: remove TODOs

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

2 years agoct: remove TODOs
Pauli [Mon, 31 May 2021 04:29:33 +0000 (14:29 +1000)]
ct: remove TODOs

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

2 years agocrmf: remove TODOs
Pauli [Mon, 31 May 2021 04:29:33 +0000 (14:29 +1000)]
crmf: remove TODOs

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

2 years agocomp: remove TODOs
Pauli [Mon, 31 May 2021 04:29:33 +0000 (14:29 +1000)]
comp: remove TODOs

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

2 years agocms: remove TODOs
Pauli [Mon, 31 May 2021 04:29:33 +0000 (14:29 +1000)]
cms: remove TODOs

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

2 years agocmp: remove TODOs
Pauli [Mon, 31 May 2021 04:29:33 +0000 (14:29 +1000)]
cmp: remove TODOs

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

2 years agox509: remove TODOs
Pauli [Mon, 31 May 2021 04:28:45 +0000 (14:28 +1000)]
x509: remove TODOs

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

2 years agobio: remove TODOs
Pauli [Mon, 31 May 2021 04:28:32 +0000 (14:28 +1000)]
bio: remove TODOs

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

2 years agoasn.1: remove TODOs
Pauli [Mon, 31 May 2021 04:28:15 +0000 (14:28 +1000)]
asn.1: remove TODOs

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

2 years agoproviders: remove TODOs
Pauli [Mon, 31 May 2021 04:27:58 +0000 (14:27 +1000)]
providers: remove TODOs

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

2 years agotls: remove TODOs
Pauli [Mon, 31 May 2021 04:27:48 +0000 (14:27 +1000)]
tls: remove TODOs

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

2 years agotest: remove TODOs
Pauli [Mon, 31 May 2021 04:27:31 +0000 (14:27 +1000)]
test: remove TODOs

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

2 years agofuzz: remove TODOs
Pauli [Mon, 31 May 2021 04:27:18 +0000 (14:27 +1000)]
fuzz: remove TODOs

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

2 years agoapps: remove TODOs
Pauli [Mon, 31 May 2021 04:27:04 +0000 (14:27 +1000)]
apps: remove TODOs

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

2 years agoproviders/common/der/build.info: make a variable for ../include/prov
Richard Levitte [Tue, 1 Jun 2021 05:49:56 +0000 (07:49 +0200)]
providers/common/der/build.info: make a variable for ../include/prov

This is a proof of concept for GENERATE variable expansion.

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

2 years agoConfigure: variable expand GENERATE values too
Richard Levitte [Tue, 1 Jun 2021 05:45:54 +0000 (07:45 +0200)]
Configure: variable expand GENERATE values too

Internal documentation doesn't allow for any exception...  Therefore,
even GENERATE values should be variable expanded.

(there are historical reasons why GENERATE was excepted from variable
expansion, that aren't applicable any more)

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

2 years agoFix up bad libcrypto.num
Jon Spillett [Wed, 2 Jun 2021 03:04:04 +0000 (13:04 +1000)]
Fix up bad libcrypto.num

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

2 years agoAdd NCONF_get_section_names()
Tomas Mraz [Thu, 27 May 2021 09:00:35 +0000 (11:00 +0200)]
Add NCONF_get_section_names()

And a few additional fixups to make the no-deprecated configuration
to build.

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

2 years agoAdd NCONF_get0_libctx()
Rich Salz [Tue, 25 May 2021 18:48:41 +0000 (14:48 -0400)]
Add NCONF_get0_libctx()

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

2 years agoMake conf_method_st and conf_st deprecated
Rich Salz [Tue, 25 May 2021 16:57:06 +0000 (12:57 -0400)]
Make conf_method_st and conf_st deprecated

So they can be made opaque in a future release.

Fixes #15101

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

2 years agoModify ssl_handshake_hash to call SSLfatal
Trev Larock [Fri, 28 May 2021 12:54:44 +0000 (12:54 +0000)]
Modify ssl_handshake_hash to call SSLfatal

When EVP_MD_CTX_new fails call SSLfatal before the goto err.
This resolves a state machine issue on the out of memory condition.

Fixes #15491.
CLA: trivial

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

2 years agoMake the 00-prep_*.t recipe truly mandatory
Tomas Mraz [Mon, 31 May 2021 15:00:38 +0000 (17:00 +0200)]
Make the 00-prep_*.t recipe truly mandatory

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

2 years agoWindows CI: enable fips on shared 64 bit build
Tomas Mraz [Mon, 31 May 2021 12:22:35 +0000 (14:22 +0200)]
Windows CI: enable fips on shared 64 bit build

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

2 years agoFix enable-fips builds on Windows
Tomas Mraz [Mon, 31 May 2021 12:18:56 +0000 (14:18 +0200)]
Fix enable-fips builds on Windows

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

2 years agoAdd documentation of the old names kept as alias macros
Tomas Mraz [Fri, 28 May 2021 15:36:16 +0000 (17:36 +0200)]
Add documentation of the old names kept as alias macros

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

2 years agoRename also the OSSL_PROVIDER_name() function
Tomas Mraz [Fri, 28 May 2021 14:57:22 +0000 (16:57 +0200)]
Rename also the OSSL_PROVIDER_name() function

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

2 years agoRename all getters to use get/get0 in name
Tomas Mraz [Fri, 21 May 2021 14:58:08 +0000 (16:58 +0200)]
Rename all getters to use get/get0 in name

For functions that exist in 1.1.1 provide a simple aliases via #define.

Fixes #15236

Functions with OSSL_DECODER_, OSSL_ENCODER_, OSSL_STORE_LOADER_,
EVP_KEYEXCH_, EVP_KEM_, EVP_ASYM_CIPHER_, EVP_SIGNATURE_,
EVP_KEYMGMT_, EVP_RAND_, EVP_MAC_, EVP_KDF_, EVP_PKEY_,
EVP_MD_, and EVP_CIPHER_ prefixes are renamed.

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

2 years agoPass library context and property query into private key decoders
Jon Spillett [Tue, 18 May 2021 03:37:35 +0000 (13:37 +1000)]
Pass library context and property query into private key decoders

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

2 years agoFix up encoder/decoder issues caused by not passing a library context to the PKCS8...
Jon Spillett [Thu, 6 May 2021 01:55:42 +0000 (11:55 +1000)]
Fix up encoder/decoder issues caused by not passing a library context to the PKCS8 encrypt/decrypt

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

2 years agoEnhance the encoder/decoder tests to allow testing with a non-default library context...
Jon Spillett [Mon, 15 Mar 2021 04:26:09 +0000 (14:26 +1000)]
Enhance the encoder/decoder tests to allow testing with a non-default library context and configurable providers

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

2 years agoreq: fix Coverity 1485137 Explicit null dereference
Pauli [Sun, 30 May 2021 23:26:05 +0000 (09:26 +1000)]
req: fix Coverity 1485137 Explicit null dereference

Add a check for a non-existent file name when specifying params via file.
Add a check for a failure to determine key type.

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

2 years agocrypto: updates to pass size_t to RAND_bytes_ex()
Pauli [Mon, 31 May 2021 06:31:18 +0000 (16:31 +1000)]
crypto: updates to pass size_t to RAND_bytes_ex()

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

2 years agossl: ass size_t to RAND_bytes_ex()
Pauli [Mon, 31 May 2021 06:31:04 +0000 (16:31 +1000)]
ssl: ass size_t to RAND_bytes_ex()

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

2 years agorand: use size_t for size argument to RAND_bytes_ex()
Pauli [Mon, 31 May 2021 06:30:50 +0000 (16:30 +1000)]
rand: use size_t for size argument to RAND_bytes_ex()

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

2 years agoMove provider der_XXX.h.in files to the include directory.
Shane Lontis [Mon, 31 May 2021 08:45:44 +0000 (18:45 +1000)]
Move provider der_XXX.h.in files to the include directory.

Fixes #15506

The .in and generated .h files are now in the same directory.

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

2 years agoFix error stack for some fetch calls.
Shane Lontis [Sat, 29 May 2021 07:16:22 +0000 (17:16 +1000)]
Fix error stack for some fetch calls.

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

2 years agoMigration guide updates for flags and controls.
Shane Lontis [Sat, 29 May 2021 02:47:19 +0000 (12:47 +1000)]
Migration guide updates for flags and controls.

Provided a section that links to the ctrl/flags mappings to parameters
for digests and ciphers.

Added "EVP_CIPHER_CTX_set_flags() ordering" to changes section.

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

2 years agoDocument Settable EVP_CIPHER_CTX parameter "use-bits"
Shane Lontis [Sat, 29 May 2021 02:41:43 +0000 (12:41 +1000)]
Document Settable EVP_CIPHER_CTX parameter "use-bits"

Added docs for EVP_CIPHER_CTX_set_flags(),
EVP_CIPHER_CTX_clear_flags() and EVP_CIPHER_CTX_test_flags().

Added section for "FLAGS" to show parameter mappings.

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