]> git.ipfire.org Git - thirdparty/openssl.git/log
thirdparty/openssl.git
3 years agoUpdate CHANGES and NEWS for new release
Matt Caswell [Tue, 8 Dec 2020 11:19:41 +0000 (11:19 +0000)] 
Update CHANGES and NEWS for new release

Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoAdd a test for encoding/decoding using an invalid ASN.1 Template
Matt Caswell [Mon, 30 Nov 2020 14:46:47 +0000 (14:46 +0000)] 
Add a test for encoding/decoding using an invalid ASN.1 Template

If you have a CHOICE type that it must use explicit tagging - otherwise
the template is invalid. We add tests for this.

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
3 years agoAdd a test for GENERAL_NAME_cmp
Matt Caswell [Mon, 30 Nov 2020 13:50:52 +0000 (13:50 +0000)] 
Add a test for GENERAL_NAME_cmp

Based on a boringssl test contributed by David Benjamin

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
3 years agoComplain if we are attempting to encode with an invalid ASN.1 template
Matt Caswell [Thu, 12 Nov 2020 14:55:31 +0000 (14:55 +0000)] 
Complain if we are attempting to encode with an invalid ASN.1 template

It never makes sense for multi-string or CHOICE types to have implicit
tagging. If we have a template that uses the in this way then we
should immediately fail.

Thanks to David Benjamin from Google for reporting this issue.

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
3 years agoCheck that multi-strings/CHOICE types don't use implicit tagging
Matt Caswell [Thu, 12 Nov 2020 11:58:12 +0000 (11:58 +0000)] 
Check that multi-strings/CHOICE types don't use implicit tagging

It never makes sense for multi-string or CHOICE types to use implicit
tagging since the content would be ambiguous. It is an error in the
template if this ever happens. If we detect it we should stop parsing.

Thanks to David Benjamin from Google for reporting this issue.

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
3 years agoCorrectly compare EdiPartyName in GENERAL_NAME_cmp()
Matt Caswell [Wed, 11 Nov 2020 16:12:58 +0000 (16:12 +0000)] 
Correctly compare EdiPartyName in GENERAL_NAME_cmp()

If a GENERAL_NAME field contained EdiPartyName data then it was
incorrectly being handled as type "other". This could lead to a
segmentation fault.

Many thanks to David Benjamin from Google for reporting this issue.

CVE-2020-1971

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
3 years agoDirectoryString is a CHOICE type and therefore uses explicit tagging
Matt Caswell [Wed, 11 Nov 2020 15:19:34 +0000 (15:19 +0000)] 
DirectoryString is a CHOICE type and therefore uses explicit tagging

EDIPartyName has 2 fields that use a DirectoryString. However they were
marked as implicit tagging - which is not correct for a CHOICE type.

Additionally the partyName field was marked as Optional when, according to
RFC5280 it is not.

Many thanks to github user @filipnavara for reporting this issue. Also to
David Benjamin from Google who independently identified and reported it.

Fixes #6859

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
3 years agoDeprecate EC_POINT_bn2point and EC_POINT_point2bn.
Shane Lontis [Mon, 2 Nov 2020 02:46:38 +0000 (12:46 +1000)] 
Deprecate EC_POINT_bn2point and EC_POINT_point2bn.

Fixes #10366

The one place that actually used was in the legacy printing of ecparams.
This has been replaced by the pointtobuf variant.

The ecparam app was using one of these functions - this line has just been
removed as another PR will remove all the code generated lines..

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

3 years agoChange OPENSSL_hexstr2buf_ex() & OPENSSL_buf2hexstr_ex() to pass the separator
Shane Lontis [Mon, 2 Nov 2020 02:41:23 +0000 (12:41 +1000)] 
Change OPENSSL_hexstr2buf_ex() & OPENSSL_buf2hexstr_ex() to pass the separator

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

