Tanzinul Islam [Sat, 7 Nov 2020 20:49:47 +0000 (20:49 +0000)]
Generalize delimiter in archiver response file
While [`lib.exe` of MSVC][1] expects newline-delimited response file
lines, [`tlib.exe` of C++Builder][2] expects lines to end with `&` in
order to read the next line.
[1]: https://docs.microsoft.com/cpp/build/reference/running-lib?view=msvc-160#lib-command-files
[2]: http://docwiki.embarcadero.com/RADStudio/Sydney/en/TLIB.EXE,_the_Library_Manager#Response_Files
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/13540)
Tanzinul Islam [Sat, 7 Nov 2020 14:11:05 +0000 (14:11 +0000)]
Avoid space between "-I" and include directory
The space is problematic with C++Builder (`bcc32.exe`). MSVC (`cl.exe`)
doesn't care.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/13540)
Tanzinul Islam [Sat, 7 Nov 2020 13:13:34 +0000 (13:13 +0000)]
Move VS Tools configuration to VC-common target
The Windows toolchain is composed of utilites from both the Windows SDK
and the Visual Studio Build Tools. Move the configuration of the latter
utilities into the `VC-common` template inside `10-main.conf`, while
leaving the former utilities in `BASE_Windows`. This allows for other
Windows compilers to be configured inheriting from `BASE_Windows`.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/13540)
Tanzinul Islam [Sat, 7 Nov 2020 12:52:30 +0000 (12:52 +0000)]
Avoid "&&" in windows-makefile.tmpl
The `make.exe` utility shipped with Embarcadero C++Builder has a special
meaning for the [`&&` operator in commands][1]. This meaning is retained
even in Microsoft NMake compatibility mode (`make -N`). Split all
commands using this shell (`cmd.exe`) operator into two commands.
[1]: http://docwiki.embarcadero.com/RADStudio/Sydney/en/MAKE_Rules_(Explicit_and_Implicit)_and_Commands#MAKE_Command_Operators
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/13540)
Tomas Mraz [Thu, 15 Apr 2021 09:53:42 +0000 (11:53 +0200)]
Add test for the IV handling of DES based ciphers
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/14882)
Tomas Mraz [Thu, 15 Apr 2021 07:55:04 +0000 (09:55 +0200)]
Do IV reset also for DES and 3DES implementations
Fixes #14704
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/14882)
Matt Caswell [Mon, 12 Apr 2021 16:04:43 +0000 (17:04 +0100)]
Change the default MANSUFFIX
We now use the MANSUFFIX "ossl" by default.
Fixes #14318
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14847)
Tomas Mraz [Fri, 16 Apr 2021 10:31:39 +0000 (12:31 +0200)]
Add DHX FIPS 186-4 domain parameter validation example
Fixes #14369
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14896)
Richard Levitte [Tue, 16 Mar 2021 04:40:50 +0000 (05:40 +0100)]
CORE: pre-populate the namemap with legacy OIDs too
This also pre-populates the namemap with names derived from the
internal EVP_PKEY_ASN1_METHODs. This requires attention, as they
contain aliases that we may want (RSA == rsaEncryption), as well as
aliases that we absolutely do not want (SM2 == EC).
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14498)
Richard Levitte [Thu, 11 Mar 2021 15:04:16 +0000 (16:04 +0100)]
TEST: Use OSSL_MAX_NAME_SIZE instead of arbitrary number of mdname
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14498)
Richard Levitte [Thu, 11 Mar 2021 12:36:06 +0000 (13:36 +0100)]
CORE: Register all legacy "names" when generating the initial namemap
When generating the initial namemap from EVP cipher and digest names,
we din't do it quite as thoroughly as necessary, which meant that so
called "long names" weren't necessarily registered, and if anyone ever
tried to check the algorithm of an EVP_CIPHER or EVP_MD using a so
called "long name" would fail.
This doesn't deal with the fact that "long names" have a distinct role
as human readable descriptors, useful for printouts. Further changes
are necessary to deal with this.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14498)
Richard Levitte [Wed, 10 Mar 2021 11:58:53 +0000 (12:58 +0100)]
Modify OBJ_nid2sn(OBJ_obj2nid(...)) occurences to use OBJ_obj2txt()
The intention is to allow for OIDs for which libcrypto has no
information, but are still fetchable for OSSL_ALGORITHM
implementations that specify an OID amongst their names.
Fixes #14278
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14498)
Richard Levitte [Wed, 10 Mar 2021 11:53:51 +0000 (12:53 +0100)]
TEST: Modify how the retrieved digest name for SM2 digestsign is checked
Because of aliases, retrieved names won't always match one specific
string. A safer way to check is to fetch the digest from the
retrieved name and check it's the expected one with the help of
EVP_MD_is_a().
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14498)
Richard Levitte [Wed, 10 Mar 2021 10:32:45 +0000 (11:32 +0100)]
TEST: Modify testutil's run_tests to display NOSUBTEST cases individually
When test cases were added with ADD_ALL_TESTS_NOSUBTEST(), all those
iteration verdicts were summarized as if it was one single case. This
modification gets each iteration verdict displayed separately instead.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14498)
Richard Levitte [Wed, 10 Mar 2021 10:31:49 +0000 (11:31 +0100)]
TEST: Modify test/evp_fetch_prov_test.c to also fetch by OID
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14498)
Richard Levitte [Wed, 10 Mar 2021 10:22:55 +0000 (11:22 +0100)]
PROV: Add OIDs we know to all provider applicable algorithms
The OIDs were extracted with the help of libcrypto's ASN1 OID database.
While doing this, we move all the names strings to macro definitions,
to avoid duplication and conflicting names declarations. Those macros
are all in providers/implementations/include/prov/names.h
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14498)
Rich Salz [Tue, 16 Feb 2021 22:51:56 +0000 (17:51 -0500)]
Add "origin" field to EVP_CIPHER, EVP_MD
Add a "where did this EVP_{CIPHER,MD} come from" flag: global, via fetch,
or via EVP_{CIPHER,MD}_meth_new. Update EVP_{CIPHER,MD}_free to handle all
three origins. The flag is deliberately right before some function pointers,
so that compile-time failures (int/pointer) will occur, as opposed to
taking a bit in the existing "flags" field. The "global variable" flag
is non-zero, so the default case of using OPENSSL_zalloc (for provider
ciphers), will do the right thing. Ref-counting is a no-op for
Make up_ref no-op for global MD and CIPHER objects
Deprecate EVP_MD_CTX_md(). Added EVP_MD_CTX_get0_md() (same semantics as
the deprecated function) and EVP_MD_CTX_get1_md(). Likewise, deprecate
EVP_CIPHER_CTX_cipher() in favor of EVP_CIPHER_CTX_get0_cipher(), and add
EVP_CIPHER_CTX_get1_CIPHER().
Refactor EVP_MD_free() and EVP_MD_meth_free() to call new common
evp_md_free_int() function.
Refactor EVP_CIPHER_free() and EVP_CIPHER_meth_free() to call new common
evp_cipher_free_int() function.
Also change some flags tests to explicit test == or != zero. E.g.,
if (flags & x) --> if ((flags & x) != 0)
if (!(flags & x)) --> if ((flags & x) == 0)
Only done for those lines where "get0_cipher" calls were made.
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14193)
Rich Salz [Mon, 15 Feb 2021 17:31:36 +0000 (12:31 -0500)]
Standard style for all EVP_xxx_free routines
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14193)
Nan Xiao [Fri, 16 Apr 2021 01:46:26 +0000 (09:46 +0800)]
Fix typo in aesccm.c
CLA: trivial
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14894)
Dr. David von Oheimb [Thu, 15 Apr 2021 13:44:41 +0000 (15:44 +0200)]
apps/cmp.c: Fix TLS hostname checking in case -server provides more than hostname
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14889)
Dr. David von Oheimb [Tue, 13 Apr 2021 07:08:07 +0000 (09:08 +0200)]
OSSL_CMP_CTX_new(): Fix distinction of out-of-memory and other errors
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14889)
Pauli [Thu, 15 Apr 2021 23:13:43 +0000 (09:13 +1000)]
Fix naming for EVP_RAND_CTX_gettable functions.
Change:
EVP_RAND_gettable_ctx_params -> EVP_RAND_CTX_gettable_params
EVP_RAND_settable_ctx_params -> EVP_RAND_CTX_settable_params
Which brings them in line with the other similar functions for other algorithm
types.
Fixes #14880
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14893)
Matt Caswell [Mon, 12 Apr 2021 14:22:56 +0000 (15:22 +0100)]
Sanity check provider up-calls
When we store references to up-calls for future reference we run a sanity
check to make sure we either previously haven't set these values or they
are the same as last time. We don't support the scenario where an
application is linked against multiple versions of libcrypto but using a
shared fips.so file. This would result in different up-calls for different
calls to OSSL_provider_init(), which we currently can't handle.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14814)
Matt Caswell [Fri, 9 Apr 2021 16:26:34 +0000 (17:26 +0100)]
Store some FIPS global variables in the FIPS_GLOBAL structure
We had some FIPS global variables that were based on values from the
config file. In theory if two instances of the fips module are loaded
they could be based on different config files which would cause this to
fail. Instead we store them in the FIPS_GLOBAL structure.
Fixes #14364
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14814)
Pauli [Wed, 14 Apr 2021 09:00:20 +0000 (19:00 +1000)]
lifecycle: update master lifecycle transition spreadsheet fixing the ettable issue
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14867)
Pauli [Wed, 14 Apr 2021 08:45:44 +0000 (18:45 +1000)]
lifecycle: correct [sg]ettable to [sg]et
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14867)
Nan Xiao [Tue, 23 Mar 2021 16:07:28 +0000 (00:07 +0800)]
demos: Add clean target for bio/Makefile
CLA: trivial
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14661)
Shane Lontis [Mon, 12 Apr 2021 03:58:14 +0000 (13:58 +1000)]
Add more negative checks for integers passed to OPENSSL_malloc().
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14830)
Pauli [Tue, 13 Apr 2021 02:11:41 +0000 (12:11 +1000)]
SipHash: Fix CTRL API for the digest size.
Adds a mapping from "digestsize" to "size" for setting a param.
Fixes #14370
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14850)
Richard Levitte [Wed, 31 Mar 2021 05:59:48 +0000 (07:59 +0200)]
Github workflows: re-implement a no-shared build
We do this both on Ubuntu and MacOS X
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/14753)
Shane Lontis [Thu, 8 Apr 2021 10:05:14 +0000 (20:05 +1000)]
Add EVP_PKEY_todata() and EVP_PKEY_export() functions.
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14800)
Tomas Mraz [Wed, 14 Apr 2021 14:35:28 +0000 (16:35 +0200)]
Add OID for mdc2WithRSASignature and remove related TODO 3.0
Fixes #14366
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14874)
Tomas Mraz [Wed, 14 Apr 2021 10:42:30 +0000 (12:42 +0200)]
Rename EVP_PKEY_get0_first_alg_name to EVP_PKEY_get0_type_name
We use type elsewhere and documenting the 'first' in the
name of the call is a little bit superfluous making the
name too mouthful.
Also rename EVP_PKEY_typenames_do_all to
EVP_PKEY_type_names_do_all to keep the words separated by
underscore.
Fixes #14701
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14868)
Pauli [Wed, 14 Apr 2021 02:26:41 +0000 (12:26 +1000)]
changes: note that some ctrl calls have a different error return.
Providers do not distinguish between invalid and other errors via the return
code.
Fixes #14442
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14864)
Tomas Mraz [Thu, 8 Apr 2021 17:27:06 +0000 (19:27 +0200)]
Do not allow creating empty RSA keys by duplication
Also avoid crashing in rsa_get_params on empty keys.
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/14793)
Tomas Mraz [Thu, 8 Apr 2021 17:02:44 +0000 (19:02 +0200)]
Remove keymgmt_copy function from the provider API
It is superceded by the keymgmt_dup.
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/14793)
Tomas Mraz [Thu, 8 Apr 2021 16:25:26 +0000 (18:25 +0200)]
Add selection support to the provider keymgmt_dup function
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/14793)
Tomas Mraz [Wed, 7 Apr 2021 17:35:13 +0000 (19:35 +0200)]
Implement provider-side keymgmt_dup function
To avoid mutating key data add OSSL_FUNC_KEYMGMT_DUP function
to the provider API and implement it for all asym-key key
managements.
Use it when copying everything to an empty EVP_PKEY
which is the case with EVP_PKEY_dup().
Fixes #14658
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/14793)
Dr. David von Oheimb [Sat, 3 Apr 2021 13:53:16 +0000 (15:53 +0200)]
80-test_cmp_http.t: Extend diagnostics of mock server launch
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14839)
Dr. David von Oheimb [Sat, 3 Apr 2021 12:28:17 +0000 (14:28 +0200)]
80-test_cmp_http.t: Silence check for availability of 'kill' and 'lsof' commands
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14839)
Dr. David von Oheimb [Sat, 3 Apr 2021 12:25:54 +0000 (14:25 +0200)]
80-test_cmp_http.t: Fix resumption when skipping after mock server launch failed
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14839)
Dr. David von Oheimb [Sat, 3 Apr 2021 10:19:10 +0000 (12:19 +0200)]
apps/cmp: Add generic random state options, e.g., for nonce generation
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14842)
Dr. David von Oheimb [Sat, 3 Apr 2021 11:08:16 +0000 (13:08 +0200)]
openssl-cmp.pod.in: Fix missing provider options description
Also correct layout of engines description
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14842)
Dr. David von Oheimb [Sat, 3 Apr 2021 09:29:54 +0000 (11:29 +0200)]
cmp_util.c: Fix OSSL_CMP_log_open() in case OPENSSL_NO_TRACE
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14842)
Dr. David von Oheimb [Sat, 3 Apr 2021 12:05:09 +0000 (14:05 +0200)]
APPS and TEST: Make sure prog name is set for usage output
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14841)
Dr. David von Oheimb [Sat, 3 Apr 2021 10:53:51 +0000 (12:53 +0200)]
APPS: make apps strict on app_RAND_load() and app_RAND_write() failure
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14840)
Tomas Mraz [Mon, 12 Apr 2021 17:22:04 +0000 (19:22 +0200)]
Document the invariants for the empty X509_NAME encoding
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/14832)
Tomas Mraz [Mon, 12 Apr 2021 07:58:27 +0000 (09:58 +0200)]
X509_NAME_cmp: if canon_enclen is 0 for both names return 0
We do not care whether canon_enc is NULL in this case.
Fixes #14813
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/14832)
Pauli [Mon, 12 Apr 2021 21:47:31 +0000 (07:47 +1000)]
bio_printf: add \0 terminators for error returns in floating point conversions.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14829)
Pauli [Mon, 12 Apr 2021 03:52:19 +0000 (13:52 +1000)]
bio: note that BIO_sprintf null terminates on insufficient space.
Fixes: #14772
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14829)
Pauli [Mon, 12 Apr 2021 01:36:50 +0000 (11:36 +1000)]
bio: add a malloc failed error to BIO_print
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14829)
Shane Lontis [Mon, 12 Apr 2021 01:19:21 +0000 (11:19 +1000)]
Add some additional NULL checks to prevent segfaults.
Fixes #14809
PR #14752 attempted to pass the libctx, propq in a few places related to
X509 signing. There were a few places that needed additional NULL checks so that they behavethe same as they did before.
OCSP_basic_sign() was changed to call EVP_DigestSignInit_ex() which passed the parameter EVP_MD_name(dgst). Since dgst can be NULL EVP_MD_name() was segfaulting.
Adding an additional NULL check EVP_MD_name() resolves this issue.
The other NULL checks are required to produce errors rather than
segfaults if the certificate is NULL.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14826)
Shane Lontis [Sun, 11 Apr 2021 23:06:24 +0000 (09:06 +1000)]
Add domain parameter match check for DH and ECDH key exchange.
Fixes #14808
Validation checks were moved into EVP_PKEY_derive_set_peer() which broke
an external negative test. Originally the old code was semi working by checking the peers public key was in the range of other parties p. It was not actually ever
checking that the domain parameters were consistent between the 2
parties. It now checks the parameters match as well as validating the
peers public key.
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14823)
Matt Caswell [Mon, 12 Apr 2021 14:52:05 +0000 (15:52 +0100)]
Remove a TODO(3.0) from X509_PUBKEY_set
The comment talks about the EVP_PKEY that is contained within an
X509_PUBKEY object and whether it has to be exactly the same as the one
passed by the caller in X509_PUBKEY_set(). IMO it does, so the TODO should
be dropped.
Fixes #14378
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14845)
FdaSilvaYY [Wed, 28 Mar 2018 21:15:38 +0000 (23:15 +0200)]
crypto: raise error on malloc failure
clean a few style nits.
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14806)
FdaSilvaYY [Sun, 6 May 2018 15:50:23 +0000 (17:50 +0200)]
nits: fix a few typo in template code
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14806)
Jakub Wilk [Mon, 12 Apr 2021 10:41:27 +0000 (12:41 +0200)]
doc: Fix formatting
CLA: trivial
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14835)
Todd Short [Mon, 22 Mar 2021 16:56:36 +0000 (12:56 -0400)]
Handle set_alpn_protos inputs better.
It's possible to set an invalid protocol list that will be sent in a
ClientHello. This validates the inputs to make sure this does not
happen.
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14815)
Dr. Matthias St. Pierre [Mon, 8 Feb 2021 23:16:55 +0000 (00:16 +0100)]
util/wrap.pl: use the apps/openssl.cnf from the source tree
The `make install_fips` target failed
msp@debian:~/src/openssl$ make install_fips
*** Installing FIPS module
install providers/fips.so -> /opt/openssl-dev/lib/ossl-modules/fips.so
*** Installing FIPS module configuration
fipsinstall /opt/openssl-dev/ssl/fipsmodule.cnf
FATAL: Startup failure (dev note: apps_startup()) for ./apps/openssl
... No such file or directory:crypto/conf/conf_def.c:771:calling stat(fipsmodule.cnf)
...
make: *** [Makefile:3341: install_fips] Error 1
because the `openssl fipsinstall` command was loading a previously installed
configuration file instead of the copy shipped with the source tree.
msp@debian:~/src/openssl$ strace -f make install_fips |& grep openssl.cnf
[pid 128683] openat(AT_FDCWD, "/opt/openssl-dev/ssl/openssl.cnf", O_RDONLY) = 3
This issue reveiled a more general problem, which applies to the tests as well:
unless openssl is installed, the openssl app must not use any preinstalled
configuration file. This holds in particular when the preinstalled configuration
file load providers, which caused the above failure.
The most consistent way to achieve this behaviour is to set the OPENSSL_CONF
environment variable to the correct location in the util/wrap.pl perl wrapper.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14136)
Petr Gotthard [Sat, 10 Apr 2021 09:08:58 +0000 (11:08 +0200)]
apps: call ERR_print_errors when OSSL_PROVIDER_load fails
The ERR_print_errors often displays the reason why the provider
couldn't be loaded. Hence it is quite important for debugging.
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14818)
Pauli [Mon, 12 Apr 2021 00:24:18 +0000 (10:24 +1000)]
Note deprecated function/macros with no replacement.
These functions are deprecated with no replacement specified:
DH_clear_flags, DH_get_1024_160, DH_get_2048_224, DH_get_2048_256,
DH_set_flags, DH_test_flags, DSA_clear_flags, DSA_dup_DH,
DSAparams_dup, DSA_set_flags, DSA_test_flags, RSA_blinding_off,
RSA_blinding_on, RSA_clear_flags, RSA_get_version, RSAPrivateKey_dup,
RSAPublicKey_dup, RSA_set_flags, RSA_setup_blinding and
RSA_test_flags.
The flags that are going are:
DH_FLAG_CACHE_MONT_P, DSA_FLAG_CACHE_MONT_P,
RSA_FLAG_BLINDING, RSA_FLAG_CACHE_PRIVATE, RSA_FLAG_CACHE_PUBLIC,
RSA_FLAG_EXT_PKEY, RSA_FLAG_NO_BLINDING, RSA_FLAG_THREAD_SAFE and
RSA_METHOD_FLAG_NO_CHECK.
These two flags are "readable" via EVP_is_a(). They are not writable:
DH_FLAG_TYPE_DHX and DH_FLAG_TYPE_DH.
Fixes #14616
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/14824)
Shane Lontis [Tue, 13 Apr 2021 02:24:25 +0000 (12:24 +1000)]
Fix windows compiler error in kmac_prov.c
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14851)
Shane Lontis [Mon, 12 Apr 2021 00:38:16 +0000 (10:38 +1000)]
Add FIPS Self test for AES_ECB decrypt
Fixes #14807
Compliance with IG 9.4 requires that an inverse cipher function be
tested if one is implemented. Just running AES_GCM encrypt/decrypt does not meet this
requirement (Since only ECB, CBC, XTS, KW, KWP support the inverse
function during decryption mode).
Added a mode to the cipher test so that the AES_GCM only does an encrypt
and AES_ECB only does a decrypt. TDES still does both.
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14825)
Matt Caswell [Thu, 8 Apr 2021 15:22:51 +0000 (16:22 +0100)]
Remove the function EVP_PKEY_set_alias_type
OTC recently voted that EVP_PKEY types will be immutable in 3.0. This
means that EVP_PKEY_set_alias_type can no longer work and should be
removed entirely (applications will need to be rewritten not to use it).
It was primarily used for SM2 which no longer needs this call.
Applications should generate SM2 keys directly (without going via an EC
key first), or otherwise when loading keys they should automatically be
detected as SM2 keys.
Fixes #14379
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14803)
Matt Caswell [Wed, 7 Apr 2021 18:36:45 +0000 (19:36 +0100)]
Update KTLS documentation
KTLS support has been changed to be off by default, and configuration is
via a single "option" rather two "modes". Documentation is updated
accordingly.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14799)
Matt Caswell [Wed, 7 Apr 2021 15:53:28 +0000 (16:53 +0100)]
Only enable KTLS if it is explicitly configured
It has always been the case that KTLS is not compiled by default. However
if it is compiled then it was automatically used unless specifically
configured not to. This is problematic because it avoids any crypto
implementations from providers. A user who configures all crypto to use
the FIPS provider may unexpectedly find that TLS related crypto is actually
being performed outside of the FIPS boundary.
Instead we change KTLS so that it is disabled by default.
We also swap to using a single "option" (i.e. SSL_OP_ENABLE_KTLS) rather
than two separate "modes", (i.e. SSL_MODE_NO_KTLS_RX and
SSL_MODE_NO_KTLS_TX).
Fixes #13794
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14799)
Tomas Mraz [Fri, 9 Apr 2021 10:01:16 +0000 (12:01 +0200)]
Always reset IV for CBC, OFB, and CFB mode on cipher context reinit
This is necessary to keep compatibility with 1.1.1 implementation
of the CBC, OFB, and CFB mode ciphers.
Fixes #14704
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14811)
Shane Lontis [Wed, 7 Apr 2021 03:45:19 +0000 (13:45 +1000)]
Replace OSSL_PARAM_BLD_free_params() with OSSL_PARAM_free().
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14785)
Shane Lontis [Wed, 7 Apr 2021 01:27:18 +0000 (11:27 +1000)]
Add OSSL_PARAM_dup() and OSSL_PARAM_merge().
These functions are prerequisites for implementing EVP_PKEY_todata().
OSSL_PARAM_dup() is required to make a deep copy of the exported
params (since the provider export() uses a OSSL_PARAM_BLD which throws away the
data after the call), and then use OSSL_PARAM_merge() to add some additional params
that can be passed to the EVP_PKEY_todata().
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14785)
Pauli [Fri, 9 Apr 2021 06:36:18 +0000 (16:36 +1000)]
kmac: update the documention for the customisation string maximum length
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/14810)
Pauli [Fri, 9 Apr 2021 06:20:15 +0000 (16:20 +1000)]
kmac: fix customistation string overflow bug
Previously there was an off by two error allowing a stack buffer overrun.
Avoided this by allocating a correct sized buffer on the stack. A side effect
is that the maximum size of the customisation string can be increased.
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/14810)
Pauli [Fri, 9 Apr 2021 05:20:16 +0000 (15:20 +1000)]
kmac: add long customisation string example
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/14810)
Pauli [Sat, 10 Apr 2021 02:40:59 +0000 (12:40 +1000)]
Add additional KMAC error
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/14810)
Armin Fuerst [Sat, 6 Mar 2021 11:19:18 +0000 (12:19 +0100)]
apps: fix warning about size_t / int conversion
Windows builds show the following warning:
(..\apps\ca.c(2643): warning C4267: 'function': conversion
from 'size_t' to 'int', possible loss of data)
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14453)
Dave Coombs [Tue, 6 Apr 2021 16:49:21 +0000 (12:49 -0400)]
crl2pkcs7 shouldn't include empty optional sets
If using crl2pkcs7 -nocrl and with no -certfiles, we shouldn't include
the implicitly tagged [0] certs and [1] crls sets as they are marked
optional and would be empty.
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14781)
Nan Xiao [Wed, 7 Apr 2021 01:18:29 +0000 (09:18 +0800)]
Fix typos in x509.pod
CLA: trivial
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14783)
Tomas Mraz [Wed, 31 Mar 2021 11:22:25 +0000 (13:22 +0200)]
Small fixes and cleanups of provider API documentation
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14756)
Tomas Mraz [Wed, 31 Mar 2021 11:20:21 +0000 (13:20 +0200)]
provider-decoder.pod: Documentation of provider side decoder API
Fixes #13949
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14756)
Nan Xiao [Wed, 7 Apr 2021 09:10:25 +0000 (17:10 +0800)]
Fix typo in statem_clnt.c
CLA: trivial
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14791)
Christian Heimes [Tue, 30 Mar 2021 10:02:42 +0000 (12:02 +0200)]
Inherit hostflags verify params even without hosts
X509_VERIFY_PARAM_inherit() now copies hostflags independently of hosts.
Previously hostflags were only copied when at least one host was set.
Typically applications don't configure hosts on SSL_CTX. The change
enables applications to configure hostflags on SSL_CTX and have OpenSSL
copy the flags from SSL_CTX to SSL.
Fixes: https://github.com/openssl/openssl/issues/14579
Signed-off-by: Christian Heimes <christian@python.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14743)
Dr. David von Oheimb [Thu, 25 Mar 2021 15:20:48 +0000 (16:20 +0100)]
d2i_PrivateKey_decoder(): Fix premature exit on unsuccessful OSSL_DECODER_CTX_new_for_pkey()
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14647)
Dr. David von Oheimb [Mon, 22 Mar 2021 15:23:24 +0000 (16:23 +0100)]
PEM_X509_INFO_read_bio_ex(): Generalize to allow parsing any type of private key
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14647)
Dr. David von Oheimb [Mon, 22 Mar 2021 13:16:56 +0000 (14:16 +0100)]
d2i_PrivateKey{,_ex}() and PEM_X509_INFO_read_bio_ex(): Fix handling of RSA/DSA/EC private key
This is needed to correct d2i_PrivateKey() after it was changed by commit
576892d78f80cf9a.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14647)
Dr. David von Oheimb [Sat, 20 Mar 2021 22:32:15 +0000 (23:32 +0100)]
PEM_X509_INFO_read,{_bio}_ex(): Complete documentation in PEM_X509_INFO_read_bio_ex.pod
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14647)
Pauli [Wed, 7 Apr 2021 02:48:14 +0000 (12:48 +1000)]
apps: fix Camellia CBC performance loop
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14786)
Matt Caswell [Thu, 8 Apr 2021 12:15:59 +0000 (13:15 +0100)]
Prepare for 3.0 alpha 15
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Matt Caswell [Thu, 8 Apr 2021 12:15:48 +0000 (13:15 +0100)]
Prepare for release of 3.0 alpha 14
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Matt Caswell [Thu, 8 Apr 2021 12:04:41 +0000 (13:04 +0100)]
Update copyright year
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14801)
Matt Caswell [Thu, 25 Mar 2021 17:05:49 +0000 (17:05 +0000)]
Remove a TODO in EVP_set_default_properties
Fixes #14371
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1487)
Matt Caswell [Thu, 25 Mar 2021 17:02:25 +0000 (17:02 +0000)]
Update the algorithm fetching documentation links
The documentation on algorithm fetching has moved. There were a lot of
references to the old location so we update all of those locations.
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1487)
Matt Caswell [Thu, 25 Mar 2021 16:55:51 +0000 (16:55 +0000)]
Update provider.pod
The previous commits moved some content out of provider.pod into other
pages, so that content is now removed. provider.pod is now exclusively
focussed on provider authors.
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1487)
Matt Caswell [Thu, 25 Mar 2021 15:54:56 +0000 (15:54 +0000)]
Add additional glossary entries
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1487)
Matt Caswell [Wed, 24 Mar 2021 17:41:01 +0000 (17:41 +0000)]
Expand the libcrypto documentation
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1487)
Amitay Isaacs [Tue, 19 Jan 2021 03:14:25 +0000 (14:14 +1100)]
curve448: Integrate 64-bit reference implementation
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14784)
Amitay Isaacs [Tue, 6 Apr 2021 02:52:44 +0000 (12:52 +1000)]
Configure: Check if 128-bit integers are supported by compiler
Add a config variable "use_int128" to indicate if 128-bit integers are
supported or not at the configure time. This makes it easier to
automatically select 64-bit versus 32-bit implementation for curve448.
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14784)
Amitay Isaacs [Mon, 1 Feb 2021 05:22:16 +0000 (16:22 +1100)]
curve448: Use constant time zero check function
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14784)
Amitay Isaacs [Mon, 1 Feb 2021 05:20:12 +0000 (16:20 +1100)]
Add a constant time zero check function for 64-bit integers
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14784)
Amitay Isaacs [Tue, 19 Jan 2021 03:05:24 +0000 (14:05 +1100)]
curve448: Remove the unrolled loop version
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14784)
Amitay Isaacs [Mon, 29 Mar 2021 06:26:41 +0000 (17:26 +1100)]
curve448: Use NLIMBS where appropriate to simplify the code
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14784)
Amitay Isaacs [Tue, 19 Jan 2021 03:04:48 +0000 (14:04 +1100)]
curve448: Modernise reference 64-bit code
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14784)