3 years agoopenssl.pod: Carve out Trusted Certificate, Pass Phrase, Name Format, and Format...
Ankita Shetty [Fri, 27 Nov 2020 16:05:30 +0000 (17:05 +0100)] 
openssl.pod: Carve out Trusted Certificate, Pass Phrase, Name Format, and Format Options

Move detailed doc to specific new files in doc/man1/openssl-*-options.pod

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/13315)

3 years agoopenssl.pod: Move verification doc to new doc/man1/openssl-verification-options.pod
David von Oheimb [Wed, 4 Nov 2020 13:04:27 +0000 (14:04 +0100)] 
openssl.pod: Move verification doc to new doc/man1/openssl-verification-options.pod

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

3 years agofind-doc-nits: fix regexp and point out that CA.pl and tsget.pod are special
Dr. David von Oheimb [Fri, 20 Nov 2020 11:29:32 +0000 (12:29 +0100)] 
find-doc-nits: fix regexp and point out that CA.pl and tsget.pod are special

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

3 years agoPEM: Add a more generic way to implement PEM _ex functions for libctx
Richard Levitte [Mon, 14 Sep 2020 09:30:14 +0000 (11:30 +0200)] 
PEM: Add a more generic way to implement PEM _ex functions for libctx

This also adds the following functions, for completeness:

PEM_write_PrivateKey_ex(), PEM_write_bio_PrivateKey_ex(),
PEM_write_PUBKEY_ex, PEM_write_bio_PUBKEY_ex

Fixes #13542

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

3 years agoEVP: Adjust EVP_PKEY_size(), EVP_PKEY_bits() and EVP_PKEY_security_bits()
Richard Levitte [Fri, 4 Dec 2020 08:34:25 +0000 (09:34 +0100)] 
EVP: Adjust EVP_PKEY_size(), EVP_PKEY_bits() and EVP_PKEY_security_bits()

These functions are documented to return 0 if the size they are
supposed to return 0 if the size isn't available.  They needed a bit
of adjustment to actually do so, since the backend functions they call
might return negative numbers in that case.

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

3 years agoDSA: Make DSA_bits() and DSA_size() check that there are key parameters
Richard Levitte [Fri, 4 Dec 2020 07:55:19 +0000 (08:55 +0100)] 
DSA: Make DSA_bits() and DSA_size() check that there are key parameters

Without these check, a DSA structure without key parameters will cause
these functions to crash.  This is also the case in pre-3.0 OpenSSL,
but since we now extract these data early, to cache them in the
EVP_PKEY structure, the same crash happens earlier and much more
internally.

The added checks are of the same kind as DSA_security_bits() already
does.

Fixes #13610

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

3 years agoSwitch deprecation method for X.509
Richard Levitte [Fri, 20 Nov 2020 09:10:06 +0000 (10:10 +0100)] 
Switch deprecation method for X.509

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

3 years agoSwitch deprecation method for Whirlpool
Richard Levitte [Fri, 20 Nov 2020 09:09:55 +0000 (10:09 +0100)] 
Switch deprecation method for Whirlpool

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

3 years agoSwitch deprecation method for OSSL_STORE
Richard Levitte [Fri, 20 Nov 2020 09:09:42 +0000 (10:09 +0100)] 
Switch deprecation method for OSSL_STORE

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

3 years agoSwitch deprecation method for SSL
Richard Levitte [Fri, 20 Nov 2020 09:09:29 +0000 (10:09 +0100)] 
Switch deprecation method for SSL

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

3 years agoSwitch deprecation method for SRP
Richard Levitte [Fri, 20 Nov 2020 09:09:15 +0000 (10:09 +0100)] 
Switch deprecation method for SRP

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

3 years agoSwitch deprecation method for SHA
Richard Levitte [Fri, 20 Nov 2020 09:09:06 +0000 (10:09 +0100)] 
Switch deprecation method for SHA

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

3 years agoSwitch deprecation method for SEED
Richard Levitte [Fri, 20 Nov 2020 09:08:58 +0000 (10:08 +0100)] 
Switch deprecation method for SEED

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

3 years agoSwitch deprecation method for RIPEMD
Richard Levitte [Fri, 20 Nov 2020 09:08:49 +0000 (10:08 +0100)] 
Switch deprecation method for RIPEMD

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

3 years agoSwitch deprecation method for RC5
Richard Levitte [Fri, 20 Nov 2020 09:08:33 +0000 (10:08 +0100)] 
Switch deprecation method for RC5

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

3 years agoSwitch deprecation method for RC4
Richard Levitte [Fri, 20 Nov 2020 09:08:27 +0000 (10:08 +0100)] 
Switch deprecation method for RC4

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

3 years agoSwitch deprecation method for RC2
Richard Levitte [Fri, 20 Nov 2020 09:08:18 +0000 (10:08 +0100)] 
Switch deprecation method for RC2

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

3 years agoSwitch deprecation method for RAND
Richard Levitte [Fri, 20 Nov 2020 09:08:03 +0000 (10:08 +0100)] 
Switch deprecation method for RAND

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

3 years agoSwitch deprecation method for PKCS#12
Richard Levitte [Fri, 20 Nov 2020 09:07:54 +0000 (10:07 +0100)] 
Switch deprecation method for PKCS#12

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

3 years agoSwitch deprecation method for MDC2
Richard Levitte [Fri, 20 Nov 2020 09:07:40 +0000 (10:07 +0100)] 
Switch deprecation method for MDC2

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

3 years agoSwitch deprecation method for MD5
Richard Levitte [Fri, 20 Nov 2020 09:07:31 +0000 (10:07 +0100)] 
Switch deprecation method for MD5

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

3 years agoSwitch deprecation method for MD4
Richard Levitte [Fri, 20 Nov 2020 09:07:24 +0000 (10:07 +0100)] 
Switch deprecation method for MD4

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

3 years agoSwitch deprecation method for MD2
Richard Levitte [Fri, 20 Nov 2020 09:07:10 +0000 (10:07 +0100)] 
Switch deprecation method for MD2

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

3 years agoSwitch deprecation method for IDEA
Richard Levitte [Fri, 20 Nov 2020 09:06:40 +0000 (10:06 +0100)] 
Switch deprecation method for IDEA

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

3 years agoSwitch deprecation method for HMAC
Richard Levitte [Fri, 20 Nov 2020 09:06:32 +0000 (10:06 +0100)] 
Switch deprecation method for HMAC

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

3 years agoSwitch deprecation method for EVP
Richard Levitte [Fri, 20 Nov 2020 09:06:23 +0000 (10:06 +0100)] 
Switch deprecation method for EVP

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

3 years agoSwitch deprecation method for ERR
Richard Levitte [Fri, 20 Nov 2020 09:06:13 +0000 (10:06 +0100)] 
Switch deprecation method for ERR

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

3 years agoSwitch deprecation method for ENGINE
Richard Levitte [Fri, 20 Nov 2020 09:05:22 +0000 (10:05 +0100)] 
Switch deprecation method for ENGINE

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

3 years agoSwitch deprecation method for DES
Richard Levitte [Fri, 20 Nov 2020 09:05:12 +0000 (10:05 +0100)] 
Switch deprecation method for DES

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

3 years agoSwitch deprecation method for CRYPTO
Richard Levitte [Fri, 20 Nov 2020 09:05:04 +0000 (10:05 +0100)] 
Switch deprecation method for CRYPTO

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

3 years agoSwitch deprecation method for CONF
Richard Levitte [Fri, 20 Nov 2020 09:04:55 +0000 (10:04 +0100)] 
Switch deprecation method for CONF

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

3 years agoSwitch deprecation method for CMAC
Richard Levitte [Fri, 20 Nov 2020 09:04:42 +0000 (10:04 +0100)] 
Switch deprecation method for CMAC

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

3 years agoSwitch deprecation method for CAST
Richard Levitte [Fri, 20 Nov 2020 09:04:30 +0000 (10:04 +0100)] 
Switch deprecation method for CAST

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

3 years agoSwitch deprecation method for Camellia
Richard Levitte [Fri, 20 Nov 2020 09:04:19 +0000 (10:04 +0100)] 
Switch deprecation method for Camellia

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

3 years agoSwitch deprecation method for BIGNUM
Richard Levitte [Fri, 20 Nov 2020 09:04:09 +0000 (10:04 +0100)] 
Switch deprecation method for BIGNUM

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

3 years agoSwitch deprecation method for Blowfish
Richard Levitte [Fri, 20 Nov 2020 09:03:59 +0000 (10:03 +0100)] 
Switch deprecation method for Blowfish

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

3 years agoSwitch deprecation method for BIO
Richard Levitte [Fri, 20 Nov 2020 09:03:07 +0000 (10:03 +0100)] 
Switch deprecation method for BIO

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

3 years agoSwitch deprecation method for ASN.1
Richard Levitte [Fri, 20 Nov 2020 09:02:51 +0000 (10:02 +0100)] 
Switch deprecation method for ASN.1

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

3 years agoSwitch deprecation method for AES
Richard Levitte [Fri, 20 Nov 2020 09:02:27 +0000 (10:02 +0100)] 
Switch deprecation method for AES

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

3 years agotest/certs/setup.sh: Fix two glitches
Dr. David von Oheimb [Thu, 3 Dec 2020 14:26:48 +0000 (15:26 +0100)] 
test/certs/setup.sh: Fix two glitches

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

3 years agox509_vfy.c: Improve comments (correcting typos etc.)
Dr. David von Oheimb [Thu, 3 Dec 2020 10:10:19 +0000 (11:10 +0100)] 
x509_vfy.c: Improve comments (correcting typos etc.)

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

3 years agoapps/verify:c: Enable output of multiple verification errors due to -x509_strict
Dr. David von Oheimb [Thu, 3 Dec 2020 11:00:35 +0000 (12:00 +0100)] 
apps/verify:c: Enable output of multiple verification errors due to -x509_strict

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

3 years ago{.travis,ci,appveyor}.yml: Make minimal config consistent, add no-deprecated no-ec...
Dr. David von Oheimb [Tue, 1 Dec 2020 16:15:45 +0000 (17:15 +0100)] 
{.travis,ci,appveyor}.yml: Make minimal config consistent, add no-deprecated no-ec no-ktls no-siv

This works nicely by addin a new no-bulk option to Configure.

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

3 years agoapps/speed.c: Rename misleading 'rsa_count' variable to 'op_count'
Dr. David von Oheimb [Wed, 2 Dec 2020 09:49:49 +0000 (10:49 +0100)] 
apps/speed.c: Rename misleading 'rsa_count' variable to 'op_count'

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

3 years agoevp_pkey_dparams_test.c: Fix build error on OPENSSL_NO_{DH,DSA,EC}
Dr. David von Oheimb [Sun, 29 Nov 2020 19:35:49 +0000 (20:35 +0100)] 
evp_pkey_dparams_test.c: Fix build error on OPENSSL_NO_{DH,DSA,EC}

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

3 years agoendecode_test.c: Fix build errors on OPENSSL_NO_{DH,DSA,EC,EC2M}
Dr. David von Oheimb [Sun, 29 Nov 2020 19:33:23 +0000 (20:33 +0100)] 
endecode_test.c: Fix build errors on OPENSSL_NO_{DH,DSA,EC,EC2M}

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

3 years agoapps/speed.c: Fix build errors on OPENSSL_NO_{RSA,DSA,EC,DEPECATED_3_0}
Dr. David von Oheimb [Sun, 29 Nov 2020 19:32:46 +0000 (20:32 +0100)] 
apps/speed.c: Fix build errors on OPENSSL_NO_{RSA,DSA,EC,DEPECATED_3_0}

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

3 years agofuzz/server.c: Fix build error on OPENSSL_NO_{DSA,EC,DEPECATED_3_0}
Dr. David von Oheimb [Sun, 29 Nov 2020 19:23:57 +0000 (20:23 +0100)] 
fuzz/server.c: Fix build error on OPENSSL_NO_{DSA,EC,DEPECATED_3_0}

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

3 years agoencode_key2text.c: Fix build error on OPENSSL_NO_{DH,DSA,EC}
Dr. David von Oheimb [Sun, 29 Nov 2020 21:54:18 +0000 (22:54 +0100)] 
encode_key2text.c: Fix build error on OPENSSL_NO_{DH,DSA,EC}

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

3 years agoencode_key2any.c: Fix build error on OPENSSL_NO_DH and OPENSSL_NO_EC
Dr. David von Oheimb [Sun, 29 Nov 2020 20:30:53 +0000 (21:30 +0100)] 
encode_key2any.c: Fix build error on OPENSSL_NO_DH and OPENSSL_NO_EC

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

3 years agoappveyor.yml: Move printing of env variables such that locally defined ones are shown...
Dr. David von Oheimb [Sat, 10 Oct 2020 20:25:10 +0000 (22:25 +0200)] 
appveyor.yml: Move printing of env variables such that locally defined ones are shown as well.

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

3 years agoFix no-dsa
Matt Caswell [Wed, 2 Dec 2020 17:01:55 +0000 (17:01 +0000)] 
Fix no-dsa

Skip tests that require DSA to be available. While we're doing this
we also remove an OPENSSL_NO_DSA guard in the dhparam app that is no
longer necessary (even though DSA may not be present in our own providers
it could be available via a third party provider).

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

3 years agoFix dsa & rsa signature dupctx() so that ctx->propq is strduped
Shane Lontis [Thu, 26 Nov 2020 05:06:34 +0000 (15:06 +1000)] 
Fix dsa & rsa signature dupctx() so that ctx->propq is strduped

Discovered when fixing up ecdsa code.

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

3 years agoFix ecdsa digest setting code to match dsa.
Shane Lontis [Thu, 26 Nov 2020 05:03:10 +0000 (15:03 +1000)] 
Fix ecdsa digest setting code to match dsa.

Fixes #13422

ecdsa_set_ctx_params() was not setting the digest correctly. The side
effect noted was that the check for sha1 when signing was not being
done in fips mode.

Also fixed the dupctx() so that propq is deep copied.
The usage of the variable 'flag_allow_md' was also copied from the dsa code.

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

3 years agoFix EVP_PKEY_CTX propq so that it uses a copy
Shane Lontis [Wed, 2 Dec 2020 10:54:08 +0000 (20:54 +1000)] 
Fix EVP_PKEY_CTX propq so that it uses a copy

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

3 years agofix x509_PUBKEY propq so that it uses a copy
Shane Lontis [Wed, 2 Dec 2020 10:52:32 +0000 (20:52 +1000)] 
fix x509_PUBKEY propq so that it uses a copy

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

3 years agoFix x509_crl propq so that it uses a copy
Shane Lontis [Wed, 2 Dec 2020 10:50:32 +0000 (20:50 +1000)] 
Fix x509_crl propq so that it uses a copy

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

3 years agoFix X509 propq so it does not use references
Shane Lontis [Fri, 21 Aug 2020 05:14:42 +0000 (15:14 +1000)] 
Fix X509 propq so it does not use references

Fixes #13486

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

3 years agoci.yml: Let 'make' run silently (-s) with build (gcc) runs in parallel (-j4)
Dr. David von Oheimb [Sun, 29 Nov 2020 18:45:39 +0000 (19:45 +0100)] 
ci.yml: Let 'make' run silently (-s) with build (gcc) runs in parallel (-j4)

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

3 years agoci.yml: Add 'perl configdata.pm --dump' to each config
Dr. David von Oheimb [Tue, 1 Dec 2020 08:44:35 +0000 (09:44 +0100)] 
ci.yml: Add 'perl configdata.pm --dump' to each config

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

3 years ago.travis.yml: Do some build (gcc) runs in parallel (-j4)
Dr. David von Oheimb [Sat, 10 Oct 2020 19:36:47 +0000 (21:36 +0200)] 
.travis.yml: Do some build (gcc) runs in parallel (-j4)

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

3 years agoappveyor.yml: Let 'nmake' do builds in parallel on all CPU cores
Dr. David von Oheimb [Tue, 1 Dec 2020 08:14:15 +0000 (09:14 +0100)] 
appveyor.yml: Let 'nmake' do builds in parallel on all CPU cores

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

3 years agoappveyor.yml: Let 'nmake' run by defaut silently (/S), using MAKEVERBOSE like .travis.yml
Dr. David von Oheimb [Tue, 1 Dec 2020 07:52:33 +0000 (08:52 +0100)] 
appveyor.yml: Let 'nmake' run by defaut silently (/S), using MAKEVERBOSE like .travis.yml

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

3 years agox509_vfy.c: Restore rejection of expired trusted (root) certificate
Dr. David von Oheimb [Tue, 1 Dec 2020 13:22:16 +0000 (14:22 +0100)] 
x509_vfy.c: Restore rejection of expired trusted (root) certificate

The certificate path validation procedure specified in RFC 5280 does not
include checking the validity period of the trusted (root) certificate.
Still it is common good practice to perform this check.
Also OpenSSL did this until commit 0e7b1383e, which accidentally killed it.

The current commit restores the previous behavior.
It also removes the cause of that bug, namely counter-intuitive design
of the internal function check_issued(), which was complicated by checks
that actually belong to some other internal function, namely find_issuer().

Moreover, this commit adds a regression check and proper documentation of
the root cert validity period check feature, which had been missing so far.

Fixes #13427

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

3 years agoapps/pkcs12.c: Improve user guidance, re-ordering no-export vs. export options
Dr. David von Oheimb [Thu, 26 Nov 2020 14:39:22 +0000 (15:39 +0100)] 
apps/pkcs12.c: Improve user guidance, re-ordering no-export vs. export options

Make the option order consistent in the help output and in the POD file.
Give warnings when an option is ignored because -export is given or missing.

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

3 years agotag unused function arguments as ossl_unused
Pauli [Tue, 1 Dec 2020 01:30:10 +0000 (11:30 +1000)] 
tag unused function arguments as ossl_unused

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

3 years agoremove unused initialisations
Pauli [Tue, 1 Dec 2020 01:18:36 +0000 (11:18 +1000)] 
remove unused initialisations

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

3 years agoremove unused assignments
Pauli [Tue, 1 Dec 2020 01:13:08 +0000 (11:13 +1000)] 
remove unused assignments

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

3 years agoremove unused return value assignments
Pauli [Tue, 1 Dec 2020 00:58:32 +0000 (10:58 +1000)] 
remove unused return value assignments

Fixes: #13555
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/13577)

3 years agoFix comment in do_dtls1_write()
Benjamin Kaduk [Sun, 29 Nov 2020 01:11:46 +0000 (17:11 -0800)] 
Fix comment in do_dtls1_write()

This code started off as a copy of ssl3_write_bytes(), and the comment
was not updated with the implementation.

Reported by yangyangtiantianlonglong in #13518

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

3 years agoAdd test to demonstrate the app's new engine key loading
Richard Levitte [Mon, 30 Nov 2020 09:44:34 +0000 (10:44 +0100)] 
Add test to demonstrate the app's new engine key loading

This adds a bit of functionality in ossltest, so it can now be used to
load PEM files.  It takes the file name as key ID, but just to make
sure faults aren't ignored, it requires all file names to be prefixed
with 'ot:'.

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

3 years agoAPPS: Adapt load_key() and load_pubkey() for the engine: loader
Richard Levitte [Mon, 30 Nov 2020 06:25:46 +0000 (07:25 +0100)] 
APPS: Adapt load_key() and load_pubkey() for the engine: loader

These two functions react when the FORMAT_ENGINE format is given, and
use the passed ENGINE |e| and the passed key argument to form a URI
suitable for the engine: loader.

Co-authored-by: David von Oheimb <david.von.oheimb@siemens.com>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/13570)

3 years agoAPPS: Add OSSL_STORE loader for engine keys
Richard Levitte [Fri, 12 Oct 2018 15:02:58 +0000 (17:02 +0200)] 
APPS: Add OSSL_STORE loader for engine keys

The idea is to be able to have our apps load engine keys using a URI:

    org.openssl.engine:{engineid}:{keyid}

This is legacy, but added for the time being to support keys given to
the application like this:

    -engine {engineid} -key {keyid} -keyform ENGINE

This latter form is recognised internally, and rewritten into the URI
form.

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

3 years agoFix no-dtls
Matt Caswell [Tue, 1 Dec 2020 15:34:24 +0000 (15:34 +0000)] 
Fix no-dtls

Ensure we correctly detect if DTLS has been disabled in the client auth
test_ssl_new tests.

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

3 years agoFix a compile error with the no-sock option
Matt Caswell [Tue, 1 Dec 2020 15:19:56 +0000 (15:19 +0000)] 
Fix a compile error with the no-sock option

BIO_do_connect() can work even in no-sock builds (non socket based BIOs
have the right ctrls). Therefore we move the macro outside of the
OPENSSL_NO_SOCK guards

Fixes #12207

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

3 years agoopenssl dgst: add option to specify output length for XOF
Daiki Ueno [Mon, 26 Oct 2020 12:23:14 +0000 (13:23 +0100)] 
openssl dgst: add option to specify output length for XOF

This adds the -xoflen option to control the output length of the XOF
algorithms, such as SHAKE128 and SHAKE256.

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

3 years agoAdapt everything else to the updated OSSL_ENCODER_CTX_new_by_EVP_PKEY()
Richard Levitte [Fri, 27 Nov 2020 07:03:23 +0000 (08:03 +0100)] 
Adapt everything else to the updated OSSL_ENCODER_CTX_new_by_EVP_PKEY()

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

3 years agoENCODER: Don't pass libctx to OSSL_ENCODER_CTX_new_by_EVP_PKEY()
Richard Levitte [Fri, 27 Nov 2020 06:59:02 +0000 (07:59 +0100)] 
ENCODER: Don't pass libctx to OSSL_ENCODER_CTX_new_by_EVP_PKEY()

The passed 'pkey' already contains a library context, and the encoder
implementations should be found within the same context, so passing an
explicit library context seems unnecessary, and potentially dangerous.

It should be noted that it's possible to pass an EVP_PKEY with a
legacy internal key.  The condition there is that it doesn't have a
library context assigned to it, so the NULL library context is used
automatically, thus requiring that appropriate encoders are available
through that context.

Fixes #13544

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

3 years agocmp_client.c: Fix indentation and remove empty line
Ankita Shetty [Tue, 24 Nov 2020 18:55:27 +0000 (19:55 +0100)] 
cmp_client.c: Fix indentation and remove empty line

Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/13488)

3 years agocmp_client.c: Remove dead code of variable 'txt' in cert_response()
Ankita Shetty [Mon, 23 Nov 2020 16:12:33 +0000 (17:12 +0100)] 
cmp_client.c: Remove dead code of variable 'txt' in cert_response()

Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/13488)

3 years agoDon't Overflow when printing Thawte Strong Extranet Version
Matt Caswell [Thu, 19 Nov 2020 13:58:21 +0000 (13:58 +0000)] 
Don't Overflow when printing Thawte Strong Extranet Version

When printing human readable info on the Thawte Strong Extranet extension
the version number could overflow if the version number == LONG_MAX. This
is undefined behaviour.

Issue found by OSSFuzz.

Reviewed-by: Ben Kaduk <kaduk@mit.edu>
(Merged from https://github.com/openssl/openssl/pull/13452)

3 years agoAdd EVP_KDF-X942 to the fips module
Shane Lontis [Mon, 16 Nov 2020 02:42:18 +0000 (12:42 +1000)] 
Add EVP_KDF-X942 to the fips module

The X942 KDF had been modified so that it supports all optional fields - not
just the fields used by CMS.

As there are 2 types of KDF for X942 - this has been made a bit clearer
by adding an X942KDF-ASN1 alias. X942KDF-CONCAT has also been added as an
alias of X963KDF.

This work was instigated as a result of the ACVP tests optionally being
able to use keybits for the supp_pubinfo field.
Setting the parameter OSSL_KDF_PARAM_X942_USE_KEYBITS to 0 allows this
to be disabled.

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

3 years agoFix s390 EDDSA HW support in providers.
Shane Lontis [Wed, 25 Nov 2020 08:19:27 +0000 (18:19 +1000)] 
Fix s390 EDDSA HW support in providers.

Fixes #12476

Note this stopped working when ECX was swapped over to using
providers. The ECX_KEY keygen and exchange were converted, but not the ED
signing support.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Patrick Steuer <patrick.steuer@de.ibm.com>
(Merged from https://github.com/openssl/openssl/pull/13508)

3 years agoPrint random seed on test failure.
Pauli [Mon, 30 Nov 2020 12:13:12 +0000 (22:13 +1000)] 
Print random seed on test failure.

Tests randomisation wasn't reliably printing the seed used on failure in the CIs.

Fixes: #13572
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/13573)

3 years agoCorrect system guessing for darwin64-arm64 target
Tim Hudson [Thu, 26 Nov 2020 02:31:25 +0000 (12:31 +1000)] 
Correct system guessing for darwin64-arm64 target

Previously the system guessing logic would incorrectly guess
i686-apple-darwin as the fallback for any unspecified architecture
that is a Darwin target

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

3 years agoapps/pkcs12.c: Correct default legacy algs and make related doc consistent
Dr. David von Oheimb [Thu, 26 Nov 2020 10:03:24 +0000 (11:03 +0100)] 
apps/pkcs12.c: Correct default legacy algs and make related doc consistent

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

3 years agoFix simpledynamic.c - a typo and missed a header
Kelvin Lee [Tue, 1 Dec 2020 13:25:01 +0000 (00:25 +1100)] 
Fix simpledynamic.c - a typo and missed a header

CLA: trivial

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

3 years agoTEST: Add a simple module loader, and test the FIPS module with it
Richard Levitte [Wed, 25 Nov 2020 06:57:45 +0000 (07:57 +0100)] 
TEST: Add a simple module loader, and test the FIPS module with it

This very simple module loader is only linked with the standard C
library, so cannot and should not provide any other symbol to the
module it tries to load.  It can thereby be used to verify that the
module it tries to load doesn't have any surprising dependencies when
it's supposed to be self contained.

A test recipe is added to verify the FIPS module with this loader.

Fixes #11020

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

3 years agoTEST: Break out the local dynamic loading code from shlibloadtest.c
Richard Levitte [Wed, 25 Nov 2020 06:56:08 +0000 (07:56 +0100)] 
TEST: Break out the local dynamic loading code from shlibloadtest.c

The result is "simpledynamic.c", or "sd" for short.

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

3 years agoendecode_test.c: Add warning that 512-bit DH key size is for testing only
Dr. David von Oheimb [Sun, 29 Nov 2020 11:46:12 +0000 (12:46 +0100)] 
endecode_test.c: Add warning that 512-bit DH key size is for testing only

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

3 years agotest cleanup: move helper .c and .h files to test/helpers/
Dr. David von Oheimb [Sun, 29 Nov 2020 11:40:10 +0000 (12:40 +0100)] 
test cleanup: move helper .c and .h files to test/helpers/

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