From scan-admin at coverity.com Sun Mar 1 07:52:19 2020 From: scan-admin at coverity.com (scan-admin at coverity.com) Date: Sun, 01 Mar 2020 07:52:19 +0000 (UTC) Subject: Coverity Scan: Analysis completed for OpenSSL-1.0.2 Message-ID: <5e5b69b368b3f_48ef2aedfbd76f547368a@appnode-2.mail> Your request for analysis of OpenSSL-1.0.2 has been completed successfully. The results are available at https://u2389337.ct.sendgrid.net/ls/click?upn=nJaKvJSIH-2FPAfmty-2BK5tYpPklAc1eEA-2F1zfUjH6teExPWvbuQnlOROdcN604ufBDoN19TFJwpfzx7faM2hcaNQ-3D-3Ds55f_MulOTlHne1IxTRELXXnGni8d68xSVF-2BUCe3a7Ux-2BjeEqAhW3i13UHgXR34ZaDU-2FkZJc6Eeo1224j53go0oSclFXEGKfli2Pu0pQJl9Y4uSRNIIeFlMxSYib-2B-2FXffafCAxBSaVIPXRJXDB-2FPP0uWTDvCGFfkB6-2F4Dh7TTCIdVvBnVhrXxlssqacazFyTVtTdIRBZvsxKSEKMHWItwznOyVcrsmQdSTTPxIB-2BXeWxgTPBQdMefcW6JkI8R3qWmjEPo Build ID: 297712 Analysis Summary: New defects found: 0 Defects eliminated: 0 From scan-admin at coverity.com Sun Mar 1 07:52:25 2020 From: scan-admin at coverity.com (scan-admin at coverity.com) Date: Sun, 01 Mar 2020 07:52:25 +0000 (UTC) Subject: Coverity Scan: Analysis completed for openssl/openssl Message-ID: <5e5b69b9552c3_49092aedfbd76f5473671@appnode-2.mail> Your request for analysis of openssl/openssl has been completed successfully. The results are available at https://u2389337.ct.sendgrid.net/ls/click?upn=nJaKvJSIH-2FPAfmty-2BK5tYpPklAc1eEA-2F1zfUjH6teExPWvbuQnlOROdcN604ufBDi0WH2X69cApo3pLD935e8Q-3D-3Dhshi_MulOTlHne1IxTRELXXnGni8d68xSVF-2BUCe3a7Ux-2BjeF-2BAqz-2FXKszGTFMGhg9xzwEpLhjwDh5LyhV4B4WhFfWVFc4sSodP-2BvCrWezsNa5eY5uygGYyTVXNuhPN5XiOUCvazjNC7AS1gS7uXdPN1Sberr3iJmiuLNwSDjuFjoycFmHTNAfaIZT2a6BCJaxExQTZjZ2EtBm3gq-2BRVp6m0-2FGUjcG-2FW2YNAMVsHTH-2BARHPAqf9o2Hq3YzkOtJAgQw-2FB7H Build ID: 297711 Analysis Summary: New defects found: 7 Defects eliminated: 1 If you have difficulty understanding any defects, email us at scan-admin at coverity.com, or post your question to StackOverflow at https://u2389337.ct.sendgrid.net/ls/click?upn=QsMnDxMCOVVs7CDlyD2jouKTgNlKFinTRd3y-2BJC7sZryfVdWHH2BBU620aHLHGfhMXPTHYY5wQ5zOiTMnTlWDg-3D-3DKvn0_MulOTlHne1IxTRELXXnGni8d68xSVF-2BUCe3a7Ux-2BjeF-2BAqz-2FXKszGTFMGhg9xzwEpLhjwDh5LyhV4B4WhFfWVLSQyNBHZZG3WRtcJD7OaQZ-2FDxKqszII8h8aAl2ivPQEmNJBZHaETxF0epUa1e0yWsNZOiBQZQ7uJNHqDyxkiEwhKosmBVvhw7tH6MIXxv0-2F7-2Fq-2B13H-2B1s3Pgk1FfhXR59E5UCZk1pChaC7zC1GT1m5VqQ-2FimdYH0D-2BqTZeFo1E1 From no-reply at appveyor.com Sun Mar 1 20:59:09 2020 From: no-reply at appveyor.com (AppVeyor) Date: Sun, 01 Mar 2020 20:59:09 +0000 Subject: Build failed: openssl master.32173 Message-ID: <20200301205909.1.71237197863EA7E9@appveyor.com> An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Sun Mar 1 22:16:47 2020 From: no-reply at appveyor.com (AppVeyor) Date: Sun, 01 Mar 2020 22:16:47 +0000 Subject: Build failed: openssl master.32174 Message-ID: <20200301221647.1.09C8EE360C6355DD@appveyor.com> An HTML attachment was scrubbed... URL: From pauli at openssl.org Mon Mar 2 00:19:07 2020 From: pauli at openssl.org (Dr. Paul Dale) Date: Mon, 02 Mar 2020 00:19:07 +0000 Subject: [openssl] master update Message-ID: <1583108347.810297.21482.nullmailer@dev.openssl.org> The branch master has been updated via 15e5b96933e98fe3046ce4e881c42ee07e8fe255 (commit) from e32c608e0733d5b295c9aa119153133413c5d744 (commit) - Log ----------------------------------------------------------------- commit 15e5b96933e98fe3046ce4e881c42ee07e8fe255 Author: Andr? Klitzing Date: Sat Feb 29 23:40:29 2020 +0100 Fix drop of const qualifier The parameter got "const" in 9fdcc21fdc9 but that was not added to cast. So this throws a -Wcast-qual in user code. error: cast from 'const DUMMY *' to 'ASN1_VALUE_st *' drops const qualifier [-Werror,-Wcast-qual] CLA: trivial Reviewed-by: Richard Levitte Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/11210) ----------------------------------------------------------------------- Summary of changes: include/openssl/asn1t.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/openssl/asn1t.h b/include/openssl/asn1t.h index 754cab5f3d..934b10c2a6 100644 --- a/include/openssl/asn1t.h +++ b/include/openssl/asn1t.h @@ -814,13 +814,13 @@ typedef struct ASN1_STREAM_ARG_st { } \ int i2d_##fname(const stname *a, unsigned char **out) \ { \ - return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\ + return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\ } # define IMPLEMENT_ASN1_NDEF_FUNCTION(stname) \ int i2d_##stname##_NDEF(const stname *a, unsigned char **out) \ { \ - return ASN1_item_ndef_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(stname));\ + return ASN1_item_ndef_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(stname));\ } # define IMPLEMENT_STATIC_ASN1_ENCODE_FUNCTIONS(stname) \ @@ -832,7 +832,7 @@ typedef struct ASN1_STREAM_ARG_st { } \ static int i2d_##stname(const stname *a, unsigned char **out) \ { \ - return ASN1_item_i2d((ASN1_VALUE *)a, out, \ + return ASN1_item_i2d((const ASN1_VALUE *)a, out, \ ASN1_ITEM_rptr(stname)); \ } @@ -849,7 +849,7 @@ typedef struct ASN1_STREAM_ARG_st { int fname##_print_ctx(BIO *out, const stname *x, int indent, \ const ASN1_PCTX *pctx) \ { \ - return ASN1_item_print(out, (ASN1_VALUE *)x, indent, \ + return ASN1_item_print(out, (const ASN1_VALUE *)x, indent, \ ASN1_ITEM_rptr(itname), pctx); \ } From builds at travis-ci.org Mon Mar 2 01:07:31 2020 From: builds at travis-ci.org (Travis CI) Date: Mon, 02 Mar 2020 01:07:31 +0000 Subject: Still Failing: openssl/openssl#32739 (master - 15e5b96) In-Reply-To: Message-ID: <5e5c5c52b11bb_43fd2ab18c30c90419@47333e0d-2b2b-4a22-ba03-64c336066732.mail> Build Update for openssl/openssl ------------------------------------- Build: #32739 Status: Still Failing Duration: 45 mins and 9 secs Commit: 15e5b96 (master) Author: Andr? Klitzing Message: Fix drop of const qualifier The parameter got "const" in 9fdcc21fdc9 but that was not added to cast. So this throws a -Wcast-qual in user code. error: cast from 'const DUMMY *' to 'ASN1_VALUE_st *' drops const qualifier [-Werror,-Wcast-qual] CLA: trivial Reviewed-by: Richard Levitte Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/11210) View the changeset: https://github.com/openssl/openssl/compare/e32c608e0733...15e5b96933e9 View the full build log and details: https://travis-ci.org/openssl/openssl/builds/657086653?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the openssl/openssl repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=5849220&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From levitte at openssl.org Mon Mar 2 02:18:38 2020 From: levitte at openssl.org (Richard Levitte) Date: Mon, 02 Mar 2020 02:18:38 +0000 Subject: [openssl] master update Message-ID: <1583115518.594826.22493.nullmailer@dev.openssl.org> The branch master has been updated via ccceeb48000d5fae95f38d2c4dd02cdd89ca1ee1 (commit) from 15e5b96933e98fe3046ce4e881c42ee07e8fe255 (commit) - Log ----------------------------------------------------------------- commit ccceeb48000d5fae95f38d2c4dd02cdd89ca1ee1 Author: Richard Levitte Date: Thu Feb 27 06:03:52 2020 +0100 crypto/perlasm/x86_64-xlate.pl: detect GNU as to deal with quirks It turns out that GNU as and Solaris as don't have compatible ideas on the .section syntax, so we need to check if we're using GNU as or another assembler and adapt this .section syntax accordingly. Fixes #11132 Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/11191) ----------------------------------------------------------------------- Summary of changes: crypto/perlasm/x86_64-xlate.pl | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/crypto/perlasm/x86_64-xlate.pl b/crypto/perlasm/x86_64-xlate.pl index f87f1a5b96..197bc48873 100755 --- a/crypto/perlasm/x86_64-xlate.pl +++ b/crypto/perlasm/x86_64-xlate.pl @@ -83,6 +83,10 @@ my $PTR=" PTR"; my $nasmref=2.03; my $nasm=0; +# GNU as indicator, as opposed to $gas, which indicates acceptable +# syntax +my $gnuas=0; + if ($flavour eq "mingw64") { $gas=1; $elf=0; $win64=1; $prefix=`echo __USER_LABEL_PREFIX__ | $ENV{CC} -E -P -`; $prefix =~ s|\R$||; # Better chomp @@ -100,6 +104,12 @@ elsif (!$gas) $elf=0; $decor="\$L\$"; } +# Find out if we're using GNU as +elsif (`$ENV{CC} -Wa,-v -c -o /dev/null -x assembler /dev/null 2>&1` + =~ /GNU assembler version ([2-9]\.[0-9]+)/) +{ + $gnuas=1; +} my $cet_property; if ($flavour =~ /elf/) { @@ -108,8 +118,10 @@ if ($flavour =~ /elf/) { # with Intel CET support in order for linker to mark output with # Intel CET support. my $p2align=3; $p2align=2 if ($flavour eq "elf32"); + my $section='.note.gnu.property, #alloc'; + $section='".note.gnu.property", "a"' if $gnuas; $cet_property = <<_____; - .section ".note.gnu.property", "a" + .section $section .p2align $p2align .long 1f - 0f .long 4f - 1f From levitte at openssl.org Mon Mar 2 02:28:55 2020 From: levitte at openssl.org (Richard Levitte) Date: Mon, 02 Mar 2020 02:28:55 +0000 Subject: [openssl] master update Message-ID: <1583116135.519107.1802.nullmailer@dev.openssl.org> The branch master has been updated via 2888fc1590ad31633be7a99e7288dcecd35e800c (commit) via ff3b59e1705a40f7cfc6df8d788d08b0a525aa58 (commit) via 13697f1c62e98a4c1365fd85cb39ada0f47dce5f (commit) via 1e9101c404b92b1fd32e8f0308ddc20742285135 (commit) via bee5d6cd3fa2f8bcc7e1153e4dc26aa26144bee0 (commit) via 157ded39ee68c1c00814165f79f9b2f000996884 (commit) from ccceeb48000d5fae95f38d2c4dd02cdd89ca1ee1 (commit) - Log ----------------------------------------------------------------- commit 2888fc1590ad31633be7a99e7288dcecd35e800c Author: Richard Levitte Date: Thu Feb 6 09:53:15 2020 +0100 PROV: Add a OP_keymgmt_match() function to our DH, DSA, RSA and EC_KEY impl Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/11158) commit ff3b59e1705a40f7cfc6df8d788d08b0a525aa58 Author: Richard Levitte Date: Wed Feb 5 16:30:21 2020 +0100 EVP: Add support for copying provided EVP_PKEYs This adds evp_keymgmt_util_copy() and affects EVP_PKEY_copy_parameters() Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/11158) commit 13697f1c62e98a4c1365fd85cb39ada0f47dce5f Author: Richard Levitte Date: Wed Feb 5 15:41:58 2020 +0100 KEYMGMT: Add a keydata copy function Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/11158) commit 1e9101c404b92b1fd32e8f0308ddc20742285135 Author: Richard Levitte Date: Wed Feb 5 12:55:43 2020 +0100 EVP: Add support for comparing provided EVP_PKEYs This adds evp_keymgmt_util_match() and affects EVP_PKEY_cmp() and EVP_PKEY_cmp_parameters(). The word 'match' was used for the new routines because many associate 'cmp' with comparison functions that allows sorting, i.e. return -1, 0 or 1 depending on the order in which the two compared elements should be sorted. EVP_PKEY_cmp() and EVP_PKEY_cmp_parameters() don't quite do that. Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/11158) commit bee5d6cd3fa2f8bcc7e1153e4dc26aa26144bee0 Author: Richard Levitte Date: Wed Feb 5 12:53:14 2020 +0100 KEYMGMT: Add a keydata matching function Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/11158) commit 157ded39ee68c1c00814165f79f9b2f000996884 Author: Richard Levitte Date: Wed Feb 5 10:18:51 2020 +0100 EVP: Adapt EVP_PKEY_missing_parameters() for provider keys Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/11158) ----------------------------------------------------------------------- Summary of changes: crypto/dsa/dsa_lib.c | 5 + crypto/evp/evp_local.h | 2 + crypto/evp/keymgmt_lib.c | 136 ++++++++++++++++++++ crypto/evp/keymgmt_meth.c | 24 ++++ crypto/evp/p_lib.c | 173 +++++++++++++++++++++++--- doc/man7/provider-keymgmt.pod | 19 ++- include/crypto/dsa.h | 4 + include/crypto/evp.h | 9 ++ include/openssl/core_numbers.h | 14 ++- providers/implementations/keymgmt/dh_kmgmt.c | 21 ++++ providers/implementations/keymgmt/dsa_kmgmt.c | 23 ++++ providers/implementations/keymgmt/ec_kmgmt.c | 28 +++++ providers/implementations/keymgmt/rsa_kmgmt.c | 17 +++ 13 files changed, 459 insertions(+), 16 deletions(-) diff --git a/crypto/dsa/dsa_lib.c b/crypto/dsa/dsa_lib.c index 4b048d48c5..154048a3a3 100644 --- a/crypto/dsa/dsa_lib.c +++ b/crypto/dsa/dsa_lib.c @@ -337,3 +337,8 @@ int DSA_bits(const DSA *dsa) { return BN_num_bits(dsa->params.p); } + +FFC_PARAMS *dsa_get0_params(DSA *dsa) +{ + return &dsa->params; +} diff --git a/crypto/evp/evp_local.h b/crypto/evp/evp_local.h index 9b4ab29fda..774db4da8f 100644 --- a/crypto/evp/evp_local.h +++ b/crypto/evp/evp_local.h @@ -85,12 +85,14 @@ struct evp_keymgmt_st { OSSL_OP_keymgmt_query_operation_name_fn *query_operation_name; OSSL_OP_keymgmt_has_fn *has; OSSL_OP_keymgmt_validate_fn *validate; + OSSL_OP_keymgmt_match_fn *match; /* Import and export routines */ OSSL_OP_keymgmt_import_fn *import; OSSL_OP_keymgmt_import_types_fn *import_types; OSSL_OP_keymgmt_export_fn *export; OSSL_OP_keymgmt_export_types_fn *export_types; + OSSL_OP_keymgmt_copy_fn *copy; } /* EVP_KEYMGMT */ ; struct evp_keyexch_st { diff --git a/crypto/evp/keymgmt_lib.c b/crypto/evp/keymgmt_lib.c index a88d65dc5e..68ccdbb8ee 100644 --- a/crypto/evp/keymgmt_lib.c +++ b/crypto/evp/keymgmt_lib.c @@ -214,3 +214,139 @@ void *evp_keymgmt_util_fromdata(EVP_PKEY *target, EVP_KEYMGMT *keymgmt, return keydata; } + +int evp_keymgmt_util_has(EVP_PKEY *pk, int selection) +{ + /* Check if key is even assigned */ + if (pk->keymgmt == NULL) + return 0; + + return evp_keymgmt_has(pk->keymgmt, pk->keydata, selection); +} + +/* + * evp_keymgmt_util_match() doesn't just look at the provider side "origin", + * but also in the operation cache to see if there's any common keymgmt that + * supplies OP_keymgmt_match. + * + * evp_keymgmt_util_match() adheres to the return values that EVP_PKEY_cmp() + * and EVP_PKEY_cmp_parameters() return, i.e.: + * + * 1 same key + * 0 not same key + * -1 not same key type + * -2 unsupported operation + */ +int evp_keymgmt_util_match(EVP_PKEY *pk1, EVP_PKEY *pk2, int selection) +{ + EVP_KEYMGMT *keymgmt1 = NULL, *keymgmt2 = NULL; + void *keydata1 = NULL, *keydata2 = NULL; + + if (pk1 == NULL || pk2 == NULL) { + if (pk1 == NULL && pk2 == NULL) + return 1; + return 0; + } + + keymgmt1 = pk1->keymgmt; + keydata1 = pk1->keydata; + keymgmt2 = pk2->keymgmt; + keydata2 = pk2->keydata; + + if (keymgmt1 != keymgmt2) { + void *tmp_keydata = NULL; + + /* Complex case, where the keymgmt differ */ + if (keymgmt1 != NULL + && keymgmt2 != NULL + && !match_type(keymgmt1, keymgmt2)) { + ERR_raise(ERR_LIB_EVP, EVP_R_DIFFERENT_KEY_TYPES); + return -1; /* Not the same type */ + } + + /* + * The key types are determined to match, so we try cross export, + * but only to keymgmt's that supply a matching function. + */ + if (keymgmt2 != NULL + && keymgmt2->match != NULL) { + tmp_keydata = evp_keymgmt_util_export_to_provider(pk1, keymgmt2); + if (tmp_keydata != NULL) { + keymgmt1 = keymgmt2; + keydata1 = tmp_keydata; + } + } + if (tmp_keydata == NULL + && keymgmt1 != NULL + && keymgmt1->match != NULL) { + tmp_keydata = evp_keymgmt_util_export_to_provider(pk2, keymgmt1); + if (tmp_keydata != NULL) { + keymgmt2 = keymgmt1; + keydata2 = tmp_keydata; + } + } + } + + /* If we still don't have matching keymgmt implementations, we give up */ + if (keymgmt1 != keymgmt2) + return -2; + + return evp_keymgmt_match(keymgmt1, keydata1, keydata2, selection); +} + +int evp_keymgmt_util_copy(EVP_PKEY *to, EVP_PKEY *from, int selection) +{ + /* Save copies of pointers we want to play with without affecting |to| */ + EVP_KEYMGMT *to_keymgmt = to->keymgmt; + void *to_keydata = to->keydata, *alloc_keydata = NULL; + + /* An unassigned key can't be copied */ + if (from == NULL || from->keymgmt == NULL) + return 0; + + /* If |from| doesn't support copying, we fail */ + if (from->keymgmt->copy == NULL) + return 0; + + /* If |to| doesn't have a provider side "origin" yet, create one */ + if (to_keymgmt == NULL) { + to_keydata = alloc_keydata = evp_keymgmt_newdata(from->keymgmt); + if (to_keydata == NULL) + return 0; + to_keymgmt = from->keymgmt; + } + + if (to_keymgmt == from->keymgmt) { + /* |to| and |from| have the same keymgmt, just copy and be done */ + if (!evp_keymgmt_copy(to_keymgmt, to_keydata, from->keydata, + selection)) + return 0; + } else if (match_type(to_keymgmt, from->keymgmt)) { + struct import_data_st import_data; + + import_data.keymgmt = to_keymgmt; + import_data.keydata = to_keydata; + import_data.selection = selection; + + if (!evp_keymgmt_export(from->keymgmt, from->keydata, selection, + &try_import, &import_data)) { + evp_keymgmt_freedata(to_keymgmt, alloc_keydata); + return 0; + } + } else { + ERR_raise(ERR_LIB_EVP, EVP_R_DIFFERENT_KEY_TYPES); + return 0; + } + + if (to->keymgmt == NULL + && !EVP_KEYMGMT_up_ref(to_keymgmt)) { + evp_keymgmt_freedata(to_keymgmt, alloc_keydata); + return 0; + } + evp_keymgmt_util_clear_operation_cache(to); + to->keymgmt = to_keymgmt; + to->keydata = to_keydata; + evp_keymgmt_util_cache_keyinfo(to); + + return 1; +} diff --git a/crypto/evp/keymgmt_meth.c b/crypto/evp/keymgmt_meth.c index 3fcc073a5a..f80e6e29b5 100644 --- a/crypto/evp/keymgmt_meth.c +++ b/crypto/evp/keymgmt_meth.c @@ -95,6 +95,10 @@ static void *keymgmt_from_dispatch(int name_id, if (keymgmt->validate == NULL) keymgmt->validate = OSSL_get_OP_keymgmt_validate(fns); break; + case OSSL_FUNC_KEYMGMT_MATCH: + if (keymgmt->match == NULL) + keymgmt->match = OSSL_get_OP_keymgmt_match(fns); + break; case OSSL_FUNC_KEYMGMT_IMPORT: if (keymgmt->import == NULL) { importfncnt++; @@ -290,6 +294,16 @@ int evp_keymgmt_validate(const EVP_KEYMGMT *keymgmt, void *keydata, return keymgmt->validate(keydata, selection); } +int evp_keymgmt_match(const EVP_KEYMGMT *keymgmt, + const void *keydata1, const void *keydata2, + int selection) +{ + /* We assume no match if the implementation doesn't have a function */ + if (keymgmt->match == NULL) + return 0; + return keymgmt->match(keydata1, keydata2, selection); +} + int evp_keymgmt_import(const EVP_KEYMGMT *keymgmt, void *keydata, int selection, const OSSL_PARAM params[]) { @@ -321,3 +335,13 @@ const OSSL_PARAM *evp_keymgmt_export_types(const EVP_KEYMGMT *keymgmt, return NULL; return keymgmt->export_types(selection); } + +int evp_keymgmt_copy(const EVP_KEYMGMT *keymgmt, + void *keydata_to, const void *keydata_from, + int selection) +{ + /* We assume no copy if the implementation doesn't have a function */ + if (keymgmt->copy == NULL) + return 0; + return keymgmt->copy(keydata_to, keydata_from, selection); +} diff --git a/crypto/evp/p_lib.c b/crypto/evp/p_lib.c index 621d99d171..586ffaf041 100644 --- a/crypto/evp/p_lib.c +++ b/crypto/evp/p_lib.c @@ -86,12 +86,25 @@ int EVP_PKEY_save_parameters(EVP_PKEY *pkey, int mode) int EVP_PKEY_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from) { - if (to->type == EVP_PKEY_NONE) { - if (EVP_PKEY_set_type(to, from->type) == 0) - return 0; - } else if (to->type != from->type) { - EVPerr(EVP_F_EVP_PKEY_COPY_PARAMETERS, EVP_R_DIFFERENT_KEY_TYPES); - goto err; + /* + * TODO: clean up legacy stuff from this function when legacy support + * is gone. + */ + + /* + * Only check that type match this early when both keys are legacy. + * If either of them is provided, we let evp_keymgmt_util_copy() + * do this check, after having exported either of them that isn't + * provided. + */ + if (to->keymgmt == NULL && from->keymgmt == NULL) { + if (to->type == EVP_PKEY_NONE) { + if (EVP_PKEY_set_type(to, from->type) == 0) + return 0; + } else if (to->type != from->type) { + EVPerr(EVP_F_EVP_PKEY_COPY_PARAMETERS, EVP_R_DIFFERENT_KEY_TYPES); + goto err; + } } if (EVP_PKEY_missing_parameters(from)) { @@ -106,7 +119,56 @@ int EVP_PKEY_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from) return 0; } - if (from->ameth && from->ameth->param_copy) + /* + * If |from| is provided, we upgrade |to| to be provided as well. + * This drops the legacy key from |to|. + * evp_pkey_upgrade_to_provider() checks if |to| is already provided, + * we don't need to do that here. + * + * TODO(3.0) We should investigate if that's too aggressive and make + * this scenario unsupported instead. + */ + if (from->keymgmt != NULL) { + EVP_KEYMGMT *tmp_keymgmt = from->keymgmt; + + /* + * The returned pointer is known to be cached, so we don't have to + * save it. However, if it's NULL, something went wrong and we can't + * copy. + */ + if (evp_pkey_upgrade_to_provider(to, NULL, + &tmp_keymgmt, NULL) == NULL) { + ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR); + return 0; + } + } + + /* For purely provided keys, we just call the keymgmt utility */ + if (to->keymgmt != NULL && from->keymgmt != NULL) + return evp_keymgmt_util_copy(to, (EVP_PKEY *)from, + OSSL_KEYMGMT_SELECT_ALL_PARAMETERS); + + /* + * If |to| is provided, we know that |from| is legacy at this point. + * Try exporting |from| to |to|'s keymgmt, then use evp_keymgmt_copy() + * to copy the appropriate data to |to|'s keydata. + */ + if (to->keymgmt != NULL) { + EVP_KEYMGMT *to_keymgmt = to->keymgmt; + void *from_keydata = + evp_pkey_export_to_provider((EVP_PKEY *)from, NULL, &to_keymgmt, + NULL); + + if (from_keydata == NULL) { + ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR); + return 0; + } + return evp_keymgmt_copy(to->keymgmt, to->keydata, from_keydata, + OSSL_KEYMGMT_SELECT_ALL_PARAMETERS); + } + + /* Both keys are legacy */ + if (from->ameth != NULL && from->ameth->param_copy != NULL) return from->ameth->param_copy(to, from); err: return 0; @@ -114,35 +176,118 @@ int EVP_PKEY_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from) int EVP_PKEY_missing_parameters(const EVP_PKEY *pkey) { - if (pkey != NULL && pkey->ameth && pkey->ameth->param_missing) - return pkey->ameth->param_missing(pkey); + if (pkey != NULL) { + if (pkey->keymgmt != NULL) + return !evp_keymgmt_util_has((EVP_PKEY *)pkey, + OSSL_KEYMGMT_SELECT_ALL_PARAMETERS); + else if (pkey->ameth != NULL && pkey->ameth->param_missing != NULL) + return pkey->ameth->param_missing(pkey); + } return 0; } +/* + * This function is called for any mixture of keys except pure legacy pair. + * TODO When legacy keys are gone, we replace a call to this functions with + * a call to evp_keymgmt_util_match(). + */ +static int evp_pkey_cmp_any(const EVP_PKEY *a, const EVP_PKEY *b, + int selection) +{ + EVP_KEYMGMT *keymgmt1 = NULL, *keymgmt2 = NULL; + void *keydata1 = NULL, *keydata2 = NULL, *tmp_keydata = NULL; + + /* If none of them are provided, this function shouldn't have been called */ + if (!ossl_assert(a->keymgmt != NULL || b->keymgmt != NULL)) + return -2; + + /* For purely provided keys, we just call the keymgmt utility */ + if (a->keymgmt != NULL && b->keymgmt != NULL) + return evp_keymgmt_util_match((EVP_PKEY *)a, (EVP_PKEY *)b, selection); + + /* + * Here, we know that we have a mixture of legacy and provided keys. + * Try cross export and compare the resulting key data. + */ + keymgmt1 = a->keymgmt; + keydata1 = a->keydata; + keymgmt2 = b->keymgmt; + keydata2 = b->keydata; + + if ((keymgmt1 == NULL + && !EVP_KEYMGMT_is_a(keymgmt2, OBJ_nid2sn(a->type))) + || (keymgmt2 == NULL + && !EVP_KEYMGMT_is_a(keymgmt1, OBJ_nid2sn(b->type)))) + return -1; /* not the same key type */ + + if (keymgmt2 != NULL && keymgmt2->match != NULL) { + tmp_keydata = + evp_pkey_export_to_provider((EVP_PKEY *)a, NULL, &keymgmt2, NULL); + if (tmp_keydata != NULL) { + keymgmt1 = keymgmt2; + keydata1 = tmp_keydata; + } + } + if (tmp_keydata == NULL && keymgmt1 != NULL && keymgmt1->match != NULL) { + tmp_keydata = + evp_pkey_export_to_provider((EVP_PKEY *)b, NULL, &keymgmt1, NULL); + if (tmp_keydata != NULL) { + keymgmt2 = keymgmt1; + keydata2 = tmp_keydata; + } + } + + /* If we still don't have matching keymgmt implementations, we give up */ + if (keymgmt1 != keymgmt2) + return -2; + + return evp_keymgmt_match(keymgmt1, keydata1, keydata2, selection); +} + int EVP_PKEY_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b) { + /* + * TODO: clean up legacy stuff from this function when legacy support + * is gone. + */ + + if (a->keymgmt != NULL || b->keymgmt != NULL) + return evp_pkey_cmp_any(a, b, OSSL_KEYMGMT_SELECT_ALL_PARAMETERS); + + /* All legacy keys */ if (a->type != b->type) return -1; - if (a->ameth && a->ameth->param_cmp) + if (a->ameth != NULL && a->ameth->param_cmp != NULL) return a->ameth->param_cmp(a, b); return -2; } int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b) { + /* + * TODO: clean up legacy stuff from this function when legacy support + * is gone. + */ + + if (a->keymgmt != NULL || b->keymgmt != NULL) + return evp_pkey_cmp_any(a, b, + OSSL_KEYMGMT_SELECT_ALL_PARAMETERS + | OSSL_KEYMGMT_SELECT_PUBLIC_KEY); + + /* All legacy keys */ if (a->type != b->type) return -1; - if (a->ameth) { + if (a->ameth != NULL) { int ret; /* Compare parameters if the algorithm has them */ - if (a->ameth->param_cmp) { + if (a->ameth->param_cmp != NULL) { ret = a->ameth->param_cmp(a, b); if (ret <= 0) return ret; } - if (a->ameth->pub_cmp) + if (a->ameth->pub_cmp != NULL) return a->ameth->pub_cmp(a, b); } @@ -870,7 +1015,7 @@ int EVP_PKEY_up_ref(EVP_PKEY *pkey) static void evp_pkey_free_legacy(EVP_PKEY *x) { if (x->ameth != NULL) { - if (x->ameth->pkey_free) + if (x->ameth->pkey_free != NULL) x->ameth->pkey_free(x); x->pkey.ptr = NULL; x->ameth = NULL; diff --git a/doc/man7/provider-keymgmt.pod b/doc/man7/provider-keymgmt.pod index 5141ffdebc..91b87cecdc 100644 --- a/doc/man7/provider-keymgmt.pod +++ b/doc/man7/provider-keymgmt.pod @@ -26,6 +26,8 @@ provider-keymgmt - The KEYMGMT library E-E provider functions /* Key object content checks */ int OP_keymgmt_has(void *keydata, int selection); + int OP_keymgmt_match(const void *keydata1, const void *keydata2, + int selection); /* Discovery of supported operations */ const char *OP_keymgmt_query_operation_name(int operation_id); @@ -37,6 +39,9 @@ provider-keymgmt - The KEYMGMT library E-E provider functions OSSL_CALLBACK *param_cb, void *cbarg); const OSSL_PARAM *OP_keymgmt_export_types(int selection); + /* Key object copy */ + int OP_keymgmt_copy(void *keydata_to, const void *keydata_from, int selection); + /* Key object validation */ int OP_keymgmt_validate(void *keydata, int selection); @@ -84,12 +89,14 @@ macros in L, as follows: OP_keymgmt_has OSSL_FUNC_KEYMGMT_HAS OP_keymgmt_validate OSSL_FUNC_KEYMGMT_VALIDATE + OP_keymgmt_match OSSL_FUNC_KEYMGMT_MATCH OP_keymgmt_import OSSL_FUNC_KEYMGMT_IMPORT OP_keymgmt_import_types OSSL_FUNC_KEYMGMT_IMPORT_TYPES OP_keymgmt_export OSSL_FUNC_KEYMGMT_EXPORT OP_keymgmt_export_types OSSL_FUNC_KEYMGMT_EXPORT_TYPES + OP_keymgmt_copy OSSL_FUNC_KEYMGMT_COPY =head2 Key Objects @@ -239,7 +246,12 @@ B (or B for short) is expected to check that the pairwise consistency of I is valid. -=head2 Key Object Import and Export Functions +OP_keymgmt_match() should check if the data subset indicated by +I in I and I match. It is assumed that +the caller has ensured that I and I are both owned +by the implementation of this function. + +=head2 Key Object Import, Export and Copy Functions OP_keymgmt_import() should import data indicated by I into I with values taken from the B array I. @@ -256,6 +268,11 @@ OP_keymgmt_export_types() should return a constant array of descriptor B for data indicated by I, that the OP_keymgmt_export() callback can expect to receive. +OP_keymgmt_copy() should copy data subsets indicated by I +from I to I. It is assumed that the caller +has ensured that I and I are both owned by +the implementation of this function. + =head2 Built-in RSA Import/Export Types The following Import/Export types are available for the built-in RSA algorithm: diff --git a/include/crypto/dsa.h b/include/crypto/dsa.h index 1da23a8a7b..eab5d44603 100644 --- a/include/crypto/dsa.h +++ b/include/crypto/dsa.h @@ -8,6 +8,7 @@ */ #include +#include "internal/ffc.h" #define DSA_PARAMGEN_TYPE_FIPS_186_2 1 /* Use legacy FIPS186-2 standard */ #define DSA_PARAMGEN_TYPE_FIPS_186_4 2 /* Use FIPS186-4 standard */ @@ -21,6 +22,9 @@ int dsa_generate_ffc_parameters(DSA *dsa, int type, int dsa_sign_int(int type, const unsigned char *dgst, int dlen, unsigned char *sig, unsigned int *siglen, DSA *dsa); const unsigned char *dsa_algorithmidentifier_encoding(int md_nid, size_t *len); + +FFC_PARAMS *dsa_get0_params(DSA *dsa); + int dsa_generate_public_key(BN_CTX *ctx, const DSA *dsa, const BIGNUM *priv_key, BIGNUM *pub_key); int dsa_check_params(const DSA *dsa, int *ret); diff --git a/include/crypto/evp.h b/include/crypto/evp.h index ddba4083e9..7da0258279 100644 --- a/include/crypto/evp.h +++ b/include/crypto/evp.h @@ -619,6 +619,9 @@ int evp_keymgmt_util_cache_keydata(EVP_PKEY *pk, size_t index, void evp_keymgmt_util_cache_keyinfo(EVP_PKEY *pk); void *evp_keymgmt_util_fromdata(EVP_PKEY *target, EVP_KEYMGMT *keymgmt, int selection, const OSSL_PARAM params[]); +int evp_keymgmt_util_has(EVP_PKEY *pk, int selection); +int evp_keymgmt_util_match(EVP_PKEY *pk1, EVP_PKEY *pk2, int selection); +int evp_keymgmt_util_copy(EVP_PKEY *to, EVP_PKEY *from, int selection); /* @@ -637,6 +640,9 @@ const OSSL_PARAM *evp_keymgmt_settable_params(const EVP_KEYMGMT *keymgmt); int evp_keymgmt_has(const EVP_KEYMGMT *keymgmt, void *keyddata, int selection); int evp_keymgmt_validate(const EVP_KEYMGMT *keymgmt, void *keydata, int selection); +int evp_keymgmt_match(const EVP_KEYMGMT *keymgmt, + const void *keydata1, const void *keydata2, + int selection); int evp_keymgmt_import(const EVP_KEYMGMT *keymgmt, void *keydata, int selection, const OSSL_PARAM params[]); @@ -646,6 +652,9 @@ int evp_keymgmt_export(const EVP_KEYMGMT *keymgmt, void *keydata, int selection, OSSL_CALLBACK *param_cb, void *cbarg); const OSSL_PARAM *evp_keymgmt_export_types(const EVP_KEYMGMT *keymgmt, int selection); +int evp_keymgmt_copy(const EVP_KEYMGMT *keymgmt, + void *keydata_to, const void *keydata_from, + int selection); /* Pulling defines out of C source files */ diff --git a/include/openssl/core_numbers.h b/include/openssl/core_numbers.h index 3fd462a8d6..3314a0f665 100644 --- a/include/openssl/core_numbers.h +++ b/include/openssl/core_numbers.h @@ -412,7 +412,13 @@ OSSL_CORE_MAKE_FUNC(int, OP_keymgmt_has, (void *keydata, int selection)) # define OSSL_FUNC_KEYMGMT_VALIDATE 22 OSSL_CORE_MAKE_FUNC(int, OP_keymgmt_validate, (void *keydata, int selection)) -/* Import and export functions, with ddiscovery */ +/* Key checks - matching */ +# define OSSL_FUNC_KEYMGMT_MATCH 23 +OSSL_CORE_MAKE_FUNC(int, OP_keymgmt_match, + (const void *keydata1, const void *keydata2, + int selection)) + +/* Import and export functions, with discovery */ # define OSSL_FUNC_KEYMGMT_IMPORT 40 # define OSSL_FUNC_KEYMGMT_IMPORT_TYPES 41 # define OSSL_FUNC_KEYMGMT_EXPORT 42 @@ -427,6 +433,12 @@ OSSL_CORE_MAKE_FUNC(int, OP_keymgmt_export, OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_keymgmt_export_types, (int selection)) +/* Copy function, only works for matching keymgmt */ +# define OSSL_FUNC_KEYMGMT_COPY 44 +OSSL_CORE_MAKE_FUNC(int, OP_keymgmt_copy, + ( void *keydata_to, const void *keydata_from, + int selection)) + /* Key Exchange */ # define OSSL_FUNC_KEYEXCH_NEWCTX 1 diff --git a/providers/implementations/keymgmt/dh_kmgmt.c b/providers/implementations/keymgmt/dh_kmgmt.c index f4f04eeab8..90a583e7db 100644 --- a/providers/implementations/keymgmt/dh_kmgmt.c +++ b/providers/implementations/keymgmt/dh_kmgmt.c @@ -29,6 +29,7 @@ static OSSL_OP_keymgmt_free_fn dh_freedata; static OSSL_OP_keymgmt_get_params_fn dh_get_params; static OSSL_OP_keymgmt_gettable_params_fn dh_gettable_params; static OSSL_OP_keymgmt_has_fn dh_has; +static OSSL_OP_keymgmt_match_fn dh_match; static OSSL_OP_keymgmt_import_fn dh_import; static OSSL_OP_keymgmt_import_types_fn dh_import_types; static OSSL_OP_keymgmt_export_fn dh_export; @@ -169,6 +170,25 @@ static int dh_has(void *keydata, int selection) return ok; } +static int dh_match(const void *keydata1, const void *keydata2, int selection) +{ + const DH *dh1 = keydata1; + const DH *dh2 = keydata2; + int ok = 1; + + if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0) + ok = ok && BN_cmp(DH_get0_pub_key(dh1), DH_get0_pub_key(dh2)) == 0; + if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) + ok = ok && BN_cmp(DH_get0_priv_key(dh1), DH_get0_priv_key(dh2)) == 0; + if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0) { + FFC_PARAMS *dhparams1 = dh_get0_params((DH *)dh1); + FFC_PARAMS *dhparams2 = dh_get0_params((DH *)dh2); + + ok = ok && ffc_params_cmp(dhparams1, dhparams2, 1); + } + return ok; +} + static int dh_import(void *keydata, int selection, const OSSL_PARAM params[]) { DH *dh = keydata; @@ -302,6 +322,7 @@ const OSSL_DISPATCH dh_keymgmt_functions[] = { { OSSL_FUNC_KEYMGMT_GET_PARAMS, (void (*) (void))dh_get_params }, { OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS, (void (*) (void))dh_gettable_params }, { OSSL_FUNC_KEYMGMT_HAS, (void (*)(void))dh_has }, + { OSSL_FUNC_KEYMGMT_MATCH, (void (*)(void))dh_match }, { OSSL_FUNC_KEYMGMT_IMPORT, (void (*)(void))dh_import }, { OSSL_FUNC_KEYMGMT_IMPORT_TYPES, (void (*)(void))dh_import_types }, { OSSL_FUNC_KEYMGMT_EXPORT, (void (*)(void))dh_export }, diff --git a/providers/implementations/keymgmt/dsa_kmgmt.c b/providers/implementations/keymgmt/dsa_kmgmt.c index 0781f13760..494f284111 100644 --- a/providers/implementations/keymgmt/dsa_kmgmt.c +++ b/providers/implementations/keymgmt/dsa_kmgmt.c @@ -29,6 +29,7 @@ static OSSL_OP_keymgmt_free_fn dsa_freedata; static OSSL_OP_keymgmt_get_params_fn dsa_get_params; static OSSL_OP_keymgmt_gettable_params_fn dsa_gettable_params; static OSSL_OP_keymgmt_has_fn dsa_has; +static OSSL_OP_keymgmt_match_fn dsa_match; static OSSL_OP_keymgmt_import_fn dsa_import; static OSSL_OP_keymgmt_import_types_fn dsa_import_types; static OSSL_OP_keymgmt_export_fn dsa_export; @@ -175,6 +176,27 @@ static int dsa_has(void *keydata, int selection) return ok; } +static int dsa_match(const void *keydata1, const void *keydata2, int selection) +{ + const DSA *dsa1 = keydata1; + const DSA *dsa2 = keydata2; + int ok = 1; + + if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0) + ok = ok + && BN_cmp(DSA_get0_pub_key(dsa1), DSA_get0_pub_key(dsa2)) == 0; + if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) + ok = ok + && BN_cmp(DSA_get0_priv_key(dsa1), DSA_get0_priv_key(dsa2)) == 0; + if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0) { + FFC_PARAMS *dsaparams1 = dsa_get0_params((DSA *)dsa1); + FFC_PARAMS *dsaparams2 = dsa_get0_params((DSA *)dsa2); + + ok = ok && ffc_params_cmp(dsaparams1, dsaparams2, 1); + } + return ok; +} + static int dsa_import(void *keydata, int selection, const OSSL_PARAM params[]) { DSA *dsa = keydata; @@ -313,6 +335,7 @@ const OSSL_DISPATCH dsa_keymgmt_functions[] = { { OSSL_FUNC_KEYMGMT_GET_PARAMS, (void (*) (void))dsa_get_params }, { OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS, (void (*) (void))dsa_gettable_params }, { OSSL_FUNC_KEYMGMT_HAS, (void (*)(void))dsa_has }, + { OSSL_FUNC_KEYMGMT_MATCH, (void (*)(void))dsa_match }, { OSSL_FUNC_KEYMGMT_IMPORT, (void (*)(void))dsa_import }, { OSSL_FUNC_KEYMGMT_IMPORT_TYPES, (void (*)(void))dsa_import_types }, { OSSL_FUNC_KEYMGMT_EXPORT, (void (*)(void))dsa_export }, diff --git a/providers/implementations/keymgmt/ec_kmgmt.c b/providers/implementations/keymgmt/ec_kmgmt.c index 794dd92499..6a358aa93b 100644 --- a/providers/implementations/keymgmt/ec_kmgmt.c +++ b/providers/implementations/keymgmt/ec_kmgmt.c @@ -31,6 +31,7 @@ static OSSL_OP_keymgmt_gettable_params_fn ec_gettable_params; static OSSL_OP_keymgmt_set_params_fn ec_set_params; static OSSL_OP_keymgmt_settable_params_fn ec_settable_params; static OSSL_OP_keymgmt_has_fn ec_has; +static OSSL_OP_keymgmt_match_fn ec_match; static OSSL_OP_keymgmt_import_fn ec_import; static OSSL_OP_keymgmt_import_types_fn ec_import_types; static OSSL_OP_keymgmt_export_fn ec_export; @@ -442,6 +443,32 @@ int ec_has(void *keydata, int selection) return ok; } +static int ec_match(const void *keydata1, const void *keydata2, int selection) +{ + const EC_KEY *ec1 = keydata1; + const EC_KEY *ec2 = keydata2; + const EC_GROUP *group_a = EC_KEY_get0_group(ec1); + const EC_GROUP *group_b = EC_KEY_get0_group(ec2); + int ok = 1; + + if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0) + ok = ok && group_a != NULL && group_b != NULL + && EC_GROUP_cmp(group_a, group_b, NULL) == 0; + if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) { + const BIGNUM *pa = EC_KEY_get0_private_key(ec1); + const BIGNUM *pb = EC_KEY_get0_private_key(ec2); + + ok = ok && BN_cmp(pa, pb) == 0; + } + if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0) { + const EC_POINT *pa = EC_KEY_get0_public_key(ec1); + const EC_POINT *pb = EC_KEY_get0_public_key(ec2); + + ok = ok && EC_POINT_cmp(group_b, pa, pb, NULL); + } + return ok; +} + static int ec_import(void *keydata, int selection, const OSSL_PARAM params[]) { @@ -711,6 +738,7 @@ const OSSL_DISPATCH ec_keymgmt_functions[] = { { OSSL_FUNC_KEYMGMT_SET_PARAMS, (void (*) (void))ec_set_params }, { OSSL_FUNC_KEYMGMT_SETTABLE_PARAMS, (void (*) (void))ec_settable_params }, { OSSL_FUNC_KEYMGMT_HAS, (void (*)(void))ec_has }, + { OSSL_FUNC_KEYMGMT_MATCH, (void (*)(void))ec_match }, { OSSL_FUNC_KEYMGMT_IMPORT, (void (*)(void))ec_import }, { OSSL_FUNC_KEYMGMT_IMPORT_TYPES, (void (*)(void))ec_import_types }, { OSSL_FUNC_KEYMGMT_EXPORT, (void (*)(void))ec_export }, diff --git a/providers/implementations/keymgmt/rsa_kmgmt.c b/providers/implementations/keymgmt/rsa_kmgmt.c index 8f3f25eb60..8c7673ad49 100644 --- a/providers/implementations/keymgmt/rsa_kmgmt.c +++ b/providers/implementations/keymgmt/rsa_kmgmt.c @@ -32,6 +32,7 @@ static OSSL_OP_keymgmt_free_fn rsa_freedata; static OSSL_OP_keymgmt_get_params_fn rsa_get_params; static OSSL_OP_keymgmt_gettable_params_fn rsa_gettable_params; static OSSL_OP_keymgmt_has_fn rsa_has; +static OSSL_OP_keymgmt_match_fn rsa_match; static OSSL_OP_keymgmt_validate_fn rsa_validate; static OSSL_OP_keymgmt_import_fn rsa_import; static OSSL_OP_keymgmt_import_types_fn rsa_import_types; @@ -203,6 +204,21 @@ static int rsa_has(void *keydata, int selection) return ok; } +static int rsa_match(const void *keydata1, const void *keydata2, int selection) +{ + const RSA *rsa1 = keydata1; + const RSA *rsa2 = keydata2; + int ok = 1; + + /* There is always an |e| */ + ok = ok && BN_cmp(RSA_get0_e(rsa1), RSA_get0_e(rsa2)) == 0; + if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0) + ok = ok && BN_cmp(RSA_get0_n(rsa1), RSA_get0_n(rsa2)) == 0; + if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) + ok = ok && BN_cmp(RSA_get0_d(rsa1), RSA_get0_d(rsa2)) == 0; + return ok; +} + static int rsa_import(void *keydata, int selection, const OSSL_PARAM params[]) { RSA *rsa = keydata; @@ -399,6 +415,7 @@ const OSSL_DISPATCH rsa_keymgmt_functions[] = { { OSSL_FUNC_KEYMGMT_GET_PARAMS, (void (*) (void))rsa_get_params }, { OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS, (void (*) (void))rsa_gettable_params }, { OSSL_FUNC_KEYMGMT_HAS, (void (*)(void))rsa_has }, + { OSSL_FUNC_KEYMGMT_MATCH, (void (*)(void))rsa_match }, { OSSL_FUNC_KEYMGMT_VALIDATE, (void (*)(void))rsa_validate }, { OSSL_FUNC_KEYMGMT_IMPORT, (void (*)(void))rsa_import }, { OSSL_FUNC_KEYMGMT_IMPORT_TYPES, (void (*)(void))rsa_import_types }, From levitte at openssl.org Mon Mar 2 02:37:00 2020 From: levitte at openssl.org (Richard Levitte) Date: Mon, 02 Mar 2020 02:37:00 +0000 Subject: [openssl] master update Message-ID: <1583116620.202281.12445.nullmailer@dev.openssl.org> The branch master has been updated via 97ace6c2dae451ce8e3b099cf242968ecff128af (commit) via fe909ee4aeb6eb64f6f31a1544c5d3c81c5fe1f1 (commit) via 19cf4404d5174a41d46a781155ad513a3502c609 (commit) via a3f1fc25017ef768a956b88edee4aaf851a58db2 (commit) via e42921790267d54054cde1596711219b72a184ad (commit) via ad5be194c6b08e89f9a6e2a78b85ff19a3c40d40 (commit) from 2888fc1590ad31633be7a99e7288dcecd35e800c (commit) - Log ----------------------------------------------------------------- commit 97ace6c2dae451ce8e3b099cf242968ecff128af Author: Richard Levitte Date: Thu Feb 27 02:07:50 2020 +0100 .travis.yml: Remove NOUPDATE support It was a temporary measure to deal with the fact that util/progs.pl didn't work right at all times, but that has now been fixed. Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/11185) commit fe909ee4aeb6eb64f6f31a1544c5d3c81c5fe1f1 Author: Richard Levitte Date: Wed Feb 26 14:52:04 2020 +0100 Remove apps/progs.c and apps/progs.h Since they are generated in build time, there's not need to keep them in the source tree. Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/11185) commit 19cf4404d5174a41d46a781155ad513a3502c609 Author: Richard Levitte Date: Wed Feb 26 14:42:10 2020 +0100 Configure: Diverse cleanups There were some remaining old code and comments that don't serve a purpose any longer. Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/11185) commit a3f1fc25017ef768a956b88edee4aaf851a58db2 Author: Richard Levitte Date: Wed Feb 26 14:39:16 2020 +0100 Build: Generate apps/progs.c and apps/progs.h in build time util/progs.pl depends on the build tree (on configdata.pm, specifically), so it needs to be run from the build tree. But why stop there? We might as well generate apps/progs.c and apps/progs.h when building. Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/11185) commit e42921790267d54054cde1596711219b72a184ad Author: Richard Levitte Date: Wed Feb 26 14:35:17 2020 +0100 build.info: Implement simply substitutions in variable values Use case: having a variable with multiple source files in its value, and wanting to refer to the corresponding object file. $SRCS=foo.c bar.c SOURCE[program]=$SRCS DEPEND[${SRCS/.c/.o}]=prog.h GENERATE[prog.h]=... Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/11185) commit ad5be194c6b08e89f9a6e2a78b85ff19a3c40d40 Author: Richard Levitte Date: Wed Feb 26 14:30:38 2020 +0100 build.info: Make it possible to have more than one item in KEYWORD[] So far, the "index" part of KEYWORD[whatever] could only handle one item. There are cases, however, where we want to add the exact same value to multiple items. This is especially helpful if a variable that may have multi-item values are used in the "index" part. Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/11185) ----------------------------------------------------------------------- Summary of changes: .travis.yml | 4 +- Configurations/descrip.mms.tmpl | 4 +- Configurations/unix-Makefile.tmpl | 10 +- Configurations/windows-makefile.tmpl | 4 +- Configure | 228 +++++++++++--------- apps/build.info | 15 +- apps/progs.c | 402 ----------------------------------- apps/progs.h | 123 ----------- doc/internal/man7/build.info.pod | 56 +++-- 9 files changed, 187 insertions(+), 659 deletions(-) delete mode 100644 apps/progs.c delete mode 100644 apps/progs.h diff --git a/.travis.yml b/.travis.yml index b6d698ae76..a015eb4053 100644 --- a/.travis.yml +++ b/.travis.yml @@ -65,7 +65,7 @@ matrix: - os: linux arch: arm64 compiler: gcc - env: CONFIG_OPTS="no-asm no-deprecated enable-buildtest-c++ --strict-warnings -D_DEFAULT_SOURCE" BUILDONLY="yes" NOUPDATE="yes" CHECKDOCS="yes" CPPFLAGS="-ansi" + env: CONFIG_OPTS="no-asm no-deprecated enable-buildtest-c++ --strict-warnings -D_DEFAULT_SOURCE" BUILDONLY="yes" CHECKDOCS="yes" CPPFLAGS="-ansi" - os: linux arch: s390x compiler: gcc @@ -212,7 +212,7 @@ script: - if [ -n "$DESTDIR" ]; then cd _build; fi - - if [ -z "$NOUPDATE" ] && ! $make update; then + - if ! $make update; then echo -e '\052\052 FAILED -- MAKE UPDATE'; travis_terminate 1; fi diff --git a/Configurations/descrip.mms.tmpl b/Configurations/descrip.mms.tmpl index bf22e40dc4..8ce6e78999 100644 --- a/Configurations/descrip.mms.tmpl +++ b/Configurations/descrip.mms.tmpl @@ -140,8 +140,8 @@ HTMLDOCS3={- join(", ", map { "-\n\t".$_ } @{$unified_info{htmldocs}->{man3}}) - HTMLDOCS5={- join(", ", map { "-\n\t".$_ } @{$unified_info{htmldocs}->{man5}}) -} HTMLDOCS7={- join(", ", map { "-\n\t".$_ } @{$unified_info{htmldocs}->{man7}}) -} -APPS_OPENSSL={- use File::Spec::Functions; - catfile("apps","openssl") -} +APPS_OPENSSL="{- use File::Spec::Functions; + catfile("apps","openssl") -}" # DESTDIR is for package builders so that they can configure for, say, # SYS$COMMON:[OPENSSL] and yet have everything installed in STAGING:[USER]. diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl index ac24687609..a019779993 100644 --- a/Configurations/unix-Makefile.tmpl +++ b/Configurations/unix-Makefile.tmpl @@ -195,8 +195,8 @@ MANDOCS7={- fill_lines(" ", $COLUMNS - 9, map { platform->bin($_) } @{$unified_info{mandocs}->{man7}})) -} -APPS_OPENSSL={- use File::Spec::Functions; - catfile("apps","openssl") -} +APPS_OPENSSL="{- use File::Spec::Functions; + catfile("apps","openssl") -}" # DESTDIR is for package builders so that they can configure for, say, # /usr/ and yet have everything installed to /tmp/somedir/usr/. @@ -962,12 +962,6 @@ lint: generate_apps: ( cd $(SRCDIR); $(PERL) VMS/VMSify-conf.pl \ < apps/openssl.cnf > apps/openssl-vms.cnf ) - @ : {- output_off() if $disabled{apps}; "" -} - ( b=`pwd`; cd $(SRCDIR); \ - $(PERL) -I$$b apps/progs.pl -H $(APPS_OPENSSL) > apps/progs.h ) - ( b=`pwd`; cd $(SRCDIR); \ - $(PERL) -I$$b apps/progs.pl -C $(APPS_OPENSSL) > apps/progs.c ) - @ : {- output_on() if $disabled{apps}; "" -} generate_crypto_bn: ( cd $(SRCDIR); $(PERL) crypto/bn/bn_prime.pl > crypto/bn/bn_prime.h ) diff --git a/Configurations/windows-makefile.tmpl b/Configurations/windows-makefile.tmpl index 859d3a6324..c49b32f0e1 100644 --- a/Configurations/windows-makefile.tmpl +++ b/Configurations/windows-makefile.tmpl @@ -130,8 +130,8 @@ HTMLDOCS5_BLDDIRS={- my %dirs = map { dirname($_) => 1 } @HTMLDOCS5; HTMLDOCS7_BLDDIRS={- my %dirs = map { dirname($_) => 1 } @HTMLDOCS7; join(' ', sort keys %dirs) -} -APPS_OPENSSL={- use File::Spec::Functions; - "\"".catfile("apps","openssl")."\"" -} +APPS_OPENSSL="{- use File::Spec::Functions; + catfile("apps","openssl") -}" # Do not edit these manually. Use Configure with --prefix or --openssldir # to change this! Short explanation in the top comment in Configure diff --git a/Configure b/Configure index 7b3e6ccbd3..19b57d90b8 100755 --- a/Configure +++ b/Configure @@ -1807,23 +1807,62 @@ if ($builder eq "unified") { # contains a dollar sign, it had better be escaped, or it will be # taken for a variable name prefix. my %variables = (); - my $variable_re = qr/\$(?P[[:alpha:]][[:alnum:]_]*)/; + # Variable name syntax + my $variable_name_re = qr/(?P[[:alpha:]][[:alnum:]_]*)/; + # Value modifier syntaxes + my $variable_subst_re = qr/\/(?P(?:\\\/|.)*?)\/(?P.*?)/; + # Put it all together + my $variable_re = qr/\$ + (?| + # Simple case, just the name + ${variable_name_re} + | + # Expressive case, with braces and possible + # modifier expressions + \{ + ${variable_name_re} + (?: + # Pile on modifier expressions, + # separated by | + ${variable_subst_re} + ) + \} + )/x; my $expand_variables = sub { my $value = ''; my $value_rest = shift; if ($ENV{CONFIGURE_DEBUG_VARIABLE_EXPAND}) { print STDERR - "DEBUG[\$expand_variables] Parsed '$value_rest' into:\n" + "DEBUG[\$expand_variables] Parsed '$value_rest' ...\n" } while ($value_rest =~ /(?{$_}}, @values; + if (defined $attrref) { + $handle_attributes->($attr_str, \$$attrref->{$_}, + @values); + } + } + } else { + push @$valueref, @values; + $handle_attributes->($attr_str, $attrref, @values) + if defined $attrref; + } + }; + # We want to detect configdata.pm in the source tree, so we # don't use it if the build tree is different. my $src_configdata = cleanfile($srcdir, "configdata.pm", $blddir); @@ -1937,88 +2004,64 @@ if ($builder eq "unified") { } }, qr/^\s* PROGRAMS ${attribs_re} \s* = ${value_re} $/x - => sub { - if (!@skip || $skip[$#skip] > 0) { - my @p = tokenize($expand_variables->($+{VALUE})); - push @programs, @p; - $handle_attributes->($+{ATTRIBS}, - \$attributes{programs}, - @p); - } - }, + => sub { $push_to->(\@programs, undef, + \$attributes{programs}, $+{ATTRIBS}, + tokenize($expand_variables->($+{VALUE}))) + if !@skip || $skip[$#skip] > 0; }, qr/^\s* LIBS ${attribs_re} \s* = ${value_re} $/x - => sub { - if (!@skip || $skip[$#skip] > 0) { - my @l = tokenize($expand_variables->($+{VALUE})); - push @libraries, @l; - $handle_attributes->($+{ATTRIBS}, - \$attributes{libraries}, - @l); - } - }, + => sub { $push_to->(\@libraries, undef, + \$attributes{libraries}, $+{ATTRIBS}, + tokenize($expand_variables->($+{VALUE}))) + if !@skip || $skip[$#skip] > 0; }, qr/^\s* MODULES ${attribs_re} \s* = ${value_re} $/x - => sub { - if (!@skip || $skip[$#skip] > 0) { - my @m = tokenize($expand_variables->($+{VALUE})); - push @modules, @m; - $handle_attributes->($+{ATTRIBS}, - \$attributes{modules}, - @m); - } - }, + => sub { $push_to->(\@modules, undef, + \$attributes{modules}, $+{ATTRIBS}, + tokenize($expand_variables->($+{VALUE}))) + if !@skip || $skip[$#skip] > 0; }, qr/^\s* SCRIPTS ${attribs_re} \s* = ${value_re} $/x - => sub { - if (!@skip || $skip[$#skip] > 0) { - my @s = tokenize($expand_variables->($+{VALUE})); - push @scripts, @s; - $handle_attributes->($+{ATTRIBS}, - \$attributes{scripts}, - @s); - } - }, + => sub { $push_to->(\@scripts, undef, + \$attributes{scripts}, $+{ATTRIBS}, + tokenize($expand_variables->($+{VALUE}))) + if !@skip || $skip[$#skip] > 0; }, qr/^\s* HTMLDOCS ${index_re} = ${value_re} $/x - => sub { push @{$htmldocs{$expand_variables->($+{INDEX})}}, - tokenize($expand_variables->($+{VALUE})) - if !@skip || $skip[$#skip] > 0 }, + => sub { $push_to->(\%htmldocs, $expand_variables->($+{INDEX}), + undef, undef, + tokenize($expand_variables->($+{VALUE}))) + if !@skip || $skip[$#skip] > 0; }, qr/^\s* MANDOCS ${index_re} = ${value_re} $/x - => sub { push @{$mandocs{$expand_variables->($+{INDEX})}}, - tokenize($expand_variables->($+{VALUE})) - if !@skip || $skip[$#skip] > 0 }, - qr/^\s* ORDINALS ${index_re} = ${value_re} $/x - => sub { push @{$ordinals{$expand_variables->($+{INDEX})}}, - tokenize($expand_variables->($+{VALUE})) - if !@skip || $skip[$#skip] > 0 }, + => sub { $push_to->(\%mandocs, $expand_variables->($+{INDEX}), + undef, undef, + tokenize($expand_variables->($+{VALUE}))) + if !@skip || $skip[$#skip] > 0; }, qr/^\s* SOURCE ${index_re} = ${value_re} $/x - => sub { push @{$sources{$expand_variables->($+{INDEX})}}, - tokenize($expand_variables->($+{VALUE})) - if !@skip || $skip[$#skip] > 0 }, + => sub { $push_to->(\%sources, $expand_variables->($+{INDEX}), + undef, undef, + tokenize($expand_variables->($+{VALUE}))) + if !@skip || $skip[$#skip] > 0; }, qr/^\s* SHARED_SOURCE ${index_re} = ${value_re} $/x - => sub { push @{$shared_sources{$expand_variables->($+{INDEX})}}, - tokenize($expand_variables->($+{VALUE})) - if !@skip || $skip[$#skip] > 0 }, + => sub { $push_to->(\%shared_sources, $expand_variables->($+{INDEX}), + undef, undef, + tokenize($expand_variables->($+{VALUE}))) + if !@skip || $skip[$#skip] > 0; }, qr/^\s* INCLUDE ${index_re} = ${value_re} $/x - => sub { push @{$includes{$expand_variables->($+{INDEX})}}, - tokenize($expand_variables->($+{VALUE})) - if !@skip || $skip[$#skip] > 0 }, + => sub { $push_to->(\%includes, $expand_variables->($+{INDEX}), + undef, undef, + tokenize($expand_variables->($+{VALUE}))) + if !@skip || $skip[$#skip] > 0; }, qr/^\s* DEFINE ${index_re} = ${value_re} $/x - => sub { push @{$defines{$expand_variables->($+{INDEX})}}, - tokenize($expand_variables->($+{VALUE})) - if !@skip || $skip[$#skip] > 0 }, + => sub { $push_to->(\%defines, $expand_variables->($+{INDEX}), + undef, undef, + tokenize($expand_variables->($+{VALUE}))) + if !@skip || $skip[$#skip] > 0; }, qr/^\s* DEPEND ${index_re} ${attribs_re} = ${value_re} $/x - => sub { - if (!@skip || $skip[$#skip] > 0) { - my $i = $expand_variables->($+{INDEX}); - my @d = tokenize($expand_variables->($+{VALUE})); - push @{$depends{$i}}, @d; - $handle_attributes->($+{ATTRIBS}, - \$attributes{depends}->{$i}, - @d); - } - }, + => sub { $push_to->(\%depends, $expand_variables->($+{INDEX}), + \$attributes{depends}, $+{ATTRIBS}, + tokenize($expand_variables->($+{VALUE}))) + if !@skip || $skip[$#skip] > 0; }, qr/^\s* GENERATE ${index_re} = ${value_re} $/x - => sub { push @{$generate{$expand_variables->($+{INDEX})}}, - $+{VALUE} - if !@skip || $skip[$#skip] > 0 }, + => sub { $push_to->(\%generate, $expand_variables->($+{INDEX}), + undef, undef, $+{VALUE}) + if !@skip || $skip[$#skip] > 0; }, qr/^\s* (?:\#.*)? $/x => sub { }, "OTHERWISE" => sub { die "Something wrong with this line:\n$_\nat $sourced/$f" }, "BEFORE" => sub { @@ -2078,9 +2121,9 @@ EOF foreach (@{$sources{$dest}}) { my $s = cleanfile($sourced, $_, $blddir); - # If it isn't in the source tree, we assume it's generated - # in the build tree - if ($s eq $src_configdata || ! -f $s || $generate{$_}) { + # If it's generated or we simply don't find it in the source + # tree, we assume it's in the build tree. + if ($s eq $src_configdata || $generate{$_} || ! -f $s) { $s = cleanfile($buildd, $_, $blddir); } # We recognise C++, C and asm files @@ -2110,9 +2153,9 @@ EOF foreach (@{$shared_sources{$dest}}) { my $s = cleanfile($sourced, $_, $blddir); - # If it isn't in the source tree, we assume it's generated - # in the build tree - if ($s eq $src_configdata || ! -f $s || $generate{$_}) { + # If it's generated or we simply don't find it in the source + # tree, we assume it's in the build tree. + if ($s eq $src_configdata || $generate{$_} || ! -f $s) { $s = cleanfile($buildd, $_, $blddir); } @@ -2152,8 +2195,7 @@ EOF my $gen = $generator[0]; $generator[0] = cleanfile($sourced, $gen, $blddir); - # If the generator isn't in the source tree, we assume it's - # generated in the build tree + # If the generator is itself generated, it's in the build tree if ($generate{$gen}) { $generator[0] = cleanfile($buildd, $gen, $blddir); } @@ -2175,23 +2217,14 @@ EOF # If we know it's generated, or assume it is because we can't # find it in the source tree, we set file we depend on to be - # in the build tree rather than the source tree, and assume - # and that there are lines to build it in a BEGINRAW..ENDRAW - # section or in the Makefile template. + # in the build tree rather than the source tree. if ($d eq $src_configdata - || ! -f $d || (grep { $d eq $_ } map { cleanfile($srcdir, $_, $blddir) } - grep { /\.h$/ } keys %{$unified_info{generate}})) { + grep { /\.h$/ } keys %{$unified_info{generate}}) + || ! -f $d) { $d = cleanfile($buildd, $_, $blddir); } - # Take note if the file to depend on is being renamed - # Take extra care with files ending with .a, they should - # be treated without that extension, and the extension - # should be added back after treatment. - $d =~ /(\.a)?$/; - my $e = $1 // ""; - $d = $`.$e; $unified_info{depends}->{$ddest}->{$d} = 1; # Fix up associated attributes @@ -2230,9 +2263,6 @@ EOF # be a generated file in the build tree. if (! -f $ddest) { $ddest = cleanfile($buildd, $dest, $blddir); - if ($unified_info{rename}->{$ddest}) { - $ddest = $unified_info{rename}->{$ddest}; - } } } foreach my $v (@{$defines{$dest}}) { diff --git a/apps/build.info b/apps/build.info index 1b931c8ac1..495e56065e 100644 --- a/apps/build.info +++ b/apps/build.info @@ -19,6 +19,10 @@ $OPENSSLSRC=\ s_client.c s_server.c s_time.c sess_id.c smime.c speed.c \ spkac.c srp.c ts.c verify.c version.c x509.c rehash.c storeutl.c \ list.c info.c provider.c fipsinstall.c +IF[{- !$disabled{'deprecated-3.0'} -}] + $OPENSSLSRC=$OPENSSLSRC \ + dhparam.c dsa.c dsaparam.c gendsa.c rsa.c rsautl.c genrsa.c +ENDIF IF[{- !$disabled{apps} -}] PROGRAMS=openssl @@ -26,15 +30,18 @@ IF[{- !$disabled{apps} -}] INCLUDE[openssl]=.. ../include include DEPEND[openssl]=libapps.a ../libssl + DEPEND[${OPENSSLSRC/.c/.o}]=progs.h + GENERATE[progs.c]=progs.pl -C $(APPS_OPENSSL) + GENERATE[progs.h]=progs.pl -H $(APPS_OPENSSL) + # progs.pl tries to read all 'openssl' sources, including progs.c, so we make + # sure things are generated in the correct order. + DEPEND[progs.h]=progs.c + IF[{- $config{target} =~ /^(?:Cygwin|mingw|VC-)/ -}] GENERATE[openssl.rc]=../util/mkrc.pl openssl SOURCE[openssl]=openssl.rc ENDIF - IF[{- !$disabled{'deprecated-3.0'} -}] - SOURCE[openssl]=dhparam.c dsa.c dsaparam.c gendsa.c rsa.c rsautl.c genrsa.c - ENDIF - SCRIPTS{misc}=CA.pl SOURCE[CA.pl]=CA.pl.in # linkname tells build files that a symbolic link or copy of this script diff --git a/apps/progs.c b/apps/progs.c deleted file mode 100644 index 3492c93e25..0000000000 --- a/apps/progs.c +++ /dev/null @@ -1,402 +0,0 @@ -/* - * WARNING: do not edit! - * Generated by apps/progs.pl - * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. - * - * Licensed under the Apache License 2.0 (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution or at - * https://www.openssl.org/source/license.html - */ - -#include "progs.h" - -FUNCTION functions[] = { - {FT_general, "asn1parse", asn1parse_main, asn1parse_options, NULL}, - {FT_general, "ca", ca_main, ca_options, NULL}, -#ifndef OPENSSL_NO_SOCK - {FT_general, "ciphers", ciphers_main, ciphers_options, NULL}, -#endif -#ifndef OPENSSL_NO_CMS - {FT_general, "cms", cms_main, cms_options, NULL}, -#endif - {FT_general, "crl", crl_main, crl_options, NULL}, - {FT_general, "crl2pkcs7", crl2pkcs7_main, crl2pkcs7_options, NULL}, - {FT_general, "dgst", dgst_main, dgst_options, NULL}, -#if !defined(OPENSSL_NO_DH) && !defined(OPENSSL_NO_DEPRECATED_3_0) - {FT_general, "dhparam", dhparam_main, dhparam_options, "pkeyparam"}, -#endif -#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_DEPRECATED_3_0) - {FT_general, "dsa", dsa_main, dsa_options, "pkey"}, -#endif -#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_DEPRECATED_3_0) - {FT_general, "dsaparam", dsaparam_main, dsaparam_options, "pkeyparam"}, -#endif -#if !defined(OPENSSL_NO_EC) && !defined(OPENSSL_NO_DEPRECATED_3_0) - {FT_general, "ec", ec_main, ec_options, "pkey"}, -#endif -#if !defined(OPENSSL_NO_EC) && !defined(OPENSSL_NO_DEPRECATED_3_0) - {FT_general, "ecparam", ecparam_main, ecparam_options, "pkeyparam"}, -#endif - {FT_general, "enc", enc_main, enc_options, NULL}, -#ifndef OPENSSL_NO_ENGINE - {FT_general, "engine", engine_main, engine_options, NULL}, -#endif - {FT_general, "errstr", errstr_main, errstr_options, NULL}, - {FT_general, "fipsinstall", fipsinstall_main, fipsinstall_options, NULL}, -#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_DEPRECATED_3_0) - {FT_general, "gendsa", gendsa_main, gendsa_options, "genpkey"}, -#endif - {FT_general, "genpkey", genpkey_main, genpkey_options, NULL}, -#if !defined(OPENSSL_NO_RSA) && !defined(OPENSSL_NO_DEPRECATED_3_0) - {FT_general, "genrsa", genrsa_main, genrsa_options, "genpkey"}, -#endif - {FT_general, "help", help_main, help_options, NULL}, - {FT_general, "info", info_main, info_options, NULL}, - {FT_general, "kdf", kdf_main, kdf_options, NULL}, - {FT_general, "list", list_main, list_options, NULL}, - {FT_general, "mac", mac_main, mac_options, NULL}, - {FT_general, "nseq", nseq_main, nseq_options, NULL}, -#ifndef OPENSSL_NO_OCSP - {FT_general, "ocsp", ocsp_main, ocsp_options, NULL}, -#endif - {FT_general, "passwd", passwd_main, passwd_options, NULL}, -#ifndef OPENSSL_NO_DES - {FT_general, "pkcs12", pkcs12_main, pkcs12_options, NULL}, -#endif - {FT_general, "pkcs7", pkcs7_main, pkcs7_options, NULL}, - {FT_general, "pkcs8", pkcs8_main, pkcs8_options, NULL}, - {FT_general, "pkey", pkey_main, pkey_options, NULL}, - {FT_general, "pkeyparam", pkeyparam_main, pkeyparam_options, NULL}, - {FT_general, "pkeyutl", pkeyutl_main, pkeyutl_options, NULL}, - {FT_general, "prime", prime_main, prime_options, NULL}, - {FT_general, "provider", provider_main, provider_options, NULL}, - {FT_general, "rand", rand_main, rand_options, NULL}, - {FT_general, "rehash", rehash_main, rehash_options, NULL}, - {FT_general, "req", req_main, req_options, NULL}, -#if !defined(OPENSSL_NO_RSA) && !defined(OPENSSL_NO_DEPRECATED_3_0) - {FT_general, "rsa", rsa_main, rsa_options, "pkey"}, -#endif -#if !defined(OPENSSL_NO_RSA) && !defined(OPENSSL_NO_DEPRECATED_3_0) - {FT_general, "rsautl", rsautl_main, rsautl_options, "pkeyutl"}, -#endif -#ifndef OPENSSL_NO_SOCK - {FT_general, "s_client", s_client_main, s_client_options, NULL}, -#endif -#ifndef OPENSSL_NO_SOCK - {FT_general, "s_server", s_server_main, s_server_options, NULL}, -#endif -#ifndef OPENSSL_NO_SOCK - {FT_general, "s_time", s_time_main, s_time_options, NULL}, -#endif - {FT_general, "sess_id", sess_id_main, sess_id_options, NULL}, - {FT_general, "smime", smime_main, smime_options, NULL}, - {FT_general, "speed", speed_main, speed_options, NULL}, - {FT_general, "spkac", spkac_main, spkac_options, NULL}, -#ifndef OPENSSL_NO_SRP - {FT_general, "srp", srp_main, srp_options, NULL}, -#endif - {FT_general, "storeutl", storeutl_main, storeutl_options, NULL}, -#ifndef OPENSSL_NO_TS - {FT_general, "ts", ts_main, ts_options, NULL}, -#endif - {FT_general, "verify", verify_main, verify_options, NULL}, - {FT_general, "version", version_main, version_options, NULL}, - {FT_general, "x509", x509_main, x509_options, NULL}, -#ifndef OPENSSL_NO_MD2 - {FT_md, "md2", dgst_main, NULL, NULL}, -#endif -#ifndef OPENSSL_NO_MD4 - {FT_md, "md4", dgst_main, NULL, NULL}, -#endif - {FT_md, "md5", dgst_main, NULL, NULL}, -#ifndef OPENSSL_NO_GOST - {FT_md, "gost", dgst_main, NULL, NULL}, -#endif - {FT_md, "sha1", dgst_main, NULL, NULL}, - {FT_md, "sha224", dgst_main, NULL, NULL}, - {FT_md, "sha256", dgst_main, NULL, NULL}, - {FT_md, "sha384", dgst_main, NULL, NULL}, - {FT_md, "sha512", dgst_main, NULL, NULL}, - {FT_md, "sha512-224", dgst_main, NULL, NULL}, - {FT_md, "sha512-256", dgst_main, NULL, NULL}, - {FT_md, "sha3-224", dgst_main, NULL, NULL}, - {FT_md, "sha3-256", dgst_main, NULL, NULL}, - {FT_md, "sha3-384", dgst_main, NULL, NULL}, - {FT_md, "sha3-512", dgst_main, NULL, NULL}, - {FT_md, "shake128", dgst_main, NULL, NULL}, - {FT_md, "shake256", dgst_main, NULL, NULL}, -#ifndef OPENSSL_NO_MDC2 - {FT_md, "mdc2", dgst_main, NULL, NULL}, -#endif -#ifndef OPENSSL_NO_RMD160 - {FT_md, "rmd160", dgst_main, NULL, NULL}, -#endif -#ifndef OPENSSL_NO_BLAKE2 - {FT_md, "blake2b512", dgst_main, NULL, NULL}, -#endif -#ifndef OPENSSL_NO_BLAKE2 - {FT_md, "blake2s256", dgst_main, NULL, NULL}, -#endif -#ifndef OPENSSL_NO_SM3 - {FT_md, "sm3", dgst_main, NULL, NULL}, -#endif - {FT_cipher, "aes-128-cbc", enc_main, enc_options, NULL}, - {FT_cipher, "aes-128-ecb", enc_main, enc_options, NULL}, - {FT_cipher, "aes-192-cbc", enc_main, enc_options, NULL}, - {FT_cipher, "aes-192-ecb", enc_main, enc_options, NULL}, - {FT_cipher, "aes-256-cbc", enc_main, enc_options, NULL}, - {FT_cipher, "aes-256-ecb", enc_main, enc_options, NULL}, -#ifndef OPENSSL_NO_ARIA - {FT_cipher, "aria-128-cbc", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_ARIA - {FT_cipher, "aria-128-cfb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_ARIA - {FT_cipher, "aria-128-ctr", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_ARIA - {FT_cipher, "aria-128-ecb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_ARIA - {FT_cipher, "aria-128-ofb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_ARIA - {FT_cipher, "aria-128-cfb1", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_ARIA - {FT_cipher, "aria-128-cfb8", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_ARIA - {FT_cipher, "aria-192-cbc", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_ARIA - {FT_cipher, "aria-192-cfb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_ARIA - {FT_cipher, "aria-192-ctr", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_ARIA - {FT_cipher, "aria-192-ecb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_ARIA - {FT_cipher, "aria-192-ofb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_ARIA - {FT_cipher, "aria-192-cfb1", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_ARIA - {FT_cipher, "aria-192-cfb8", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_ARIA - {FT_cipher, "aria-256-cbc", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_ARIA - {FT_cipher, "aria-256-cfb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_ARIA - {FT_cipher, "aria-256-ctr", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_ARIA - {FT_cipher, "aria-256-ecb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_ARIA - {FT_cipher, "aria-256-ofb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_ARIA - {FT_cipher, "aria-256-cfb1", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_ARIA - {FT_cipher, "aria-256-cfb8", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_CAMELLIA - {FT_cipher, "camellia-128-cbc", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_CAMELLIA - {FT_cipher, "camellia-128-ecb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_CAMELLIA - {FT_cipher, "camellia-192-cbc", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_CAMELLIA - {FT_cipher, "camellia-192-ecb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_CAMELLIA - {FT_cipher, "camellia-256-cbc", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_CAMELLIA - {FT_cipher, "camellia-256-ecb", enc_main, enc_options, NULL}, -#endif - {FT_cipher, "base64", enc_main, enc_options, NULL}, -#ifdef ZLIB - {FT_cipher, "zlib", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_DES - {FT_cipher, "des", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_DES - {FT_cipher, "des3", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_DES - {FT_cipher, "desx", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_IDEA - {FT_cipher, "idea", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_SEED - {FT_cipher, "seed", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_RC4 - {FT_cipher, "rc4", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_RC4 - {FT_cipher, "rc4-40", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_RC2 - {FT_cipher, "rc2", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_BF - {FT_cipher, "bf", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_CAST - {FT_cipher, "cast", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_RC5 - {FT_cipher, "rc5", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_DES - {FT_cipher, "des-ecb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_DES - {FT_cipher, "des-ede", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_DES - {FT_cipher, "des-ede3", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_DES - {FT_cipher, "des-cbc", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_DES - {FT_cipher, "des-ede-cbc", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_DES - {FT_cipher, "des-ede3-cbc", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_DES - {FT_cipher, "des-cfb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_DES - {FT_cipher, "des-ede-cfb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_DES - {FT_cipher, "des-ede3-cfb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_DES - {FT_cipher, "des-ofb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_DES - {FT_cipher, "des-ede-ofb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_DES - {FT_cipher, "des-ede3-ofb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_IDEA - {FT_cipher, "idea-cbc", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_IDEA - {FT_cipher, "idea-ecb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_IDEA - {FT_cipher, "idea-cfb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_IDEA - {FT_cipher, "idea-ofb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_SEED - {FT_cipher, "seed-cbc", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_SEED - {FT_cipher, "seed-ecb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_SEED - {FT_cipher, "seed-cfb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_SEED - {FT_cipher, "seed-ofb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_RC2 - {FT_cipher, "rc2-cbc", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_RC2 - {FT_cipher, "rc2-ecb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_RC2 - {FT_cipher, "rc2-cfb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_RC2 - {FT_cipher, "rc2-ofb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_RC2 - {FT_cipher, "rc2-64-cbc", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_RC2 - {FT_cipher, "rc2-40-cbc", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_BF - {FT_cipher, "bf-cbc", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_BF - {FT_cipher, "bf-ecb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_BF - {FT_cipher, "bf-cfb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_BF - {FT_cipher, "bf-ofb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_CAST - {FT_cipher, "cast5-cbc", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_CAST - {FT_cipher, "cast5-ecb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_CAST - {FT_cipher, "cast5-cfb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_CAST - {FT_cipher, "cast5-ofb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_CAST - {FT_cipher, "cast-cbc", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_RC5 - {FT_cipher, "rc5-cbc", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_RC5 - {FT_cipher, "rc5-ecb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_RC5 - {FT_cipher, "rc5-cfb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_RC5 - {FT_cipher, "rc5-ofb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_SM4 - {FT_cipher, "sm4-cbc", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_SM4 - {FT_cipher, "sm4-ecb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_SM4 - {FT_cipher, "sm4-cfb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_SM4 - {FT_cipher, "sm4-ofb", enc_main, enc_options, NULL}, -#endif -#ifndef OPENSSL_NO_SM4 - {FT_cipher, "sm4-ctr", enc_main, enc_options, NULL}, -#endif - {0, NULL, NULL, NULL, NULL} -}; diff --git a/apps/progs.h b/apps/progs.h deleted file mode 100644 index 04e9c4e922..0000000000 --- a/apps/progs.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * WARNING: do not edit! - * Generated by apps/progs.pl - * - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. - * - * Licensed under the Apache License 2.0 (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution or at - * https://www.openssl.org/source/license.html - */ - -#include "function.h" - -extern int asn1parse_main(int argc, char *argv[]); -extern int ca_main(int argc, char *argv[]); -extern int ciphers_main(int argc, char *argv[]); -extern int cms_main(int argc, char *argv[]); -extern int crl_main(int argc, char *argv[]); -extern int crl2pkcs7_main(int argc, char *argv[]); -extern int dgst_main(int argc, char *argv[]); -extern int dhparam_main(int argc, char *argv[]); -extern int dsa_main(int argc, char *argv[]); -extern int dsaparam_main(int argc, char *argv[]); -extern int ec_main(int argc, char *argv[]); -extern int ecparam_main(int argc, char *argv[]); -extern int enc_main(int argc, char *argv[]); -extern int engine_main(int argc, char *argv[]); -extern int errstr_main(int argc, char *argv[]); -extern int fipsinstall_main(int argc, char *argv[]); -extern int gendsa_main(int argc, char *argv[]); -extern int genpkey_main(int argc, char *argv[]); -extern int genrsa_main(int argc, char *argv[]); -extern int help_main(int argc, char *argv[]); -extern int info_main(int argc, char *argv[]); -extern int kdf_main(int argc, char *argv[]); -extern int list_main(int argc, char *argv[]); -extern int mac_main(int argc, char *argv[]); -extern int nseq_main(int argc, char *argv[]); -extern int ocsp_main(int argc, char *argv[]); -extern int passwd_main(int argc, char *argv[]); -extern int pkcs12_main(int argc, char *argv[]); -extern int pkcs7_main(int argc, char *argv[]); -extern int pkcs8_main(int argc, char *argv[]); -extern int pkey_main(int argc, char *argv[]); -extern int pkeyparam_main(int argc, char *argv[]); -extern int pkeyutl_main(int argc, char *argv[]); -extern int prime_main(int argc, char *argv[]); -extern int provider_main(int argc, char *argv[]); -extern int rand_main(int argc, char *argv[]); -extern int rehash_main(int argc, char *argv[]); -extern int req_main(int argc, char *argv[]); -extern int rsa_main(int argc, char *argv[]); -extern int rsautl_main(int argc, char *argv[]); -extern int s_client_main(int argc, char *argv[]); -extern int s_server_main(int argc, char *argv[]); -extern int s_time_main(int argc, char *argv[]); -extern int sess_id_main(int argc, char *argv[]); -extern int smime_main(int argc, char *argv[]); -extern int speed_main(int argc, char *argv[]); -extern int spkac_main(int argc, char *argv[]); -extern int srp_main(int argc, char *argv[]); -extern int storeutl_main(int argc, char *argv[]); -extern int ts_main(int argc, char *argv[]); -extern int verify_main(int argc, char *argv[]); -extern int version_main(int argc, char *argv[]); -extern int x509_main(int argc, char *argv[]); - -extern const OPTIONS asn1parse_options[]; -extern const OPTIONS ca_options[]; -extern const OPTIONS ciphers_options[]; -extern const OPTIONS cms_options[]; -extern const OPTIONS crl_options[]; -extern const OPTIONS crl2pkcs7_options[]; -extern const OPTIONS dgst_options[]; -extern const OPTIONS dhparam_options[]; -extern const OPTIONS dsa_options[]; -extern const OPTIONS dsaparam_options[]; -extern const OPTIONS ec_options[]; -extern const OPTIONS ecparam_options[]; -extern const OPTIONS enc_options[]; -extern const OPTIONS engine_options[]; -extern const OPTIONS errstr_options[]; -extern const OPTIONS fipsinstall_options[]; -extern const OPTIONS gendsa_options[]; -extern const OPTIONS genpkey_options[]; -extern const OPTIONS genrsa_options[]; -extern const OPTIONS help_options[]; -extern const OPTIONS info_options[]; -extern const OPTIONS kdf_options[]; -extern const OPTIONS list_options[]; -extern const OPTIONS mac_options[]; -extern const OPTIONS nseq_options[]; -extern const OPTIONS ocsp_options[]; -extern const OPTIONS passwd_options[]; -extern const OPTIONS pkcs12_options[]; -extern const OPTIONS pkcs7_options[]; -extern const OPTIONS pkcs8_options[]; -extern const OPTIONS pkey_options[]; -extern const OPTIONS pkeyparam_options[]; -extern const OPTIONS pkeyutl_options[]; -extern const OPTIONS prime_options[]; -extern const OPTIONS provider_options[]; -extern const OPTIONS rand_options[]; -extern const OPTIONS rehash_options[]; -extern const OPTIONS req_options[]; -extern const OPTIONS rsa_options[]; -extern const OPTIONS rsautl_options[]; -extern const OPTIONS s_client_options[]; -extern const OPTIONS s_server_options[]; -extern const OPTIONS s_time_options[]; -extern const OPTIONS sess_id_options[]; -extern const OPTIONS smime_options[]; -extern const OPTIONS speed_options[]; -extern const OPTIONS spkac_options[]; -extern const OPTIONS srp_options[]; -extern const OPTIONS storeutl_options[]; -extern const OPTIONS ts_options[]; -extern const OPTIONS verify_options[]; -extern const OPTIONS version_options[]; -extern const OPTIONS x509_options[]; - -extern FUNCTION functions[]; diff --git a/doc/internal/man7/build.info.pod b/doc/internal/man7/build.info.pod index 2be709f770..f6ca49067d 100644 --- a/doc/internal/man7/build.info.pod +++ b/doc/internal/man7/build.info.pod @@ -24,7 +24,7 @@ B I ... B I ... -BIB<]=> I ... +BIB<]=> I ... BIB<]=> I I ... @@ -32,9 +32,9 @@ BIB<]=> I ... BIB<]=> I ... -BIB<]=> I[B<=>I] ... +BIB<]=> I[B<=>I] ... -BIB<]=> I ... +BIB<]=> I ... B<$>IB<=>I @@ -122,7 +122,7 @@ syntax is one of: =item B> B<=> I ... -=item B[>IB<]> B<=> I ... +=item B[>IB<]> B<=> I ... =back @@ -154,8 +154,14 @@ F and F, and that it depends on the library C (in other words, the library will be included when linking that program together). -For any indexed statement for which the item hasn't been specified -through any plain statement, or where the item exists but the indexed +Multiple space separated items are allowed too: + + SOURCE[foo]=foo.c + SOURCE[details]=details.c + DEPEND[foo details]=libcookie + +For any indexed statement for which the items haven't been specified +through any plain statement, or where the items exists but the indexed statement does not apply, the value is simply ignored by the build file generators. @@ -169,7 +175,7 @@ variations on how they are treated. =item B{> I | IB<=>I [,...]B<}> B<=> I ... -=item B[>IB<]{> I | IB<=>I +=item B[>IB<]{> I | IB<=>I [,...]B<}> B<=> I ... =back @@ -264,6 +270,22 @@ part of is tokenized>. I +Variable references can be one of: + +=over 4 + +=item B<$>I or B<${>IB<}> + +Simple reference; the variable reference is replaced with its value, +verbatim. + +=item B<${>IBIBIB<}> + +Substitution reference; the variable reference is replaced with its +value, modified by replacing all occurences of I with I. + +=back + =head2 Scope Most of the statement values are accumulated globally from all the @@ -411,15 +433,15 @@ C, while the script C will. =over 4 -=item BIB<]> B<=> I ... +=item BIB<]> B<=> I ... -Collects dependencies, where I depends on the given Is. +Collects dependencies, where I depend on the given Is. -As a special case, the I may be empty, for which the build file +As a special case, the I may be empty, for which the build file generators should make the whole build depend on the given Is, -rather than some specific I. +rather than the specific I. -The I may be any program, library, module, script, or any +The I may be any program, library, module, script, or any filename used as a value anywhere. B statements may have attributes, which apply to each @@ -473,19 +495,19 @@ given with B or B. For libraries, the given filenames are only used for their shared form, so if the item is a library name ending with C<.a>, the filenames will be ignored. -=item BIB<]> B<=> I[B<=>I] ... +=item BIB<]> B<=> I[B<=>I] ... Collects I / I pairs (or just I with no defined -value if no I is given) associated with I. +value if no I is given) associated with I. The build file generators will decide what to do with them. For example, these pairs should become C macro definitions whenever a C<.c> file is built into an object file. -=item BIB<]> B<=> I ... +=item BIB<]> B<=> I ... Collects inclusion directories that will be used when building the -I components (object files and whatever else). This is used at +I components (object files and whatever else). This is used at the discretion of the build file generators. =back @@ -568,7 +590,7 @@ the exception of conditional statements and variable assignments. =item "indexed statement" -Any F statement of the form B[>IB<]=>I, +Any F statement of the form B[>IB<]=>I, with the exception of conditional statements. =item "intermediate file" From builds at travis-ci.org Mon Mar 2 03:08:41 2020 From: builds at travis-ci.org (Travis CI) Date: Mon, 02 Mar 2020 03:08:41 +0000 Subject: Still Failing: openssl/openssl#32745 (master - ccceeb4) In-Reply-To: Message-ID: <5e5c78b935ea1_43feda1cc916415234a@55be48be-f73b-4225-9cb5-9aaeeee653f4.mail> Build Update for openssl/openssl ------------------------------------- Build: #32745 Status: Still Failing Duration: 48 mins and 19 secs Commit: ccceeb4 (master) Author: Richard Levitte Message: crypto/perlasm/x86_64-xlate.pl: detect GNU as to deal with quirks It turns out that GNU as and Solaris as don't have compatible ideas on the .section syntax, so we need to check if we're using GNU as or another assembler and adapt this .section syntax accordingly. Fixes #11132 Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/11191) View the changeset: https://github.com/openssl/openssl/compare/15e5b96933e9...ccceeb48000d View the full build log and details: https://travis-ci.org/openssl/openssl/builds/657106808?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the openssl/openssl repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=5849220&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From builds at travis-ci.org Mon Mar 2 03:36:01 2020 From: builds at travis-ci.org (Travis CI) Date: Mon, 02 Mar 2020 03:36:01 +0000 Subject: Still Failing: openssl/openssl#32748 (master - 2888fc1) In-Reply-To: Message-ID: <5e5c7f2113c46_43fda23691d142451a8@707c51a4-559c-4efb-96b5-d54489be6b09.mail> Build Update for openssl/openssl ------------------------------------- Build: #32748 Status: Still Failing Duration: 49 mins and 12 secs Commit: 2888fc1 (master) Author: Richard Levitte Message: PROV: Add a OP_keymgmt_match() function to our DH, DSA, RSA and EC_KEY impl Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/11158) View the changeset: https://github.com/openssl/openssl/compare/ccceeb48000d...2888fc1590ad View the full build log and details: https://travis-ci.org/openssl/openssl/builds/657108772?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the openssl/openssl repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=5849220&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From builds at travis-ci.org Mon Mar 2 03:51:30 2020 From: builds at travis-ci.org (Travis CI) Date: Mon, 02 Mar 2020 03:51:30 +0000 Subject: Errored: openssl/openssl#32750 (master - 97ace6c) In-Reply-To: Message-ID: <5e5c82c1ddbf4_43feda1cc9650160357@55be48be-f73b-4225-9cb5-9aaeeee653f4.mail> Build Update for openssl/openssl ------------------------------------- Build: #32750 Status: Errored Duration: 48 mins and 16 secs Commit: 97ace6c (master) Author: Richard Levitte Message: .travis.yml: Remove NOUPDATE support It was a temporary measure to deal with the fact that util/progs.pl didn't work right at all times, but that has now been fixed. Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/11185) View the changeset: https://github.com/openssl/openssl/compare/2888fc1590ad...97ace6c2dae4 View the full build log and details: https://travis-ci.org/openssl/openssl/builds/657110495?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the openssl/openssl repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=5849220&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From openssl at openssl.org Mon Mar 2 04:05:18 2020 From: openssl at openssl.org (OpenSSL run-checker) Date: Mon, 02 Mar 2020 04:05:18 +0000 Subject: Still FAILED build of OpenSSL branch master with options -d --strict-warnings no-deprecated Message-ID: <1583121918.748303.3320.nullmailer@run.openssl.org> Platform and configuration command: $ uname -a Linux run 4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux $ CC=clang ../openssl/config -d --strict-warnings no-deprecated Commit log since last time: e32c608e07 DOCS: Add and modify docs for internal EVP_KEYMGMT utility functions e33b132a1a DOCS: Add internal docs for EVP_PKEY and the export functions badf51c869 EVP: Add evp_pkey_upgrade_to_provider(), for EVP_PKEY upgrades 3c6ed9555c Rethink the EVP_PKEY cache of provider side keys 4911964763 man: openssl-ocsp: separate client and server options 6103f39c0d x509v3 subjectSignTool extention support 1dfdbd5bf6 Fix util/mktar.sh to use the new VERSION information c590be6f12 Fix comment placement in ecp_nistp256.ci 12d99aac97 Deprecate ASN1_sign(), ASN1_verify() and ASN1_digest() 8efc4a9c65 Implement the ECX Serializers 30a4cda5e0 Replace util/shlib_wrap.sh with util/wrap.pl in diverse docs c3845ceba8 Build file templates: don't set OPENSSL_{ENGINES,MODULES} 285e2991af TEST: add util/wrap.pl and use it f33ca114c1 VMS: mitigate for the C++ compiler that doesn't understand certain pragmas Build log ended with (last 100 lines): 65-test_cmp_protect.t .............. ok 65-test_cmp_status.t ............... ok 65-test_cmp_vfy.t .................. ok 70-test_asyncio.t .................. ok 70-test_bad_dtls.t ................. ok 70-test_clienthello.t .............. ok 70-test_comp.t ..................... ok 70-test_key_share.t ................ ok 70-test_packet.t ................... ok 70-test_recordlen.t ................ ok 70-test_renegotiation.t ............ ok 70-test_servername.t ............... ok 70-test_sslcbcpadding.t ............ ok 70-test_sslcertstatus.t ............ ok 70-test_sslextension.t ............. ok 70-test_sslmessages.t .............. ok 70-test_sslrecords.t ............... ok 70-test_sslsessiontick.t ........... ok 70-test_sslsigalgs.t ............... ok 70-test_sslsignature.t ............. ok 70-test_sslskewith0p.t ............. ok 70-test_sslversions.t .............. ok 70-test_sslvertol.t ................ ok 70-test_tls13alerts.t .............. ok 70-test_tls13cookie.t .............. ok 70-test_tls13downgrade.t ........... ok 70-test_tls13hrr.t ................. ok 70-test_tls13kexmodes.t ............ ok 70-test_tls13messages.t ............ ok 70-test_tls13psk.t ................. ok 70-test_tlsextms.t ................. ok 70-test_verify_extra.t ............. ok 70-test_wpacket.t .................. ok 71-test_ssl_ctx.t .................. ok 80-test_ca.t ....................... ok 80-test_cipherbytes.t .............. ok 80-test_cipherlist.t ............... ok 80-test_ciphername.t ............... ok 80-test_cms.t ...................... ok 80-test_cmsapi.t ................... ok 80-test_ct.t ....................... ok 80-test_dane.t ..................... ok 80-test_dtls.t ..................... ok 80-test_dtls_mtu.t ................. ok 80-test_dtlsv1listen.t ............. ok 80-test_http.t ..................... ok 80-test_ocsp.t ..................... ok 80-test_pkcs12.t ................... ok 80-test_ssl_new.t .................. ok 80-test_ssl_old.t .................. ok 80-test_ssl_test_ctx.t ............. ok 80-test_sslcorrupt.t ............... ok 80-test_tsa.t ...................... ok 80-test_x509aux.t .................. ok 90-test_asn1_time.t ................ ok 90-test_async.t .................... ok 90-test_bio_enc.t .................. ok 90-test_bio_memleak.t .............. ok 90-test_constant_time.t ............ ok 90-test_fatalerr.t ................. ok 90-test_gmdiff.t ................... ok 90-test_gost.t ..................... Dubious, test returned 1 (wstat 256, 0x100) Failed 1/1 subtests 90-test_ige.t ...................... skipped: AES_ige support is disabled in this build 90-test_includes.t ................. ok 90-test_memleak.t .................. ok 90-test_overhead.t ................. ok 90-test_secmem.t ................... ok 90-test_shlibload.t ................ ok 90-test_srp.t ...................... ok 90-test_sslapi.t ................... ok 90-test_sslbuffers.t ............... ok 90-test_sslprovider.t .............. ok 90-test_store.t .................... ok 90-test_sysdefault.t ............... ok 90-test_threads.t .................. ok 90-test_time_offset.t .............. ok 90-test_tls13ccs.t ................. ok 90-test_tls13encryption.t .......... ok 90-test_tls13secrets.t ............. ok 90-test_v3name.t ................... ok 95-test_external_boringssl.t ....... skipped: No external tests in this configuration 95-test_external_krb5.t ............ skipped: No external tests in this configuration 95-test_external_pyca.t ............ skipped: No external tests in this configuration 99-test_ecstress.t ................. ok 99-test_fuzz.t ..................... ok Test Summary Report ------------------- 90-test_gost.t (Wstat: 256 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 1 Files=192, Tests=1916, 448 wallclock secs ( 6.88 usr 1.33 sys + 415.31 cusr 35.10 csys = 458.62 CPU) Result: FAIL Makefile:2920: recipe for target '_tests' failed make[1]: *** [_tests] Error 1 make[1]: Leaving directory '/home/openssl/run-checker/no-deprecated' Makefile:2918: recipe for target 'tests' failed make: *** [tests] Error 2 From openssl at openssl.org Mon Mar 2 04:21:40 2020 From: openssl at openssl.org (OpenSSL run-checker) Date: Mon, 02 Mar 2020 04:21:40 +0000 Subject: Still FAILED build of OpenSSL branch master with options -d --strict-warnings no-des Message-ID: <1583122900.272497.4893.nullmailer@run.openssl.org> Platform and configuration command: $ uname -a Linux run 4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux $ CC=clang ../openssl/config -d --strict-warnings no-des Commit log since last time: e32c608e07 DOCS: Add and modify docs for internal EVP_KEYMGMT utility functions e33b132a1a DOCS: Add internal docs for EVP_PKEY and the export functions badf51c869 EVP: Add evp_pkey_upgrade_to_provider(), for EVP_PKEY upgrades 3c6ed9555c Rethink the EVP_PKEY cache of provider side keys 4911964763 man: openssl-ocsp: separate client and server options 6103f39c0d x509v3 subjectSignTool extention support 1dfdbd5bf6 Fix util/mktar.sh to use the new VERSION information c590be6f12 Fix comment placement in ecp_nistp256.ci 12d99aac97 Deprecate ASN1_sign(), ASN1_verify() and ASN1_digest() 8efc4a9c65 Implement the ECX Serializers 30a4cda5e0 Replace util/shlib_wrap.sh with util/wrap.pl in diverse docs c3845ceba8 Build file templates: don't set OPENSSL_{ENGINES,MODULES} 285e2991af TEST: add util/wrap.pl and use it f33ca114c1 VMS: mitigate for the C++ compiler that doesn't understand certain pragmas Build log ended with (last 100 lines): 65-test_cmp_protect.t .............. ok 65-test_cmp_status.t ............... ok 65-test_cmp_vfy.t .................. ok 70-test_asyncio.t .................. ok 70-test_bad_dtls.t ................. ok 70-test_clienthello.t .............. ok 70-test_comp.t ..................... ok 70-test_key_share.t ................ ok 70-test_packet.t ................... ok 70-test_recordlen.t ................ ok 70-test_renegotiation.t ............ ok 70-test_servername.t ............... ok 70-test_sslcbcpadding.t ............ ok 70-test_sslcertstatus.t ............ ok 70-test_sslextension.t ............. ok 70-test_sslmessages.t .............. ok 70-test_sslrecords.t ............... ok 70-test_sslsessiontick.t ........... ok 70-test_sslsigalgs.t ............... ok 70-test_sslsignature.t ............. ok 70-test_sslskewith0p.t ............. ok 70-test_sslversions.t .............. ok 70-test_sslvertol.t ................ ok 70-test_tls13alerts.t .............. ok 70-test_tls13cookie.t .............. ok 70-test_tls13downgrade.t ........... ok 70-test_tls13hrr.t ................. ok 70-test_tls13kexmodes.t ............ ok 70-test_tls13messages.t ............ ok 70-test_tls13psk.t ................. ok 70-test_tlsextms.t ................. ok 70-test_verify_extra.t ............. ok 70-test_wpacket.t .................. ok 71-test_ssl_ctx.t .................. ok 80-test_ca.t ....................... ok 80-test_cipherbytes.t .............. ok 80-test_cipherlist.t ............... ok 80-test_ciphername.t ............... ok 80-test_cms.t ...................... Dubious, test returned 1 (wstat 256, 0x100) Failed 1/7 subtests 80-test_cmsapi.t ................... ok 80-test_ct.t ....................... ok 80-test_dane.t ..................... ok 80-test_dtls.t ..................... ok 80-test_dtls_mtu.t ................. ok 80-test_dtlsv1listen.t ............. ok 80-test_http.t ..................... ok 80-test_ocsp.t ..................... ok 80-test_pkcs12.t ................... skipped: The PKCS12 command line utility is not supported by this OpenSSL build 80-test_ssl_new.t .................. ok 80-test_ssl_old.t .................. ok 80-test_ssl_test_ctx.t ............. ok 80-test_sslcorrupt.t ............... ok 80-test_tsa.t ...................... ok 80-test_x509aux.t .................. ok 90-test_asn1_time.t ................ ok 90-test_async.t .................... ok 90-test_bio_enc.t .................. ok 90-test_bio_memleak.t .............. ok 90-test_constant_time.t ............ ok 90-test_fatalerr.t ................. ok 90-test_gmdiff.t ................... ok 90-test_gost.t ..................... ok 90-test_ige.t ...................... ok 90-test_includes.t ................. ok 90-test_memleak.t .................. ok 90-test_overhead.t ................. ok 90-test_secmem.t ................... ok 90-test_shlibload.t ................ ok 90-test_srp.t ...................... ok 90-test_sslapi.t ................... ok 90-test_sslbuffers.t ............... ok 90-test_sslprovider.t .............. ok 90-test_store.t .................... ok 90-test_sysdefault.t ............... ok 90-test_threads.t .................. ok 90-test_time_offset.t .............. ok 90-test_tls13ccs.t ................. ok 90-test_tls13encryption.t .......... ok 90-test_tls13secrets.t ............. ok 90-test_v3name.t ................... ok 95-test_external_boringssl.t ....... skipped: No external tests in this configuration 95-test_external_krb5.t ............ skipped: No external tests in this configuration 95-test_external_pyca.t ............ skipped: No external tests in this configuration 99-test_ecstress.t ................. ok 99-test_fuzz.t ..................... ok Test Summary Report ------------------- 80-test_cms.t (Wstat: 256 Tests: 7 Failed: 1) Failed test: 7 Non-zero exit status: 1 Files=192, Tests=1877, 504 wallclock secs ( 6.64 usr 1.34 sys + 473.44 cusr 36.32 csys = 517.74 CPU) Result: FAIL Makefile:2873: recipe for target '_tests' failed make[1]: *** [_tests] Error 1 make[1]: Leaving directory '/home/openssl/run-checker/no-des' Makefile:2871: recipe for target 'tests' failed make: *** [tests] Error 2 From no-reply at appveyor.com Mon Mar 2 09:05:54 2020 From: no-reply at appveyor.com (AppVeyor) Date: Mon, 02 Mar 2020 09:05:54 +0000 Subject: Build failed: openssl master.32195 Message-ID: <20200302090554.1.9500A313EEA00992@appveyor.com> An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Mon Mar 2 10:15:52 2020 From: no-reply at appveyor.com (AppVeyor) Date: Mon, 02 Mar 2020 10:15:52 +0000 Subject: Build completed: openssl master.32196 Message-ID: <20200302101552.1.21066CCCB6453E7B@appveyor.com> An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Mon Mar 2 13:50:47 2020 From: no-reply at appveyor.com (AppVeyor) Date: Mon, 02 Mar 2020 13:50:47 +0000 Subject: Build failed: openssl master.32202 Message-ID: <20200302135047.1.501FBCC18E25DE7B@appveyor.com> An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Mon Mar 2 15:13:08 2020 From: no-reply at appveyor.com (AppVeyor) Date: Mon, 02 Mar 2020 15:13:08 +0000 Subject: Build completed: openssl master.32203 Message-ID: <20200302151308.1.C2E5F6B8D5485B59@appveyor.com> An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Mon Mar 2 19:12:46 2020 From: no-reply at appveyor.com (AppVeyor) Date: Mon, 02 Mar 2020 19:12:46 +0000 Subject: Build failed: openssl master.32207 Message-ID: <20200302191246.1.6E4A409625B363F2@appveyor.com> An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Mon Mar 2 20:17:46 2020 From: no-reply at appveyor.com (AppVeyor) Date: Mon, 02 Mar 2020 20:17:46 +0000 Subject: Build completed: openssl master.32208 Message-ID: <20200302201746.1.8DAA81B342283515@appveyor.com> An HTML attachment was scrubbed... URL: From openssl at openssl.org Mon Mar 2 23:30:53 2020 From: openssl at openssl.org (OpenSSL run-checker) Date: Mon, 02 Mar 2020 23:30:53 +0000 Subject: Still FAILED build of OpenSSL branch master with options -d --strict-warnings no-sock Message-ID: <1583191853.297176.16446.nullmailer@run.openssl.org> Platform and configuration command: $ uname -a Linux run 4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux $ CC=clang ../openssl/config -d --strict-warnings no-sock Commit log since last time: e32c608e07 DOCS: Add and modify docs for internal EVP_KEYMGMT utility functions e33b132a1a DOCS: Add internal docs for EVP_PKEY and the export functions badf51c869 EVP: Add evp_pkey_upgrade_to_provider(), for EVP_PKEY upgrades 3c6ed9555c Rethink the EVP_PKEY cache of provider side keys 4911964763 man: openssl-ocsp: separate client and server options 6103f39c0d x509v3 subjectSignTool extention support 1dfdbd5bf6 Fix util/mktar.sh to use the new VERSION information c590be6f12 Fix comment placement in ecp_nistp256.ci 12d99aac97 Deprecate ASN1_sign(), ASN1_verify() and ASN1_digest() 8efc4a9c65 Implement the ECX Serializers 30a4cda5e0 Replace util/shlib_wrap.sh with util/wrap.pl in diverse docs c3845ceba8 Build file templates: don't set OPENSSL_{ENGINES,MODULES} 285e2991af TEST: add util/wrap.pl and use it f33ca114c1 VMS: mitigate for the C++ compiler that doesn't understand certain pragmas Build log ended with (last 100 lines): clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-a_dup.d.tmp -MT crypto/asn1/libcrypto-lib-a_dup.o -c -o crypto/asn1/libcrypto-lib-a_dup.o ../openssl/crypto/asn1/a_dup.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-a_gentm.d.tmp -MT crypto/asn1/libcrypto-lib-a_gentm.o -c -o crypto/asn1/libcrypto-lib-a_gentm.o ../openssl/crypto/asn1/a_gentm.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-a_i2d_fp.d.tmp -MT crypto/asn1/libcrypto-lib-a_i2d_fp.o -c -o crypto/asn1/libcrypto-lib-a_i2d_fp.o ../openssl/crypto/asn1/a_i2d_fp.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-a_int.d.tmp -MT crypto/asn1/libcrypto-lib-a_int.o -c -o crypto/asn1/libcrypto-lib-a_int.o ../openssl/crypto/asn1/a_int.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-a_mbstr.d.tmp -MT crypto/asn1/libcrypto-lib-a_mbstr.o -c -o crypto/asn1/libcrypto-lib-a_mbstr.o ../openssl/crypto/asn1/a_mbstr.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-a_object.d.tmp -MT crypto/asn1/libcrypto-lib-a_object.o -c -o crypto/asn1/libcrypto-lib-a_object.o ../openssl/crypto/asn1/a_object.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-a_octet.d.tmp -MT crypto/asn1/libcrypto-lib-a_octet.o -c -o crypto/asn1/libcrypto-lib-a_octet.o ../openssl/crypto/asn1/a_octet.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-a_print.d.tmp -MT crypto/asn1/libcrypto-lib-a_print.o -c -o crypto/asn1/libcrypto-lib-a_print.o ../openssl/crypto/asn1/a_print.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-a_sign.d.tmp -MT crypto/asn1/libcrypto-lib-a_sign.o -c -o crypto/asn1/libcrypto-lib-a_sign.o ../openssl/crypto/asn1/a_sign.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-a_strex.d.tmp -MT crypto/asn1/libcrypto-lib-a_strex.o -c -o crypto/asn1/libcrypto-lib-a_strex.o ../openssl/crypto/asn1/a_strex.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-a_strnid.d.tmp -MT crypto/asn1/libcrypto-lib-a_strnid.o -c -o crypto/asn1/libcrypto-lib-a_strnid.o ../openssl/crypto/asn1/a_strnid.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-a_time.d.tmp -MT crypto/asn1/libcrypto-lib-a_time.o -c -o crypto/asn1/libcrypto-lib-a_time.o ../openssl/crypto/asn1/a_time.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-a_type.d.tmp -MT crypto/asn1/libcrypto-lib-a_type.o -c -o crypto/asn1/libcrypto-lib-a_type.o ../openssl/crypto/asn1/a_type.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-a_utctm.d.tmp -MT crypto/asn1/libcrypto-lib-a_utctm.o -c -o crypto/asn1/libcrypto-lib-a_utctm.o ../openssl/crypto/asn1/a_utctm.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-a_utf8.d.tmp -MT crypto/asn1/libcrypto-lib-a_utf8.o -c -o crypto/asn1/libcrypto-lib-a_utf8.o ../openssl/crypto/asn1/a_utf8.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-a_verify.d.tmp -MT crypto/asn1/libcrypto-lib-a_verify.o -c -o crypto/asn1/libcrypto-lib-a_verify.o ../openssl/crypto/asn1/a_verify.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-ameth_lib.d.tmp -MT crypto/asn1/libcrypto-lib-ameth_lib.o -c -o crypto/asn1/libcrypto-lib-ameth_lib.o ../openssl/crypto/asn1/ameth_lib.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-asn1_err.d.tmp -MT crypto/asn1/libcrypto-lib-asn1_err.o -c -o crypto/asn1/libcrypto-lib-asn1_err.o ../openssl/crypto/asn1/asn1_err.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-asn1_gen.d.tmp -MT crypto/asn1/libcrypto-lib-asn1_gen.o -c -o crypto/asn1/libcrypto-lib-asn1_gen.o ../openssl/crypto/asn1/asn1_gen.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-asn1_item_list.d.tmp -MT crypto/asn1/libcrypto-lib-asn1_item_list.o -c -o crypto/asn1/libcrypto-lib-asn1_item_list.o ../openssl/crypto/asn1/asn1_item_list.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-asn1_lib.d.tmp -MT crypto/asn1/libcrypto-lib-asn1_lib.o -c -o crypto/asn1/libcrypto-lib-asn1_lib.o ../openssl/crypto/asn1/asn1_lib.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-asn1_par.d.tmp -MT crypto/asn1/libcrypto-lib-asn1_par.o -c -o crypto/asn1/libcrypto-lib-asn1_par.o ../openssl/crypto/asn1/asn1_par.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-asn_mime.d.tmp -MT crypto/asn1/libcrypto-lib-asn_mime.o -c -o crypto/asn1/libcrypto-lib-asn_mime.o ../openssl/crypto/asn1/asn_mime.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-asn_moid.d.tmp -MT crypto/asn1/libcrypto-lib-asn_moid.o -c -o crypto/asn1/libcrypto-lib-asn_moid.o ../openssl/crypto/asn1/asn_moid.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-asn_mstbl.d.tmp -MT crypto/asn1/libcrypto-lib-asn_mstbl.o -c -o crypto/asn1/libcrypto-lib-asn_mstbl.o ../openssl/crypto/asn1/asn_mstbl.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-asn_pack.d.tmp -MT crypto/asn1/libcrypto-lib-asn_pack.o -c -o crypto/asn1/libcrypto-lib-asn_pack.o ../openssl/crypto/asn1/asn_pack.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-bio_asn1.d.tmp -MT crypto/asn1/libcrypto-lib-bio_asn1.o -c -o crypto/asn1/libcrypto-lib-bio_asn1.o ../openssl/crypto/asn1/bio_asn1.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-bio_ndef.d.tmp -MT crypto/asn1/libcrypto-lib-bio_ndef.o -c -o crypto/asn1/libcrypto-lib-bio_ndef.o ../openssl/crypto/asn1/bio_ndef.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-d2i_param.d.tmp -MT crypto/asn1/libcrypto-lib-d2i_param.o -c -o crypto/asn1/libcrypto-lib-d2i_param.o ../openssl/crypto/asn1/d2i_param.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-d2i_pr.d.tmp -MT crypto/asn1/libcrypto-lib-d2i_pr.o -c -o crypto/asn1/libcrypto-lib-d2i_pr.o ../openssl/crypto/asn1/d2i_pr.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-d2i_pu.d.tmp -MT crypto/asn1/libcrypto-lib-d2i_pu.o -c -o crypto/asn1/libcrypto-lib-d2i_pu.o ../openssl/crypto/asn1/d2i_pu.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-evp_asn1.d.tmp -MT crypto/asn1/libcrypto-lib-evp_asn1.o -c -o crypto/asn1/libcrypto-lib-evp_asn1.o ../openssl/crypto/asn1/evp_asn1.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-f_int.d.tmp -MT crypto/asn1/libcrypto-lib-f_int.o -c -o crypto/asn1/libcrypto-lib-f_int.o ../openssl/crypto/asn1/f_int.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-f_string.d.tmp -MT crypto/asn1/libcrypto-lib-f_string.o -c -o crypto/asn1/libcrypto-lib-f_string.o ../openssl/crypto/asn1/f_string.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-i2d_param.d.tmp -MT crypto/asn1/libcrypto-lib-i2d_param.o -c -o crypto/asn1/libcrypto-lib-i2d_param.o ../openssl/crypto/asn1/i2d_param.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-i2d_pr.d.tmp -MT crypto/asn1/libcrypto-lib-i2d_pr.o -c -o crypto/asn1/libcrypto-lib-i2d_pr.o ../openssl/crypto/asn1/i2d_pr.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-i2d_pu.d.tmp -MT crypto/asn1/libcrypto-lib-i2d_pu.o -c -o crypto/asn1/libcrypto-lib-i2d_pu.o ../openssl/crypto/asn1/i2d_pu.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-n_pkey.d.tmp -MT crypto/asn1/libcrypto-lib-n_pkey.o -c -o crypto/asn1/libcrypto-lib-n_pkey.o ../openssl/crypto/asn1/n_pkey.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-nsseq.d.tmp -MT crypto/asn1/libcrypto-lib-nsseq.o -c -o crypto/asn1/libcrypto-lib-nsseq.o ../openssl/crypto/asn1/nsseq.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-p5_pbe.d.tmp -MT crypto/asn1/libcrypto-lib-p5_pbe.o -c -o crypto/asn1/libcrypto-lib-p5_pbe.o ../openssl/crypto/asn1/p5_pbe.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-p5_pbev2.d.tmp -MT crypto/asn1/libcrypto-lib-p5_pbev2.o -c -o crypto/asn1/libcrypto-lib-p5_pbev2.o ../openssl/crypto/asn1/p5_pbev2.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-p5_scrypt.d.tmp -MT crypto/asn1/libcrypto-lib-p5_scrypt.o -c -o crypto/asn1/libcrypto-lib-p5_scrypt.o ../openssl/crypto/asn1/p5_scrypt.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-p8_pkey.d.tmp -MT crypto/asn1/libcrypto-lib-p8_pkey.o -c -o crypto/asn1/libcrypto-lib-p8_pkey.o ../openssl/crypto/asn1/p8_pkey.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-t_bitst.d.tmp -MT crypto/asn1/libcrypto-lib-t_bitst.o -c -o crypto/asn1/libcrypto-lib-t_bitst.o ../openssl/crypto/asn1/t_bitst.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-t_pkey.d.tmp -MT crypto/asn1/libcrypto-lib-t_pkey.o -c -o crypto/asn1/libcrypto-lib-t_pkey.o ../openssl/crypto/asn1/t_pkey.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-t_spki.d.tmp -MT crypto/asn1/libcrypto-lib-t_spki.o -c -o crypto/asn1/libcrypto-lib-t_spki.o ../openssl/crypto/asn1/t_spki.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-tasn_dec.d.tmp -MT crypto/asn1/libcrypto-lib-tasn_dec.o -c -o crypto/asn1/libcrypto-lib-tasn_dec.o ../openssl/crypto/asn1/tasn_dec.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-tasn_enc.d.tmp -MT crypto/asn1/libcrypto-lib-tasn_enc.o -c -o crypto/asn1/libcrypto-lib-tasn_enc.o ../openssl/crypto/asn1/tasn_enc.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-tasn_fre.d.tmp -MT crypto/asn1/libcrypto-lib-tasn_fre.o -c -o crypto/asn1/libcrypto-lib-tasn_fre.o ../openssl/crypto/asn1/tasn_fre.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-tasn_new.d.tmp -MT crypto/asn1/libcrypto-lib-tasn_new.o -c -o crypto/asn1/libcrypto-lib-tasn_new.o ../openssl/crypto/asn1/tasn_new.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-tasn_prn.d.tmp -MT crypto/asn1/libcrypto-lib-tasn_prn.o -c -o crypto/asn1/libcrypto-lib-tasn_prn.o ../openssl/crypto/asn1/tasn_prn.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-tasn_scn.d.tmp -MT crypto/asn1/libcrypto-lib-tasn_scn.o -c -o crypto/asn1/libcrypto-lib-tasn_scn.o ../openssl/crypto/asn1/tasn_scn.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-tasn_typ.d.tmp -MT crypto/asn1/libcrypto-lib-tasn_typ.o -c -o crypto/asn1/libcrypto-lib-tasn_typ.o ../openssl/crypto/asn1/tasn_typ.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-tasn_utl.d.tmp -MT crypto/asn1/libcrypto-lib-tasn_utl.o -c -o crypto/asn1/libcrypto-lib-tasn_utl.o ../openssl/crypto/asn1/tasn_utl.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-x_algor.d.tmp -MT crypto/asn1/libcrypto-lib-x_algor.o -c -o crypto/asn1/libcrypto-lib-x_algor.o ../openssl/crypto/asn1/x_algor.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-x_bignum.d.tmp -MT crypto/asn1/libcrypto-lib-x_bignum.o -c -o crypto/asn1/libcrypto-lib-x_bignum.o ../openssl/crypto/asn1/x_bignum.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-x_info.d.tmp -MT crypto/asn1/libcrypto-lib-x_info.o -c -o crypto/asn1/libcrypto-lib-x_info.o ../openssl/crypto/asn1/x_info.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-x_int64.d.tmp -MT crypto/asn1/libcrypto-lib-x_int64.o -c -o crypto/asn1/libcrypto-lib-x_int64.o ../openssl/crypto/asn1/x_int64.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-x_long.d.tmp -MT crypto/asn1/libcrypto-lib-x_long.o -c -o crypto/asn1/libcrypto-lib-x_long.o ../openssl/crypto/asn1/x_long.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-x_pkey.d.tmp -MT crypto/asn1/libcrypto-lib-x_pkey.o -c -o crypto/asn1/libcrypto-lib-x_pkey.o ../openssl/crypto/asn1/x_pkey.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-x_sig.d.tmp -MT crypto/asn1/libcrypto-lib-x_sig.o -c -o crypto/asn1/libcrypto-lib-x_sig.o ../openssl/crypto/asn1/x_sig.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-x_spki.d.tmp -MT crypto/asn1/libcrypto-lib-x_spki.o -c -o crypto/asn1/libcrypto-lib-x_spki.o ../openssl/crypto/asn1/x_spki.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-lib-x_val.d.tmp -MT crypto/asn1/libcrypto-lib-x_val.o -c -o crypto/asn1/libcrypto-lib-x_val.o ../openssl/crypto/asn1/x_val.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/async/arch/libcrypto-lib-async_null.d.tmp -MT crypto/async/arch/libcrypto-lib-async_null.o -c -o crypto/async/arch/libcrypto-lib-async_null.o ../openssl/crypto/async/arch/async_null.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/async/arch/libcrypto-lib-async_posix.d.tmp -MT crypto/async/arch/libcrypto-lib-async_posix.o -c -o crypto/async/arch/libcrypto-lib-async_posix.o ../openssl/crypto/async/arch/async_posix.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/async/arch/libcrypto-lib-async_win.d.tmp -MT crypto/async/arch/libcrypto-lib-async_win.o -c -o crypto/async/arch/libcrypto-lib-async_win.o ../openssl/crypto/async/arch/async_win.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/async/libcrypto-lib-async.d.tmp -MT crypto/async/libcrypto-lib-async.o -c -o crypto/async/libcrypto-lib-async.o ../openssl/crypto/async/async.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/async/libcrypto-lib-async_err.d.tmp -MT crypto/async/libcrypto-lib-async_err.o -c -o crypto/async/libcrypto-lib-async_err.o ../openssl/crypto/async/async_err.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/async/libcrypto-lib-async_wait.d.tmp -MT crypto/async/libcrypto-lib-async_wait.o -c -o crypto/async/libcrypto-lib-async_wait.o ../openssl/crypto/async/async_wait.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/bf/libcrypto-lib-bf_cfb64.d.tmp -MT crypto/bf/libcrypto-lib-bf_cfb64.o -c -o crypto/bf/libcrypto-lib-bf_cfb64.o ../openssl/crypto/bf/bf_cfb64.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/bf/libcrypto-lib-bf_ecb.d.tmp -MT crypto/bf/libcrypto-lib-bf_ecb.o -c -o crypto/bf/libcrypto-lib-bf_ecb.o ../openssl/crypto/bf/bf_ecb.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/bf/libcrypto-lib-bf_enc.d.tmp -MT crypto/bf/libcrypto-lib-bf_enc.o -c -o crypto/bf/libcrypto-lib-bf_enc.o ../openssl/crypto/bf/bf_enc.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/bf/libcrypto-lib-bf_ofb64.d.tmp -MT crypto/bf/libcrypto-lib-bf_ofb64.o -c -o crypto/bf/libcrypto-lib-bf_ofb64.o ../openssl/crypto/bf/bf_ofb64.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/bf/libcrypto-lib-bf_skey.d.tmp -MT crypto/bf/libcrypto-lib-bf_skey.o -c -o crypto/bf/libcrypto-lib-bf_skey.o ../openssl/crypto/bf/bf_skey.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/bio/libcrypto-lib-b_addr.d.tmp -MT crypto/bio/libcrypto-lib-b_addr.o -c -o crypto/bio/libcrypto-lib-b_addr.o ../openssl/crypto/bio/b_addr.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/bio/libcrypto-lib-b_dump.d.tmp -MT crypto/bio/libcrypto-lib-b_dump.o -c -o crypto/bio/libcrypto-lib-b_dump.o ../openssl/crypto/bio/b_dump.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/bio/libcrypto-lib-b_print.d.tmp -MT crypto/bio/libcrypto-lib-b_print.o -c -o crypto/bio/libcrypto-lib-b_print.o ../openssl/crypto/bio/b_print.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/bio/libcrypto-lib-b_sock.d.tmp -MT crypto/bio/libcrypto-lib-b_sock.o -c -o crypto/bio/libcrypto-lib-b_sock.o ../openssl/crypto/bio/b_sock.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/bio/libcrypto-lib-b_sock2.d.tmp -MT crypto/bio/libcrypto-lib-b_sock2.o -c -o crypto/bio/libcrypto-lib-b_sock2.o ../openssl/crypto/bio/b_sock2.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/bio/libcrypto-lib-bf_buff.d.tmp -MT crypto/bio/libcrypto-lib-bf_buff.o -c -o crypto/bio/libcrypto-lib-bf_buff.o ../openssl/crypto/bio/bf_buff.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/bio/libcrypto-lib-bf_lbuf.d.tmp -MT crypto/bio/libcrypto-lib-bf_lbuf.o -c -o crypto/bio/libcrypto-lib-bf_lbuf.o ../openssl/crypto/bio/bf_lbuf.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/bio/libcrypto-lib-bf_nbio.d.tmp -MT crypto/bio/libcrypto-lib-bf_nbio.o -c -o crypto/bio/libcrypto-lib-bf_nbio.o ../openssl/crypto/bio/bf_nbio.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/bio/libcrypto-lib-bf_null.d.tmp -MT crypto/bio/libcrypto-lib-bf_null.o -c -o crypto/bio/libcrypto-lib-bf_null.o ../openssl/crypto/bio/bf_null.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/bio/libcrypto-lib-bf_prefix.d.tmp -MT crypto/bio/libcrypto-lib-bf_prefix.o -c -o crypto/bio/libcrypto-lib-bf_prefix.o ../openssl/crypto/bio/bf_prefix.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/bio/libcrypto-lib-bio_cb.d.tmp -MT crypto/bio/libcrypto-lib-bio_cb.o -c -o crypto/bio/libcrypto-lib-bio_cb.o ../openssl/crypto/bio/bio_cb.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/bio/libcrypto-lib-bio_err.d.tmp -MT crypto/bio/libcrypto-lib-bio_err.o -c -o crypto/bio/libcrypto-lib-bio_err.o ../openssl/crypto/bio/bio_err.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/bio/libcrypto-lib-bio_lib.d.tmp -MT crypto/bio/libcrypto-lib-bio_lib.o -c -o crypto/bio/libcrypto-lib-bio_lib.o ../openssl/crypto/bio/bio_lib.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/bio/libcrypto-lib-bio_meth.d.tmp -MT crypto/bio/libcrypto-lib-bio_meth.o -c -o crypto/bio/libcrypto-lib-bio_meth.o ../openssl/crypto/bio/bio_meth.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/bio/libcrypto-lib-bss_acpt.d.tmp -MT crypto/bio/libcrypto-lib-bss_acpt.o -c -o crypto/bio/libcrypto-lib-bss_acpt.o ../openssl/crypto/bio/bss_acpt.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/bio/libcrypto-lib-bss_bio.d.tmp -MT crypto/bio/libcrypto-lib-bss_bio.o -c -o crypto/bio/libcrypto-lib-bss_bio.o ../openssl/crypto/bio/bss_bio.c ../openssl/crypto/bio/bio_lib.c:791:9: error: unused variable 'fd' [-Werror,-Wunused-variable] int fd; ^ 1 error generated. Makefile:12686: recipe for target 'crypto/bio/libcrypto-lib-bio_lib.o' failed make[1]: *** [crypto/bio/libcrypto-lib-bio_lib.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make[1]: Leaving directory '/home/openssl/run-checker/no-sock' Makefile:2877: recipe for target 'build_sw' failed make: *** [build_sw] Error 2 From shane.lontis at oracle.com Tue Mar 3 04:04:18 2020 From: shane.lontis at oracle.com (shane.lontis at oracle.com) Date: Tue, 03 Mar 2020 04:04:18 +0000 Subject: [openssl] master update Message-ID: <1583208258.716552.28684.nullmailer@dev.openssl.org> The branch master has been updated via 47c239c6b8d6e5d66a6ceef3a2c543b6ea338759 (commit) from 97ace6c2dae451ce8e3b099cf242968ecff128af (commit) - Log ----------------------------------------------------------------- commit 47c239c6b8d6e5d66a6ceef3a2c543b6ea338759 Author: Shane Lontis Date: Tue Mar 3 14:02:36 2020 +1000 Add pairwise consistency self tests to asym keygenerators Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/10952) ----------------------------------------------------------------------- Summary of changes: crypto/build.info | 4 +- crypto/dh/dh_gen.c | 7 +- crypto/dsa/dsa_key.c | 67 +++++++++++- crypto/ec/ec_key.c | 68 +++++++++++- crypto/ec/ecp_s390x_nistp.c | 5 +- crypto/rsa/rsa_gen.c | 98 ++++++++++++++++-- crypto/self_test_core.c | 108 ++++++++++++++++++- doc/man3/OSSL_SELF_TEST_new.pod | 172 +++++++++++++++++++++++++++++++ doc/man3/OSSL_SELF_TEST_set_callback.pod | 1 + doc/man7/OSSL_PROVIDER-FIPS.pod | 58 ++--------- include/crypto/ec.h | 1 + include/openssl/self_test.h | 8 ++ include/openssl/types.h | 2 + providers/fips/build.info | 2 +- providers/fips/fipsprov.c | 8 +- providers/fips/self_test.c | 21 ++-- providers/fips/self_test.h | 26 +---- providers/fips/self_test_event.c | 93 ----------------- providers/fips/self_test_kats.c | 58 +++++------ util/libcrypto.num | 5 + 20 files changed, 577 insertions(+), 235 deletions(-) create mode 100644 doc/man3/OSSL_SELF_TEST_new.pod delete mode 100644 providers/fips/self_test_event.c diff --git a/crypto/build.info b/crypto/build.info index b21cf3f45a..a688248acf 100644 --- a/crypto/build.info +++ b/crypto/build.info @@ -61,9 +61,9 @@ ENDIF # The Core $CORE_COMMON=provider_core.c provider_predefined.c \ - core_fetch.c core_algorithm.c core_namemap.c + core_fetch.c core_algorithm.c core_namemap.c self_test_core.c -SOURCE[../libcrypto]=$CORE_COMMON provider_conf.c self_test_core.c +SOURCE[../libcrypto]=$CORE_COMMON provider_conf.c SOURCE[../providers/libfips.a]=$CORE_COMMON # Central utilities diff --git a/crypto/dh/dh_gen.c b/crypto/dh/dh_gen.c index 8e2b773703..f8cda1b7e9 100644 --- a/crypto/dh/dh_gen.c +++ b/crypto/dh/dh_gen.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -15,6 +15,11 @@ /* * DH low level APIs are deprecated for public use, but still ok for * internal use. + * + * NOTE: When generating keys for key-agreement schemes - FIPS 140-2 IG 9.9 + * states that no additional pairwise tests are required (apart from the tests + * specified in SP800-56A) when generating keys. Hence DH pairwise tests are + * omitted here. */ #include "internal/deprecated.h" diff --git a/crypto/dsa/dsa_key.c b/crypto/dsa/dsa_key.c index c93ea15b76..2dec35f28f 100644 --- a/crypto/dsa/dsa_key.c +++ b/crypto/dsa/dsa_key.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -17,10 +17,12 @@ #include #include "internal/cryptlib.h" #include +#include #include "crypto/dsa.h" #include "dsa_local.h" -static int dsa_builtin_keygen(DSA *dsa); +static int dsa_keygen(DSA *dsa, int pairwise_test); +static int dsa_keygen_pairwise_test(DSA *dsa, OSSL_CALLBACK *cb, void *cbarg); int DSA_generate_key(DSA *dsa) { @@ -28,7 +30,7 @@ int DSA_generate_key(DSA *dsa) if (dsa->meth->dsa_keygen != NULL) return dsa->meth->dsa_keygen(dsa); #endif - return dsa_builtin_keygen(dsa); + return dsa_keygen(dsa, 0); } int dsa_generate_public_key(BN_CTX *ctx, const DSA *dsa, const BIGNUM *priv_key, @@ -50,7 +52,7 @@ err: return ret; } -static int dsa_builtin_keygen(DSA *dsa) +static int dsa_keygen(DSA *dsa, int pairwise_test) { int ok = 0; BN_CTX *ctx = NULL; @@ -82,8 +84,26 @@ static int dsa_builtin_keygen(DSA *dsa) dsa->priv_key = priv_key; dsa->pub_key = pub_key; - dsa->dirty_cnt++; + +#ifdef FIPS_MODE + pairwise_test = 1; +#endif /* FIPS_MODE */ + ok = 1; + if (pairwise_test) { + OSSL_CALLBACK *cb = NULL; + void *cbarg = NULL; + + OSSL_SELF_TEST_get_callback(dsa->libctx, &cb, &cbarg); + ok = dsa_keygen_pairwise_test(dsa, cb, cbarg); + if (!ok) { + BN_free(dsa->pub_key); + BN_clear_free(dsa->priv_key); + BN_CTX_free(ctx); + return ok; + } + } + dsa->dirty_cnt++; err: if (pub_key != dsa->pub_key) @@ -91,5 +111,42 @@ static int dsa_builtin_keygen(DSA *dsa) if (priv_key != dsa->priv_key) BN_free(priv_key); BN_CTX_free(ctx); + return ok; } + +/* + * FIPS 140-2 IG 9.9 AS09.33 + * Perform a sign/verify operation. + */ +static int dsa_keygen_pairwise_test(DSA *dsa, OSSL_CALLBACK *cb, void *cbarg) +{ + int ret = 0; + unsigned char dgst[16] = {0}; + unsigned int dgst_len = (unsigned int)sizeof(dgst); + DSA_SIG *sig = NULL; + OSSL_SELF_TEST *st = NULL; + + st = OSSL_SELF_TEST_new(cb, cbarg); + if (st == NULL) + goto err; + + OSSL_SELF_TEST_onbegin(st, OSSL_SELF_TEST_TYPE_PCT, + OSSL_SELF_TEST_DESC_PCT_DSA); + + sig = DSA_do_sign(dgst, (int)dgst_len, dsa); + if (sig == NULL) + goto err; + + OSSL_SELF_TEST_oncorrupt_byte(st, dgst); + + if (DSA_do_verify(dgst, dgst_len, sig, dsa) != 1) + goto err; + + ret = 1; +err: + OSSL_SELF_TEST_onend(st, ret); + OSSL_SELF_TEST_free(st); + DSA_SIG_free(sig); + return ret; +} diff --git a/crypto/ec/ec_key.c b/crypto/ec/ec_key.c index 4c56777dfe..18b544b9d3 100644 --- a/crypto/ec/ec_key.c +++ b/crypto/ec/ec_key.c @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved. * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved * * Licensed under the Apache License 2.0 (the "License"). You may not use @@ -20,8 +20,12 @@ #include "internal/refcount.h" #include #include +#include #include "crypto/bn.h" +static int ecdsa_keygen_pairwise_test(EC_KEY *eckey, OSSL_CALLBACK *cb, + void *cbarg); + #ifndef FIPS_MODE EC_KEY *EC_KEY_new(void) { @@ -241,11 +245,14 @@ int ossl_ec_key_gen(EC_KEY *eckey) * See SP800-56AR3 5.6.1.2.2 "Key Pair Generation by Testing Candidates" * * Params: + * libctx A context containing an optional self test callback. * eckey An EC key object that contains domain params. The generated keypair * is stored in this object. + * pairwise_test Set to non zero to perform a pairwise test. If the test + * fails then the keypair is not generated, * Returns 1 if the keypair was generated or 0 otherwise. */ -int ec_key_simple_generate_key(EC_KEY *eckey) +int ec_generate_key(OPENSSL_CTX *libctx, EC_KEY *eckey, int pairwise_test) { int ok = 0; BIGNUM *priv_key = NULL; @@ -305,8 +312,18 @@ int ec_key_simple_generate_key(EC_KEY *eckey) eckey->dirty_cnt++; +#ifdef FIPS_MODE + pairwise_test = 1; +#endif /* FIPS_MODE */ + ok = 1; + if (pairwise_test) { + OSSL_CALLBACK *cb = NULL; + void *cbarg = NULL; + OSSL_SELF_TEST_get_callback(libctx, &cb, &cbarg); + ok = ecdsa_keygen_pairwise_test(eckey, cb, cbarg); + } err: /* Step (9): If there is an error return an invalid keypair. */ if (!ok) { @@ -321,6 +338,11 @@ err: return ok; } +int ec_key_simple_generate_key(EC_KEY *eckey) +{ + return ec_generate_key(NULL, eckey, 0); +} + int ec_key_simple_generate_public_key(EC_KEY *eckey) { int ret; @@ -849,3 +871,45 @@ int EC_KEY_can_sign(const EC_KEY *eckey) return 0; return 1; } + +/* + * FIPS 140-2 IG 9.9 AS09.33 + * Perform a sign/verify operation. + * + * NOTE: When generating keys for key-agreement schemes - FIPS 140-2 IG 9.9 + * states that no additional pairwise tests are required (apart from the tests + * specified in SP800-56A) when generating keys. Hence pairwise ECDH tests are + * omitted here. + */ +static int ecdsa_keygen_pairwise_test(EC_KEY *eckey, OSSL_CALLBACK *cb, + void *cbarg) +{ + int ret = 0; + unsigned char dgst[16] = {0}; + int dgst_len = (int)sizeof(dgst); + ECDSA_SIG *sig = NULL; + OSSL_SELF_TEST *st = NULL; + + st = OSSL_SELF_TEST_new(cb, cbarg); + if (st == NULL) + return 0; + + OSSL_SELF_TEST_onbegin(st, OSSL_SELF_TEST_TYPE_PCT, + OSSL_SELF_TEST_DESC_PCT_ECDSA); + + sig = ECDSA_do_sign(dgst, dgst_len, eckey); + if (sig == NULL) + goto err; + + OSSL_SELF_TEST_oncorrupt_byte(st, dgst); + + if (ECDSA_do_verify(dgst, dgst_len, sig, eckey) != 1) + goto err; + + ret = 1; +err: + OSSL_SELF_TEST_onend(st, ret); + OSSL_SELF_TEST_free(st); + ECDSA_SIG_free(sig); + return ret; +} diff --git a/crypto/ec/ecp_s390x_nistp.c b/crypto/ec/ecp_s390x_nistp.c index a7cb5d3186..92b199d96a 100644 --- a/crypto/ec/ecp_s390x_nistp.c +++ b/crypto/ec/ecp_s390x_nistp.c @@ -169,12 +169,13 @@ static ECDSA_SIG *ecdsa_s390x_nistp_sign_sig(const unsigned char *dgst, if (r == NULL || kinv == NULL) { /* - * Generate random k and copy to param param block. RAND_priv_bytes + * Generate random k and copy to param param block. RAND_priv_bytes_ex * is used instead of BN_priv_rand_range or BN_generate_dsa_nonce * because kdsa instruction constructs an in-range, invertible nonce * internally implementing counter-measures for RNG weakness. */ - if (RAND_priv_bytes(param + S390X_OFF_RN(len), len) != 1) { + if (RAND_priv_bytes_ex(eckey->libctx, param + S390X_OFF_RN(len), + len) != 1) { ECerr(EC_F_ECDSA_S390X_NISTP_SIGN_SIG, EC_R_RANDOM_NUMBER_GENERATION_FAILED); goto ret; diff --git a/crypto/rsa/rsa_gen.c b/crypto/rsa/rsa_gen.c index 5778bdada5..5d82ae6f34 100644 --- a/crypto/rsa/rsa_gen.c +++ b/crypto/rsa/rsa_gen.c @@ -23,10 +23,12 @@ #include #include "internal/cryptlib.h" #include +#include #include "rsa_local.h" -static int rsa_builtin_keygen(RSA *rsa, int bits, int primes, BIGNUM *e_value, - BN_GENCB *cb); +static int rsa_keygen_pairwise_test(RSA *rsa, OSSL_CALLBACK *cb, void *cbarg); +static int rsa_keygen(OPENSSL_CTX *libctx, RSA *rsa, int bits, int primes, + BIGNUM *e_value, BN_GENCB *cb, int pairwise_test); /* * NB: this wrapper would normally be placed in rsa_lib.c and the static @@ -65,19 +67,21 @@ int RSA_generate_multi_prime_key(RSA *rsa, int bits, int primes, return 0; } #endif /* FIPS_MODE */ - return rsa_builtin_keygen(rsa, bits, primes, e_value, cb); + return rsa_keygen(NULL, rsa, bits, primes, e_value, cb, 0); } -static int rsa_builtin_keygen(RSA *rsa, int bits, int primes, BIGNUM *e_value, - BN_GENCB *cb) +static int rsa_keygen(OPENSSL_CTX *libctx, RSA *rsa, int bits, int primes, + BIGNUM *e_value, BN_GENCB *cb, int pairwise_test) { + int ok = -1; #ifdef FIPS_MODE if (primes != 2) return 0; - return rsa_sp800_56b_generate_key(rsa, bits, e_value, cb); + ok = rsa_sp800_56b_generate_key(rsa, bits, e_value, cb); + pairwise_test = 1; /* FIPS MODE needs to always run the pairwise test */ #else BIGNUM *r0 = NULL, *r1 = NULL, *r2 = NULL, *tmp, *prime; - int ok = -1, n = 0, bitsr[RSA_MAX_PRIME_NUM], bitse = 0; + int n = 0, bitsr[RSA_MAX_PRIME_NUM], bitse = 0; int i = 0, quo = 0, rmd = 0, adj = 0, retries = 0; RSA_PRIME_INFO *pinfo = NULL; STACK_OF(RSA_PRIME_INFO) *prime_infos = NULL; @@ -87,13 +91,13 @@ static int rsa_builtin_keygen(RSA *rsa, int bits, int primes, BIGNUM *e_value, if (bits < RSA_MIN_MODULUS_BITS) { ok = 0; /* we set our own err */ - RSAerr(RSA_F_RSA_BUILTIN_KEYGEN, RSA_R_KEY_SIZE_TOO_SMALL); + RSAerr(0, RSA_R_KEY_SIZE_TOO_SMALL); goto err; } if (primes < RSA_DEFAULT_PRIME_NUM || primes > rsa_multip_cap(bits)) { ok = 0; /* we set our own err */ - RSAerr(RSA_F_RSA_BUILTIN_KEYGEN, RSA_R_KEY_PRIME_NUM_INVALID); + RSAerr(0, RSA_R_KEY_PRIME_NUM_INVALID); goto err; } @@ -398,11 +402,83 @@ static int rsa_builtin_keygen(RSA *rsa, int bits, int primes, BIGNUM *e_value, ok = 1; err: if (ok == -1) { - RSAerr(RSA_F_RSA_BUILTIN_KEYGEN, ERR_LIB_BN); + RSAerr(0, ERR_LIB_BN); ok = 0; } BN_CTX_end(ctx); BN_CTX_free(ctx); - return ok; #endif /* FIPS_MODE */ + + if (pairwise_test && ok > 0) { + OSSL_CALLBACK *stcb = NULL; + void *stcbarg = NULL; + + OSSL_SELF_TEST_get_callback(libctx, &stcb, &stcbarg); + ok = rsa_keygen_pairwise_test(rsa, stcb, stcbarg); + if (!ok) { + /* Clear intermediate results */ + BN_clear_free(rsa->d); + BN_clear_free(rsa->p); + BN_clear_free(rsa->q); + BN_clear_free(rsa->dmp1); + BN_clear_free(rsa->dmq1); + BN_clear_free(rsa->iqmp); + } + } + return ok; +} + +/* + * For RSA key generation it is not known whether the key pair will be used + * for key transport or signatures. FIPS 140-2 IG 9.9 states that in this case + * either a signature verification OR an encryption operation may be used to + * perform the pairwise consistency check. The simpler encrypt/decrypt operation + * has been chosen for this case. + */ +static int rsa_keygen_pairwise_test(RSA *rsa, OSSL_CALLBACK *cb, void *cbarg) +{ + int ret = 0; + unsigned int ciphertxt_len; + unsigned char *ciphertxt = NULL; + const unsigned char plaintxt[16] = {0}; + unsigned char decoded[256]; + unsigned int decoded_len; + unsigned int plaintxt_len = (unsigned int)sizeof(plaintxt_len); + int padding = RSA_PKCS1_PADDING; + OSSL_SELF_TEST *st = NULL; + + st = OSSL_SELF_TEST_new(cb, cbarg); + if (st == NULL) + goto err; + OSSL_SELF_TEST_onbegin(st, OSSL_SELF_TEST_TYPE_PCT, + OSSL_SELF_TEST_DESC_PCT_RSA_PKCS1); + + ciphertxt_len = RSA_size(rsa); + ciphertxt = OPENSSL_zalloc(ciphertxt_len); + if (ciphertxt == NULL) + goto err; + + ciphertxt_len = RSA_public_encrypt(plaintxt_len, plaintxt, ciphertxt, rsa, + padding); + if (ciphertxt_len <= 0) + goto err; + if (ciphertxt_len == plaintxt_len + && memcmp(decoded, plaintxt, plaintxt_len) == 0) + goto err; + + OSSL_SELF_TEST_oncorrupt_byte(st, ciphertxt); + + decoded_len = RSA_private_decrypt(ciphertxt_len, ciphertxt, decoded, rsa, + padding); + if (decoded_len != plaintxt_len + || memcmp(decoded, plaintxt, decoded_len) != 0) + goto err; + + ret = 1; +err: + OSSL_SELF_TEST_onend(st, ret); + OSSL_SELF_TEST_free(st); + OPENSSL_free(ciphertxt); + + return ret; } diff --git a/crypto/self_test_core.c b/crypto/self_test_core.c index 77864a230b..bee3161ed5 100644 --- a/crypto/self_test_core.c +++ b/crypto/self_test_core.c @@ -1,5 +1,5 @@ /* - * Copyright 2019 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -8,6 +8,8 @@ */ #include +#include +#include #include "internal/cryptlib.h" typedef struct self_test_cb_st @@ -16,6 +18,19 @@ typedef struct self_test_cb_st void *cbarg; } SELF_TEST_CB; +struct ossl_self_test_st +{ + /* local state variables */ + const char *phase; + const char *type; + const char *desc; + OSSL_CALLBACK *cb; + + /* callback related variables used to pass the state back to the user */ + OSSL_PARAM params[4]; + void *cb_arg; +}; + static void *self_test_set_callback_new(OPENSSL_CTX *ctx) { SELF_TEST_CB *stcb; @@ -40,6 +55,7 @@ static SELF_TEST_CB *get_self_test_callback(OPENSSL_CTX *libctx) &self_test_set_callback_method); } +#ifndef FIPS_MODE void OSSL_SELF_TEST_set_callback(OPENSSL_CTX *libctx, OSSL_CALLBACK *cb, void *cbarg) { @@ -50,6 +66,8 @@ void OSSL_SELF_TEST_set_callback(OPENSSL_CTX *libctx, OSSL_CALLBACK *cb, stcb->cbarg = cbarg; } } +#endif /* FIPS_MODE */ + void OSSL_SELF_TEST_get_callback(OPENSSL_CTX *libctx, OSSL_CALLBACK **cb, void **cbarg) { @@ -60,3 +78,91 @@ void OSSL_SELF_TEST_get_callback(OPENSSL_CTX *libctx, OSSL_CALLBACK **cb, if (cbarg != NULL) *cbarg = (stcb != NULL ? stcb->cbarg : NULL); } + +static void self_test_setparams(OSSL_SELF_TEST *st) +{ + size_t n = 0; + + if (st->cb != NULL) { + st->params[n++] = + OSSL_PARAM_construct_utf8_string(OSSL_PROV_PARAM_SELF_TEST_PHASE, + (char *)st->phase, 0); + st->params[n++] = + OSSL_PARAM_construct_utf8_string(OSSL_PROV_PARAM_SELF_TEST_TYPE, + (char *)st->type, 0); + st->params[n++] = + OSSL_PARAM_construct_utf8_string(OSSL_PROV_PARAM_SELF_TEST_DESC, + (char *)st->desc, 0); + } + st->params[n++] = OSSL_PARAM_construct_end(); +} + +OSSL_SELF_TEST *OSSL_SELF_TEST_new(OSSL_CALLBACK *cb, void *cbarg) +{ + OSSL_SELF_TEST *ret = OPENSSL_zalloc(sizeof(*ret)); + + if (ret == NULL) + return NULL; + + ret->cb = cb; + ret->cb_arg = cbarg; + ret->phase = ""; + ret->type = ""; + ret->desc = ""; + self_test_setparams(ret); + return ret; +} + +void OSSL_SELF_TEST_free(OSSL_SELF_TEST *st) +{ + OPENSSL_free(st); +} + +/* Can be used during application testing to log that a test has started. */ +void OSSL_SELF_TEST_onbegin(OSSL_SELF_TEST *st, const char *type, + const char *desc) +{ + if (st != NULL && st->cb != NULL) { + st->phase = OSSL_SELF_TEST_PHASE_START; + st->type = type; + st->desc = desc; + self_test_setparams(st); + (void)st->cb(st->params, st->cb_arg); + } +} + +/* + * Can be used during application testing to log that a test has either + * passed or failed. + */ +void OSSL_SELF_TEST_onend(OSSL_SELF_TEST *st, int ret) +{ + if (st != NULL && st->cb != NULL) { + st->phase = + (ret == 1 ? OSSL_SELF_TEST_PHASE_PASS : OSSL_SELF_TEST_PHASE_FAIL); + self_test_setparams(st); + (void)st->cb(st->params, st->cb_arg); + + st->phase = OSSL_SELF_TEST_PHASE_NONE; + st->type = OSSL_SELF_TEST_TYPE_NONE; + st->desc = OSSL_SELF_TEST_DESC_NONE; + } +} + +/* + * Used for failure testing. + * + * Call the applications SELF_TEST_cb() if it exists. + * If the application callback decides to return 0 then the first byte of 'bytes' + * is modified (corrupted). This is used to modify output signatures or + * ciphertext before they are verified or decrypted. + */ +void OSSL_SELF_TEST_oncorrupt_byte(OSSL_SELF_TEST *st, unsigned char *bytes) +{ + if (st != NULL && st->cb != NULL) { + st->phase = OSSL_SELF_TEST_PHASE_CORRUPT; + self_test_setparams(st); + if (!st->cb(st->params, st->cb_arg)) + bytes[0] ^= 1; + } +} diff --git a/doc/man3/OSSL_SELF_TEST_new.pod b/doc/man3/OSSL_SELF_TEST_new.pod new file mode 100644 index 0000000000..32155e1cd0 --- /dev/null +++ b/doc/man3/OSSL_SELF_TEST_new.pod @@ -0,0 +1,172 @@ +=pod + +=head1 NAME + +OSSL_SELF_TEST_new, +OSSL_SELF_TEST_free, +OSSL_SELF_TEST_onbegin, +OSSL_SELF_TEST_oncorrupt_byte, +OSSL_SELF_TEST_onend - functionality to trigger a callback during a self test + +=head1 SYNOPSIS + + #include + + OSSL_SELF_TEST *OSSL_SELF_TEST_new(OSSL_CALLBACK *cb, void *cbarg); + void OSSL_SELF_TEST_free(OSSL_SELF_TEST *st); + + void OSSL_SELF_TEST_onbegin(OSSL_SELF_TEST *st, const char *type, + const char *desc); + void OSSL_SELF_TEST_oncorrupt_byte(OSSL_SELF_TEST *st, unsigned char *bytes); + void OSSL_SELF_TEST_onend(OSSL_SELF_TEST *st, int ret); + +=head1 DESCRIPTION + +These methods are intended for use by provider implementors, to display +diagnostic information during self testing. + +OSSL_SELF_TEST_new() allocates an opaque B object that has a +callback and callback argument associated with it. + +The callback I may be triggered multiple times by a self test to indicate +different phases. + +OSSL_SELF_TEST_free() frees the space allocated by OSSL_SELF_TEST_new(). + +OSSL_SELF_TEST_onbegin() may be inserted at the start of a block of self test +code. It can be used for diagnostic purposes. +If this method is called the callback I will receive the following +B object. + +=over 4 + +=item "st-phase" (B) + +The value is the string "Start" + +=back + +OSSL_SELF_TEST_oncorrupt_byte() may be inserted just after the known answer is +calculated, but before the self test compares the result. The first byte in the +passed in array of I will be corrupted if the callback returns 0, +otherwise it leaves the array unaltered. It can be used for failure testing. +The I and I can be used to identify an individual self test to +target for failure testing. +If this method is called the callback I will receive the following +B object. + +=over 4 + +=item "st-phase" (B) + +The value is the string "Corrupt" + +=back + +OSSL_SELF_TEST_onend() may be inserted at the end of a block of self test code +just before cleanup to indicate if the test passed or failed. It can be used for +diagnostic purposes. +If this method is called the callback I will receive the following +B object. + +=over 4 + +=item "st-phase" (B) + +The value of the string is "Pass" if I is non zero, otherwise it has the +value "Fail". + +=back + +After the callback I has been called the values that were set by +OSSL_SELF_TEST_onbegin() for I and I are set to the value "None". + +If OSSL_SELF_TEST_onbegin(), OSSL_SELF_TEST_oncorrupt_byte() or +OSSL_SELF_TEST_onend() is called the following additional B are +passed to the callback. + +=over 4 + +=item "st-type" (B) + +The value is setup by the I passed to OSSL_SELF_TEST_onbegin(). +This allows the callback to identify the type of test being run. + +=item "st-desc" (B) + +The value is setup by the I passed to OSSL_SELF_TEST_onbegin(). +This allows the callback to identify the sub category of the test being run. + +=back + +=head1 RETURN VALUES + +OSSL_SELF_TEST_new() returns the allocated B object, or NULL if +it fails. + +=head1 EXAMPLES + +A single self test could be set up in the following way: + + OSSL_SELF_TEST *st = NULL; + OSSL_CALLBACK *cb; + void *cbarg; + int ok = 0; + unsigned char out[EVP_MAX_MD_SIZE]; + unsigned int out_len = 0; + EVP_MD_CTX *ctx = EVP_MD_CTX_new(); + EVP_MD *md = EVP_MD_fetch(libctx, t->algorithm, NULL); + + /* + * Retrieve the callback - will be NULL if not set by the application via + * OSSL_SELF_TEST_set_callback(). + */ + OSSL_SELF_TEST_get_callback(libctx, &cb, &cbarg); + + st = OSSL_SELF_TEST_new(cb, cb_arg); + + /* Trigger the optional callback */ + OSSL_SELF_TEST_onbegin(st, OSSL_SELF_TEST_TYPE_KAT_DIGEST, + OSSL_SELF_TEST_DESC_MD_SHA2); + + if (!EVP_DigestInit_ex(ctx, md, NULL) + || !EVP_DigestUpdate(ctx, pt, pt_len) + || !EVP_DigestFinal(ctx, out, &out_len)) + goto err; + + /* Optional corruption - If the application callback returns 0 */ + OSSL_SELF_TEST_oncorrupt_byte(st, out); + + if (out_len != t->expected_len + || memcmp(out, t->expected, out_len) != 0) + goto err; + ok = 1; + err: + OSSL_SELF_TEST_onend(st, ok); + EVP_MD_free(md); + EVP_MD_CTX_free(ctx); + +Multiple self test's can be set up in a similar way by repeating the pattern of +OSSL_SELF_TEST_onbegin(), OSSL_SELF_TEST_oncorrupt_byte(), OSSL_SELF_TEST_onend() +for each test. + +=head1 SEE ALSO + +L, +L, +L + +=head1 HISTORY + +The functions described here were added in OpenSSL 3.0. + +=head1 COPYRIGHT + +Copyright 2020 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the Apache License 2.0 (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +L. + +=cut diff --git a/doc/man3/OSSL_SELF_TEST_set_callback.pod b/doc/man3/OSSL_SELF_TEST_set_callback.pod index b2d38fbf7f..be65eca0fe 100644 --- a/doc/man3/OSSL_SELF_TEST_set_callback.pod +++ b/doc/man3/OSSL_SELF_TEST_set_callback.pod @@ -32,6 +32,7 @@ not been called. L, L +L L =head1 HISTORY diff --git a/doc/man7/OSSL_PROVIDER-FIPS.pod b/doc/man7/OSSL_PROVIDER-FIPS.pod index c3768da7bc..1cb75e7c87 100644 --- a/doc/man7/OSSL_PROVIDER-FIPS.pod +++ b/doc/man7/OSSL_PROVIDER-FIPS.pod @@ -17,59 +17,16 @@ One of the requirements for the FIPS module is self testing. An optional callbac mechanism is available to return information to the user using L. +The parameters passed to the callback are described in L + The OPENSSL FIPS module uses the following mechanism to provide information about the self tests as they run. This is useful for debugging if a self test is failing. The callback also allows forcing any self test to fail, in order to check that it operates correctly on failure. - -The 'args' parameter of B contains the B associated -with the provider that is triggering the self test. This may be useful if -multiple fips providers are present. - -The OSSL_PARAM names used are: - -=over 4 - -=item "st-phase" (B) - -Each self test calls the callback 3 times with the following string values -for the phase. - -=over 4 - -=item "Start" (B) - -This is the initial phase before the self test has run. -This is used for informational purposes only. -The value returned by the callback is ignored. - -=item "Corrupt" (B) - -The corrupt phase is run after the self test has calculated its known value. -The callback may be used to force the self test to fail by returning a value -of 0 from the callback during this phase. -Returning any other value from the callback causes the self test to run normally. - -=item "Pass" (B) - -=item "Fail" (B) - -The final phase runs after the self test is complete and indicates if a self -test passed or failed. This is used for informational purposes only. -The value returned by the callback is ignored. -"Fail" should normally only be returned if any self test was forced to fail -during the "Corrupt" phase (or if there was an error such as the integrity -check of the module failed). - Note that all self tests run even if a self test failure occurs. -=back - -=item "st-type" (B) - -Used as a category to identify the type of self test being run. -It includes the following string values: +The FIPS module passes the following type(s) to OSSL_SELF_TEST_onbegin(). =over 4 @@ -126,10 +83,8 @@ All other self test categories are run once at installation time, except for the There is only one instance of the "Module_Integrity" and "Install_Integrity" self tests. All other self tests may have multiple instances. -=item "st-desc" (B) -Used as a sub category to identify an individual self test. -The following description strings are used. +The FIPS module passes the following descriptions(s) to OSSL_SELF_TEST_onbegin(). =over 4 @@ -187,8 +142,6 @@ DRBG tests used with the "DRBG" type. =back -=back - =head1 EXAMPLES A simple self test callback is shown below for illustrative purposes. @@ -241,6 +194,7 @@ A simple self test callback is shown below for illustrative purposes. L, L, L, +L, L, L @@ -250,7 +204,7 @@ The type and functions described here were added in OpenSSL 3.0. =head1 COPYRIGHT -Copyright 2019 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved. Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/include/crypto/ec.h b/include/crypto/ec.h index 4a0a967629..c4f7d2e778 100644 --- a/include/crypto/ec.h +++ b/include/crypto/ec.h @@ -49,5 +49,6 @@ int ecdh_KDF_X9_63(unsigned char *out, size_t outlen, const unsigned char *sinfo, size_t sinfolen, const EVP_MD *md); +int ec_generate_key(OPENSSL_CTX *libctx, EC_KEY *eckey, int pairwise_test); # endif /* OPENSSL_NO_EC */ #endif diff --git a/include/openssl/self_test.h b/include/openssl/self_test.h index 31dd6bd6c5..478d4b3cd5 100644 --- a/include/openssl/self_test.h +++ b/include/openssl/self_test.h @@ -65,4 +65,12 @@ void OSSL_SELF_TEST_set_callback(OPENSSL_CTX *libctx, OSSL_CALLBACK *cb, void OSSL_SELF_TEST_get_callback(OPENSSL_CTX *libctx, OSSL_CALLBACK **cb, void **cbarg); +OSSL_SELF_TEST *OSSL_SELF_TEST_new(OSSL_CALLBACK *cb, void *cbarg); +void OSSL_SELF_TEST_free(OSSL_SELF_TEST *st); + +void OSSL_SELF_TEST_onbegin(OSSL_SELF_TEST *st, const char *type, + const char *desc); +void OSSL_SELF_TEST_oncorrupt_byte(OSSL_SELF_TEST *st, unsigned char *bytes); +void OSSL_SELF_TEST_onend(OSSL_SELF_TEST *st, int ret); + #endif /* OPENSSL_SELF_TEST_H */ diff --git a/include/openssl/types.h b/include/openssl/types.h index 5761afc097..e7078df6d0 100644 --- a/include/openssl/types.h +++ b/include/openssl/types.h @@ -209,6 +209,8 @@ typedef int pem_password_cb (char *buf, int size, int rwflag, void *userdata); typedef struct ossl_serializer_st OSSL_SERIALIZER; typedef struct ossl_serializer_ctx_st OSSL_SERIALIZER_CTX; +typedef struct ossl_self_test_st OSSL_SELF_TEST; + #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L && \ defined(INTMAX_MAX) && defined(UINTMAX_MAX) typedef intmax_t ossl_intmax_t; diff --git a/providers/fips/build.info b/providers/fips/build.info index d12849ebb0..8d3c5e2049 100644 --- a/providers/fips/build.info +++ b/providers/fips/build.info @@ -1,2 +1,2 @@ -SOURCE[../fips]=fipsprov.c self_test.c self_test_kats.c self_test_event.c +SOURCE[../fips]=fipsprov.c self_test.c self_test_kats.c INCLUDE[../fips]=../implementations/include ../common/include ../.. diff --git a/providers/fips/fipsprov.c b/providers/fips/fipsprov.c index 0ff0408a26..7063bf5c3f 100644 --- a/providers/fips/fipsprov.c +++ b/providers/fips/fipsprov.c @@ -966,12 +966,12 @@ int OSSL_provider_init(const OSSL_PROVIDER *provider, } if (stcbfn != NULL && c_get_libctx != NULL) { - stcbfn(c_get_libctx(provider), &selftest_params.event_cb, - &selftest_params.event_cb_arg); + stcbfn(c_get_libctx(provider), &selftest_params.cb, + &selftest_params.cb_arg); } else { - selftest_params.event_cb = NULL; - selftest_params.event_cb_arg = NULL; + selftest_params.cb = NULL; + selftest_params.cb_arg = NULL; } if (!c_get_params(provider, core_params)) diff --git a/providers/fips/self_test.c b/providers/fips/self_test.c index e486dd0db0..5bc921c050 100644 --- a/providers/fips/self_test.c +++ b/providers/fips/self_test.c @@ -132,7 +132,7 @@ DEP_FINI_ATTRIBUTE void cleanup(void) */ static int verify_integrity(BIO *bio, OSSL_BIO_read_ex_fn read_ex_cb, unsigned char *expected, size_t expected_len, - OPENSSL_CTX *libctx, OSSL_ST_EVENT *ev, + OPENSSL_CTX *libctx, OSSL_SELF_TEST *ev, const char *event_type) { int ret = 0, status; @@ -143,7 +143,7 @@ static int verify_integrity(BIO *bio, OSSL_BIO_read_ex_fn read_ex_cb, EVP_MAC_CTX *ctx = NULL; OSSL_PARAM params[3], *p = params; - SELF_TEST_EVENT_onbegin(ev, event_type, OSSL_SELF_TEST_DESC_INTEGRITY_HMAC); + OSSL_SELF_TEST_onbegin(ev, event_type, OSSL_SELF_TEST_DESC_INTEGRITY_HMAC); mac = EVP_MAC_fetch(libctx, MAC_NAME, NULL); ctx = EVP_MAC_CTX_new(mac); @@ -170,13 +170,13 @@ static int verify_integrity(BIO *bio, OSSL_BIO_read_ex_fn read_ex_cb, if (!EVP_MAC_final(ctx, out, &out_len, sizeof(out))) goto err; - SELF_TEST_EVENT_oncorrupt_byte(ev, out); + OSSL_SELF_TEST_oncorrupt_byte(ev, out); if (expected_len != out_len || memcmp(expected, out, out_len) != 0) goto err; ret = 1; err: - SELF_TEST_EVENT_onend(ev, ret); + OSSL_SELF_TEST_onend(ev, ret); EVP_MAC_CTX_free(ctx); EVP_MAC_free(mac); return ret; @@ -192,7 +192,7 @@ int SELF_TEST_post(SELF_TEST_POST_PARAMS *st, int on_demand_test) unsigned char *module_checksum = NULL; unsigned char *indicator_checksum = NULL; int loclstate; - OSSL_ST_EVENT ev; + OSSL_SELF_TEST *ev = NULL; if (!RUN_ONCE(&fips_self_test_init, do_fips_self_test_init)) return 0; @@ -223,7 +223,9 @@ int SELF_TEST_post(SELF_TEST_POST_PARAMS *st, int on_demand_test) || st->module_checksum_data == NULL) goto end; - SELF_TEST_EVENT_init(&ev, st->event_cb, st->event_cb_arg); + ev = OSSL_SELF_TEST_new(st->cb, st->cb_arg); + if (ev == NULL) + goto end; module_checksum = OPENSSL_hexstr2buf(st->module_checksum_data, &checksum_len); @@ -235,7 +237,7 @@ int SELF_TEST_post(SELF_TEST_POST_PARAMS *st, int on_demand_test) if (bio_module == NULL || !verify_integrity(bio_module, st->bio_read_ex_cb, module_checksum, checksum_len, st->libctx, - &ev, OSSL_SELF_TEST_TYPE_MODULE_INTEGRITY)) + ev, OSSL_SELF_TEST_TYPE_MODULE_INTEGRITY)) goto end; /* This will be NULL during installation - so the self test KATS will run */ @@ -257,7 +259,7 @@ int SELF_TEST_post(SELF_TEST_POST_PARAMS *st, int on_demand_test) if (bio_indicator == NULL || !verify_integrity(bio_indicator, st->bio_read_ex_cb, indicator_checksum, checksum_len, - st->libctx, &ev, + st->libctx, ev, OSSL_SELF_TEST_TYPE_INSTALL_INTEGRITY)) goto end; else @@ -266,11 +268,12 @@ int SELF_TEST_post(SELF_TEST_POST_PARAMS *st, int on_demand_test) /* Only runs the KAT's during installation OR on_demand() */ if (on_demand_test || kats_already_passed == 0) { - if (!SELF_TEST_kats(&ev, st->libctx)) + if (!SELF_TEST_kats(ev, st->libctx)) goto end; } ok = 1; end: + OSSL_SELF_TEST_free(ev); OPENSSL_free(module_checksum); OPENSSL_free(indicator_checksum); diff --git a/providers/fips/self_test.h b/providers/fips/self_test.h index 5d995adac3..1950261a29 100644 --- a/providers/fips/self_test.h +++ b/providers/fips/self_test.h @@ -26,31 +26,11 @@ typedef struct self_test_post_params_st { OSSL_BIO_new_membuf_fn *bio_new_buffer_cb; OSSL_BIO_read_ex_fn *bio_read_ex_cb; OSSL_BIO_free_fn *bio_free_cb; - OSSL_CALLBACK *event_cb; - void *event_cb_arg; - OPENSSL_CTX *libctx; - -} SELF_TEST_POST_PARAMS; - -typedef struct st_event_st -{ - /* local state variables */ - const char *phase; - const char *type; - const char *desc; OSSL_CALLBACK *cb; - - /* callback related variables used to pass the state back to the user */ - OSSL_PARAM params[4]; void *cb_arg; + OPENSSL_CTX *libctx; -} OSSL_ST_EVENT; +} SELF_TEST_POST_PARAMS; int SELF_TEST_post(SELF_TEST_POST_PARAMS *st, int on_demand_test); -int SELF_TEST_kats(OSSL_ST_EVENT *event, OPENSSL_CTX *libctx); - -void SELF_TEST_EVENT_init(OSSL_ST_EVENT *ev, OSSL_CALLBACK *cb, void *cbarg); -void SELF_TEST_EVENT_onbegin(OSSL_ST_EVENT *ev, const char *type, - const char *desc); -void SELF_TEST_EVENT_onend(OSSL_ST_EVENT *ev, int ret); -void SELF_TEST_EVENT_oncorrupt_byte(OSSL_ST_EVENT *ev, unsigned char *bytes); +int SELF_TEST_kats(OSSL_SELF_TEST *event, OPENSSL_CTX *libctx); diff --git a/providers/fips/self_test_event.c b/providers/fips/self_test_event.c deleted file mode 100644 index 887b9dd17d..0000000000 --- a/providers/fips/self_test_event.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright 2019 The OpenSSL Project Authors. All Rights Reserved. - * - * Licensed under the OpenSSL license (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution or at - * https://www.openssl.org/source/license.html - */ - -#include -#include -#include "self_test.h" - -static void self_test_event_setparams(OSSL_ST_EVENT *ev) -{ - size_t n = 0; - - if (ev->cb != NULL) { - ev->params[n++] = - OSSL_PARAM_construct_utf8_string(OSSL_PROV_PARAM_SELF_TEST_PHASE, - (char *)ev->phase, 0); - ev->params[n++] = - OSSL_PARAM_construct_utf8_string(OSSL_PROV_PARAM_SELF_TEST_TYPE, - (char *)ev->type, 0); - ev->params[n++] = - OSSL_PARAM_construct_utf8_string(OSSL_PROV_PARAM_SELF_TEST_DESC, - (char *)ev->desc, 0); - } - ev->params[n++] = OSSL_PARAM_construct_end(); -} - -void SELF_TEST_EVENT_init(OSSL_ST_EVENT *ev, OSSL_CALLBACK *cb, void *cbarg) -{ - if (ev == NULL) - return; - - ev->cb = cb; - ev->cb_arg = cbarg; - ev->phase = ""; - ev->type = ""; - ev->desc = ""; - self_test_event_setparams(ev); -} - -/* Can be used during application testing to log that a test has started. */ -void SELF_TEST_EVENT_onbegin(OSSL_ST_EVENT *ev, const char *type, - const char *desc) -{ - if (ev != NULL && ev->cb != NULL) { - ev->phase = OSSL_SELF_TEST_PHASE_START; - ev->type = type; - ev->desc = desc; - self_test_event_setparams(ev); - (void)ev->cb(ev->params, ev->cb_arg); - } -} - -/* - * Can be used during application testing to log that a test has either - * passed or failed. - */ -void SELF_TEST_EVENT_onend(OSSL_ST_EVENT *ev, int ret) -{ - if (ev != NULL && ev->cb != NULL) { - ev->phase = - (ret == 1 ? OSSL_SELF_TEST_PHASE_PASS : OSSL_SELF_TEST_PHASE_FAIL); - self_test_event_setparams(ev); - (void)ev->cb(ev->params, ev->cb_arg); - - ev->phase = OSSL_SELF_TEST_PHASE_NONE; - ev->type = OSSL_SELF_TEST_TYPE_NONE; - ev->desc = OSSL_SELF_TEST_DESC_NONE; - } -} - -/* - * Used for failure testing. - * - * Call the applications SELF_TEST_cb() if it exists. - * If the application callback decides to return 0 then the first byte of 'bytes' - * is modified (corrupted). This is used to modify output signatures or - * ciphertext before they are verified or decrypted. - */ -void SELF_TEST_EVENT_oncorrupt_byte(OSSL_ST_EVENT *ev, unsigned char *bytes) -{ - if (ev != NULL && ev->cb != NULL) { - ev->phase = OSSL_SELF_TEST_PHASE_CORRUPT; - self_test_event_setparams(ev); - if (!ev->cb(ev->params, ev->cb_arg)) - bytes[0] ^= 1; - } -} - diff --git a/providers/fips/self_test_kats.c b/providers/fips/self_test_kats.c index 06f12a1ead..50e59611c5 100644 --- a/providers/fips/self_test_kats.c +++ b/providers/fips/self_test_kats.c @@ -20,7 +20,7 @@ #define DRBG_PARAM_ENTROPY "DRBG-ENTROPY" #define DRBG_PARAM_NONCE "DRBG-NONCE" -static int self_test_digest(const ST_KAT_DIGEST *t, OSSL_ST_EVENT *event, +static int self_test_digest(const ST_KAT_DIGEST *t, OSSL_SELF_TEST *st, OPENSSL_CTX *libctx) { int ok = 0; @@ -29,7 +29,7 @@ static int self_test_digest(const ST_KAT_DIGEST *t, OSSL_ST_EVENT *event, EVP_MD_CTX *ctx = EVP_MD_CTX_new(); EVP_MD *md = EVP_MD_fetch(libctx, t->algorithm, NULL); - SELF_TEST_EVENT_onbegin(event, OSSL_SELF_TEST_TYPE_KAT_DIGEST, t->desc); + OSSL_SELF_TEST_onbegin(st, OSSL_SELF_TEST_TYPE_KAT_DIGEST, t->desc); if (ctx == NULL || md == NULL @@ -39,14 +39,14 @@ static int self_test_digest(const ST_KAT_DIGEST *t, OSSL_ST_EVENT *event, goto err; /* Optional corruption */ - SELF_TEST_EVENT_oncorrupt_byte(event, out); + OSSL_SELF_TEST_oncorrupt_byte(st, out); if (out_len != t->expected_len || memcmp(out, t->expected, out_len) != 0) goto err; ok = 1; err: - SELF_TEST_EVENT_onend(event, ok); + OSSL_SELF_TEST_onend(st, ok); EVP_MD_free(md); EVP_MD_CTX_free(ctx); @@ -86,7 +86,7 @@ static int cipher_init(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, } /* Test a single KAT for encrypt/decrypt */ -static int self_test_cipher(const ST_KAT_CIPHER *t, OSSL_ST_EVENT *event, +static int self_test_cipher(const ST_KAT_CIPHER *t, OSSL_SELF_TEST *st, OPENSSL_CTX *libctx) { int ret = 0, encrypt = 1, len, ct_len = 0, pt_len = 0; @@ -95,7 +95,7 @@ static int self_test_cipher(const ST_KAT_CIPHER *t, OSSL_ST_EVENT *event, unsigned char ct_buf[256] = { 0 }; unsigned char pt_buf[256] = { 0 }; - SELF_TEST_EVENT_onbegin(event, OSSL_SELF_TEST_TYPE_KAT_CIPHER, t->base.desc); + OSSL_SELF_TEST_onbegin(st, OSSL_SELF_TEST_TYPE_KAT_CIPHER, t->base.desc); ctx = EVP_CIPHER_CTX_new(); if (ctx == NULL) @@ -110,7 +110,7 @@ static int self_test_cipher(const ST_KAT_CIPHER *t, OSSL_ST_EVENT *event, || !EVP_CipherFinal_ex(ctx, ct_buf + len, &ct_len)) goto err; - SELF_TEST_EVENT_oncorrupt_byte(event, ct_buf); + OSSL_SELF_TEST_oncorrupt_byte(st, ct_buf); ct_len += len; if (ct_len != (int)t->base.expected_len || memcmp(t->base.expected, ct_buf, ct_len) != 0) @@ -138,11 +138,11 @@ static int self_test_cipher(const ST_KAT_CIPHER *t, OSSL_ST_EVENT *event, err: EVP_CIPHER_free(cipher); EVP_CIPHER_CTX_free(ctx); - SELF_TEST_EVENT_onend(event, ret); + OSSL_SELF_TEST_onend(st, ret); return ret; } -static int self_test_kdf(const ST_KAT_KDF *t, OSSL_ST_EVENT *event, +static int self_test_kdf(const ST_KAT_KDF *t, OSSL_SELF_TEST *st, OPENSSL_CTX *libctx) { int ret = 0; @@ -154,7 +154,7 @@ static int self_test_kdf(const ST_KAT_KDF *t, OSSL_ST_EVENT *event, const OSSL_PARAM *settables = NULL; numparams = OSSL_NELEM(params); - SELF_TEST_EVENT_onbegin(event, OSSL_SELF_TEST_TYPE_KAT_KDF, t->desc); + OSSL_SELF_TEST_onbegin(st, OSSL_SELF_TEST_TYPE_KAT_KDF, t->desc); /* Zeroize the params array to avoid mem leaks on error */ for (i = 0; i < numparams; ++i) @@ -183,7 +183,7 @@ static int self_test_kdf(const ST_KAT_KDF *t, OSSL_ST_EVENT *event, if (EVP_KDF_derive(ctx, out, t->expected_len) <= 0) goto err; - SELF_TEST_EVENT_oncorrupt_byte(event, out); + OSSL_SELF_TEST_oncorrupt_byte(st, out); if (memcmp(out, t->expected, t->expected_len) != 0) goto err; @@ -194,7 +194,7 @@ err: OPENSSL_free(params[i].data); EVP_KDF_free(kdf); EVP_KDF_CTX_free(ctx); - SELF_TEST_EVENT_onend(event, ret); + OSSL_SELF_TEST_onend(st, ret); return ret; } @@ -223,7 +223,7 @@ static size_t drbg_kat_nonce_cb(RAND_DRBG *drbg, unsigned char **pout, return p->data_size; } -static int self_test_drbg(const ST_KAT_DRBG *t, OSSL_ST_EVENT *event, +static int self_test_drbg(const ST_KAT_DRBG *t, OSSL_SELF_TEST *st, OPENSSL_CTX *libctx) { int ret = 0; @@ -236,7 +236,7 @@ static int self_test_drbg(const ST_KAT_DRBG *t, OSSL_ST_EVENT *event, }; static const unsigned char zero[sizeof(drbg->data)] = { 0 }; - SELF_TEST_EVENT_onbegin(event, OSSL_SELF_TEST_TYPE_DRBG, t->desc); + OSSL_SELF_TEST_onbegin(st, OSSL_SELF_TEST_TYPE_DRBG, t->desc); if (strcmp(t->desc, OSSL_SELF_TEST_DESC_DRBG_HMAC) == 0) flags |= RAND_DRBG_FLAG_HMAC; @@ -280,7 +280,7 @@ static int self_test_drbg(const ST_KAT_DRBG *t, OSSL_ST_EVENT *event, t->entropyaddin2, t->entropyaddin2len)) goto err; - SELF_TEST_EVENT_oncorrupt_byte(event, out); + OSSL_SELF_TEST_oncorrupt_byte(st, out); if (memcmp(out, t->expected, t->expectedlen) != 0) goto err; @@ -296,7 +296,7 @@ static int self_test_drbg(const ST_KAT_DRBG *t, OSSL_ST_EVENT *event, ret = 1; err: RAND_DRBG_free(drbg); - SELF_TEST_EVENT_onend(event, ret); + OSSL_SELF_TEST_onend(st, ret); return ret; } @@ -305,45 +305,45 @@ err: * All tests are run regardless of if they fail or not. * Return 0 if any test fails. */ -static int self_test_digests(OSSL_ST_EVENT *event, OPENSSL_CTX *libctx) +static int self_test_digests(OSSL_SELF_TEST *st, OPENSSL_CTX *libctx) { int i, ret = 1; for (i = 0; i < (int)OSSL_NELEM(st_kat_digest_tests); ++i) { - if (!self_test_digest(&st_kat_digest_tests[i], event, libctx)) + if (!self_test_digest(&st_kat_digest_tests[i], st, libctx)) ret = 0; } return ret; } -static int self_test_ciphers(OSSL_ST_EVENT *event, OPENSSL_CTX *libctx) +static int self_test_ciphers(OSSL_SELF_TEST *st, OPENSSL_CTX *libctx) { int i, ret = 1; for (i = 0; i < (int)OSSL_NELEM(st_kat_cipher_tests); ++i) { - if (!self_test_cipher(&st_kat_cipher_tests[i], event, libctx)) + if (!self_test_cipher(&st_kat_cipher_tests[i], st, libctx)) ret = 0; } return ret; } -static int self_test_kdfs(OSSL_ST_EVENT *event, OPENSSL_CTX *libctx) +static int self_test_kdfs(OSSL_SELF_TEST *st, OPENSSL_CTX *libctx) { int i, ret = 1; for (i = 0; i < (int)OSSL_NELEM(st_kat_kdf_tests); ++i) { - if (!self_test_kdf(&st_kat_kdf_tests[i], event, libctx)) + if (!self_test_kdf(&st_kat_kdf_tests[i], st, libctx)) ret = 0; } return ret; } -static int self_test_drbgs(OSSL_ST_EVENT *event, OPENSSL_CTX *libctx) +static int self_test_drbgs(OSSL_SELF_TEST *st, OPENSSL_CTX *libctx) { int i, ret = 1; for (i = 0; i < (int)OSSL_NELEM(st_kat_drbg_tests); ++i) { - if (!self_test_drbg(&st_kat_drbg_tests[i], event, libctx)) + if (!self_test_drbg(&st_kat_drbg_tests[i], st, libctx)) ret = 0; } return ret; @@ -356,17 +356,17 @@ static int self_test_drbgs(OSSL_ST_EVENT *event, OPENSSL_CTX *libctx) * * TODO(3.0) Add self tests for KA, Sign/Verify when they become available */ -int SELF_TEST_kats(OSSL_ST_EVENT *event, OPENSSL_CTX *libctx) +int SELF_TEST_kats(OSSL_SELF_TEST *st, OPENSSL_CTX *libctx) { int ret = 1; - if (!self_test_digests(event, libctx)) + if (!self_test_digests(st, libctx)) ret = 0; - if (!self_test_ciphers(event, libctx)) + if (!self_test_ciphers(st, libctx)) ret = 0; - if (!self_test_kdfs(event, libctx)) + if (!self_test_kdfs(st, libctx)) ret = 0; - if (!self_test_drbgs(event, libctx)) + if (!self_test_drbgs(st, libctx)) ret = 0; return ret; diff --git a/util/libcrypto.num b/util/libcrypto.num index aefe1b4100..fa220d873f 100644 --- a/util/libcrypto.num +++ b/util/libcrypto.num @@ -4947,3 +4947,8 @@ EVP_PKEY_CTX_set0_ecdh_kdf_ukm ? 3_0_0 EXIST::FUNCTION:EC EVP_PKEY_CTX_get0_ecdh_kdf_ukm ? 3_0_0 EXIST::FUNCTION:EC EVP_PKEY_CTX_set_rsa_pss_saltlen ? 3_0_0 EXIST::FUNCTION:RSA EVP_PKEY_CTX_get_rsa_pss_saltlen ? 3_0_0 EXIST::FUNCTION:RSA +OSSL_SELF_TEST_new ? 3_0_0 EXIST::FUNCTION: +OSSL_SELF_TEST_free ? 3_0_0 EXIST::FUNCTION: +OSSL_SELF_TEST_onbegin ? 3_0_0 EXIST::FUNCTION: +OSSL_SELF_TEST_oncorrupt_byte ? 3_0_0 EXIST::FUNCTION: +OSSL_SELF_TEST_onend ? 3_0_0 EXIST::FUNCTION: From no-reply at appveyor.com Tue Mar 3 04:26:42 2020 From: no-reply at appveyor.com (AppVeyor) Date: Tue, 03 Mar 2020 04:26:42 +0000 Subject: Build failed: openssl master.32217 Message-ID: <20200303042642.1.F5806C391BE339BE@appveyor.com> An HTML attachment was scrubbed... URL: From builds at travis-ci.org Tue Mar 3 04:52:02 2020 From: builds at travis-ci.org (Travis CI) Date: Tue, 03 Mar 2020 04:52:02 +0000 Subject: Failed: openssl/openssl#32779 (master - 47c239c) In-Reply-To: Message-ID: <5e5de272793cf_43fb4ea8bded44676c@0ee0b164-553b-4738-932b-e28619b13549.mail> Build Update for openssl/openssl ------------------------------------- Build: #32779 Status: Failed Duration: 46 mins and 44 secs Commit: 47c239c (master) Author: Shane Lontis Message: Add pairwise consistency self tests to asym keygenerators Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/10952) View the changeset: https://github.com/openssl/openssl/compare/97ace6c2dae4...47c239c6b8d6 View the full build log and details: https://travis-ci.org/openssl/openssl/builds/657590541?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the openssl/openssl repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=5849220&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Tue Mar 3 05:17:52 2020 From: no-reply at appveyor.com (AppVeyor) Date: Tue, 03 Mar 2020 05:17:52 +0000 Subject: Build completed: openssl master.32218 Message-ID: <20200303051752.1.72EF08649F437C4B@appveyor.com> An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Tue Mar 3 05:34:52 2020 From: no-reply at appveyor.com (AppVeyor) Date: Tue, 03 Mar 2020 05:34:52 +0000 Subject: Build failed: openssl master.32219 Message-ID: <20200303053452.1.03A97D8713837641@appveyor.com> An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Tue Mar 3 07:31:07 2020 From: no-reply at appveyor.com (AppVeyor) Date: Tue, 03 Mar 2020 07:31:07 +0000 Subject: Build completed: openssl master.32220 Message-ID: <20200303073107.1.D3878B4C6B1BAC7D@appveyor.com> An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Tue Mar 3 08:19:51 2020 From: no-reply at appveyor.com (AppVeyor) Date: Tue, 03 Mar 2020 08:19:51 +0000 Subject: Build failed: openssl master.32221 Message-ID: <20200303081951.1.D8F7413FA3B89D2D@appveyor.com> An HTML attachment was scrubbed... URL: From levitte at openssl.org Tue Mar 3 09:54:04 2020 From: levitte at openssl.org (Richard Levitte) Date: Tue, 03 Mar 2020 09:54:04 +0000 Subject: [openssl] master update Message-ID: <1583229244.366959.6471.nullmailer@dev.openssl.org> The branch master has been updated via a24e62f54b48d01832fd0b80f97115927a777a0f (commit) from 47c239c6b8d6e5d66a6ceef3a2c543b6ea338759 (commit) - Log ----------------------------------------------------------------- commit a24e62f54b48d01832fd0b80f97115927a777a0f Author: Philippe Antoine Date: Mon Mar 2 13:46:37 2020 +0100 Fix build with clang assembler Reviewed-by: Matt Caswell Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/11219) ----------------------------------------------------------------------- Summary of changes: crypto/perlasm/x86_64-xlate.pl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crypto/perlasm/x86_64-xlate.pl b/crypto/perlasm/x86_64-xlate.pl index 197bc48873..ff2df7902b 100755 --- a/crypto/perlasm/x86_64-xlate.pl +++ b/crypto/perlasm/x86_64-xlate.pl @@ -110,6 +110,11 @@ elsif (`$ENV{CC} -Wa,-v -c -o /dev/null -x assembler /dev/null 2>&1` { $gnuas=1; } +elsif (`$ENV{CC} --version 2>/dev/null` + =~ /clang .*/) +{ + $gnuas=1; +} my $cet_property; if ($flavour =~ /elf/) { From matthias.st.pierre at ncp-e.com Tue Mar 3 09:56:18 2020 From: matthias.st.pierre at ncp-e.com (matthias.st.pierre at ncp-e.com) Date: Tue, 03 Mar 2020 09:56:18 +0000 Subject: [openssl] master update Message-ID: <1583229378.560095.11123.nullmailer@dev.openssl.org> The branch master has been updated via 88398d2a358fe41e33c61ac02f23ffaeacddcff0 (commit) from a24e62f54b48d01832fd0b80f97115927a777a0f (commit) - Log ----------------------------------------------------------------- commit 88398d2a358fe41e33c61ac02f23ffaeacddcff0 Author: Dr. Matthias St. Pierre Date: Mon Mar 2 00:25:29 2020 +0100 doc: document that 'openssl rand' is cryptographically secure Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/11213) ----------------------------------------------------------------------- Summary of changes: doc/man1/openssl-rand.pod.in | 14 +++++++++++--- doc/man3/RAND_bytes.pod | 24 ++++++++++++++++++------ 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/doc/man1/openssl-rand.pod.in b/doc/man1/openssl-rand.pod.in index 61c74df466..b8a01750c8 100644 --- a/doc/man1/openssl-rand.pod.in +++ b/doc/man1/openssl-rand.pod.in @@ -20,8 +20,14 @@ I =head1 DESCRIPTION -This command outputs I pseudo-random bytes after seeding -the random number generator once. +This command generates I random bytes using a cryptographically +secure pseudo random number generator (CSPRNG). + +The random bytes are generated using the L function, +which provides a security level of 256 bits, provided it managed to +seed itself successfully from a trusted operating system entropy source. +Otherwise, the command will fail with a non-zero error code. +For more details, see L, L, and L. =head1 OPTIONS @@ -52,7 +58,9 @@ Show the output as a hex string. =head1 SEE ALSO L, -L +L, +L, +L =head1 COPYRIGHT diff --git a/doc/man3/RAND_bytes.pod b/doc/man3/RAND_bytes.pod index 5da4692520..525b5694fe 100644 --- a/doc/man3/RAND_bytes.pod +++ b/doc/man3/RAND_bytes.pod @@ -23,8 +23,8 @@ L: =head1 DESCRIPTION -RAND_bytes() puts B cryptographically strong pseudo-random bytes -into B. +RAND_bytes() generates B random bytes using a cryptographically +secure pseudo random generator (CSPRNG) and stores them in B. RAND_priv_bytes() has the same semantics as RAND_bytes(). It is intended to be used for generating values that should remain private. If using the @@ -44,10 +44,22 @@ ignored. =head1 NOTES -Always check the error return value of RAND_bytes() and -RAND_priv_bytes() and do not take randomness for granted: an error occurs -if the CSPRNG has not been seeded with enough randomness to ensure an -unpredictable byte sequence. +By default, the OpenSSL CSPRNG supports a security level of 256 bits, provided it +was able to seed itself from a trusted entropy source. +On all major platforms supported by OpenSSL (including the Unix-like platforms +and Windows), OpenSSL is configured to automatically seed the CSPRNG on first use +using the operating systems's random generator. + +If the entropy source fails or is not available, the CSPRNG will enter an +error state and refuse to generate random bytes. For that reason, it is important +to always check the error return value of RAND_bytes() and RAND_priv_bytes() and +not take randomness for granted. + +On other platforms, there might not be a trusted entropy source available +or OpenSSL might have been explicitly configured to use different entropy sources. +If you are in doubt about the quality of the entropy source, don't hesitate to ask +your operating system vendor or post a question on GitHub or the openssl-users +mailing list. =head1 RETURN VALUES From builds at travis-ci.org Tue Mar 3 10:45:49 2020 From: builds at travis-ci.org (Travis CI) Date: Tue, 03 Mar 2020 10:45:49 +0000 Subject: Errored: openssl/openssl#32781 (master - a24e62f) In-Reply-To: Message-ID: <5e5e355ce8f60_43ff35070e9b81371ac@6739c71a-c617-4ce1-8f14-1835d5113cc2.mail> Build Update for openssl/openssl ------------------------------------- Build: #32781 Status: Errored Duration: 50 mins and 59 secs Commit: a24e62f (master) Author: Philippe Antoine Message: Fix build with clang assembler Reviewed-by: Matt Caswell Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/11219) View the changeset: https://github.com/openssl/openssl/compare/47c239c6b8d6...a24e62f54b48 View the full build log and details: https://travis-ci.org/openssl/openssl/builds/657673996?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the openssl/openssl repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=5849220&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From builds at travis-ci.org Tue Mar 3 10:52:15 2020 From: builds at travis-ci.org (Travis CI) Date: Tue, 03 Mar 2020 10:52:15 +0000 Subject: Still Failing: openssl/openssl#32782 (master - 88398d2) In-Reply-To: Message-ID: <5e5e36df9c6bf_43fe2e8b881381648df@53b4594b-a399-471f-8e32-05e0cb0380fe.mail> Build Update for openssl/openssl ------------------------------------- Build: #32782 Status: Still Failing Duration: 51 mins and 34 secs Commit: 88398d2 (master) Author: Dr. Matthias St. Pierre Message: doc: document that 'openssl rand' is cryptographically secure Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/11213) View the changeset: https://github.com/openssl/openssl/compare/a24e62f54b48...88398d2a358f View the full build log and details: https://travis-ci.org/openssl/openssl/builds/657674638?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the openssl/openssl repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=5849220&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From beldmit at gmail.com Tue Mar 3 13:36:15 2020 From: beldmit at gmail.com (beldmit at gmail.com) Date: Tue, 03 Mar 2020 13:36:15 +0000 Subject: [openssl] master update Message-ID: <1583242575.772340.10305.nullmailer@dev.openssl.org> The branch master has been updated via 348900774c14dd79c9cf762d59554f38d8c77120 (commit) via 71434aed0de274abe8f10768c4dd11a5b3b387e4 (commit) from 88398d2a358fe41e33c61ac02f23ffaeacddcff0 (commit) - Log ----------------------------------------------------------------- commit 348900774c14dd79c9cf762d59554f38d8c77120 Author: Dmitry Belyavskiy Date: Tue Jan 21 15:04:42 2020 +0300 Documenting newly added CMS modification Documented CMS-related API functions. Documented flags added to openssl-cms command Reviewed-by: Shane Lontis Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/10904) commit 71434aed0de274abe8f10768c4dd11a5b3b387e4 Author: Dmitry Belyavskiy Date: Mon Jan 20 18:17:44 2020 +0300 Implementation of Russian GOST CMS Reviewed-by: Shane Lontis Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/10904) ----------------------------------------------------------------------- Summary of changes: apps/cms.c | 49 ++++++++++--- crypto/cms/cms_env.c | 137 ++++++++++++++++++++++++++++++----- crypto/cms/cms_kari.c | 93 +++++++++++++++++++++--- crypto/cms/cms_lib.c | 4 +- crypto/cms/cms_local.h | 7 +- crypto/cms/cms_smime.c | 40 ++++++---- crypto/err/openssl.txt | 4 + crypto/evp/pmeth_lib.c | 7 ++ doc/man1/openssl-cms.pod.in | 13 ++++ doc/man3/CMS_add1_recipient_cert.pod | 18 ++++- doc/man3/CMS_decrypt.pod | 19 ++++- doc/man3/CMS_get0_RecipientInfos.pod | 20 ++++- include/openssl/cms.h | 5 ++ include/openssl/cmserr.h | 6 +- include/openssl/evp.h | 9 +++ util/libcrypto.num | 3 + util/missingcrypto.txt | 2 - 17 files changed, 371 insertions(+), 65 deletions(-) diff --git a/apps/cms.c b/apps/cms.c index d67116d3fc..9c92e79658 100644 --- a/apps/cms.c +++ b/apps/cms.c @@ -81,10 +81,11 @@ typedef enum OPTION_choice { OPT_PASSIN, OPT_TO, OPT_FROM, OPT_SUBJECT, OPT_SIGNER, OPT_RECIP, OPT_CERTSOUT, OPT_MD, OPT_INKEY, OPT_KEYFORM, OPT_KEYOPT, OPT_RR_FROM, OPT_RR_TO, OPT_AES128_WRAP, OPT_AES192_WRAP, OPT_AES256_WRAP, - OPT_3DES_WRAP, OPT_ENGINE, + OPT_3DES_WRAP, OPT_WRAP, OPT_ENGINE, OPT_R_ENUM, OPT_V_ENUM, - OPT_CIPHER + OPT_CIPHER, + OPT_ORIGINATOR } OPTION_CHOICE; const OPTIONS cms_options[] = { @@ -197,6 +198,7 @@ const OPTIONS cms_options[] = { {"from", OPT_FROM, 's', "From address"}, {"subject", OPT_SUBJECT, 's', "Subject"}, {"signer", OPT_SIGNER, 's', "Signer certificate file"}, + {"originator", OPT_ORIGINATOR, 's', "Originator certificate file"}, {"recip", OPT_RECIP, '<', "Recipient cert file for decryption"}, {"receipt_request_from", OPT_RR_FROM, 's', "Create signed receipt request with specified email address"}, @@ -214,6 +216,7 @@ const OPTIONS cms_options[] = { # ifndef OPENSSL_NO_DES {"des3-wrap", OPT_3DES_WRAP, '-', "Use 3DES-EDE to wrap key"}, # endif + {"wrap", OPT_WRAP, 's', "Any wrap cipher to wrap key"}, OPT_R_OPTIONS, OPT_V_OPTIONS, @@ -236,7 +239,7 @@ int cms_main(int argc, char **argv) STACK_OF(OPENSSL_STRING) *rr_to = NULL, *rr_from = NULL; STACK_OF(OPENSSL_STRING) *sksigners = NULL, *skkeys = NULL; STACK_OF(X509) *encerts = NULL, *other = NULL; - X509 *cert = NULL, *recip = NULL, *signer = NULL; + X509 *cert = NULL, *recip = NULL, *signer = NULL, *originator = NULL; X509_STORE *store = NULL; X509_VERIFY_PARAM *vpm = NULL; char *certfile = NULL, *keyfile = NULL, *contfile = NULL; @@ -244,7 +247,7 @@ int cms_main(int argc, char **argv) char *certsoutfile = NULL; int noCAfile = 0, noCApath = 0, noCAstore = 0; char *infile = NULL, *outfile = NULL, *rctfile = NULL; - char *passinarg = NULL, *passin = NULL, *signerfile = NULL, *recipfile = NULL; + char *passinarg = NULL, *passin = NULL, *signerfile = NULL, *originatorfile = NULL, *recipfile = NULL; char *to = NULL, *from = NULL, *subject = NULL, *prog; cms_key_param *key_first = NULL, *key_param = NULL; int flags = CMS_DETACHED, noout = 0, print = 0, keyidx = -1, vpmtouched = 0; @@ -535,6 +538,9 @@ int cms_main(int argc, char **argv) } signerfile = opt_arg(); break; + case OPT_ORIGINATOR: + originatorfile = opt_arg(); + break; case OPT_INKEY: /* If previous -inkey argument add signer to list */ if (keyfile != NULL) { @@ -629,6 +635,10 @@ int cms_main(int argc, char **argv) case OPT_AES256_WRAP: wrap_cipher = EVP_aes_256_wrap(); break; + case OPT_WRAP: + if (!opt_cipher(opt_unknown(), &wrap_cipher)) + goto end; + break; } } argc = opt_num_rest(); @@ -759,6 +769,14 @@ int cms_main(int argc, char **argv) } } + if (originatorfile != NULL) { + if ((originator = load_cert(originatorfile, FORMAT_PEM, + "originator certificate file")) == NULL) { + ERR_print_errors(bio_err); + goto end; + } + } + if (operation == SMIME_SIGN_RECEIPT) { if ((signer = load_cert(signerfile, FORMAT_PEM, "receipt signer certificate file")) == NULL) { @@ -767,7 +785,7 @@ int cms_main(int argc, char **argv) } } - if (operation == SMIME_DECRYPT) { + if ((operation == SMIME_DECRYPT) || (operation == SMIME_ENCRYPT)) { if (keyfile == NULL) keyfile = recipfile; } else if ((operation == SMIME_SIGN) || (operation == SMIME_SIGN_RECEIPT)) { @@ -877,23 +895,32 @@ int cms_main(int argc, char **argv) for (i = 0; i < sk_X509_num(encerts); i++) { CMS_RecipientInfo *ri; cms_key_param *kparam; - int tflags = flags; + int tflags = flags | CMS_KEY_PARAM; /* This flag enforces allocating the EVP_PKEY_CTX for the recipient here */ + EVP_PKEY_CTX *pctx; X509 *x = sk_X509_value(encerts, i); + int res; + for (kparam = key_first; kparam; kparam = kparam->next) { if (kparam->idx == i) { - tflags |= CMS_KEY_PARAM; break; } } - ri = CMS_add1_recipient_cert(cms, x, tflags); + ri = CMS_add1_recipient(cms, x, key, originator, tflags); if (ri == NULL) goto end; + + pctx = CMS_RecipientInfo_get0_pkey_ctx(ri); if (kparam != NULL) { - EVP_PKEY_CTX *pctx; - pctx = CMS_RecipientInfo_get0_pkey_ctx(ri); if (!cms_set_pkey_param(pctx, kparam->param)) goto end; } + + res = EVP_PKEY_CTX_ctrl(pctx, -1, -1, + EVP_PKEY_CTRL_CIPHER, + EVP_CIPHER_nid(cipher), NULL); + if (res <= 0 && res != -2) + goto end; + if (CMS_RecipientInfo_type(ri) == CMS_RECIPINFO_AGREE && wrap_cipher) { EVP_CIPHER_CTX *wctx; @@ -1039,7 +1066,7 @@ int cms_main(int argc, char **argv) } if (key != NULL) { - if (!CMS_decrypt_set1_pkey(cms, key, recip)) { + if (!CMS_decrypt_set1_pkey_and_peer(cms, key, recip, originator)) { BIO_puts(bio_err, "Error decrypting CMS using private key\n"); goto end; } diff --git a/crypto/cms/cms_env.c b/crypto/cms/cms_env.c index ac34f3efd6..003a406c68 100644 --- a/crypto/cms/cms_env.c +++ b/crypto/cms/cms_env.c @@ -20,6 +20,8 @@ /* CMS EnvelopedData Utilities */ +static void cms_env_set_version(CMS_EnvelopedData *env); + CMS_EnvelopedData *cms_get0_enveloped(CMS_ContentInfo *cms) { if (OBJ_obj2nid(cms->contentType) != NID_pkcs7_enveloped) { @@ -122,6 +124,47 @@ CMS_ContentInfo *CMS_EnvelopedData_create(const EVP_CIPHER *cipher) return NULL; } +int cms_EnvelopedData_final(CMS_ContentInfo *cms, BIO *chain) +{ + CMS_EnvelopedData *env = NULL; + EVP_CIPHER_CTX *ctx = NULL; + BIO *mbio = BIO_find_type(chain, BIO_TYPE_CIPHER); + + env = cms_get0_enveloped(cms); + if (env == NULL) + return 0; + + if (mbio == NULL) { + CMSerr(CMS_F_CMS_ENVELOPEDDATA_FINAL, CMS_R_CONTENT_NOT_FOUND); + return 0; + } + + BIO_get_cipher_ctx(mbio, &ctx); + + /* + * If the selected cipher supports unprotected attributes, + * deal with it using special ctrl function + */ + if (EVP_CIPHER_flags(EVP_CIPHER_CTX_cipher(ctx)) & EVP_CIPH_FLAG_CIPHER_WITH_MAC) { + if (cms->d.envelopedData->unprotectedAttrs == NULL) + cms->d.envelopedData->unprotectedAttrs = sk_X509_ATTRIBUTE_new_null(); + + if (cms->d.envelopedData->unprotectedAttrs == NULL) { + CMSerr(CMS_F_CMS_ENVELOPEDDATA_FINAL, ERR_R_MALLOC_FAILURE); + return 0; + } + + if (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_PROCESS_UNPROTECTED, + 1, env->unprotectedAttrs) <= 0) { + CMSerr(CMS_F_CMS_ENVELOPEDDATA_FINAL, CMS_R_CTRL_FAILURE); + return 0; + } + } + + cms_env_set_version(cms->d.envelopedData); + return 1; +} + /* Key Transport Recipient Info (KTRI) routines */ /* Initialise a ktri based on passed certificate and key */ @@ -176,8 +219,9 @@ static int cms_RecipientInfo_ktri_init(CMS_RecipientInfo *ri, X509 *recip, * Add a recipient certificate using appropriate type of RecipientInfo */ -CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms, - X509 *recip, unsigned int flags) +CMS_RecipientInfo *CMS_add1_recipient(CMS_ContentInfo *cms, X509 *recip, + EVP_PKEY *originatorPrivKey, + X509 *originator, unsigned int flags) { CMS_RecipientInfo *ri = NULL; CMS_EnvelopedData *env; @@ -193,7 +237,7 @@ CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms, pk = X509_get0_pubkey(recip); if (pk == NULL) { - CMSerr(CMS_F_CMS_ADD1_RECIPIENT_CERT, CMS_R_ERROR_GETTING_PUBLIC_KEY); + CMSerr(CMS_F_CMS_ADD1_RECIPIENT, CMS_R_ERROR_GETTING_PUBLIC_KEY); goto err; } @@ -205,12 +249,12 @@ CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms, break; case CMS_RECIPINFO_AGREE: - if (!cms_RecipientInfo_kari_init(ri, recip, pk, flags)) + if (!cms_RecipientInfo_kari_init(ri, recip, pk, originator, originatorPrivKey, flags)) goto err; break; default: - CMSerr(CMS_F_CMS_ADD1_RECIPIENT_CERT, + CMSerr(CMS_F_CMS_ADD1_RECIPIENT, CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE); goto err; @@ -222,13 +266,19 @@ CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms, return ri; merr: - CMSerr(CMS_F_CMS_ADD1_RECIPIENT_CERT, ERR_R_MALLOC_FAILURE); + CMSerr(CMS_F_CMS_ADD1_RECIPIENT, ERR_R_MALLOC_FAILURE); err: M_ASN1_free_of(ri, CMS_RecipientInfo); return NULL; } +CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms, + X509 *recip, unsigned int flags) +{ + return CMS_add1_recipient(cms, recip, NULL, NULL, flags); +} + int CMS_RecipientInfo_ktri_get0_algs(CMS_RecipientInfo *ri, EVP_PKEY **pk, X509 **recip, X509_ALGOR **palg) @@ -894,7 +944,34 @@ static void cms_env_set_version(CMS_EnvelopedData *env) env->version = 0; } -BIO *cms_EnvelopedData_init_bio(const CMS_ContentInfo *cms) +static BIO *cms_EnvelopedData_Decryption_init_bio(CMS_ContentInfo *cms) +{ + CMS_EncryptedContentInfo *ec = cms->d.envelopedData->encryptedContentInfo; + BIO *contentBio = cms_EncryptedContent_init_bio(ec); + EVP_CIPHER_CTX *ctx = NULL; + + if (contentBio == NULL) + return NULL; + + BIO_get_cipher_ctx(contentBio, &ctx); + if (ctx == NULL) { + BIO_free(contentBio); + return NULL; + } +/* + * If the selected cipher supports unprotected attributes, + * deal with it using special ctrl function + */ + if ((EVP_CIPHER_flags(EVP_CIPHER_CTX_cipher(ctx)) & EVP_CIPH_FLAG_CIPHER_WITH_MAC) + && EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_PROCESS_UNPROTECTED, 0, + cms->d.envelopedData->unprotectedAttrs) <= 0) { + BIO_free(contentBio); + return NULL; + } + return contentBio; +} + +static BIO *cms_EnvelopedData_Encryption_init_bio(CMS_ContentInfo *cms) { CMS_EncryptedContentInfo *ec; STACK_OF(CMS_RecipientInfo) *rinfos; @@ -907,22 +984,19 @@ BIO *cms_EnvelopedData_init_bio(const CMS_ContentInfo *cms) ec = cms->d.envelopedData->encryptedContentInfo; ret = cms_EncryptedContent_init_bio(ec); - /* If error or no cipher end of processing */ - - if (!ret || !ec->cipher) + /* If error end of processing */ + if (!ret) return ret; /* Now encrypt content key according to each RecipientInfo type */ - rinfos = cms->d.envelopedData->recipientInfos; for (i = 0; i < sk_CMS_RecipientInfo_num(rinfos); i++) { - ri = sk_CMS_RecipientInfo_value(rinfos, i); - if (CMS_RecipientInfo_encrypt(cms, ri) <= 0) { - CMSerr(CMS_F_CMS_ENVELOPEDDATA_INIT_BIO, - CMS_R_ERROR_SETTING_RECIPIENTINFO); - goto err; - } + ri = sk_CMS_RecipientInfo_value(rinfos, i); + if (CMS_RecipientInfo_encrypt(cms, ri) <= 0) { + CMSerr(0, CMS_R_ERROR_SETTING_RECIPIENTINFO); + goto err; + } } cms_env_set_version(cms->d.envelopedData); @@ -937,7 +1011,17 @@ BIO *cms_EnvelopedData_init_bio(const CMS_ContentInfo *cms) return ret; BIO_free(ret); return NULL; +} + +BIO *cms_EnvelopedData_init_bio(CMS_ContentInfo *cms) +{ + if (cms->d.envelopedData->encryptedContentInfo->cipher != NULL) { + /* If cipher is set it's encryption */ + return cms_EnvelopedData_Encryption_init_bio(cms); + } + /* If cipher is not set it's decryption */ + return cms_EnvelopedData_Decryption_init_bio(cms); } /* @@ -955,3 +1039,22 @@ int cms_pkey_get_ri_type(EVP_PKEY *pk) } return CMS_RECIPINFO_TRANS; } + +int cms_pkey_is_ri_type_supported(EVP_PKEY *pk, int ri_type) +{ + int supportedRiType; + + if (pk->ameth != NULL && pk->ameth->pkey_ctrl != NULL) { + int i, r; + + i = pk->ameth->pkey_ctrl(pk, ASN1_PKEY_CTRL_CMS_IS_RI_TYPE_SUPPORTED, ri_type, &r); + if (i > 0) + return r; + } + + supportedRiType = cms_pkey_get_ri_type(pk); + if (supportedRiType < 0) + return 0; + + return (supportedRiType == ri_type); +} diff --git a/crypto/cms/cms_kari.c b/crypto/cms/cms_kari.c index 6b0a59ebde..3299e9b5f5 100644 --- a/crypto/cms/cms_kari.c +++ b/crypto/cms/cms_kari.c @@ -152,7 +152,7 @@ int CMS_RecipientEncryptedKey_cert_cmp(CMS_RecipientEncryptedKey *rek, return -1; } -int CMS_RecipientInfo_kari_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pk) +int CMS_RecipientInfo_kari_set0_pkey_and_peer(CMS_RecipientInfo *ri, EVP_PKEY *pk, X509 *peer) { EVP_PKEY_CTX *pctx; CMS_KeyAgreeRecipientInfo *kari = ri->d.kari; @@ -161,9 +161,18 @@ int CMS_RecipientInfo_kari_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pk) kari->pctx = NULL; if (pk == NULL) return 1; + pctx = EVP_PKEY_CTX_new(pk, NULL); if (pctx == NULL || EVP_PKEY_derive_init(pctx) <= 0) goto err; + + if (peer != NULL) { + EVP_PKEY *pub_pkey = X509_get0_pubkey(peer); + + if (EVP_PKEY_derive_set_peer(pctx, pub_pkey) <= 0) + goto err; + } + kari->pctx = pctx; return 1; err: @@ -171,6 +180,11 @@ int CMS_RecipientInfo_kari_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pk) return 0; } +int CMS_RecipientInfo_kari_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pk) +{ + return CMS_RecipientInfo_kari_set0_pkey_and_peer(ri, pk, NULL); +} + EVP_CIPHER_CTX *CMS_RecipientInfo_kari_get0_ctx(CMS_RecipientInfo *ri) { if (ri->type == CMS_RECIPINFO_AGREE) @@ -283,10 +297,29 @@ static int cms_kari_create_ephemeral_key(CMS_KeyAgreeRecipientInfo *kari, return rv; } +/* Set originator private key and initialise context based on it */ +static int cms_kari_set_originator_private_key(CMS_KeyAgreeRecipientInfo *kari, EVP_PKEY *originatorPrivKey ) +{ + EVP_PKEY_CTX *pctx = NULL; + int rv = 0; + + pctx = EVP_PKEY_CTX_new(originatorPrivKey, NULL); + if (pctx == NULL) + goto err; + if (EVP_PKEY_derive_init(pctx) <= 0) + goto err; + + kari->pctx = pctx; + rv = 1; + err: + if (rv == 0) + EVP_PKEY_CTX_free(pctx); + return rv; +} + /* Initialise a kari based on passed certificate and key */ -int cms_RecipientInfo_kari_init(CMS_RecipientInfo *ri, X509 *recip, - EVP_PKEY *pk, unsigned int flags) +int cms_RecipientInfo_kari_init(CMS_RecipientInfo *ri, X509 *recip, EVP_PKEY *recipPubKey, X509 * originator, EVP_PKEY *originatorPrivKey, unsigned int flags) { CMS_KeyAgreeRecipientInfo *kari; CMS_RecipientEncryptedKey *rek = NULL; @@ -321,12 +354,36 @@ int cms_RecipientInfo_kari_init(CMS_RecipientInfo *ri, X509 *recip, return 0; } - /* Create ephemeral key */ - if (!cms_kari_create_ephemeral_key(kari, pk)) - return 0; + if (originatorPrivKey == NULL && originator == NULL) { + /* Create ephemeral key */ + if (!cms_kari_create_ephemeral_key(kari, recipPubKey)) + return 0; + } else { + /* Use originator key */ + CMS_OriginatorIdentifierOrKey *oik = ri->d.kari->originator; + + if (originatorPrivKey == NULL && originator == NULL) + return 0; + + if (flags & CMS_USE_ORIGINATOR_KEYID) { + oik->type = CMS_OIK_KEYIDENTIFIER; + oik->d.subjectKeyIdentifier = ASN1_OCTET_STRING_new(); + if (oik->d.subjectKeyIdentifier == NULL) + return 0; + if (!cms_set1_keyid(&oik->d.subjectKeyIdentifier, originator)) + return 0; + } else { + oik->type = CMS_REK_ISSUER_SERIAL; + if (!cms_set1_ias(&oik->d.issuerAndSerialNumber, originator)) + return 0; + } + + if (!cms_kari_set_originator_private_key(kari, originatorPrivKey)) + return 0; + } - EVP_PKEY_up_ref(pk); - rek->pkey = pk; + EVP_PKEY_up_ref(recipPubKey); + rek->pkey = recipPubKey; return 1; } @@ -336,14 +393,30 @@ static int cms_wrap_init(CMS_KeyAgreeRecipientInfo *kari, EVP_CIPHER_CTX *ctx = kari->ctx; const EVP_CIPHER *kekcipher; int keylen = EVP_CIPHER_key_length(cipher); + int ret; + /* If a suitable wrap algorithm is already set nothing to do */ kekcipher = EVP_CIPHER_CTX_cipher(ctx); - - if (kekcipher) { + if (kekcipher != NULL) { if (EVP_CIPHER_CTX_mode(ctx) != EVP_CIPH_WRAP_MODE) return 0; return 1; } + else if (cipher != NULL + && (EVP_CIPHER_flags(cipher) & EVP_CIPH_FLAG_GET_WRAP_CIPHER)) { + ret = EVP_CIPHER_meth_get_ctrl(cipher)(NULL, EVP_CTRL_GET_WRAP_CIPHER, + 0, &kekcipher); + if (ret <= 0) + return 0; + + if (kekcipher != NULL) { + if (EVP_CIPHER_mode(kekcipher) != EVP_CIPH_WRAP_MODE) + return 0; + + return EVP_EncryptInit_ex(ctx, kekcipher, NULL, NULL, NULL); + } + } + /* * Pick a cipher based on content encryption cipher. If it is DES3 use * DES3 wrap otherwise use AES wrap similar to key size. diff --git a/crypto/cms/cms_lib.c b/crypto/cms/cms_lib.c index 245544e3e9..15aba4af52 100644 --- a/crypto/cms/cms_lib.c +++ b/crypto/cms/cms_lib.c @@ -133,12 +133,14 @@ int CMS_dataFinal(CMS_ContentInfo *cms, BIO *cmsbio) switch (OBJ_obj2nid(cms->contentType)) { case NID_pkcs7_data: - case NID_pkcs7_enveloped: case NID_pkcs7_encrypted: case NID_id_smime_ct_compressedData: /* Nothing to do */ return 1; + case NID_pkcs7_enveloped: + return cms_EnvelopedData_final(cms, cmsbio); + case NID_pkcs7_signed: return cms_SignedData_final(cms, cmsbio); diff --git a/crypto/cms/cms_local.h b/crypto/cms/cms_local.h index 6cb31955eb..46956a0947 100644 --- a/crypto/cms/cms_local.h +++ b/crypto/cms/cms_local.h @@ -402,13 +402,16 @@ int cms_Receipt_verify(CMS_ContentInfo *cms, CMS_ContentInfo *req_cms); int cms_msgSigDigest_add1(CMS_SignerInfo *dest, CMS_SignerInfo *src); ASN1_OCTET_STRING *cms_encode_Receipt(CMS_SignerInfo *si); -BIO *cms_EnvelopedData_init_bio(const CMS_ContentInfo *cms); +BIO *cms_EnvelopedData_init_bio(CMS_ContentInfo *cms); +int cms_EnvelopedData_final(CMS_ContentInfo *cms, BIO *chain); CMS_EnvelopedData *cms_get0_enveloped(CMS_ContentInfo *cms); int cms_env_asn1_ctrl(CMS_RecipientInfo *ri, int cmd); int cms_pkey_get_ri_type(EVP_PKEY *pk); +int cms_pkey_is_ri_type_supported(EVP_PKEY *pk, int ri_type); /* KARI routines */ int cms_RecipientInfo_kari_init(CMS_RecipientInfo *ri, X509 *recip, - EVP_PKEY *pk, unsigned int flags); + EVP_PKEY *recipPubKey, X509 *originator, + EVP_PKEY *originatorPrivKey, unsigned int flags); int cms_RecipientInfo_kari_encrypt(const CMS_ContentInfo *cms, CMS_RecipientInfo *ri); diff --git a/crypto/cms/cms_smime.c b/crypto/cms/cms_smime.c index 4ae85c0335..d5112a83ea 100644 --- a/crypto/cms/cms_smime.c +++ b/crypto/cms/cms_smime.c @@ -576,19 +576,20 @@ CMS_ContentInfo *CMS_encrypt(STACK_OF(X509) *certs, BIO *data, return NULL; } -static int cms_kari_set1_pkey(CMS_ContentInfo *cms, CMS_RecipientInfo *ri, - EVP_PKEY *pk, X509 *cert) +static int cms_kari_set1_pkey_and_peer(CMS_ContentInfo *cms, CMS_RecipientInfo *ri, + EVP_PKEY *pk, X509 *cert, X509 *peer) { int i; STACK_OF(CMS_RecipientEncryptedKey) *reks; CMS_RecipientEncryptedKey *rek; + reks = CMS_RecipientInfo_kari_get0_reks(ri); for (i = 0; i < sk_CMS_RecipientEncryptedKey_num(reks); i++) { int rv; rek = sk_CMS_RecipientEncryptedKey_value(reks, i); if (cert != NULL && CMS_RecipientEncryptedKey_cert_cmp(rek, cert)) continue; - CMS_RecipientInfo_kari_set0_pkey(ri, pk); + CMS_RecipientInfo_kari_set0_pkey_and_peer(ri, pk, peer); rv = CMS_RecipientInfo_kari_decrypt(cms, ri, rek); CMS_RecipientInfo_kari_set0_pkey(ri, NULL); if (rv > 0) @@ -599,28 +600,37 @@ static int cms_kari_set1_pkey(CMS_ContentInfo *cms, CMS_RecipientInfo *ri, } int CMS_decrypt_set1_pkey(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert) +{ + return CMS_decrypt_set1_pkey_and_peer(cms, pk, cert, NULL); +} + +int CMS_decrypt_set1_pkey_and_peer(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert, X509 *peer) { STACK_OF(CMS_RecipientInfo) *ris; CMS_RecipientInfo *ri; - int i, r, ri_type; + int i, r, cms_pkey_ri_type; int debug = 0, match_ri = 0; ris = CMS_get0_RecipientInfos(cms); if (ris) debug = cms->d.envelopedData->encryptedContentInfo->debug; - ri_type = cms_pkey_get_ri_type(pk); - if (ri_type == CMS_RECIPINFO_NONE) { - CMSerr(CMS_F_CMS_DECRYPT_SET1_PKEY, - CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE); - return 0; + + cms_pkey_ri_type = cms_pkey_get_ri_type(pk); + if (cms_pkey_ri_type == CMS_RECIPINFO_NONE) { + CMSerr(CMS_F_CMS_DECRYPT_SET1_PKEY_AND_PEER, + CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE); + return 0; } for (i = 0; i < sk_CMS_RecipientInfo_num(ris); i++) { + int ri_type; + ri = sk_CMS_RecipientInfo_value(ris, i); - if (CMS_RecipientInfo_type(ri) != ri_type) + ri_type = CMS_RecipientInfo_type(ri); + if (!cms_pkey_is_ri_type_supported(pk, ri_type)) continue; match_ri = 1; if (ri_type == CMS_RECIPINFO_AGREE) { - r = cms_kari_set1_pkey(cms, ri, pk, cert); + r = cms_kari_set1_pkey_and_peer(cms, ri, pk, cert, peer); if (r > 0) return 1; if (r < 0) @@ -646,7 +656,7 @@ int CMS_decrypt_set1_pkey(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert) } if (r > 0) return 1; - CMSerr(CMS_F_CMS_DECRYPT_SET1_PKEY, CMS_R_DECRYPT_ERROR); + CMSerr(CMS_F_CMS_DECRYPT_SET1_PKEY_AND_PEER, CMS_R_DECRYPT_ERROR); return 0; } /* @@ -654,17 +664,17 @@ int CMS_decrypt_set1_pkey(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert) * successful decrypt. Always attempt to decrypt all recipients * to avoid leaking timing of a successful decrypt. */ - else if (r > 0 && debug) + else if (r > 0 && (debug || cms_pkey_ri_type != CMS_RECIPINFO_TRANS)) return 1; } } /* If no cert, key transport and not debugging always return success */ - if (cert == NULL && ri_type == CMS_RECIPINFO_TRANS && match_ri && !debug) { + if (cert == NULL && cms_pkey_ri_type == CMS_RECIPINFO_TRANS && match_ri && !debug) { ERR_clear_error(); return 1; } - CMSerr(CMS_F_CMS_DECRYPT_SET1_PKEY, CMS_R_NO_MATCHING_RECIPIENT); + CMSerr(CMS_F_CMS_DECRYPT_SET1_PKEY_AND_PEER, CMS_R_NO_MATCHING_RECIPIENT); return 0; } diff --git a/crypto/err/openssl.txt b/crypto/err/openssl.txt index 0a37d5af23..f14acc65b6 100644 --- a/crypto/err/openssl.txt +++ b/crypto/err/openssl.txt @@ -243,6 +243,7 @@ CMS_F_CMS_ADD0_CERT:164:CMS_add0_cert CMS_F_CMS_ADD0_RECIPIENT_KEY:100:CMS_add0_recipient_key CMS_F_CMS_ADD0_RECIPIENT_PASSWORD:165:CMS_add0_recipient_password CMS_F_CMS_ADD1_RECEIPTREQUEST:158:CMS_add1_ReceiptRequest +CMS_F_CMS_ADD1_RECIPIENT:184: CMS_F_CMS_ADD1_RECIPIENT_CERT:101:CMS_add1_recipient_cert CMS_F_CMS_ADD1_SIGNER:102:CMS_add1_signer CMS_F_CMS_ADD1_SIGNINGTIME:103:cms_add1_signingTime @@ -260,6 +261,7 @@ CMS_F_CMS_DECRYPT:112:CMS_decrypt CMS_F_CMS_DECRYPT_SET1_KEY:113:CMS_decrypt_set1_key CMS_F_CMS_DECRYPT_SET1_PASSWORD:166:CMS_decrypt_set1_password CMS_F_CMS_DECRYPT_SET1_PKEY:114:CMS_decrypt_set1_pkey +CMS_F_CMS_DECRYPT_SET1_PKEY_AND_PEER:185: CMS_F_CMS_DIGESTALGORITHM_FIND_CTX:115:cms_DigestAlgorithm_find_ctx CMS_F_CMS_DIGESTALGORITHM_INIT_BIO:116:cms_DigestAlgorithm_init_bio CMS_F_CMS_DIGESTEDDATA_DO_FINAL:117:cms_DigestedData_do_final @@ -272,6 +274,8 @@ CMS_F_CMS_ENCRYPTEDDATA_DECRYPT:121:CMS_EncryptedData_decrypt CMS_F_CMS_ENCRYPTEDDATA_ENCRYPT:122:CMS_EncryptedData_encrypt CMS_F_CMS_ENCRYPTEDDATA_SET1_KEY:123:CMS_EncryptedData_set1_key CMS_F_CMS_ENVELOPEDDATA_CREATE:124:CMS_EnvelopedData_create +CMS_F_CMS_ENVELOPEDDATA_ENCRYPTION_INIT_BIO:186: +CMS_F_CMS_ENVELOPEDDATA_FINAL:187: CMS_F_CMS_ENVELOPEDDATA_INIT_BIO:125:cms_EnvelopedData_init_bio CMS_F_CMS_ENVELOPED_DATA_INIT:126:cms_enveloped_data_init CMS_F_CMS_ENV_ASN1_CTRL:171:cms_env_asn1_ctrl diff --git a/crypto/evp/pmeth_lib.c b/crypto/evp/pmeth_lib.c index c82a543857..c42897c87d 100644 --- a/crypto/evp/pmeth_lib.c +++ b/crypto/evp/pmeth_lib.c @@ -774,6 +774,13 @@ int EVP_PKEY_CTX_set_signature_md(EVP_PKEY_CTX *ctx, const EVP_MD *md) static int legacy_ctrl_to_param(EVP_PKEY_CTX *ctx, int keytype, int optype, int cmd, int p1, void *p2) { + /* + * GOST CMS format is different for different cipher algorithms. + * Most of other algorithms don't have such a difference + * so this ctrl is just ignored. + */ + if (cmd == EVP_PKEY_CTRL_CIPHER) + return -2; # ifndef OPENSSL_NO_DH if (keytype == EVP_PKEY_DH) { switch (cmd) { diff --git a/doc/man1/openssl-cms.pod.in b/doc/man1/openssl-cms.pod.in index 1965a952be..161408fdcb 100644 --- a/doc/man1/openssl-cms.pod.in +++ b/doc/man1/openssl-cms.pod.in @@ -46,6 +46,7 @@ B B [B<-print>] [B<-md> I] [B<-I>] +[B<-wrap> I] [B<-nointern>] [B<-noverify>] [B<-nocerts>] @@ -58,6 +59,7 @@ B B [B<-certfile> I] [B<-certsout> I] [B<-signer> I] +[B<-originator> I] [B<-recip> I] [B<-keyid>] [B<-receipt_request_all>] @@ -300,6 +302,12 @@ supported by your version of OpenSSL. If not specified triple DES is used. Only used with B<-encrypt> and B<-EncryptedData_create> commands. +=item B<-wrap> I + +Cipher algorithm to use for key wrap when encrypting the message using Key +Agreement for key transport. The algorithm specified should be suitable for key +wrap. + =item B<-nointern> When verifying a message normally certificates (if any) included in @@ -374,6 +382,11 @@ used multiple times if more than one signer is required. If a message is being verified then the signers certificates will be written to this file if the verification was successful. +=item B<-originator> I + +A certificate of the originator of the encrypted message. Necessary for +decryption when Key Agreement is in use for a shared key. + =item B<-recip> I When decrypting a message this specifies the recipients certificate. The diff --git a/doc/man3/CMS_add1_recipient_cert.pod b/doc/man3/CMS_add1_recipient_cert.pod index b68183d109..34d1e0ee36 100644 --- a/doc/man3/CMS_add1_recipient_cert.pod +++ b/doc/man3/CMS_add1_recipient_cert.pod @@ -2,12 +2,16 @@ =head1 NAME -CMS_add1_recipient_cert, CMS_add0_recipient_key - add recipients to a CMS enveloped data structure +CMS_add1_recipient, CMS_add1_recipient_cert, CMS_add0_recipient_key - add recipients to a CMS enveloped data structure =head1 SYNOPSIS #include + CMS_RecipientInfo *CMS_add1_recipient(CMS_ContentInfo *cms, X509 *recip, + EVP_PKEY *originatorPrivKey, + X509 *originator, unsigned int flags); + CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms, X509 *recip, unsigned int flags); @@ -20,6 +24,11 @@ CMS_add1_recipient_cert, CMS_add0_recipient_key - add recipients to a CMS envelo =head1 DESCRIPTION +CMS_add1_recipient() adds recipient B and provides the originator pkey +B and originator certificate B to CMS_ContentInfo. +The originator-related fields are relevant only in case when the keyAgreement +method of providing of the shared key is in use. + CMS_add1_recipient_cert() adds recipient B to CMS_ContentInfo enveloped data structure B as a KeyTransRecipientInfo structure. @@ -60,9 +69,14 @@ occurs. L, L, L, +=head1 HISTORY + +B and B were added in +OpenSSL 3.0. + =head1 COPYRIGHT -Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2008-2020 The OpenSSL Project Authors. All Rights Reserved. Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/doc/man3/CMS_decrypt.pod b/doc/man3/CMS_decrypt.pod index 0c5834c549..3124fa8394 100644 --- a/doc/man3/CMS_decrypt.pod +++ b/doc/man3/CMS_decrypt.pod @@ -2,7 +2,8 @@ =head1 NAME -CMS_decrypt - decrypt content from a CMS envelopedData structure +CMS_decrypt, CMS_decrypt_set1_pkey_and_peer, CMS_decrypt_set1_pkey - decrypt +content from a CMS envelopedData structure =head1 SYNOPSIS @@ -10,6 +11,9 @@ CMS_decrypt - decrypt content from a CMS envelopedData structure int CMS_decrypt(CMS_ContentInfo *cms, EVP_PKEY *pkey, X509 *cert, BIO *dcont, BIO *out, unsigned int flags); + int CMS_decrypt_set1_pkey_and_peer(CMS_ContentInfo *cms, + EVP_PKEY *pk, X509 *cert, X509 *peer); + int CMS_decrypt_set1_pkey(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert); =head1 DESCRIPTION @@ -21,6 +25,13 @@ B is an optional set of flags. The B parameter is used in the rare case where the encrypted content is detached. It will normally be set to NULL. +CMS_decrypt_set1_pkey_and_peer() associates the private key B, the +corresponding certificate B and the originator certificate B with +the CMS_ContentInfo structure B. + +CMS_decrypt_set1_pkey() associates the private key B, corresponding +certificate B with the CMS_ContentInfo structure B. + =head1 NOTES Although the recipients certificate is not needed to decrypt the data it is @@ -70,9 +81,13 @@ mentioned in CMS_verify() also applies to CMS_decrypt(). L, L +=head1 HISTORY + +B was added in OpenSSL 3.0. + =head1 COPYRIGHT -Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2008-2020 The OpenSSL Project Authors. All Rights Reserved. Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/doc/man3/CMS_get0_RecipientInfos.pod b/doc/man3/CMS_get0_RecipientInfos.pod index 5d19e3d178..c6354381fc 100644 --- a/doc/man3/CMS_get0_RecipientInfos.pod +++ b/doc/man3/CMS_get0_RecipientInfos.pod @@ -5,6 +5,8 @@ CMS_get0_RecipientInfos, CMS_RecipientInfo_type, CMS_RecipientInfo_ktri_get0_signer_id, CMS_RecipientInfo_ktri_cert_cmp, CMS_RecipientInfo_set0_pkey, CMS_RecipientInfo_kekri_get0_id, +CMS_RecipientInfo_kari_set0_pkey_and_peer, +CMS_RecipientInfo_kari_set0_pkey, CMS_RecipientInfo_kekri_id_cmp, CMS_RecipientInfo_set0_key, CMS_RecipientInfo_decrypt, CMS_RecipientInfo_encrypt - CMS envelopedData RecipientInfo routines @@ -22,7 +24,9 @@ CMS_RecipientInfo_decrypt, CMS_RecipientInfo_encrypt ASN1_INTEGER **sno); int CMS_RecipientInfo_ktri_cert_cmp(CMS_RecipientInfo *ri, X509 *cert); int CMS_RecipientInfo_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pkey); - + int CMS_RecipientInfo_kari_set0_pkey_and_peer(CMS_RecipientInfo *ri, + EVP_PKEY *pk, X509 *peer); + int CMS_RecipientInfo_kari_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pk); int CMS_RecipientInfo_kekri_get0_id(CMS_RecipientInfo *ri, X509_ALGOR **palg, ASN1_OCTET_STRING **pid, ASN1_GENERALIZEDTIME **pdate, @@ -58,6 +62,13 @@ CMS_RecipientInfo_set0_pkey() associates the private key B with the CMS_RecipientInfo structure B, which must be of type CMS_RECIPINFO_TRANS. +CMS_RecipientInfo_kari_set0_pkey_and_peer() associates the private key B +and peer certificate B with the CMS_RecipientInfo structure B, which +must be of type CMS_RECIPINFO_AGREE. + +CMS_RecipientInfo_kari_set0_pkey() associates the private key B with the +CMS_RecipientInfo structure B, which must be of type CMS_RECIPINFO_AGREE. + CMS_RecipientInfo_kekri_get0_id() retrieves the key information from the CMS_RecipientInfo structure B which must be of type CMS_RECIPINFO_KEK. Any of the remaining parameters can be NULL if the application is not interested in @@ -127,9 +138,14 @@ Any error can be obtained from L. L, L +=head1 HISTORY + +B and B +were added in OpenSSL 3.0. + =head1 COPYRIGHT -Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2008-2020 The OpenSSL Project Authors. All Rights Reserved. Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/include/openssl/cms.h b/include/openssl/cms.h index 1d502fa457..5f66e6df4b 100644 --- a/include/openssl/cms.h +++ b/include/openssl/cms.h @@ -80,6 +80,7 @@ DECLARE_ASN1_PRINT_FUNCTION(CMS_ContentInfo) # define CMS_KEY_PARAM 0x40000 # define CMS_ASCIICRLF 0x80000 # define CMS_CADES 0x100000 +# define CMS_USE_ORIGINATOR_KEYID 0x200000 const ASN1_OBJECT *CMS_get0_type(const CMS_ContentInfo *cms); @@ -150,6 +151,7 @@ int CMS_decrypt(CMS_ContentInfo *cms, EVP_PKEY *pkey, X509 *cert, BIO *dcont, BIO *out, unsigned int flags); int CMS_decrypt_set1_pkey(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert); +int CMS_decrypt_set1_pkey_and_peer(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert, X509 *peer); int CMS_decrypt_set1_key(CMS_ContentInfo *cms, unsigned char *key, size_t keylen, const unsigned char *id, size_t idlen); @@ -162,6 +164,8 @@ EVP_PKEY_CTX *CMS_RecipientInfo_get0_pkey_ctx(CMS_RecipientInfo *ri); CMS_ContentInfo *CMS_EnvelopedData_create(const EVP_CIPHER *cipher); CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms, X509 *recip, unsigned int flags); +CMS_RecipientInfo *CMS_add1_recipient(CMS_ContentInfo *cms, X509 *recip, + EVP_PKEY *originatorPrivKey, X509 * originator, unsigned int flags); int CMS_RecipientInfo_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pkey); int CMS_RecipientInfo_ktri_cert_cmp(CMS_RecipientInfo *ri, X509 *cert); int CMS_RecipientInfo_ktri_get0_algs(CMS_RecipientInfo *ri, @@ -326,6 +330,7 @@ int CMS_RecipientEncryptedKey_get0_id(CMS_RecipientEncryptedKey *rek, int CMS_RecipientEncryptedKey_cert_cmp(CMS_RecipientEncryptedKey *rek, X509 *cert); int CMS_RecipientInfo_kari_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pk); +int CMS_RecipientInfo_kari_set0_pkey_and_peer(CMS_RecipientInfo *ri, EVP_PKEY *pk, X509 *peer); EVP_CIPHER_CTX *CMS_RecipientInfo_kari_get0_ctx(CMS_RecipientInfo *ri); int CMS_RecipientInfo_kari_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri, diff --git a/include/openssl/cmserr.h b/include/openssl/cmserr.h index 10e0fd6ae8..494ae6191a 100644 --- a/include/openssl/cmserr.h +++ b/include/openssl/cmserr.h @@ -1,6 +1,6 @@ /* * Generated by util/mkerr.pl DO NOT EDIT - * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -39,6 +39,7 @@ int ERR_load_CMS_strings(void); # define CMS_F_CMS_ADD0_RECIPIENT_KEY 0 # define CMS_F_CMS_ADD0_RECIPIENT_PASSWORD 0 # define CMS_F_CMS_ADD1_RECEIPTREQUEST 0 +# define CMS_F_CMS_ADD1_RECIPIENT 0 # define CMS_F_CMS_ADD1_RECIPIENT_CERT 0 # define CMS_F_CMS_ADD1_SIGNER 0 # define CMS_F_CMS_ADD1_SIGNINGTIME 0 @@ -56,6 +57,7 @@ int ERR_load_CMS_strings(void); # define CMS_F_CMS_DECRYPT_SET1_KEY 0 # define CMS_F_CMS_DECRYPT_SET1_PASSWORD 0 # define CMS_F_CMS_DECRYPT_SET1_PKEY 0 +# define CMS_F_CMS_DECRYPT_SET1_PKEY_AND_PEER 0 # define CMS_F_CMS_DIGESTALGORITHM_FIND_CTX 0 # define CMS_F_CMS_DIGESTALGORITHM_INIT_BIO 0 # define CMS_F_CMS_DIGESTEDDATA_DO_FINAL 0 @@ -68,6 +70,8 @@ int ERR_load_CMS_strings(void); # define CMS_F_CMS_ENCRYPTEDDATA_ENCRYPT 0 # define CMS_F_CMS_ENCRYPTEDDATA_SET1_KEY 0 # define CMS_F_CMS_ENVELOPEDDATA_CREATE 0 +# define CMS_F_CMS_ENVELOPEDDATA_ENCRYPTION_INIT_BIO 0 +# define CMS_F_CMS_ENVELOPEDDATA_FINAL 0 # define CMS_F_CMS_ENVELOPEDDATA_INIT_BIO 0 # define CMS_F_CMS_ENVELOPED_DATA_INIT 0 # define CMS_F_CMS_ENV_ASN1_CTRL 0 diff --git a/include/openssl/evp.h b/include/openssl/evp.h index 7aa56b3e93..202675cc70 100644 --- a/include/openssl/evp.h +++ b/include/openssl/evp.h @@ -294,6 +294,10 @@ int (*EVP_CIPHER_meth_get_ctrl(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *, # define EVP_CIPH_FLAG_PIPELINE 0X800000 /* For provider implementations that handle ASN1 get/set param themselves */ # define EVP_CIPH_FLAG_CUSTOM_ASN1 0x1000000 +/* For ciphers generating unprotected CMS attributes */ +# define EVP_CIPH_FLAG_CIPHER_WITH_MAC 0x2000000 +/* For supplementary wrap cipher support */ +# define EVP_CIPH_FLAG_GET_WRAP_CIPHER 0x4000000 /* * Cipher context flag to indicate we can handle wrap mode: if allowed in @@ -372,6 +376,10 @@ int (*EVP_CIPHER_meth_get_ctrl(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *, # define EVP_CTRL_GET_IV 0x26 /* Tell the cipher it's doing a speed test (SIV disallows multiple ops) */ # define EVP_CTRL_SET_SPEED 0x27 +/* Get the unprotectedAttrs from cipher ctx */ +# define EVP_CTRL_PROCESS_UNPROTECTED 0x28 +/* Get the supplementary wrap cipher */ +#define EVP_CTRL_GET_WRAP_CIPHER 0x29 /* Padding modes */ #define EVP_PADDING_PKCS7 1 @@ -1259,6 +1267,7 @@ int EVP_PBE_get(int *ptype, int *ppbe_nid, size_t num); # define ASN1_PKEY_CTRL_SET1_TLS_ENCPT 0x9 # define ASN1_PKEY_CTRL_GET1_TLS_ENCPT 0xa # define ASN1_PKEY_CTRL_SUPPORTS_MD_NID 0xb +# define ASN1_PKEY_CTRL_CMS_IS_RI_TYPE_SUPPORTED 0xc int EVP_PKEY_asn1_get_count(void); const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_get0(int idx); diff --git a/util/libcrypto.num b/util/libcrypto.num index fa220d873f..8334b99361 100644 --- a/util/libcrypto.num +++ b/util/libcrypto.num @@ -4912,6 +4912,9 @@ ASN1_GENERALIZEDTIME_dup ? 3_0_0 EXIST::FUNCTION: RAND_priv_bytes_ex ? 3_0_0 EXIST::FUNCTION: RAND_bytes_ex ? 3_0_0 EXIST::FUNCTION: EVP_PKEY_get_default_digest_name ? 3_0_0 EXIST::FUNCTION: +CMS_decrypt_set1_pkey_and_peer ? 3_0_0 EXIST::FUNCTION:CMS +CMS_add1_recipient ? 3_0_0 EXIST::FUNCTION:CMS +CMS_RecipientInfo_kari_set0_pkey_and_peer ? 3_0_0 EXIST::FUNCTION:CMS PKCS8_pkey_add1_attr ? 3_0_0 EXIST::FUNCTION: PKCS8_pkey_add1_attr_by_OBJ ? 3_0_0 EXIST::FUNCTION: EVP_PKEY_private_check ? 3_0_0 EXIST::FUNCTION: diff --git a/util/missingcrypto.txt b/util/missingcrypto.txt index be5535b87d..99c2883bd0 100644 --- a/util/missingcrypto.txt +++ b/util/missingcrypto.txt @@ -325,7 +325,6 @@ CMS_RecipientInfo_kari_get0_ctx(3) CMS_RecipientInfo_kari_get0_orig_id(3) CMS_RecipientInfo_kari_get0_reks(3) CMS_RecipientInfo_kari_orig_id_cmp(3) -CMS_RecipientInfo_kari_set0_pkey(3) CMS_RecipientInfo_ktri_get0_algs(3) CMS_RecipientInfo_set0_password(3) CMS_SharedInfo_encode(3) @@ -347,7 +346,6 @@ CMS_dataInit(3) CMS_data_create(3) CMS_decrypt_set1_key(3) CMS_decrypt_set1_password(3) -CMS_decrypt_set1_pkey(3) CMS_digest_create(3) CMS_digest_verify(3) CMS_is_detached(3) From builds at travis-ci.org Tue Mar 3 13:39:12 2020 From: builds at travis-ci.org (Travis CI) Date: Tue, 03 Mar 2020 13:39:12 +0000 Subject: Errored: openssl/openssl#32790 (pr-10904 - 3489007) In-Reply-To: Message-ID: <5e5e5e001b4a3_43fe2e8b88318197882@53b4594b-a399-471f-8e32-05e0cb0380fe.mail> Build Update for openssl/openssl ------------------------------------- Build: #32790 Status: Errored Duration: 2 mins and 54 secs Commit: 3489007 (pr-10904) Author: Dmitry Belyavskiy Message: Documenting newly added CMS modification Documented CMS-related API functions. Documented flags added to openssl-cms command Reviewed-by: Shane Lontis Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/10904) View the changeset: https://github.com/openssl/openssl/compare/71434aed0de2^...348900774c14 View the full build log and details: https://travis-ci.org/openssl/openssl/builds/657750629?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the openssl/openssl repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=5849220&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From builds at travis-ci.org Tue Mar 3 14:27:03 2020 From: builds at travis-ci.org (Travis CI) Date: Tue, 03 Mar 2020 14:27:03 +0000 Subject: Still Failing: openssl/openssl#32791 (master - 3489007) In-Reply-To: Message-ID: <5e5e69372f434_43fcd62888e2410275f@9c2da4f3-0b50-4f9a-a8fc-0f20810399a0.mail> Build Update for openssl/openssl ------------------------------------- Build: #32791 Status: Still Failing Duration: 49 mins and 40 secs Commit: 3489007 (master) Author: Dmitry Belyavskiy Message: Documenting newly added CMS modification Documented CMS-related API functions. Documented flags added to openssl-cms command Reviewed-by: Shane Lontis Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/10904) View the changeset: https://github.com/openssl/openssl/compare/88398d2a358f...348900774c14 View the full build log and details: https://travis-ci.org/openssl/openssl/builds/657750801?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the openssl/openssl repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=5849220&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Tue Mar 3 15:27:48 2020 From: no-reply at appveyor.com (AppVeyor) Date: Tue, 03 Mar 2020 15:27:48 +0000 Subject: Build failed: openssl master.32228 Message-ID: <20200303152748.1.D9BEA1ABBA697115@appveyor.com> An HTML attachment was scrubbed... URL: From tmraz at fedoraproject.org Tue Mar 3 15:40:12 2020 From: tmraz at fedoraproject.org (tmraz at fedoraproject.org) Date: Tue, 03 Mar 2020 15:40:12 +0000 Subject: [openssl] master update Message-ID: <1583250012.365855.6904.nullmailer@dev.openssl.org> The branch master has been updated via 4a98ad086a6db9a8646244bd6e6517f9fff11762 (commit) from 348900774c14dd79c9cf762d59554f38d8c77120 (commit) - Log ----------------------------------------------------------------- commit 4a98ad086a6db9a8646244bd6e6517f9fff11762 Author: Tomas Mraz Date: Tue Mar 3 15:34:53 2020 +0100 Correct two small documentation issues The find-doc-nits complains about non-zero word and about missing line before =head1 which causes build failure. Reviewed-by: Dmitry Belyavskiy Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/11231) ----------------------------------------------------------------------- Summary of changes: doc/internal/man3/s2i_ASN1_UTF8STRING.pod | 1 + doc/man1/openssl-rand.pod.in | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/internal/man3/s2i_ASN1_UTF8STRING.pod b/doc/internal/man3/s2i_ASN1_UTF8STRING.pod index 03a309ba22..c5b434a5b5 100644 --- a/doc/internal/man3/s2i_ASN1_UTF8STRING.pod +++ b/doc/internal/man3/s2i_ASN1_UTF8STRING.pod @@ -14,6 +14,7 @@ s2i_ASN1_UTF8STRING, ASN1_UTF8STRING *utf8); ASN1_UTF8STRING *s2i_ASN1_UTF8STRING(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, const char *str); + =head1 DESCRIPTION These functions convert OpenSSL objects to and from their ASN.1/string diff --git a/doc/man1/openssl-rand.pod.in b/doc/man1/openssl-rand.pod.in index b8a01750c8..5e76b228ab 100644 --- a/doc/man1/openssl-rand.pod.in +++ b/doc/man1/openssl-rand.pod.in @@ -26,7 +26,7 @@ secure pseudo random number generator (CSPRNG). The random bytes are generated using the L function, which provides a security level of 256 bits, provided it managed to seed itself successfully from a trusted operating system entropy source. -Otherwise, the command will fail with a non-zero error code. +Otherwise, the command will fail with a nonzero error code. For more details, see L, L, and L. =head1 OPTIONS From builds at travis-ci.org Tue Mar 3 16:34:29 2020 From: builds at travis-ci.org (Travis CI) Date: Tue, 03 Mar 2020 16:34:29 +0000 Subject: Still Failing: openssl/openssl#32797 (master - 4a98ad0) In-Reply-To: Message-ID: <5e5e871574ecb_43f963a4f759418818@c9a58e6a-3686-42d0-9a8c-57aa29e509a8.mail> Build Update for openssl/openssl ------------------------------------- Build: #32797 Status: Still Failing Duration: 49 mins and 44 secs Commit: 4a98ad0 (master) Author: Tomas Mraz Message: Correct two small documentation issues The find-doc-nits complains about non-zero word and about missing line before =head1 which causes build failure. Reviewed-by: Dmitry Belyavskiy Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/11231) View the changeset: https://github.com/openssl/openssl/compare/348900774c14...4a98ad086a6d View the full build log and details: https://travis-ci.org/openssl/openssl/builds/657808607?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the openssl/openssl repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=5849220&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Tue Mar 3 17:56:55 2020 From: no-reply at appveyor.com (AppVeyor) Date: Tue, 03 Mar 2020 17:56:55 +0000 Subject: Build failed: openssl pr-10904.32231 Message-ID: <20200303175655.1.D609C1B15877CB96@appveyor.com> An HTML attachment was scrubbed... URL: From shane.lontis at oracle.com Tue Mar 3 21:52:13 2020 From: shane.lontis at oracle.com (shane.lontis at oracle.com) Date: Tue, 03 Mar 2020 21:52:13 +0000 Subject: [openssl] master update Message-ID: <1583272333.744245.17332.nullmailer@dev.openssl.org> The branch master has been updated via f552d900459cbacd82433b688b237cd6870663cd (commit) from 4a98ad086a6db9a8646244bd6e6517f9fff11762 (commit) - Log ----------------------------------------------------------------- commit f552d900459cbacd82433b688b237cd6870663cd Author: Shane Lontis Date: Sun Feb 16 19:54:08 2020 +1000 Add Serializers for EC Provide EC serializers for text, pem and der. EC parameters use ANS1 'CHOICE' - which means they are more embedded than other parameters used by other KEY types (which normally have a SEQUENCE at the top level). For this reason the ANS1_STRING type that was being passed around has been changed to a void so that the code can still be shared with EC. The EC serializer only supports named curves currently. NOTE the serializer code assumes PKCS8 format - if the older encode methods are needed they will need to be added in another PR. (Probably when deserialization is considered). EVP_PKEY_key_fromdata_init was changed from using a keypair selection to all bits of a key. A side effect of this was that the very restrictive checks in the ecx code needed to be relaxed as it was assuming all selection flags were non optional. As this is not the case for any other key the code has been modified. Fixed a bug in legacy_ctrl_str_to_params() - "ecdh_cofactor_mode" was being incorrectly converted to the wrong keyname. Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/11107) ----------------------------------------------------------------------- Summary of changes: crypto/evp/pmeth_gn.c | 4 +- crypto/evp/pmeth_lib.c | 2 +- doc/man7/provider-keymgmt.pod | 26 ++ providers/defltprov.c | 32 ++- .../implementations/include/prov/implementations.h | 12 +- providers/implementations/keymgmt/ec_kmgmt.c | 2 +- providers/implementations/keymgmt/ecx_kmgmt.c | 22 +- providers/implementations/serializers/build.info | 2 + .../serializers/serializer_common.c | 28 +-- .../implementations/serializers/serializer_dh.c | 2 +- .../implementations/serializers/serializer_dsa.c | 4 +- .../implementations/serializers/serializer_ec.c | 150 ++++++++++++ .../serializers/serializer_ec_param.c | 153 ++++++++++++ .../serializers/serializer_ec_priv.c | 261 +++++++++++++++++++++ .../serializers/serializer_ec_pub.c | 159 +++++++++++++ .../implementations/serializers/serializer_local.h | 33 ++- .../serializers/serializer_rsa_priv.c | 5 +- test/build.info | 2 +- test/evp_pkey_provided_test.c | 90 ++++++- test/recipes/30-test_evp_pkey_provided.t | 3 +- test/recipes/30-test_evp_pkey_provided/EC.priv.der | Bin 0 -> 138 bytes test/recipes/30-test_evp_pkey_provided/EC.priv.pem | 5 + test/recipes/30-test_evp_pkey_provided/EC.priv.txt | 13 + test/recipes/30-test_evp_pkey_provided/EC.pub.der | Bin 0 -> 91 bytes test/recipes/30-test_evp_pkey_provided/EC.pub.pem | 4 + test/recipes/30-test_evp_pkey_provided/EC.pub.txt | 9 + 26 files changed, 955 insertions(+), 68 deletions(-) create mode 100644 providers/implementations/serializers/serializer_ec.c create mode 100644 providers/implementations/serializers/serializer_ec_param.c create mode 100644 providers/implementations/serializers/serializer_ec_priv.c create mode 100644 providers/implementations/serializers/serializer_ec_pub.c create mode 100644 test/recipes/30-test_evp_pkey_provided/EC.priv.der create mode 100644 test/recipes/30-test_evp_pkey_provided/EC.priv.pem create mode 100644 test/recipes/30-test_evp_pkey_provided/EC.priv.txt create mode 100644 test/recipes/30-test_evp_pkey_provided/EC.pub.der create mode 100644 test/recipes/30-test_evp_pkey_provided/EC.pub.pem create mode 100644 test/recipes/30-test_evp_pkey_provided/EC.pub.txt diff --git a/crypto/evp/pmeth_gn.c b/crypto/evp/pmeth_gn.c index 4bea1a1b86..84149fabd7 100644 --- a/crypto/evp/pmeth_gn.c +++ b/crypto/evp/pmeth_gn.c @@ -230,7 +230,7 @@ int EVP_PKEY_fromdata(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey, OSSL_PARAM params[]) if (ctx->operation == EVP_PKEY_OP_PARAMFROMDATA) selection = OSSL_KEYMGMT_SELECT_ALL_PARAMETERS; else - selection = OSSL_KEYMGMT_SELECT_KEYPAIR; + selection = OSSL_KEYMGMT_SELECT_ALL; keydata = evp_keymgmt_util_fromdata(*ppkey, ctx->keymgmt, selection, params); @@ -261,6 +261,6 @@ const OSSL_PARAM *EVP_PKEY_key_fromdata_settable(EVP_PKEY_CTX *ctx) /* We call fromdata_init to get ctx->keymgmt populated */ if (fromdata_init(ctx, EVP_PKEY_OP_UNDEFINED)) return evp_keymgmt_import_types(ctx->keymgmt, - OSSL_KEYMGMT_SELECT_KEYPAIR); + OSSL_KEYMGMT_SELECT_ALL); return NULL; } diff --git a/crypto/evp/pmeth_lib.c b/crypto/evp/pmeth_lib.c index c42897c87d..906b08156f 100644 --- a/crypto/evp/pmeth_lib.c +++ b/crypto/evp/pmeth_lib.c @@ -938,7 +938,7 @@ static int legacy_ctrl_str_to_param(EVP_PKEY_CTX *ctx, const char *name, else if (strcmp(name, "ecdh_cofactor_mode") == 0) name = OSSL_EXCHANGE_PARAM_EC_ECDH_COFACTOR_MODE; else if (strcmp(name, "ecdh_kdf_md") == 0) - name = OSSL_EXCHANGE_PARAM_KDF_TYPE; + name = OSSL_EXCHANGE_PARAM_KDF_DIGEST; # endif { diff --git a/doc/man7/provider-keymgmt.pod b/doc/man7/provider-keymgmt.pod index 91b87cecdc..0f765f775a 100644 --- a/doc/man7/provider-keymgmt.pod +++ b/doc/man7/provider-keymgmt.pod @@ -354,6 +354,32 @@ The private key value. =back +=head2 Built-in EC Import/Export Types + +The following Import/Export types are available for the built-in EC algorithm: + +=over 4 + +=item "curve-name" (B) + +The EC curve name. + +=item "use-cofactor-flag" (B) + +Enable Cofactor DH (ECC CDH) if this value is 1, otherwise it uses normal EC DH +if the value is zero. The cofactor variant multiplies the shared secret by the +EC curve's cofactor (note for some curves the cofactor is 1). + +=item "pub" (B) + +The public key value in EC point format. + +=item "priv" (B) + +The private key value. + +=back + =head2 Information Parameters See L for further details on the parameters structure. diff --git a/providers/defltprov.c b/providers/defltprov.c index 9400eee0c9..0f66aa2b71 100644 --- a/providers/defltprov.c +++ b/providers/defltprov.c @@ -471,17 +471,17 @@ static const OSSL_ALGORITHM deflt_serializer[] = { #endif #ifndef OPENSSL_NO_EC - { "X25519", "provider=default,format=text,type=private", + { "X25519", "provider=default,fips=yes,format=text,type=private", x25519_priv_print_serializer_functions }, - { "X25519", "provider=default,format=text,type=public", + { "X25519", "provider=default,fips=yes,format=text,type=public", x25519_pub_print_serializer_functions }, - { "X25519", "provider=default,format=der,type=private", + { "X25519", "provider=default,fips=yes,format=der,type=private", x25519_priv_der_serializer_functions }, - { "X25519", "provider=default,format=der,type=public", + { "X25519", "provider=default,fips=yes,format=der,type=public", x25519_pub_der_serializer_functions }, - { "X25519", "provider=default,format=pem,type=private", + { "X25519", "provider=default,fips=yes,format=pem,type=private", x25519_priv_pem_serializer_functions }, - { "X25519", "provider=default,format=pem,type=public", + { "X25519", "provider=default,fips=yes,format=pem,type=public", x25519_pub_pem_serializer_functions }, { "X448", "provider=default,format=text,type=private", @@ -496,8 +496,26 @@ static const OSSL_ALGORITHM deflt_serializer[] = { x448_priv_pem_serializer_functions }, { "X448", "provider=default,format=pem,type=public", x448_pub_pem_serializer_functions }, -#endif + { "EC", "provider=default,fips=yes,format=text,type=private", + ec_priv_text_serializer_functions }, + { "EC", "provider=default,fips=yes,format=text,type=public", + ec_pub_text_serializer_functions }, + { "EC", "provider=default,fips=yes,format=text,type=parameters", + ec_param_text_serializer_functions }, + { "EC", "provider=default,fips=yes,format=der,type=private", + ec_priv_der_serializer_functions }, + { "EC", "provider=default,fips=yes,format=der,type=public", + ec_pub_der_serializer_functions }, + { "EC", "provider=default,fips=yes,format=der,type=parameters", + ec_param_der_serializer_functions }, + { "EC", "provider=default,fips=yes,format=pem,type=private", + ec_priv_pem_serializer_functions }, + { "EC", "provider=default,fips=yes,format=pem,type=public", + ec_pub_pem_serializer_functions }, + { "EC", "provider=default,fips=yes,format=pem,type=parameters", + ec_param_pem_serializer_functions }, +#endif { NULL, NULL, NULL } }; diff --git a/providers/implementations/include/prov/implementations.h b/providers/implementations/include/prov/implementations.h index a98d1139d3..ea33bedfd8 100644 --- a/providers/implementations/include/prov/implementations.h +++ b/providers/implementations/include/prov/implementations.h @@ -1,5 +1,5 @@ /* - * Copyright 2019 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -315,3 +315,13 @@ extern const OSSL_DISPATCH x448_priv_der_serializer_functions[]; extern const OSSL_DISPATCH x448_pub_der_serializer_functions[]; extern const OSSL_DISPATCH x448_priv_pem_serializer_functions[]; extern const OSSL_DISPATCH x448_pub_pem_serializer_functions[]; + +extern const OSSL_DISPATCH ec_priv_text_serializer_functions[]; +extern const OSSL_DISPATCH ec_pub_text_serializer_functions[]; +extern const OSSL_DISPATCH ec_param_text_serializer_functions[]; +extern const OSSL_DISPATCH ec_priv_der_serializer_functions[]; +extern const OSSL_DISPATCH ec_pub_der_serializer_functions[]; +extern const OSSL_DISPATCH ec_param_der_serializer_functions[]; +extern const OSSL_DISPATCH ec_priv_pem_serializer_functions[]; +extern const OSSL_DISPATCH ec_pub_pem_serializer_functions[]; +extern const OSSL_DISPATCH ec_param_pem_serializer_functions[]; diff --git a/providers/implementations/keymgmt/ec_kmgmt.c b/providers/implementations/keymgmt/ec_kmgmt.c index 6a358aa93b..107ab1b594 100644 --- a/providers/implementations/keymgmt/ec_kmgmt.c +++ b/providers/implementations/keymgmt/ec_kmgmt.c @@ -473,7 +473,7 @@ static int ec_import(void *keydata, int selection, const OSSL_PARAM params[]) { EC_KEY *ec = keydata; - int ok = 0; + int ok = 1; if (ec == NULL) return 0; diff --git a/providers/implementations/keymgmt/ecx_kmgmt.c b/providers/implementations/keymgmt/ecx_kmgmt.c index fe0193d944..d3aa9ba1f9 100644 --- a/providers/implementations/keymgmt/ecx_kmgmt.c +++ b/providers/implementations/keymgmt/ecx_kmgmt.c @@ -27,6 +27,8 @@ static OSSL_OP_keymgmt_import_types_fn ecx_imexport_types; static OSSL_OP_keymgmt_export_fn ecx_export; static OSSL_OP_keymgmt_export_types_fn ecx_imexport_types; +#define ECX_POSSIBLE_SELECTIONS (OSSL_KEYMGMT_SELECT_KEYPAIR) + static void *x25519_new_key(void *provctx) { return ecx_key_new(X25519_KEYLEN, 0); @@ -40,12 +42,9 @@ static void *x448_new_key(void *provctx) static int ecx_has(void *keydata, int selection) { ECX_KEY *key = keydata; - const int ecx_selections = OSSL_KEYMGMT_SELECT_PUBLIC_KEY - | OSSL_KEYMGMT_SELECT_PRIVATE_KEY; int ok = 1; - if ((selection & ~ecx_selections) != 0 - || (selection & ecx_selections) == 0) + if ((selection & ECX_POSSIBLE_SELECTIONS) == 0) return 0; if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0) @@ -63,29 +62,24 @@ static int ecx_import(void *keydata, int selection, const OSSL_PARAM params[]) size_t privkeylen = 0, pubkeylen; const OSSL_PARAM *param_priv_key = NULL, *param_pub_key; unsigned char *pubkey; - const int ecx_selections = OSSL_KEYMGMT_SELECT_PUBLIC_KEY - | OSSL_KEYMGMT_SELECT_PRIVATE_KEY; if (key == NULL) return 0; - if ((selection & ~ecx_selections) != 0 - || (selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) == 0) + if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) == 0) return 0; - if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) - param_priv_key = - OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PRIV_KEY); param_pub_key = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PUB_KEY); + if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) + param_priv_key = + OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PRIV_KEY); /* * If a private key is present then a public key must also be present. * Alternatively we've just got a public key. */ - if (param_pub_key == NULL - || (param_priv_key == NULL - && (selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0)) + if (param_pub_key == NULL) return 0; if (param_priv_key != NULL diff --git a/providers/implementations/serializers/build.info b/providers/implementations/serializers/build.info index d5873d1052..66502c76aa 100644 --- a/providers/implementations/serializers/build.info +++ b/providers/implementations/serializers/build.info @@ -6,6 +6,7 @@ $RSA_GOAL=../../libimplementations.a $DH_GOAL=../../libimplementations.a $DSA_GOAL=../../libimplementations.a $ECX_GOAL=../../libimplementations.a +$EC_GOAL=../../libimplementations.a SOURCE[$SERIALIZER_GOAL]=serializer_common.c SOURCE[$RSA_GOAL]=serializer_rsa.c serializer_rsa_priv.c serializer_rsa_pub.c @@ -17,4 +18,5 @@ IF[{- !$disabled{dsa} -}] ENDIF IF[{- !$disabled{ec} -}] SOURCE[$ECX_GOAL]=serializer_ecx.c serializer_ecx_priv.c serializer_ecx_pub.c + SOURCE[$EC_GOAL]=serializer_ec.c serializer_ec_priv.c serializer_ec_pub.c serializer_ec_param.c ENDIF diff --git a/providers/implementations/serializers/serializer_common.c b/providers/implementations/serializers/serializer_common.c index b1ad523b71..0b99f4939b 100644 --- a/providers/implementations/serializers/serializer_common.c +++ b/providers/implementations/serializers/serializer_common.c @@ -1,5 +1,5 @@ /* - * Copyright 2019 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -21,7 +21,7 @@ static PKCS8_PRIV_KEY_INFO * ossl_prov_p8info_from_obj(const void *obj, int obj_nid, - ASN1_STRING *params, + void *params, int params_type, int (*k2d)(const void *obj, unsigned char **pder)) @@ -72,7 +72,7 @@ static X509_SIG *ossl_prov_encp8_from_p8info(PKCS8_PRIV_KEY_INFO *p8info, } static X509_SIG *ossl_prov_encp8_from_obj(const void *obj, int obj_nid, - ASN1_STRING *params, + void *params, int params_type, int (*k2d)(const void *obj, unsigned char **pder), @@ -87,7 +87,7 @@ static X509_SIG *ossl_prov_encp8_from_obj(const void *obj, int obj_nid, } static X509_PUBKEY *ossl_prov_pubkey_from_obj(const void *obj, int obj_nid, - ASN1_STRING *params, + void *params, int params_type, int (*k2d)(const void *obj, unsigned char **pder)) @@ -272,18 +272,17 @@ int ossl_prov_print_labeled_buf(BIO *out, const char *label, return 1; } - -/* p2s = param to asn1_string, k2d = key to der */ +/* p2s = param to asn1, k2d = key to der */ int ossl_prov_write_priv_der_from_obj(BIO *out, const void *obj, int obj_nid, int (*p2s)(const void *obj, int nid, - ASN1_STRING **str, + void **str, int *strtype), int (*k2d)(const void *obj, unsigned char **pder), struct pkcs8_encrypt_ctx_st *ctx) { int ret = 0; - ASN1_STRING *str = NULL; + void *str = NULL; int strtype = V_ASN1_UNDEF; if (p2s != NULL && !p2s(obj, obj_nid, &str, &strtype)) @@ -312,14 +311,14 @@ int ossl_prov_write_priv_der_from_obj(BIO *out, const void *obj, int obj_nid, int ossl_prov_write_priv_pem_from_obj(BIO *out, const void *obj, int obj_nid, int (*p2s)(const void *obj, int nid, - ASN1_STRING **str, + void **str, int *strtype), int (*k2d)(const void *obj, unsigned char **pder), struct pkcs8_encrypt_ctx_st *ctx) { int ret = 0; - ASN1_STRING *str = NULL; + void *str = NULL; int strtype = V_ASN1_UNDEF; if (p2s != NULL && !p2s(obj, obj_nid, &str, &strtype)) @@ -348,13 +347,13 @@ int ossl_prov_write_priv_pem_from_obj(BIO *out, const void *obj, int obj_nid, int ossl_prov_write_pub_der_from_obj(BIO *out, const void *obj, int obj_nid, int (*p2s)(const void *obj, int nid, - ASN1_STRING **str, + void **str, int *strtype), int (*k2d)(const void *obj, unsigned char **pder)) { int ret = 0; - ASN1_STRING *str = NULL; + void *str = NULL; int strtype = V_ASN1_UNDEF; X509_PUBKEY *xpk = NULL; @@ -373,13 +372,13 @@ int ossl_prov_write_pub_der_from_obj(BIO *out, const void *obj, int obj_nid, int ossl_prov_write_pub_pem_from_obj(BIO *out, const void *obj, int obj_nid, int (*p2s)(const void *obj, int nid, - ASN1_STRING **str, + void **str, int *strtype), int (*k2d)(const void *obj, unsigned char **pder)) { int ret = 0; - ASN1_STRING *str = NULL; + void *str = NULL; int strtype = V_ASN1_UNDEF; X509_PUBKEY *xpk = NULL; @@ -395,4 +394,3 @@ int ossl_prov_write_pub_pem_from_obj(BIO *out, const void *obj, int obj_nid, X509_PUBKEY_free(xpk); return ret; } - diff --git a/providers/implementations/serializers/serializer_dh.c b/providers/implementations/serializers/serializer_dh.c index 31ba175dd7..b2517ed947 100644 --- a/providers/implementations/serializers/serializer_dh.c +++ b/providers/implementations/serializers/serializer_dh.c @@ -107,7 +107,7 @@ int ossl_prov_print_dh(BIO *out, DH *dh, enum dh_print_type type) } int ossl_prov_prepare_dh_params(const void *dh, int nid, - ASN1_STRING **pstr, int *pstrtype) + void **pstr, int *pstrtype) { ASN1_STRING *params = ASN1_STRING_new(); diff --git a/providers/implementations/serializers/serializer_dsa.c b/providers/implementations/serializers/serializer_dsa.c index 16ecb0d952..c26be47e66 100644 --- a/providers/implementations/serializers/serializer_dsa.c +++ b/providers/implementations/serializers/serializer_dsa.c @@ -98,7 +98,7 @@ int ossl_prov_print_dsa(BIO *out, DSA *dsa, enum dsa_print_type type) } int ossl_prov_prepare_dsa_params(const void *dsa, int nid, - ASN1_STRING **pstr, int *pstrtype) + void **pstr, int *pstrtype) { ASN1_STRING *params = ASN1_STRING_new(); @@ -121,7 +121,7 @@ int ossl_prov_prepare_dsa_params(const void *dsa, int nid, } int ossl_prov_prepare_all_dsa_params(const void *dsa, int nid, - ASN1_STRING **pstr, int *pstrtype) + void **pstr, int *pstrtype) { const BIGNUM *p = DSA_get0_p(dsa); const BIGNUM *q = DSA_get0_q(dsa); diff --git a/providers/implementations/serializers/serializer_ec.c b/providers/implementations/serializers/serializer_ec.c new file mode 100644 index 0000000000..3d455f1507 --- /dev/null +++ b/providers/implementations/serializers/serializer_ec.c @@ -0,0 +1,150 @@ +/* + * Copyright 2020 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#include +#include "crypto/ec.h" +#include "prov/bio.h" /* ossl_prov_bio_printf() */ +#include "prov/implementations.h" /* ec_keymgmt_functions */ +#include "serializer_local.h" + +void ec_get_new_free_import(OSSL_OP_keymgmt_new_fn **ec_new, + OSSL_OP_keymgmt_free_fn **ec_free, + OSSL_OP_keymgmt_import_fn **ec_import) +{ + *ec_new = ossl_prov_get_keymgmt_new(ec_keymgmt_functions); + *ec_free = ossl_prov_get_keymgmt_free(ec_keymgmt_functions); + *ec_import = ossl_prov_get_keymgmt_import(ec_keymgmt_functions); +} + +static int ossl_prov_print_ec_param(BIO *out, const EC_GROUP *group) +{ + const char *curve_name; + int curve_nid = EC_GROUP_get_curve_name(group); + + /* TODO(3.0): Explicit parameters are currently not supported */ + if (curve_nid == NID_undef) + return 0; + + if (ossl_prov_bio_printf(out, "%s: %s\n", "ASN1 OID", + OBJ_nid2sn(curve_nid)) <= 0) + return 0; + + /* TODO(3.0): Only named curves are currently supported */ + curve_name = EC_curve_nid2nist(curve_nid); + return (curve_name == NULL + || ossl_prov_bio_printf(out, "%s: %s\n", "NIST CURVE", + curve_name) > 0); +} + +int ossl_prov_print_eckey(BIO *out, EC_KEY *eckey, enum ec_print_type type) +{ + int ret = 0; + const char *type_label = NULL; + unsigned char *priv = NULL, *pub = NULL; + size_t priv_len = 0, pub_len = 0; + const EC_GROUP *group; + + if (eckey == NULL || (group = EC_KEY_get0_group(eckey)) == NULL) + goto null_err; + + switch (type) { + case ec_print_priv: + type_label = "Private-Key"; + break; + case ec_print_pub: + type_label = "Public-Key"; + break; + case ec_print_params: + type_label = "EC-Parameters"; + break; + } + + if (type == ec_print_priv) { + const BIGNUM *priv_key = EC_KEY_get0_private_key(eckey); + + if (priv_key == NULL) + goto null_err; + priv_len = EC_KEY_priv2buf(eckey, &priv); + if (priv_len == 0) + goto err; + } + + if (type == ec_print_priv || type == ec_print_pub) { + const EC_POINT *pub_pt = EC_KEY_get0_public_key(eckey); + + if (pub_pt == NULL) + goto null_err; + + pub_len = EC_KEY_key2buf(eckey, EC_KEY_get_conv_form(eckey), &pub, NULL); + if (pub_len == 0) + goto err; + } + + if (ossl_prov_bio_printf(out, "%s: (%d bit)\n", type_label, + EC_GROUP_order_bits(group)) <= 0) + goto err; + if (priv != NULL + && !ossl_prov_print_labeled_buf(out, "priv:", priv, priv_len)) + goto err; + if (pub != NULL + && !ossl_prov_print_labeled_buf(out, "pub:", pub, pub_len)) + goto err; + ret = ossl_prov_print_ec_param(out, group); +err: + OPENSSL_clear_free(priv, priv_len); + OPENSSL_free(pub); + return ret; +null_err: + ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_NULL_PARAMETER); + goto err; +} + +int ossl_prov_prepare_ec_params(const void *eckey, int nid, + void **pstr, int *pstrtype) +{ + int curve_nid; + const EC_GROUP *group = EC_KEY_get0_group(eckey); + ASN1_OBJECT *params; + + if (group == NULL + || ((curve_nid = EC_GROUP_get_curve_name(group)) == NID_undef) + || ((params = OBJ_nid2obj(curve_nid)) == NULL)) { + /* TODO(3.0): Explicit curves are not supported */ + return 0; + } + + *pstr = params; + *pstrtype = V_ASN1_OBJECT; + return 1; +} + +int ossl_prov_ec_pub_to_der(const void *eckey, unsigned char **pder) +{ + return i2o_ECPublicKey(eckey, pder); +} + +int ossl_prov_ec_priv_to_der(const void *veckey, unsigned char **pder) +{ + EC_KEY *eckey = (EC_KEY *)veckey; + unsigned int old_flags; + int ret = 0; + + /* + * For PKCS8 the curve name appears in the PKCS8_PRIV_KEY_INFO object + * as the pkeyalg->parameter field. (For a named curve this is an OID) + * The pkey field is an octet string that holds the encoded + * ECPrivateKey SEQUENCE with the optional parameters field omitted. + * We omit this by setting the EC_PKEY_NO_PARAMETERS flag. + */ + old_flags = EC_KEY_get_enc_flags(eckey); /* save old flags */ + EC_KEY_set_enc_flags(eckey, old_flags | EC_PKEY_NO_PARAMETERS); + ret = i2d_ECPrivateKey(eckey, pder); + EC_KEY_set_enc_flags(eckey, old_flags); /* restore old flags */ + return ret; /* return the length of the der encoded data */ +} diff --git a/providers/implementations/serializers/serializer_ec_param.c b/providers/implementations/serializers/serializer_ec_param.c new file mode 100644 index 0000000000..fdeedb5dff --- /dev/null +++ b/providers/implementations/serializers/serializer_ec_param.c @@ -0,0 +1,153 @@ +/* + * Copyright 2020 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#include +#include +#include +#include +#include +#include "prov/bio.h" +#include "prov/implementations.h" +#include "prov/providercommonerr.h" +#include "serializer_local.h" + +static OSSL_OP_serializer_newctx_fn ec_param_newctx; +static OSSL_OP_serializer_freectx_fn ec_param_freectx; +static OSSL_OP_serializer_serialize_data_fn ec_param_der_data; +static OSSL_OP_serializer_serialize_object_fn ec_param_der; +static OSSL_OP_serializer_serialize_data_fn ec_param_pem_data; +static OSSL_OP_serializer_serialize_object_fn ec_param_pem; + +static OSSL_OP_serializer_serialize_data_fn ec_param_print_data; +static OSSL_OP_serializer_serialize_object_fn ec_param_print; + + +/* There is no specific implementation context, so use the provider context */ +static void *ec_param_newctx(void *provctx) +{ + return provctx; +} + +static void ec_param_freectx(void *vctx) +{ +} + +/* Public key : DER */ +static int ec_param_der_data(void *vctx, const OSSL_PARAM params[], BIO *out, + OSSL_PASSPHRASE_CALLBACK *cb, void *cbarg) +{ + OSSL_OP_keymgmt_new_fn *ec_new; + OSSL_OP_keymgmt_free_fn *ec_free; + OSSL_OP_keymgmt_import_fn *ec_import; + int ok = 0; + + ec_get_new_free_import(&ec_new, &ec_free, &ec_import); + + if (ec_import != NULL) { + EC_KEY *eckey; + + /* vctx == provctx */ + if ((eckey = ec_new(vctx)) != NULL + && ec_import(eckey, OSSL_KEYMGMT_SELECT_ALL_PARAMETERS, params) + && ec_param_der(vctx, eckey, out, cb, cbarg)) + ok = 1; + ec_free(eckey); + } + return ok; +} + +static int ec_param_der(void *vctx, void *eckey, BIO *out, + OSSL_PASSPHRASE_CALLBACK *cb, void *cbarg) +{ + return i2d_ECPKParameters_bio(out, EC_KEY_get0_group(eckey)); +} + +/* Public key : PEM */ +static int ec_param_pem_data(void *vctx, const OSSL_PARAM params[], BIO *out, + OSSL_PASSPHRASE_CALLBACK *cb, void *cbarg) +{ + OSSL_OP_keymgmt_new_fn *ec_new; + OSSL_OP_keymgmt_free_fn *ec_free; + OSSL_OP_keymgmt_import_fn *ec_import; + int ok = 0; + + ec_get_new_free_import(&ec_new, &ec_free, &ec_import); + + if (ec_import != NULL) { + EC_KEY *eckey; + + /* vctx == provctx */ + if ((eckey = ec_new(vctx)) != NULL + && ec_import(eckey, OSSL_KEYMGMT_SELECT_ALL_PARAMETERS, params) + && ec_param_pem(vctx, eckey, out, cb, cbarg)) + ok = 1; + ec_free(eckey); + } + return ok; +} + +static int ec_param_pem(void *vctx, void *eckey, BIO *out, + OSSL_PASSPHRASE_CALLBACK *cb, void *cbarg) +{ + return PEM_write_bio_ECPKParameters(out, EC_KEY_get0_group(eckey)); +} + +static int ec_param_print_data(void *vctx, const OSSL_PARAM params[], BIO *out, + OSSL_PASSPHRASE_CALLBACK *cb, void *cbarg) +{ + OSSL_OP_keymgmt_new_fn *ec_new; + OSSL_OP_keymgmt_free_fn *ec_free; + OSSL_OP_keymgmt_import_fn *ec_import; + int ok = 0; + + ec_get_new_free_import(&ec_new, &ec_free, &ec_import); + + if (ec_import != NULL) { + EC_KEY *eckey; + + /* vctx == provctx */ + if ((eckey = ec_new(vctx)) != NULL + && ec_import(eckey, OSSL_KEYMGMT_SELECT_ALL_PARAMETERS, params) + && ec_param_print(vctx, eckey, out, cb, cbarg)) + ok = 1; + ec_free(eckey); + } + return ok; +} + +static int ec_param_print(void *vctx, void *eckey, BIO *out, + OSSL_PASSPHRASE_CALLBACK *cb, void *cbarg) +{ + return ossl_prov_print_eckey(out, eckey, ec_print_params); +} + +const OSSL_DISPATCH ec_param_der_serializer_functions[] = { + { OSSL_FUNC_SERIALIZER_NEWCTX, (void (*)(void))ec_param_newctx }, + { OSSL_FUNC_SERIALIZER_FREECTX, (void (*)(void))ec_param_freectx }, + { OSSL_FUNC_SERIALIZER_SERIALIZE_DATA, (void (*)(void))ec_param_der_data }, + { OSSL_FUNC_SERIALIZER_SERIALIZE_OBJECT, (void (*)(void))ec_param_der }, + { 0, NULL } +}; + +const OSSL_DISPATCH ec_param_pem_serializer_functions[] = { + { OSSL_FUNC_SERIALIZER_NEWCTX, (void (*)(void))ec_param_newctx }, + { OSSL_FUNC_SERIALIZER_FREECTX, (void (*)(void))ec_param_freectx }, + { OSSL_FUNC_SERIALIZER_SERIALIZE_DATA, (void (*)(void))ec_param_pem_data }, + { OSSL_FUNC_SERIALIZER_SERIALIZE_OBJECT, (void (*)(void))ec_param_pem }, + { 0, NULL } +}; + +const OSSL_DISPATCH ec_param_text_serializer_functions[] = { + { OSSL_FUNC_SERIALIZER_NEWCTX, (void (*)(void))ec_param_newctx }, + { OSSL_FUNC_SERIALIZER_FREECTX, (void (*)(void))ec_param_freectx }, + { OSSL_FUNC_SERIALIZER_SERIALIZE_OBJECT, (void (*)(void))ec_param_print }, + { OSSL_FUNC_SERIALIZER_SERIALIZE_DATA, + (void (*)(void))ec_param_print_data }, + { 0, NULL } +}; diff --git a/providers/implementations/serializers/serializer_ec_priv.c b/providers/implementations/serializers/serializer_ec_priv.c new file mode 100644 index 0000000000..14ff2ae60e --- /dev/null +++ b/providers/implementations/serializers/serializer_ec_priv.c @@ -0,0 +1,261 @@ +/* + * Copyright 2020 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#include +#include +#include +#include +#include +#include +#include +#include "prov/bio.h" +#include "prov/implementations.h" +#include "serializer_local.h" + +static OSSL_OP_serializer_newctx_fn ec_priv_newctx; +static OSSL_OP_serializer_freectx_fn ec_priv_freectx; +static OSSL_OP_serializer_set_ctx_params_fn ec_priv_set_ctx_params; +static OSSL_OP_serializer_settable_ctx_params_fn ec_priv_settable_ctx_params; +static OSSL_OP_serializer_serialize_data_fn ec_priv_der_data; +static OSSL_OP_serializer_serialize_object_fn ec_priv_der; +static OSSL_OP_serializer_serialize_data_fn ec_pem_priv_data; +static OSSL_OP_serializer_serialize_object_fn ec_pem_priv; + +static OSSL_OP_serializer_newctx_fn ec_print_newctx; +static OSSL_OP_serializer_freectx_fn ec_print_freectx; +static OSSL_OP_serializer_serialize_data_fn ec_priv_print_data; +static OSSL_OP_serializer_serialize_object_fn ec_priv_print; + + /* + * Context used for private key serialization. + */ +struct ec_priv_ctx_st { + void *provctx; + + struct pkcs8_encrypt_ctx_st sc; +}; + +/* Private key : context */ +static void *ec_priv_newctx(void *provctx) +{ + struct ec_priv_ctx_st *ctx = OPENSSL_zalloc(sizeof(*ctx)); + + if (ctx != NULL) { + ctx->provctx = provctx; + + /* -1 is the "whatever" indicator, i.e. the PKCS8 library default PBE */ + ctx->sc.pbe_nid = -1; + } + return ctx; +} + +static void ec_priv_freectx(void *vctx) +{ + struct ec_priv_ctx_st *ctx = vctx; + + EVP_CIPHER_free(ctx->sc.cipher); + OPENSSL_free(ctx->sc.cipher_pass); + OPENSSL_free(ctx); +} + +static const OSSL_PARAM *ec_priv_settable_ctx_params(void) +{ + static const OSSL_PARAM settables[] = { + OSSL_PARAM_utf8_string(OSSL_SERIALIZER_PARAM_CIPHER, NULL, 0), + OSSL_PARAM_octet_string(OSSL_SERIALIZER_PARAM_PASS, NULL, 0), + OSSL_PARAM_END, + }; + + return settables; +} + +static int ec_priv_set_ctx_params(void *vctx, const OSSL_PARAM params[]) +{ + struct ec_priv_ctx_st *ctx = vctx; + const OSSL_PARAM *p; + + if ((p = OSSL_PARAM_locate_const(params, OSSL_SERIALIZER_PARAM_CIPHER)) + != NULL) { + const OSSL_PARAM *propsp = + OSSL_PARAM_locate_const(params, OSSL_SERIALIZER_PARAM_PROPERTIES); + const char *props = NULL; + + if (p->data_type != OSSL_PARAM_UTF8_STRING) + return 0; + if (propsp != NULL && propsp->data_type != OSSL_PARAM_UTF8_STRING) + return 0; + props = (propsp != NULL ? propsp->data : NULL); + + EVP_CIPHER_free(ctx->sc.cipher); + ctx->sc.cipher_intent = p->data != NULL; + if (p->data != NULL + && ((ctx->sc.cipher = EVP_CIPHER_fetch(NULL, p->data, props)) + == NULL)) + return 0; + } + if ((p = OSSL_PARAM_locate_const(params, OSSL_SERIALIZER_PARAM_PASS)) + != NULL) { + OPENSSL_free(ctx->sc.cipher_pass); + ctx->sc.cipher_pass = NULL; + if (!OSSL_PARAM_get_octet_string(p, &ctx->sc.cipher_pass, 0, + &ctx->sc.cipher_pass_length)) + return 0; + } + return 1; +} + +/* Private key : DER */ +static int ec_priv_der_data(void *vctx, const OSSL_PARAM params[], BIO *out, + OSSL_PASSPHRASE_CALLBACK *cb, void *cbarg) +{ + struct ec_priv_ctx_st *ctx = vctx; + OSSL_OP_keymgmt_new_fn *ec_new; + OSSL_OP_keymgmt_free_fn *ec_free; + OSSL_OP_keymgmt_import_fn *ec_import; + int ok = 0; + + ec_get_new_free_import(&ec_new, &ec_free, &ec_import); + + if (ec_import != NULL) { + EC_KEY *eckey; + + if ((eckey = ec_new(ctx->provctx)) != NULL + && ec_import(eckey, OSSL_KEYMGMT_SELECT_KEYPAIR, params) + && ec_priv_der(ctx, eckey, out, cb, cbarg)) + ok = 1; + ec_free(eckey); + } + return ok; +} + +static int ec_priv_der(void *vctx, void *eckey, BIO *out, + OSSL_PASSPHRASE_CALLBACK *cb, void *cbarg) +{ + struct ec_priv_ctx_st *ctx = vctx; + + ctx->sc.cb = cb; + ctx->sc.cbarg = cbarg; + + return ossl_prov_write_priv_der_from_obj(out, eckey, EVP_PKEY_EC, + ossl_prov_prepare_ec_params, + ossl_prov_ec_priv_to_der, + &ctx->sc); +} + +/* Private key : PEM */ +static int ec_pem_priv_data(void *vctx, const OSSL_PARAM params[], BIO *out, + OSSL_PASSPHRASE_CALLBACK *cb, void *cbarg) +{ + struct ec_priv_ctx_st *ctx = vctx; + OSSL_OP_keymgmt_new_fn *ec_new; + OSSL_OP_keymgmt_free_fn *ec_free; + OSSL_OP_keymgmt_import_fn *ec_import; + int ok = 0; + + ec_get_new_free_import(&ec_new, &ec_free, &ec_import); + + if (ec_import != NULL) { + EC_KEY *eckey; + + if ((eckey = ec_new(ctx->provctx)) != NULL + && ec_import(eckey, OSSL_KEYMGMT_SELECT_KEYPAIR, params) + && ec_pem_priv(ctx, eckey, out, cb, cbarg)) + ok = 1; + ec_free(eckey); + } + return ok; +} + +static int ec_pem_priv(void *vctx, void *eckey, BIO *out, + OSSL_PASSPHRASE_CALLBACK *cb, void *cbarg) +{ + struct ec_priv_ctx_st *ctx = vctx; + + ctx->sc.cb = cb; + ctx->sc.cbarg = cbarg; + + return ossl_prov_write_priv_pem_from_obj(out, eckey, EVP_PKEY_EC, + ossl_prov_prepare_ec_params, + ossl_prov_ec_priv_to_der, + &ctx->sc); +} + +/* + * There's no specific print context, so we use the provider context + */ +static void *ec_print_newctx(void *provctx) +{ + return provctx; +} + +static void ec_print_freectx(void *ctx) +{ +} + +static int ec_priv_print_data(void *vctx, const OSSL_PARAM params[], BIO *out, + OSSL_PASSPHRASE_CALLBACK *cb, void *cbarg) +{ + struct ec_priv_ctx_st *ctx = vctx; + OSSL_OP_keymgmt_new_fn *ec_new; + OSSL_OP_keymgmt_free_fn *ec_free; + OSSL_OP_keymgmt_import_fn *ec_import; + int ok = 0; + + ec_get_new_free_import(&ec_new, &ec_free, &ec_import); + + if (ec_import != NULL) { + EC_KEY *eckey; + + if ((eckey = ec_new(ctx->provctx)) != NULL + && ec_import(eckey, OSSL_KEYMGMT_SELECT_KEYPAIR, params) + && ec_priv_print(ctx, eckey, out, cb, cbarg)) + ok = 1; + ec_free(eckey); + } + return ok; +} + +static int ec_priv_print(void *vctx, void *eckey, BIO *out, + OSSL_PASSPHRASE_CALLBACK *cb, void *cbarg) +{ + return ossl_prov_print_eckey(out, eckey, ec_print_priv); +} + +const OSSL_DISPATCH ec_priv_der_serializer_functions[] = { + { OSSL_FUNC_SERIALIZER_NEWCTX, (void (*)(void))ec_priv_newctx }, + { OSSL_FUNC_SERIALIZER_FREECTX, (void (*)(void))ec_priv_freectx }, + { OSSL_FUNC_SERIALIZER_SET_CTX_PARAMS, + (void (*)(void))ec_priv_set_ctx_params }, + { OSSL_FUNC_SERIALIZER_SETTABLE_CTX_PARAMS, + (void (*)(void))ec_priv_settable_ctx_params }, + { OSSL_FUNC_SERIALIZER_SERIALIZE_DATA, (void (*)(void))ec_priv_der_data }, + { OSSL_FUNC_SERIALIZER_SERIALIZE_OBJECT, (void (*)(void))ec_priv_der }, + { 0, NULL } +}; + +const OSSL_DISPATCH ec_priv_pem_serializer_functions[] = { + { OSSL_FUNC_SERIALIZER_NEWCTX, (void (*)(void))ec_priv_newctx }, + { OSSL_FUNC_SERIALIZER_FREECTX, (void (*)(void))ec_priv_freectx }, + { OSSL_FUNC_SERIALIZER_SET_CTX_PARAMS, + (void (*)(void))ec_priv_set_ctx_params }, + { OSSL_FUNC_SERIALIZER_SETTABLE_CTX_PARAMS, + (void (*)(void))ec_priv_settable_ctx_params }, + { OSSL_FUNC_SERIALIZER_SERIALIZE_DATA, (void (*)(void))ec_pem_priv_data }, + { OSSL_FUNC_SERIALIZER_SERIALIZE_OBJECT, (void (*)(void))ec_pem_priv }, + { 0, NULL } +}; + +const OSSL_DISPATCH ec_priv_text_serializer_functions[] = { + { OSSL_FUNC_SERIALIZER_NEWCTX, (void (*)(void))ec_print_newctx }, + { OSSL_FUNC_SERIALIZER_FREECTX, (void (*)(void))ec_print_freectx }, + { OSSL_FUNC_SERIALIZER_SERIALIZE_OBJECT, (void (*)(void))ec_priv_print }, + { OSSL_FUNC_SERIALIZER_SERIALIZE_DATA, + (void (*)(void))ec_priv_print_data }, + { 0, NULL } +}; diff --git a/providers/implementations/serializers/serializer_ec_pub.c b/providers/implementations/serializers/serializer_ec_pub.c new file mode 100644 index 0000000000..e9d90f1d20 --- /dev/null +++ b/providers/implementations/serializers/serializer_ec_pub.c @@ -0,0 +1,159 @@ +/* + * Copyright 2020 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#include +#include +#include +#include +#include +#include "prov/bio.h" +#include "prov/implementations.h" +#include "serializer_local.h" + +static OSSL_OP_serializer_newctx_fn ec_pub_newctx; +static OSSL_OP_serializer_freectx_fn ec_pub_freectx; +static OSSL_OP_serializer_serialize_data_fn ec_pub_der_data; +static OSSL_OP_serializer_serialize_object_fn ec_pub_der; +static OSSL_OP_serializer_serialize_data_fn ec_pub_pem_data; +static OSSL_OP_serializer_serialize_object_fn ec_pub_pem; + +static OSSL_OP_serializer_serialize_data_fn ec_pub_print_data; +static OSSL_OP_serializer_serialize_object_fn ec_pub_print; + +/* Public key : context */ + +/* + * There's no specific implementation context, so we use the provider context + */ +static void *ec_pub_newctx(void *provctx) +{ + return provctx; +} + +static void ec_pub_freectx(void *ctx) +{ +} + +/* Public key : DER */ +static int ec_pub_der_data(void *vctx, const OSSL_PARAM params[], BIO *out, + OSSL_PASSPHRASE_CALLBACK *cb, void *cbarg) +{ + OSSL_OP_keymgmt_new_fn *ec_new; + OSSL_OP_keymgmt_free_fn *ec_free; + OSSL_OP_keymgmt_import_fn *ec_import; + int ok = 0; + + ec_get_new_free_import(&ec_new, &ec_free, &ec_import); + + if (ec_import != NULL) { + EC_KEY *eckey; + + /* vctx == provctx */ + if ((eckey = ec_new(vctx)) != NULL + && ec_import(eckey, OSSL_KEYMGMT_SELECT_KEYPAIR, params) + && ec_pub_der(vctx, eckey, out, cb, cbarg)) + ok = 1; + ec_free(eckey); + } + return ok; +} + +static int ec_pub_der(void *ctx, void *eckey, BIO *out, + OSSL_PASSPHRASE_CALLBACK *cb, void *cbarg) +{ + return ossl_prov_write_pub_der_from_obj(out, eckey, EVP_PKEY_EC, + ossl_prov_prepare_ec_params, + ossl_prov_ec_pub_to_der); +} + +/* Public key : PEM */ +static int ec_pub_pem_data(void *vctx, const OSSL_PARAM params[], BIO *out, + OSSL_PASSPHRASE_CALLBACK *cb, void *cbarg) +{ + OSSL_OP_keymgmt_new_fn *ec_new; + OSSL_OP_keymgmt_free_fn *ec_free; + OSSL_OP_keymgmt_import_fn *ec_import; + int ok = 0; + + ec_get_new_free_import(&ec_new, &ec_free, &ec_import); + + if (ec_import != NULL) { + EC_KEY *eckey; + + /* ctx == provctx */ + if ((eckey = ec_new(vctx)) != NULL + && ec_import(eckey, OSSL_KEYMGMT_SELECT_KEYPAIR, params) + && ec_pub_pem(vctx, eckey, out, cb, cbarg)) + ok = 1; + ec_free(eckey); + } + return ok; +} + +static int ec_pub_pem(void *vctx, void *eckey, BIO *out, + OSSL_PASSPHRASE_CALLBACK *cb, void *cbarg) +{ + return ossl_prov_write_pub_pem_from_obj(out, eckey, EVP_PKEY_EC, + ossl_prov_prepare_ec_params, + ossl_prov_ec_pub_to_der); +} + +static int ec_pub_print_data(void *vctx, const OSSL_PARAM params[], BIO *out, + OSSL_PASSPHRASE_CALLBACK *cb, void *cbarg) +{ + OSSL_OP_keymgmt_new_fn *ec_new; + OSSL_OP_keymgmt_free_fn *ec_free; + OSSL_OP_keymgmt_import_fn *ec_import; + int ok = 0; + + ec_get_new_free_import(&ec_new, &ec_free, &ec_import); + + if (ec_import != NULL) { + EC_KEY *eckey; + + /* ctx == provctx */ + if ((eckey = ec_new(vctx)) != NULL + && ec_import(eckey, OSSL_KEYMGMT_SELECT_KEYPAIR, params) + && ec_pub_print(vctx, eckey, out, cb, cbarg)) + ok = 1; + ec_free(eckey); + } + return ok; +} + +static int ec_pub_print(void *vctx, void *eckey, BIO *out, + OSSL_PASSPHRASE_CALLBACK *cb, void *cbarg) +{ + return ossl_prov_print_eckey(out, eckey, ec_print_pub); +} + +const OSSL_DISPATCH ec_pub_der_serializer_functions[] = { + { OSSL_FUNC_SERIALIZER_NEWCTX, (void (*)(void))ec_pub_newctx }, + { OSSL_FUNC_SERIALIZER_FREECTX, (void (*)(void))ec_pub_freectx }, + { OSSL_FUNC_SERIALIZER_SERIALIZE_DATA, (void (*)(void))ec_pub_der_data }, + { OSSL_FUNC_SERIALIZER_SERIALIZE_OBJECT, (void (*)(void))ec_pub_der }, + { 0, NULL } +}; + +const OSSL_DISPATCH ec_pub_pem_serializer_functions[] = { + { OSSL_FUNC_SERIALIZER_NEWCTX, (void (*)(void))ec_pub_newctx }, + { OSSL_FUNC_SERIALIZER_FREECTX, (void (*)(void))ec_pub_freectx }, + { OSSL_FUNC_SERIALIZER_SERIALIZE_DATA, (void (*)(void))ec_pub_pem_data }, + { OSSL_FUNC_SERIALIZER_SERIALIZE_OBJECT, (void (*)(void))ec_pub_pem }, + { 0, NULL } +}; + +const OSSL_DISPATCH ec_pub_text_serializer_functions[] = { + { OSSL_FUNC_SERIALIZER_NEWCTX, (void (*)(void))ec_pub_newctx }, + { OSSL_FUNC_SERIALIZER_FREECTX, (void (*)(void))ec_pub_freectx }, + { OSSL_FUNC_SERIALIZER_SERIALIZE_OBJECT, (void (*)(void))ec_pub_print }, + { OSSL_FUNC_SERIALIZER_SERIALIZE_DATA, + (void (*)(void))ec_pub_print_data }, + { 0, NULL } +}; diff --git a/providers/implementations/serializers/serializer_local.h b/providers/implementations/serializers/serializer_local.h index ec27f1443b..3125dc8f74 100644 --- a/providers/implementations/serializers/serializer_local.h +++ b/providers/implementations/serializers/serializer_local.h @@ -50,8 +50,17 @@ OSSL_OP_keymgmt_new_fn *ossl_prov_get_keymgmt_dsa_new(void); OSSL_OP_keymgmt_free_fn *ossl_prov_get_keymgmt_dsa_free(void); OSSL_OP_keymgmt_import_fn *ossl_prov_get_keymgmt_dsa_import(void); +void ec_get_new_free_import(OSSL_OP_keymgmt_new_fn **ec_new, + OSSL_OP_keymgmt_free_fn **ec_free, + OSSL_OP_keymgmt_import_fn **ec_import); + +int ossl_prov_prepare_ec_params(const void *eckey, int nid, + void **pstr, int *pstrtype); +int ossl_prov_ec_pub_to_der(const void *eckey, unsigned char **pder); +int ossl_prov_ec_priv_to_der(const void *eckey, unsigned char **pder); + int ossl_prov_prepare_dh_params(const void *dh, int nid, - ASN1_STRING **pstr, int *pstrtype); + void **pstr, int *pstrtype); int ossl_prov_dh_pub_to_der(const void *dh, unsigned char **pder); int ossl_prov_dh_priv_to_der(const void *dh, unsigned char **pder); @@ -63,14 +72,14 @@ int ossl_prov_ecx_pub_to_der(const void *ecxkey, unsigned char **pder); int ossl_prov_ecx_priv_to_der(const void *ecxkey, unsigned char **pder); int ossl_prov_prepare_dsa_params(const void *dsa, int nid, - ASN1_STRING **pstr, int *pstrtype); + void **pstr, int *pstrtype); /* * Special variant of ossl_prov_prepare_dsa_params() that requires all * three parameters (P, Q and G) to be set. This is used when serializing * the public key. */ int ossl_prov_prepare_all_dsa_params(const void *dsa, int nid, - ASN1_STRING **pstr, int *pstrtype); + void **pstr, int *pstrtype); int ossl_prov_dsa_pub_to_der(const void *dsa, unsigned char **pder); int ossl_prov_dsa_priv_to_der(const void *dsa, unsigned char **pder); @@ -88,6 +97,16 @@ enum dh_print_type { int ossl_prov_print_dh(BIO *out, DH *dh, enum dh_print_type type); +#ifndef OPENSSL_NO_EC +enum ec_print_type { + ec_print_priv, + ec_print_pub, + ec_print_params +}; + +int ossl_prov_print_eckey(BIO *out, EC_KEY *eckey, enum ec_print_type type); +#endif /* OPENSSL_NO_EC */ + enum dsa_print_type { dsa_print_priv, dsa_print_pub, @@ -107,27 +126,27 @@ int ossl_prov_print_ecx(BIO *out, ECX_KEY *ecxkey, enum ecx_print_type type); int ossl_prov_write_priv_der_from_obj(BIO *out, const void *obj, int obj_nid, int (*p2s)(const void *obj, int nid, - ASN1_STRING **str, + void **str, int *strtype), int (*k2d)(const void *obj, unsigned char **pder), struct pkcs8_encrypt_ctx_st *ctx); int ossl_prov_write_priv_pem_from_obj(BIO *out, const void *obj, int obj_nid, int (*p2s)(const void *obj, int nid, - ASN1_STRING **str, + void **str, int *strtype), int (*k2d)(const void *obj, unsigned char **pder), struct pkcs8_encrypt_ctx_st *ctx); int ossl_prov_write_pub_der_from_obj(BIO *out, const void *obj, int obj_nid, int (*p2s)(const void *obj, int nid, - ASN1_STRING **str, + void **str, int *strtype), int (*k2d)(const void *obj, unsigned char **pder)); int ossl_prov_write_pub_pem_from_obj(BIO *out, const void *obj, int obj_nid, int (*p2s)(const void *obj, int nid, - ASN1_STRING **str, + void **str, int *strtype), int (*k2d)(const void *obj, unsigned char **pder)); diff --git a/providers/implementations/serializers/serializer_rsa_priv.c b/providers/implementations/serializers/serializer_rsa_priv.c index 8ac9f30ad5..23042041de 100644 --- a/providers/implementations/serializers/serializer_rsa_priv.c +++ b/providers/implementations/serializers/serializer_rsa_priv.c @@ -52,7 +52,7 @@ struct rsa_priv_ctx_st { /* Helper functions to prepare RSA-PSS params for serialization */ static int prepare_rsa_params(const void *rsa, int nid, - ASN1_STRING **pstr, int *pstrtype) + void **pstr, int *pstrtype) { const RSA_PSS_PARAMS *pss = RSA_get0_pss_params(rsa); *pstr = NULL; @@ -68,7 +68,8 @@ static int prepare_rsa_params(const void *rsa, int nid, return 1; } /* Encode PSS parameters */ - if (ASN1_item_pack((void *)pss, ASN1_ITEM_rptr(RSA_PSS_PARAMS), pstr) + if (ASN1_item_pack((void *)pss, ASN1_ITEM_rptr(RSA_PSS_PARAMS), + (ASN1_STRING **)pstr) == NULL) return 0; diff --git a/test/build.info b/test/build.info index 5965616d80..ea350e5d6a 100644 --- a/test/build.info +++ b/test/build.info @@ -144,7 +144,7 @@ IF[{- !$disabled{tests} -}] SOURCE[evp_pkey_provided_test]=evp_pkey_provided_test.c INCLUDE[evp_pkey_provided_test]=../include ../apps/include - DEPEND[evp_pkey_provided_test]=../libcrypto libtestutil.a + DEPEND[evp_pkey_provided_test]=../libcrypto.a libtestutil.a IF[{- !$disabled{'deprecated-3.0'} -}] PROGRAMS{noinst}=igetest bftest casttest diff --git a/test/evp_pkey_provided_test.c b/test/evp_pkey_provided_test.c index c161698505..6f7f3986e9 100644 --- a/test/evp_pkey_provided_test.c +++ b/test/evp_pkey_provided_test.c @@ -1,5 +1,5 @@ /* - * Copyright 2019 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -15,6 +15,7 @@ #include #include "crypto/ecx.h" #include "internal/nelem.h" +#include "internal/param_build.h" #include "crypto/evp.h" /* For the internal API */ #include "testutil.h" @@ -155,7 +156,7 @@ static int test_print_key_type_using_serializer(const char *alg, int type, const char *pq; OSSL_SERIALIZER_CTX *ctx = NULL; BIO *membio = BIO_new(BIO_s_mem()); - int ret = 1; + int ret = 0; switch (type) { case PRIV_TEXT: @@ -187,10 +188,8 @@ static int test_print_key_type_using_serializer(const char *alg, int type, goto err; } - if (!TEST_ptr(membio)) { - ret = 0; + if (!TEST_ptr(membio)) goto err; - } /* Make a context, it's valid for several prints */ TEST_note("Setting up a OSSL_SERIALIZER context with passphrase"); @@ -203,7 +202,7 @@ static int test_print_key_type_using_serializer(const char *alg, int type, TEST_note("Testing with no encryption"); if (!TEST_true(OSSL_SERIALIZER_to_bio(ctx, membio)) || !TEST_true(compare_with_file(alg, type, membio))) - ret = 0; + goto err; if (type == PRIV_PEM) { /* Set a passphrase to be used later */ @@ -216,22 +215,22 @@ static int test_print_key_type_using_serializer(const char *alg, int type, TEST_note("Displaying PEM encrypted with AES-256-CBC"); if (!TEST_true(OSSL_SERIALIZER_CTX_set_cipher(ctx, "AES-256-CBC", NULL)) || !TEST_true(OSSL_SERIALIZER_to_bio(ctx, bio_out))) - ret = 0; + goto err; /* Use an invalid cipher name, which should generate no output */ TEST_note("NOT Displaying PEM encrypted with (invalid) FOO"); if (!TEST_false(OSSL_SERIALIZER_CTX_set_cipher(ctx, "FOO", NULL)) || !TEST_false(OSSL_SERIALIZER_to_bio(ctx, bio_out))) - ret = 0; + goto err; /* Clear the cipher. This should give us an unencrypted PEM again */ TEST_note("Testing with encryption cleared (no encryption)"); if (!TEST_true(OSSL_SERIALIZER_CTX_set_cipher(ctx, NULL, NULL)) || !TEST_true(OSSL_SERIALIZER_to_bio(ctx, membio)) || !TEST_true(compare_with_file(alg, type, membio))) - ret = 0; + goto err; } - + ret = 1; err: BIO_free(membio); OSSL_SERIALIZER_CTX_free(ctx); @@ -479,13 +478,79 @@ static int test_fromdata_ecx(int tst) ret = test_print_key_using_pem(alg, pk) && test_print_key_using_serializer(alg, pk); - err: +err: EVP_PKEY_free(pk); EVP_PKEY_CTX_free(ctx); return ret; } -#endif + +static int test_fromdata_ec(void) +{ + int ret = 0; + EVP_PKEY_CTX *ctx = NULL; + EVP_PKEY *pk = NULL; + OSSL_PARAM_BLD bld; + BIGNUM *ec_priv_bn = NULL; + OSSL_PARAM *fromdata_params = NULL; + const char *alg = "EC"; + static const unsigned char ec_pub_keydata[] = { + 0x04, + 0x1b, 0x93, 0x67, 0x55, 0x1c, 0x55, 0x9f, 0x63, + 0xd1, 0x22, 0xa4, 0xd8, 0xd1, 0x0a, 0x60, 0x6d, + 0x02, 0xa5, 0x77, 0x57, 0xc8, 0xa3, 0x47, 0x73, + 0x3a, 0x6a, 0x08, 0x28, 0x39, 0xbd, 0xc9, 0xd2, + 0x80, 0xec, 0xe9, 0xa7, 0x08, 0x29, 0x71, 0x2f, + 0xc9, 0x56, 0x82, 0xee, 0x9a, 0x85, 0x0f, 0x6d, + 0x7f, 0x59, 0x5f, 0x8c, 0xd1, 0x96, 0x0b, 0xdf, + 0x29, 0x3e, 0x49, 0x07, 0x88, 0x3f, 0x9a, 0x29 + }; + static const unsigned char ec_priv_keydata[] = { + 0x33, 0xd0, 0x43, 0x83, 0xa9, 0x89, 0x56, 0x03, + 0xd2, 0xd7, 0xfe, 0x6b, 0x01, 0x6f, 0xe4, 0x59, + 0xcc, 0x0d, 0x9a, 0x24, 0x6c, 0x86, 0x1b, 0x2e, + 0xdc, 0x4b, 0x4d, 0x35, 0x43, 0xe1, 0x1b, 0xad + }; + + ossl_param_bld_init(&bld); + + if (!TEST_ptr(ec_priv_bn = BN_bin2bn(ec_priv_keydata, + sizeof(ec_priv_keydata), NULL))) + goto err; + + if (ossl_param_bld_push_utf8_string(&bld, OSSL_PKEY_PARAM_EC_NAME, + "prime256v1", 0) <= 0) + goto err; + if (ossl_param_bld_push_octet_string(&bld, OSSL_PKEY_PARAM_PUB_KEY, + ec_pub_keydata, + sizeof(ec_pub_keydata)) <= 0) + goto err; + if (ossl_param_bld_push_BN(&bld, OSSL_PKEY_PARAM_PRIV_KEY, ec_priv_bn) <= 0) + goto err; + if (!TEST_ptr(fromdata_params = ossl_param_bld_to_param(&bld))) + goto err; + ctx = EVP_PKEY_CTX_new_from_name(NULL, alg, NULL); + if (!TEST_ptr(ctx)) + goto err; + + if (!TEST_true(EVP_PKEY_key_fromdata_init(ctx)) + || !TEST_true(EVP_PKEY_fromdata(ctx, &pk, fromdata_params)) + || !TEST_int_eq(EVP_PKEY_bits(pk), 256) + || !TEST_int_eq(EVP_PKEY_security_bits(pk), 128) + || !TEST_int_eq(EVP_PKEY_size(pk), 2 + 35 * 2)) + goto err; + + ret = test_print_key_using_pem(alg, pk) + && test_print_key_using_serializer(alg, pk); +err: + BN_free(ec_priv_bn); + ossl_param_bld_free(fromdata_params); + EVP_PKEY_free(pk); + EVP_PKEY_CTX_free(ctx); + return ret; +} + +#endif /* OPENSSL_NO_EC */ int setup_tests(void) @@ -504,6 +569,7 @@ int setup_tests(void) #endif #ifndef OPENSSL_NO_EC ADD_ALL_TESTS(test_fromdata_ecx, 2); + ADD_TEST(test_fromdata_ec); #endif return 1; } diff --git a/test/recipes/30-test_evp_pkey_provided.t b/test/recipes/30-test_evp_pkey_provided.t index 74b366451d..d9efbeaa66 100644 --- a/test/recipes/30-test_evp_pkey_provided.t +++ b/test/recipes/30-test_evp_pkey_provided.t @@ -1,6 +1,5 @@ #! /usr/bin/env perl -# Copyright 2018 The OpenSSL Project Authors. All Rights Reserved. -# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright 2020 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the Apache License 2.0 (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy diff --git a/test/recipes/30-test_evp_pkey_provided/EC.priv.der b/test/recipes/30-test_evp_pkey_provided/EC.priv.der new file mode 100644 index 0000000000..2f74cfc1ae Binary files /dev/null and b/test/recipes/30-test_evp_pkey_provided/EC.priv.der differ diff --git a/test/recipes/30-test_evp_pkey_provided/EC.priv.pem b/test/recipes/30-test_evp_pkey_provided/EC.priv.pem new file mode 100644 index 0000000000..953b7a619c --- /dev/null +++ b/test/recipes/30-test_evp_pkey_provided/EC.priv.pem @@ -0,0 +1,5 @@ +-----BEGIN PRIVATE KEY----- +MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgM9BDg6mJVgPS1/5r +AW/kWcwNmiRshhsu3EtNNUPhG62hRANCAAQbk2dVHFWfY9EipNjRCmBtAqV3V8ij +R3M6aggoOb3J0oDs6acIKXEvyVaC7pqFD21/WV+M0ZYL3yk+SQeIP5op +-----END PRIVATE KEY----- diff --git a/test/recipes/30-test_evp_pkey_provided/EC.priv.txt b/test/recipes/30-test_evp_pkey_provided/EC.priv.txt new file mode 100644 index 0000000000..9360d892af --- /dev/null +++ b/test/recipes/30-test_evp_pkey_provided/EC.priv.txt @@ -0,0 +1,13 @@ +Private-Key: (256 bit) +priv: + 33:d0:43:83:a9:89:56:03:d2:d7:fe:6b:01:6f:e4: + 59:cc:0d:9a:24:6c:86:1b:2e:dc:4b:4d:35:43:e1: + 1b:ad +pub: + 04:1b:93:67:55:1c:55:9f:63:d1:22:a4:d8:d1:0a: + 60:6d:02:a5:77:57:c8:a3:47:73:3a:6a:08:28:39: + bd:c9:d2:80:ec:e9:a7:08:29:71:2f:c9:56:82:ee: + 9a:85:0f:6d:7f:59:5f:8c:d1:96:0b:df:29:3e:49: + 07:88:3f:9a:29 +ASN1 OID: prime256v1 +NIST CURVE: P-256 diff --git a/test/recipes/30-test_evp_pkey_provided/EC.pub.der b/test/recipes/30-test_evp_pkey_provided/EC.pub.der new file mode 100644 index 0000000000..b08f9a745f Binary files /dev/null and b/test/recipes/30-test_evp_pkey_provided/EC.pub.der differ diff --git a/test/recipes/30-test_evp_pkey_provided/EC.pub.pem b/test/recipes/30-test_evp_pkey_provided/EC.pub.pem new file mode 100644 index 0000000000..16ec838271 --- /dev/null +++ b/test/recipes/30-test_evp_pkey_provided/EC.pub.pem @@ -0,0 +1,4 @@ +-----BEGIN PUBLIC KEY----- +MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEG5NnVRxVn2PRIqTY0QpgbQKld1fI +o0dzOmoIKDm9ydKA7OmnCClxL8lWgu6ahQ9tf1lfjNGWC98pPkkHiD+aKQ== +-----END PUBLIC KEY----- diff --git a/test/recipes/30-test_evp_pkey_provided/EC.pub.txt b/test/recipes/30-test_evp_pkey_provided/EC.pub.txt new file mode 100644 index 0000000000..612ba89bb6 --- /dev/null +++ b/test/recipes/30-test_evp_pkey_provided/EC.pub.txt @@ -0,0 +1,9 @@ +Public-Key: (256 bit) +pub: + 04:1b:93:67:55:1c:55:9f:63:d1:22:a4:d8:d1:0a: + 60:6d:02:a5:77:57:c8:a3:47:73:3a:6a:08:28:39: + bd:c9:d2:80:ec:e9:a7:08:29:71:2f:c9:56:82:ee: + 9a:85:0f:6d:7f:59:5f:8c:d1:96:0b:df:29:3e:49: + 07:88:3f:9a:29 +ASN1 OID: prime256v1 +NIST CURVE: P-256 From builds at travis-ci.org Tue Mar 3 22:49:55 2020 From: builds at travis-ci.org (Travis CI) Date: Tue, 03 Mar 2020 22:49:55 +0000 Subject: Errored: openssl/openssl#32811 (master - f552d90) In-Reply-To: Message-ID: <5e5edf11819c6_43fd4436a35902069d@f8d18e7c-4aa0-478e-af66-9795e23de6e3.mail> Build Update for openssl/openssl ------------------------------------- Build: #32811 Status: Errored Duration: 52 mins and 38 secs Commit: f552d90 (master) Author: Shane Lontis Message: Add Serializers for EC Provide EC serializers for text, pem and der. EC parameters use ANS1 'CHOICE' - which means they are more embedded than other parameters used by other KEY types (which normally have a SEQUENCE at the top level). For this reason the ANS1_STRING type that was being passed around has been changed to a void so that the code can still be shared with EC. The EC serializer only supports named curves currently. NOTE the serializer code assumes PKCS8 format - if the older encode methods are needed they will need to be added in another PR. (Probably when deserialization is considered). EVP_PKEY_key_fromdata_init was changed from using a keypair selection to all bits of a key. A side effect of this was that the very restrictive checks in the ecx code needed to be relaxed as it was assuming all selection flags were non optional. As this is not the case for any other key the code has been modified. Fixed a bug in legacy_ctrl_str_to_params() - "ecdh_cofactor_mode" was being incorrectly converted to the wrong keyname. Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/11107) View the changeset: https://github.com/openssl/openssl/compare/4a98ad086a6d...f552d900459c View the full build log and details: https://travis-ci.org/openssl/openssl/builds/657957959?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the openssl/openssl repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=5849220&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From shane.lontis at oracle.com Wed Mar 4 00:19:56 2020 From: shane.lontis at oracle.com (shane.lontis at oracle.com) Date: Wed, 04 Mar 2020 00:19:56 +0000 Subject: [openssl] master update Message-ID: <1583281196.262409.2136.nullmailer@dev.openssl.org> The branch master has been updated via 888e2a9bf5e2cf825398b39e5cbabdbc29c71748 (commit) from f552d900459cbacd82433b688b237cd6870663cd (commit) - Log ----------------------------------------------------------------- commit 888e2a9bf5e2cf825398b39e5cbabdbc29c71748 Author: Vladimir Panteleev Date: Mon Mar 2 18:05:03 2020 +0000 .gitignore: Add /apps/progs.{c,h} These files were removed from the source tree in fe909ee4aeb6eb64f6f31a1544c5d3c81c5fe1f1. CLA: trivial Reviewed-by: Richard Levitte Reviewed-by: Paul Dale Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/11222) ----------------------------------------------------------------------- Summary of changes: .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 44f963db78..3b1a455209 100644 --- a/.gitignore +++ b/.gitignore @@ -123,6 +123,8 @@ doc/man1/openssl-x509.pod /TAGS *.map *.ld +/apps/progs.c +/apps/progs.h # Windows (legacy) /tmp32 From builds at travis-ci.org Wed Mar 4 01:08:41 2020 From: builds at travis-ci.org (Travis CI) Date: Wed, 04 Mar 2020 01:08:41 +0000 Subject: Failed: openssl/openssl#32816 (master - 888e2a9) In-Reply-To: Message-ID: <5e5eff98c679a_43f9b6038852051388@d7bffead-3bf1-4c7a-854a-1a28f66f827f.mail> Build Update for openssl/openssl ------------------------------------- Build: #32816 Status: Failed Duration: 48 mins and 21 secs Commit: 888e2a9 (master) Author: Vladimir Panteleev Message: .gitignore: Add /apps/progs.{c,h} These files were removed from the source tree in fe909ee4aeb6eb64f6f31a1544c5d3c81c5fe1f1. CLA: trivial Reviewed-by: Richard Levitte Reviewed-by: Paul Dale Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/11222) View the changeset: https://github.com/openssl/openssl/compare/f552d900459c...888e2a9bf5e2 View the full build log and details: https://travis-ci.org/openssl/openssl/builds/658004178?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the openssl/openssl repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=5849220&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From openssl at openssl.org Wed Mar 4 04:17:17 2020 From: openssl at openssl.org (OpenSSL run-checker) Date: Wed, 04 Mar 2020 04:17:17 +0000 Subject: Still FAILED build of OpenSSL branch master with options -d --strict-warnings no-deprecated Message-ID: <1583295437.523855.10203.nullmailer@run.openssl.org> Platform and configuration command: $ uname -a Linux run 4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux $ CC=clang ../openssl/config -d --strict-warnings no-deprecated Commit log since last time: f552d90045 Add Serializers for EC 4a98ad086a Correct two small documentation issues 348900774c Documenting newly added CMS modification 71434aed0d Implementation of Russian GOST CMS 88398d2a35 doc: document that 'openssl rand' is cryptographically secure a24e62f54b Fix build with clang assembler 47c239c6b8 Add pairwise consistency self tests to asym keygenerators 97ace6c2da .travis.yml: Remove NOUPDATE support fe909ee4ae Remove apps/progs.c and apps/progs.h 19cf4404d5 Configure: Diverse cleanups a3f1fc2501 Build: Generate apps/progs.c and apps/progs.h in build time e429217902 build.info: Implement simply substitutions in variable values ad5be194c6 build.info: Make it possible to have more than one item in KEYWORD[] 2888fc1590 PROV: Add a OP_keymgmt_match() function to our DH, DSA, RSA and EC_KEY impl ff3b59e170 EVP: Add support for copying provided EVP_PKEYs 13697f1c62 KEYMGMT: Add a keydata copy function 1e9101c404 EVP: Add support for comparing provided EVP_PKEYs bee5d6cd3f KEYMGMT: Add a keydata matching function 157ded39ee EVP: Adapt EVP_PKEY_missing_parameters() for provider keys ccceeb4800 crypto/perlasm/x86_64-xlate.pl: detect GNU as to deal with quirks 15e5b96933 Fix drop of const qualifier Build log ended with (last 100 lines): 65-test_cmp_protect.t .............. ok 65-test_cmp_status.t ............... ok 65-test_cmp_vfy.t .................. ok 70-test_asyncio.t .................. ok 70-test_bad_dtls.t ................. ok 70-test_clienthello.t .............. ok 70-test_comp.t ..................... ok 70-test_key_share.t ................ ok 70-test_packet.t ................... ok 70-test_recordlen.t ................ ok 70-test_renegotiation.t ............ ok 70-test_servername.t ............... ok 70-test_sslcbcpadding.t ............ ok 70-test_sslcertstatus.t ............ ok 70-test_sslextension.t ............. ok 70-test_sslmessages.t .............. ok 70-test_sslrecords.t ............... ok 70-test_sslsessiontick.t ........... ok 70-test_sslsigalgs.t ............... ok 70-test_sslsignature.t ............. ok 70-test_sslskewith0p.t ............. ok 70-test_sslversions.t .............. ok 70-test_sslvertol.t ................ ok 70-test_tls13alerts.t .............. ok 70-test_tls13cookie.t .............. ok 70-test_tls13downgrade.t ........... ok 70-test_tls13hrr.t ................. ok 70-test_tls13kexmodes.t ............ ok 70-test_tls13messages.t ............ ok 70-test_tls13psk.t ................. ok 70-test_tlsextms.t ................. ok 70-test_verify_extra.t ............. ok 70-test_wpacket.t .................. ok 71-test_ssl_ctx.t .................. ok 80-test_ca.t ....................... ok 80-test_cipherbytes.t .............. ok 80-test_cipherlist.t ............... ok 80-test_ciphername.t ............... ok 80-test_cms.t ...................... ok 80-test_cmsapi.t ................... ok 80-test_ct.t ....................... ok 80-test_dane.t ..................... ok 80-test_dtls.t ..................... ok 80-test_dtls_mtu.t ................. ok 80-test_dtlsv1listen.t ............. ok 80-test_http.t ..................... ok 80-test_ocsp.t ..................... ok 80-test_pkcs12.t ................... ok 80-test_ssl_new.t .................. ok 80-test_ssl_old.t .................. ok 80-test_ssl_test_ctx.t ............. ok 80-test_sslcorrupt.t ............... ok 80-test_tsa.t ...................... ok 80-test_x509aux.t .................. ok 90-test_asn1_time.t ................ ok 90-test_async.t .................... ok 90-test_bio_enc.t .................. ok 90-test_bio_memleak.t .............. ok 90-test_constant_time.t ............ ok 90-test_fatalerr.t ................. ok 90-test_gmdiff.t ................... ok 90-test_gost.t ..................... Dubious, test returned 1 (wstat 256, 0x100) Failed 1/1 subtests 90-test_ige.t ...................... skipped: AES_ige support is disabled in this build 90-test_includes.t ................. ok 90-test_memleak.t .................. ok 90-test_overhead.t ................. ok 90-test_secmem.t ................... ok 90-test_shlibload.t ................ ok 90-test_srp.t ...................... ok 90-test_sslapi.t ................... ok 90-test_sslbuffers.t ............... ok 90-test_sslprovider.t .............. ok 90-test_store.t .................... ok 90-test_sysdefault.t ............... ok 90-test_threads.t .................. ok 90-test_time_offset.t .............. ok 90-test_tls13ccs.t ................. ok 90-test_tls13encryption.t .......... ok 90-test_tls13secrets.t ............. ok 90-test_v3name.t ................... ok 95-test_external_boringssl.t ....... skipped: No external tests in this configuration 95-test_external_krb5.t ............ skipped: No external tests in this configuration 95-test_external_pyca.t ............ skipped: No external tests in this configuration 99-test_ecstress.t ................. ok 99-test_fuzz.t ..................... ok Test Summary Report ------------------- 90-test_gost.t (Wstat: 256 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 1 Files=192, Tests=1916, 460 wallclock secs ( 7.07 usr 1.30 sys + 426.48 cusr 35.73 csys = 470.58 CPU) Result: FAIL Makefile:2927: recipe for target '_tests' failed make[1]: *** [_tests] Error 1 make[1]: Leaving directory '/home/openssl/run-checker/no-deprecated' Makefile:2925: recipe for target 'tests' failed make: *** [tests] Error 2 From openssl at openssl.org Wed Mar 4 04:33:42 2020 From: openssl at openssl.org (OpenSSL run-checker) Date: Wed, 04 Mar 2020 04:33:42 +0000 Subject: Still FAILED build of OpenSSL branch master with options -d --strict-warnings no-des Message-ID: <1583296422.253417.11903.nullmailer@run.openssl.org> Platform and configuration command: $ uname -a Linux run 4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux $ CC=clang ../openssl/config -d --strict-warnings no-des Commit log since last time: f552d90045 Add Serializers for EC 4a98ad086a Correct two small documentation issues 348900774c Documenting newly added CMS modification 71434aed0d Implementation of Russian GOST CMS 88398d2a35 doc: document that 'openssl rand' is cryptographically secure a24e62f54b Fix build with clang assembler 47c239c6b8 Add pairwise consistency self tests to asym keygenerators 97ace6c2da .travis.yml: Remove NOUPDATE support fe909ee4ae Remove apps/progs.c and apps/progs.h 19cf4404d5 Configure: Diverse cleanups a3f1fc2501 Build: Generate apps/progs.c and apps/progs.h in build time e429217902 build.info: Implement simply substitutions in variable values ad5be194c6 build.info: Make it possible to have more than one item in KEYWORD[] 2888fc1590 PROV: Add a OP_keymgmt_match() function to our DH, DSA, RSA and EC_KEY impl ff3b59e170 EVP: Add support for copying provided EVP_PKEYs 13697f1c62 KEYMGMT: Add a keydata copy function 1e9101c404 EVP: Add support for comparing provided EVP_PKEYs bee5d6cd3f KEYMGMT: Add a keydata matching function 157ded39ee EVP: Adapt EVP_PKEY_missing_parameters() for provider keys ccceeb4800 crypto/perlasm/x86_64-xlate.pl: detect GNU as to deal with quirks 15e5b96933 Fix drop of const qualifier Build log ended with (last 100 lines): 65-test_cmp_protect.t .............. ok 65-test_cmp_status.t ............... ok 65-test_cmp_vfy.t .................. ok 70-test_asyncio.t .................. ok 70-test_bad_dtls.t ................. ok 70-test_clienthello.t .............. ok 70-test_comp.t ..................... ok 70-test_key_share.t ................ ok 70-test_packet.t ................... ok 70-test_recordlen.t ................ ok 70-test_renegotiation.t ............ ok 70-test_servername.t ............... ok 70-test_sslcbcpadding.t ............ ok 70-test_sslcertstatus.t ............ ok 70-test_sslextension.t ............. ok 70-test_sslmessages.t .............. ok 70-test_sslrecords.t ............... ok 70-test_sslsessiontick.t ........... ok 70-test_sslsigalgs.t ............... ok 70-test_sslsignature.t ............. ok 70-test_sslskewith0p.t ............. ok 70-test_sslversions.t .............. ok 70-test_sslvertol.t ................ ok 70-test_tls13alerts.t .............. ok 70-test_tls13cookie.t .............. ok 70-test_tls13downgrade.t ........... ok 70-test_tls13hrr.t ................. ok 70-test_tls13kexmodes.t ............ ok 70-test_tls13messages.t ............ ok 70-test_tls13psk.t ................. ok 70-test_tlsextms.t ................. ok 70-test_verify_extra.t ............. ok 70-test_wpacket.t .................. ok 71-test_ssl_ctx.t .................. ok 80-test_ca.t ....................... ok 80-test_cipherbytes.t .............. ok 80-test_cipherlist.t ............... ok 80-test_ciphername.t ............... ok 80-test_cms.t ...................... Dubious, test returned 1 (wstat 256, 0x100) Failed 1/7 subtests 80-test_cmsapi.t ................... ok 80-test_ct.t ....................... ok 80-test_dane.t ..................... ok 80-test_dtls.t ..................... ok 80-test_dtls_mtu.t ................. ok 80-test_dtlsv1listen.t ............. ok 80-test_http.t ..................... ok 80-test_ocsp.t ..................... ok 80-test_pkcs12.t ................... skipped: The PKCS12 command line utility is not supported by this OpenSSL build 80-test_ssl_new.t .................. ok 80-test_ssl_old.t .................. ok 80-test_ssl_test_ctx.t ............. ok 80-test_sslcorrupt.t ............... ok 80-test_tsa.t ...................... ok 80-test_x509aux.t .................. ok 90-test_asn1_time.t ................ ok 90-test_async.t .................... ok 90-test_bio_enc.t .................. ok 90-test_bio_memleak.t .............. ok 90-test_constant_time.t ............ ok 90-test_fatalerr.t ................. ok 90-test_gmdiff.t ................... ok 90-test_gost.t ..................... ok 90-test_ige.t ...................... ok 90-test_includes.t ................. ok 90-test_memleak.t .................. ok 90-test_overhead.t ................. ok 90-test_secmem.t ................... ok 90-test_shlibload.t ................ ok 90-test_srp.t ...................... ok 90-test_sslapi.t ................... ok 90-test_sslbuffers.t ............... ok 90-test_sslprovider.t .............. ok 90-test_store.t .................... ok 90-test_sysdefault.t ............... ok 90-test_threads.t .................. ok 90-test_time_offset.t .............. ok 90-test_tls13ccs.t ................. ok 90-test_tls13encryption.t .......... ok 90-test_tls13secrets.t ............. ok 90-test_v3name.t ................... ok 95-test_external_boringssl.t ....... skipped: No external tests in this configuration 95-test_external_krb5.t ............ skipped: No external tests in this configuration 95-test_external_pyca.t ............ skipped: No external tests in this configuration 99-test_ecstress.t ................. ok 99-test_fuzz.t ..................... ok Test Summary Report ------------------- 80-test_cms.t (Wstat: 256 Tests: 7 Failed: 1) Failed test: 7 Non-zero exit status: 1 Files=192, Tests=1877, 503 wallclock secs ( 6.95 usr 1.36 sys + 468.56 cusr 38.16 csys = 515.03 CPU) Result: FAIL Makefile:2865: recipe for target '_tests' failed make[1]: *** [_tests] Error 1 make[1]: Leaving directory '/home/openssl/run-checker/no-des' Makefile:2863: recipe for target 'tests' failed make: *** [tests] Error 2 From tmraz at fedoraproject.org Wed Mar 4 10:42:13 2020 From: tmraz at fedoraproject.org (tmraz at fedoraproject.org) Date: Wed, 04 Mar 2020 10:42:13 +0000 Subject: [openssl] master update Message-ID: <1583318533.231434.27795.nullmailer@dev.openssl.org> The branch master has been updated via a8055c70fa0828636b99fe613a642a2066c0aa8b (commit) from 888e2a9bf5e2cf825398b39e5cbabdbc29c71748 (commit) - Log ----------------------------------------------------------------- commit a8055c70fa0828636b99fe613a642a2066c0aa8b Author: Rich Salz Date: Wed Feb 26 15:25:43 2020 -0500 Add some missing env var documentation Reviewed-by: Paul Dale Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/11189) ----------------------------------------------------------------------- Summary of changes: doc/man1/CA.pl.pod | 9 ++++++++- doc/man7/openssl-env.pod | 17 ++++++++++++----- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/doc/man1/CA.pl.pod b/doc/man1/CA.pl.pod index db444d5683..4c53970890 100644 --- a/doc/man1/CA.pl.pod +++ b/doc/man1/CA.pl.pod @@ -174,11 +174,18 @@ Sign the request: CA.pl -signreq +=head1 ENVIRONMENT + +The environment variable B may be used to specify a +configuration option and value to the B and B commands invoked by +this script. It's value should be the option and pathname, as in +C<-config /path/to/conf-file>. + =head1 NOTES Most of the filenames mentioned can be modified by editing the B script. -If the demoCA directory already exists then the B<-newca> command will not +If the F directory already exists then the B<-newca> command will not overwrite it and will do nothing. This can happen if a previous call using the B<-newca> option terminated abnormally. To get the correct behaviour delete the demoCA directory if it already exists. diff --git a/doc/man7/openssl-env.pod b/doc/man7/openssl-env.pod index be89f85172..f59cd59610 100644 --- a/doc/man7/openssl-env.pod +++ b/doc/man7/openssl-env.pod @@ -20,15 +20,22 @@ See L. =item B -Specifies the path to the B executable. Only used by -the B script. -See L. +Specifies the path to the B executable. Used by +the B script (see L) +and by the B script (see L -=item B +=item B, B -Specifies the path to a configuration file. +Specifies the path to a configuration file and the directory for +included files. See L and L. +=item B + +Specifies a configuration option and filename for the B and B +commands invoked by the B script. +See L. + =item B Specifies the directory from which dynamic engines are loaded. From builds at travis-ci.org Wed Mar 4 11:33:03 2020 From: builds at travis-ci.org (Travis CI) Date: Wed, 04 Mar 2020 11:33:03 +0000 Subject: Still Failing: openssl/openssl#32834 (master - a8055c7) In-Reply-To: Message-ID: <5e5f91ee69f52_43f9b5299036882869@0e275592-2277-45f3-a061-94a81a666b35.mail> Build Update for openssl/openssl ------------------------------------- Build: #32834 Status: Still Failing Duration: 50 mins and 18 secs Commit: a8055c7 (master) Author: Rich Salz Message: Add some missing env var documentation Reviewed-by: Paul Dale Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/11189) View the changeset: https://github.com/openssl/openssl/compare/888e2a9bf5e2...a8055c70fa08 View the full build log and details: https://travis-ci.org/openssl/openssl/builds/658155199?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the openssl/openssl repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=5849220&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From levitte at openssl.org Wed Mar 4 11:57:14 2020 From: levitte at openssl.org (Richard Levitte) Date: Wed, 04 Mar 2020 11:57:14 +0000 Subject: [openssl] master update Message-ID: <1583323034.087929.4787.nullmailer@dev.openssl.org> The branch master has been updated via 6caf63ec4871a578f6f99c668b67e495ccc2bbf6 (commit) from a8055c70fa0828636b99fe613a642a2066c0aa8b (commit) - Log ----------------------------------------------------------------- commit 6caf63ec4871a578f6f99c668b67e495ccc2bbf6 Author: Richard Levitte Date: Wed Feb 26 14:57:39 2020 +0100 .travis.yml: where it matters, have build and source nesting levels differ Where we build out of source, the source directory was _srcdist and the build directory was _build. That gives the same nesting level for both, which doesn't quite exercise all aspects of relative back references from build to source tree. Changing the build tree to be in _build/tree will challenge back references a bit more, and ensure a bit more that we got it right. Reviewed-by: Nicola Tuveri (Merged from https://github.com/openssl/openssl/pull/11186) ----------------------------------------------------------------------- Summary of changes: .travis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index a015eb4053..f77f8c7586 100644 --- a/.travis.yml +++ b/.travis.yml @@ -170,10 +170,10 @@ before_script: - if [ -n "$DESTDIR" ]; then sh .travis-create-release.sh $TRAVIS_OS_NAME; tar -xzf _srcdist.tar.gz; - mkdir _build; - cd _build; - srcdir=../_srcdist; - top=..; + mkdir -p _build/tree; + cd _build/tree; + srcdir=../../_srcdist; + top=../..; else srcdir=.; top=.; @@ -210,7 +210,7 @@ script: fi - top=${PWD} - if [ -n "$DESTDIR" ]; then - cd _build; + cd _build/tree; fi - if ! $make update; then echo -e '\052\052 FAILED -- MAKE UPDATE'; From builds at travis-ci.org Wed Mar 4 12:50:28 2020 From: builds at travis-ci.org (Travis CI) Date: Wed, 04 Mar 2020 12:50:28 +0000 Subject: Errored: openssl/openssl#32838 (master - 6caf63e) In-Reply-To: Message-ID: <5e5fa4141c06e_43f7fc3ef7d741593dd@ac5bcc85-708f-4eae-8830-88ae9e75db4f.mail> Build Update for openssl/openssl ------------------------------------- Build: #32838 Status: Errored Duration: 51 mins and 56 secs Commit: 6caf63e (master) Author: Richard Levitte Message: .travis.yml: where it matters, have build and source nesting levels differ Where we build out of source, the source directory was _srcdist and the build directory was _build. That gives the same nesting level for both, which doesn't quite exercise all aspects of relative back references from build to source tree. Changing the build tree to be in _build/tree will challenge back references a bit more, and ensure a bit more that we got it right. Reviewed-by: Nicola Tuveri (Merged from https://github.com/openssl/openssl/pull/11186) View the changeset: https://github.com/openssl/openssl/compare/a8055c70fa08...6caf63ec4871 View the full build log and details: https://travis-ci.org/openssl/openssl/builds/658181415?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the openssl/openssl repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=5849220&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From levitte at openssl.org Wed Mar 4 16:14:32 2020 From: levitte at openssl.org (Richard Levitte) Date: Wed, 04 Mar 2020 16:14:32 +0000 Subject: [openssl] master update Message-ID: <1583338472.009956.32716.nullmailer@dev.openssl.org> The branch master has been updated via b16654a2810c91384d60f30683d83416866e72d2 (commit) from 6caf63ec4871a578f6f99c668b67e495ccc2bbf6 (commit) - Log ----------------------------------------------------------------- commit b16654a2810c91384d60f30683d83416866e72d2 Author: Richard Levitte Date: Mon Mar 2 10:50:24 2020 +0100 config, Configure: move the check of removed crypto/ sub-systems The 'config' script checked for a bunch of crypto/ sub-system directories, and added 'no-' options if they weren't there. We move it to 'Configure' in an effort to simplify 'config' for further work. Note: this is pretty much a historical thing. In modern OpenSSL, it's much simpler to edit the SUBDIRS statement in crypto/build.info. However, it's been claimed the there are those who still remove some of these sub-system sources. Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/11217) ----------------------------------------------------------------------- Summary of changes: Configure | 13 +++++++++++++ config | 8 -------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Configure b/Configure index 19b57d90b8..64e30fe2a0 100755 --- a/Configure +++ b/Configure @@ -265,6 +265,19 @@ if (grep /^reconf(igure)?$/, @argvcopy) { $config{perlargv} = [ @argvcopy ]; +# Historical: if known directories in crypto/ have been removed, it means +# that those sub-systems are disabled. +# (the other option would be to removed them from the SUBDIRS statement in +# crypto/build.info) +# We reverse the input list for cosmetic purely reasons, to compensate that +# 'unshift' adds at the front of the list (i.e. in reverse input order). +foreach ( reverse sort( 'aes', 'aria', 'bf', 'camellia', 'cast', 'des', 'dh', + 'dsa', 'ec', 'hmac', 'idea', 'md2', 'md5', 'mdc2', + 'rc2', 'rc4', 'rc5', 'ripemd', 'rsa', 'seed', 'sha', + 'sm2', 'sm3', 'sm4') ) { + unshift @argvcopy, "no-$_" if ! -d catdir($srcdir, 'crypto', $_); +} + # Collect version numbers my %version = (); diff --git a/config b/config index e39481ca2a..7dfea22802 100755 --- a/config +++ b/config @@ -847,14 +847,6 @@ case "$GUESSOS" in i386-*) options="$options 386" ;; esac -for i in aes aria bf camellia cast des dh dsa ec hmac idea md2 md5 mdc2 rc2 rc4 rc5 ripemd rsa seed sha sm2 sm3 sm4 -do - if [ ! -d $THERE/crypto/$i ] - then - options="$options no-$i" - fi -done - if [ -z "$OUT" ]; then OUT="$CC" fi From builds at travis-ci.org Wed Mar 4 17:10:41 2020 From: builds at travis-ci.org (Travis CI) Date: Wed, 04 Mar 2020 17:10:41 +0000 Subject: Failed: openssl/openssl#32848 (master - b16654a) In-Reply-To: Message-ID: <5e5fe10ea5d19_43fdbb188d3542609ef@3e16be01-f145-413d-9e03-1e7b40ab148f.mail> Build Update for openssl/openssl ------------------------------------- Build: #32848 Status: Failed Duration: 54 mins and 38 secs Commit: b16654a (master) Author: Richard Levitte Message: config, Configure: move the check of removed crypto/ sub-systems The 'config' script checked for a bunch of crypto/ sub-system directories, and added 'no-' options if they weren't there. We move it to 'Configure' in an effort to simplify 'config' for further work. Note: this is pretty much a historical thing. In modern OpenSSL, it's much simpler to edit the SUBDIRS statement in crypto/build.info. However, it's been claimed the there are those who still remove some of these sub-system sources. Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/11217) View the changeset: https://github.com/openssl/openssl/compare/6caf63ec4871...b16654a2810c View the full build log and details: https://travis-ci.org/openssl/openssl/builds/658288581?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the openssl/openssl repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=5849220&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From shane.lontis at oracle.com Wed Mar 4 22:27:44 2020 From: shane.lontis at oracle.com (shane.lontis at oracle.com) Date: Wed, 04 Mar 2020 22:27:44 +0000 Subject: [openssl] master update Message-ID: <1583360864.842610.11917.nullmailer@dev.openssl.org> The branch master has been updated via a54ff473df579dffbf70eec637d54e48370b5bdc (commit) from b16654a2810c91384d60f30683d83416866e72d2 (commit) - Log ----------------------------------------------------------------- commit a54ff473df579dffbf70eec637d54e48370b5bdc Author: Shane Lontis Date: Tue Jan 21 15:45:40 2020 +1000 Add DH key validation to default provider Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/10911) ----------------------------------------------------------------------- Summary of changes: crypto/dh/build.info | 4 +-- providers/implementations/keymgmt/dh_kmgmt.c | 46 ++++++++++++++++++++++++++-- test/evp_pkey_provided_test.c | 13 ++++++-- 3 files changed, 57 insertions(+), 6 deletions(-) diff --git a/crypto/dh/build.info b/crypto/dh/build.info index bb71f4a16b..56c085bb1e 100644 --- a/crypto/dh/build.info +++ b/crypto/dh/build.info @@ -1,9 +1,9 @@ LIBS=../../libcrypto -$COMMON=dh_lib.c dh_key.c dh_group_params.c +$COMMON=dh_lib.c dh_key.c dh_group_params.c dh_check.c SOURCE[../../libcrypto]=$COMMON\ - dh_asn1.c dh_gen.c dh_check.c dh_err.c dh_depr.c \ + dh_asn1.c dh_gen.c dh_err.c dh_depr.c \ dh_ameth.c dh_pmeth.c dh_prn.c dh_rfc5114.c dh_kdf.c dh_meth.c SOURCE[../../providers/libfips.a]=$COMMON diff --git a/providers/implementations/keymgmt/dh_kmgmt.c b/providers/implementations/keymgmt/dh_kmgmt.c index 90a583e7db..6a6a06cc86 100644 --- a/providers/implementations/keymgmt/dh_kmgmt.c +++ b/providers/implementations/keymgmt/dh_kmgmt.c @@ -16,13 +16,13 @@ #include #include #include +#include #include -#include "internal/param_build.h" -#include "crypto/dh.h" #include "prov/implementations.h" #include "prov/providercommon.h" #include "prov/provider_ctx.h" #include "crypto/dh.h" +#include "internal/param_build.h" static OSSL_OP_keymgmt_new_fn dh_newdata; static OSSL_OP_keymgmt_free_fn dh_freedata; @@ -30,6 +30,7 @@ static OSSL_OP_keymgmt_get_params_fn dh_get_params; static OSSL_OP_keymgmt_gettable_params_fn dh_gettable_params; static OSSL_OP_keymgmt_has_fn dh_has; static OSSL_OP_keymgmt_match_fn dh_match; +static OSSL_OP_keymgmt_validate_fn dh_validate; static OSSL_OP_keymgmt_import_fn dh_import; static OSSL_OP_keymgmt_import_types_fn dh_import_types; static OSSL_OP_keymgmt_export_fn dh_export; @@ -316,6 +317,46 @@ static const OSSL_PARAM *dh_gettable_params(void) return dh_params; } +static int dh_validate_public(DH *dh) +{ + const BIGNUM *pub_key = NULL; + + DH_get0_key(dh, &pub_key, NULL); + return DH_check_pub_key_ex(dh, pub_key); +} + +static int dh_validate_private(DH *dh) +{ + int status = 0; + const BIGNUM *priv_key = NULL; + + DH_get0_key(dh, NULL, &priv_key); + return dh_check_priv_key(dh, priv_key, &status);; +} + +static int dh_validate(void *keydata, int selection) +{ + DH *dh = keydata; + int ok = 0; + + if ((selection & DH_POSSIBLE_SELECTIONS) != 0) + ok = 1; + + if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0) + ok = ok && DH_check_params_ex(dh); + + if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0) + ok = ok && dh_validate_public(dh); + + if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) + ok = ok && dh_validate_private(dh); + + if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) + == OSSL_KEYMGMT_SELECT_KEYPAIR) + ok = ok && dh_check_pairwise(dh); + return ok; +} + const OSSL_DISPATCH dh_keymgmt_functions[] = { { OSSL_FUNC_KEYMGMT_NEW, (void (*)(void))dh_newdata }, { OSSL_FUNC_KEYMGMT_FREE, (void (*)(void))dh_freedata }, @@ -323,6 +364,7 @@ const OSSL_DISPATCH dh_keymgmt_functions[] = { { OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS, (void (*) (void))dh_gettable_params }, { OSSL_FUNC_KEYMGMT_HAS, (void (*)(void))dh_has }, { OSSL_FUNC_KEYMGMT_MATCH, (void (*)(void))dh_match }, + { OSSL_FUNC_KEYMGMT_VALIDATE, (void (*)(void))dh_validate }, { OSSL_FUNC_KEYMGMT_IMPORT, (void (*)(void))dh_import }, { OSSL_FUNC_KEYMGMT_IMPORT_TYPES, (void (*)(void))dh_import_types }, { OSSL_FUNC_KEYMGMT_EXPORT, (void (*)(void))dh_export }, diff --git a/test/evp_pkey_provided_test.c b/test/evp_pkey_provided_test.c index 6f7f3986e9..c395f185dd 100644 --- a/test/evp_pkey_provided_test.c +++ b/test/evp_pkey_provided_test.c @@ -331,7 +331,7 @@ static int test_fromdata_rsa(void) static int test_fromdata_dh(void) { int ret = 0; - EVP_PKEY_CTX *ctx = NULL; + EVP_PKEY_CTX *ctx = NULL, *key_ctx = NULL; EVP_PKEY *pk = NULL; /* * 32-bit DH key, extracted from this command, @@ -367,9 +367,19 @@ static int test_fromdata_dh(void) ret = test_print_key_using_pem("DH", pk) && test_print_key_using_serializer("DH", pk); + if (!TEST_ptr(key_ctx = EVP_PKEY_CTX_new_from_pkey(NULL, pk, ""))) + goto err; + + if (!TEST_false(EVP_PKEY_check(key_ctx)) + || !TEST_true(EVP_PKEY_public_check(key_ctx)) + || !TEST_false(EVP_PKEY_private_check(key_ctx)) /* Need a q */ + || !TEST_true(EVP_PKEY_pairwise_check(key_ctx))) + goto err; + err: EVP_PKEY_free(pk); EVP_PKEY_CTX_free(ctx); + EVP_PKEY_CTX_free(key_ctx); return ret; } @@ -552,7 +562,6 @@ err: #endif /* OPENSSL_NO_EC */ - int setup_tests(void) { if (!test_skip_common_options()) { From shane.lontis at oracle.com Wed Mar 4 22:36:04 2020 From: shane.lontis at oracle.com (shane.lontis at oracle.com) Date: Wed, 04 Mar 2020 22:36:04 +0000 Subject: [openssl] master update Message-ID: <1583361364.068661.20919.nullmailer@dev.openssl.org> The branch master has been updated via 22b858a888c1b4b1d2acdde2548a52c76ec6b97f (commit) from a54ff473df579dffbf70eec637d54e48370b5bdc (commit) - Log ----------------------------------------------------------------- commit 22b858a888c1b4b1d2acdde2548a52c76ec6b97f Author: Shane Lontis Date: Tue Jan 21 15:57:25 2020 +1000 Add DSA Key validation to default provider Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/10912) ----------------------------------------------------------------------- Summary of changes: crypto/dsa/build.info | 5 ++- crypto/dsa/dsa_check.c | 1 - providers/implementations/keymgmt/dsa_kmgmt.c | 56 +++++++++++++++++++++++++-- 3 files changed, 56 insertions(+), 6 deletions(-) diff --git a/crypto/dsa/build.info b/crypto/dsa/build.info index 2cbea9b961..35a95a2be1 100644 --- a/crypto/dsa/build.info +++ b/crypto/dsa/build.info @@ -1,9 +1,10 @@ LIBS=../../libcrypto -$COMMON=dsa_sign.c dsa_vrf.c dsa_lib.c dsa_ossl.c dsa_aid.c +$COMMON=dsa_sign.c dsa_vrf.c dsa_lib.c dsa_ossl.c dsa_aid.c dsa_check.c \ + dsa_key.c SOURCE[../../libcrypto]=$COMMON\ - dsa_gen.c dsa_key.c dsa_asn1.c \ + dsa_gen.c dsa_asn1.c \ dsa_err.c dsa_depr.c dsa_ameth.c dsa_pmeth.c dsa_prn.c \ dsa_meth.c SOURCE[../../providers/libfips.a]=$COMMON diff --git a/crypto/dsa/dsa_check.c b/crypto/dsa/dsa_check.c index 3b86d2dc7a..611a4e66f6 100644 --- a/crypto/dsa/dsa_check.c +++ b/crypto/dsa/dsa_check.c @@ -15,7 +15,6 @@ int dsa_check_params(const DSA *dsa, int *ret) { - int nid; /* * (2b) FFC domain params conform to FIPS-186-4 explicit domain param * validity tests. diff --git a/providers/implementations/keymgmt/dsa_kmgmt.c b/providers/implementations/keymgmt/dsa_kmgmt.c index 494f284111..a4821f94c3 100644 --- a/providers/implementations/keymgmt/dsa_kmgmt.c +++ b/providers/implementations/keymgmt/dsa_kmgmt.c @@ -1,5 +1,5 @@ /* - * Copyright 2019 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -17,12 +17,11 @@ #include #include #include -#include "internal/param_build.h" -#include "crypto/dsa.h" #include "prov/implementations.h" #include "prov/providercommon.h" #include "prov/provider_ctx.h" #include "crypto/dsa.h" +#include "internal/param_build.h" static OSSL_OP_keymgmt_new_fn dsa_newdata; static OSSL_OP_keymgmt_free_fn dsa_freedata; @@ -30,6 +29,7 @@ static OSSL_OP_keymgmt_get_params_fn dsa_get_params; static OSSL_OP_keymgmt_gettable_params_fn dsa_gettable_params; static OSSL_OP_keymgmt_has_fn dsa_has; static OSSL_OP_keymgmt_match_fn dsa_match; +static OSSL_OP_keymgmt_validate_fn dsa_validate; static OSSL_OP_keymgmt_import_fn dsa_import; static OSSL_OP_keymgmt_import_types_fn dsa_import_types; static OSSL_OP_keymgmt_export_fn dsa_export; @@ -329,6 +329,55 @@ static const OSSL_PARAM *dsa_gettable_params(void) return dsa_params; } +static int dsa_validate_domparams(DSA *dsa) +{ + int status = 0; + + return dsa_check_params(dsa, &status); +} + +static int dsa_validate_public(DSA *dsa) +{ + int status = 0; + const BIGNUM *pub_key = NULL; + + DSA_get0_key(dsa, &pub_key, NULL); + return dsa_check_pub_key(dsa, pub_key, &status); +} + +static int dsa_validate_private(DSA *dsa) +{ + int status = 0; + const BIGNUM *priv_key = NULL; + + DSA_get0_key(dsa, NULL, &priv_key); + return dsa_check_priv_key(dsa, priv_key, &status); +} + +static int dsa_validate(void *keydata, int selection) +{ + DSA *dsa = keydata; + int ok = 0; + + if ((selection & DSA_POSSIBLE_SELECTIONS) != 0) + ok = 1; + + if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0) + ok = ok && dsa_validate_domparams(dsa); + + if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0) + ok = ok && dsa_validate_public(dsa); + + if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) + ok = ok && dsa_validate_private(dsa); + + /* If the whole key is selected, we do a pairwise validation */ + if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) + == OSSL_KEYMGMT_SELECT_KEYPAIR) + ok = ok && dsa_check_pairwise(dsa); + return ok; +} + const OSSL_DISPATCH dsa_keymgmt_functions[] = { { OSSL_FUNC_KEYMGMT_NEW, (void (*)(void))dsa_newdata }, { OSSL_FUNC_KEYMGMT_FREE, (void (*)(void))dsa_freedata }, @@ -336,6 +385,7 @@ const OSSL_DISPATCH dsa_keymgmt_functions[] = { { OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS, (void (*) (void))dsa_gettable_params }, { OSSL_FUNC_KEYMGMT_HAS, (void (*)(void))dsa_has }, { OSSL_FUNC_KEYMGMT_MATCH, (void (*)(void))dsa_match }, + { OSSL_FUNC_KEYMGMT_VALIDATE, (void (*)(void))dsa_validate }, { OSSL_FUNC_KEYMGMT_IMPORT, (void (*)(void))dsa_import }, { OSSL_FUNC_KEYMGMT_IMPORT_TYPES, (void (*)(void))dsa_import_types }, { OSSL_FUNC_KEYMGMT_EXPORT, (void (*)(void))dsa_export }, From pauli at openssl.org Wed Mar 4 22:56:45 2020 From: pauli at openssl.org (Dr. Paul Dale) Date: Wed, 04 Mar 2020 22:56:45 +0000 Subject: [openssl] master update Message-ID: <1583362605.003434.8766.nullmailer@dev.openssl.org> The branch master has been updated via 922241de76dce66a04e0217bfc270a5228b694f3 (commit) from 22b858a888c1b4b1d2acdde2548a52c76ec6b97f (commit) - Log ----------------------------------------------------------------- commit 922241de76dce66a04e0217bfc270a5228b694f3 Author: Vladimir Panteleev Date: Mon Mar 2 20:36:07 2020 +0000 .github/PULL_REQUEST_TEMPLATE.md: Fix link to contributors guide The file was converted to Markdown and renamed appropriately in 2e07506a12e126894cd820304465162bc0e732b4. CLA: trivial Reviewed-by: Paul Dale Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/11223) ----------------------------------------------------------------------- Summary of changes: .github/PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 7b384b1149..191d9c9174 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,7 +1,7 @@ ] [I ...] @@ -91,6 +92,8 @@ B<-trusted>, B<-untrusted> or B<-CRLfile> options. {- $OpenSSL::safe::opt_v_item -} +{- $OpenSSL::safe::opt_provider_item -} + =item B<--> Indicates the last option. All arguments following this are assumed to be diff --git a/doc/man1/openssl-version.pod b/doc/man1/openssl-version.pod.in similarity index 96% rename from doc/man1/openssl-version.pod rename to doc/man1/openssl-version.pod.in index 62d50ce701..d2aaaecbf3 100644 --- a/doc/man1/openssl-version.pod +++ b/doc/man1/openssl-version.pod.in @@ -1,4 +1,5 @@ =pod +{- OpenSSL::safe::output_do_not_edit_headers(); -} =head1 NAME diff --git a/doc/man1/openssl-x509.pod.in b/doc/man1/openssl-x509.pod.in index 1ec2110100..8cf03d937e 100644 --- a/doc/man1/openssl-x509.pod.in +++ b/doc/man1/openssl-x509.pod.in @@ -75,6 +75,7 @@ B B {- $OpenSSL::safe::opt_name_synopsis -} {- $OpenSSL::safe::opt_r_synopsis -} {- $OpenSSL::safe::opt_engine_synopsis -} +{- $OpenSSL::safe::opt_provider_synopsis -} =for openssl ifdef engine subject_hash_old issuer_hash_old @@ -135,6 +136,8 @@ Cannot be used with the B<-days> option. {- $OpenSSL::safe::opt_engine_item -} +{- $OpenSSL::safe::opt_provider_item -} + =back =head2 Display Options diff --git a/doc/man1/openssl.pod b/doc/man1/openssl.pod index bd3daa1a14..2f56ab7592 100644 --- a/doc/man1/openssl.pod +++ b/doc/man1/openssl.pod @@ -755,6 +755,26 @@ This file can be used in a subsequent command invocation. =back +=head2 Provider Options + +With the move to provider based cryptographic operations in OpenSSL 3.0, +options were added to allow specific providers or sets of providers to be used. + +=over 4 + +=item B<-provider> I + +Use the provider identified by I and use all the methods it +implements (algorithms, key storage, etc.). This option can be specified +multiple time to load more than one provider. + +=item B<-provider_path> I + +Specify the search I that is used to locate provider modules. The format +of I varies depending on the operating system being used. + +=back + =head2 Extended Verification Options Sometimes there may be more than one certificate chain leading to an diff --git a/doc/man3/OSSL_PROVIDER.pod b/doc/man3/OSSL_PROVIDER.pod index f4f8a3bd5e..8cedbadf09 100644 --- a/doc/man3/OSSL_PROVIDER.pod +++ b/doc/man3/OSSL_PROVIDER.pod @@ -2,6 +2,7 @@ =head1 NAME +OSSL_PROVIDER_set_default_search_path, OSSL_PROVIDER, OSSL_PROVIDER_load, OSSL_PROVIDER_unload, OSSL_PROVIDER_available, OSSL_PROVIDER_gettable_params, OSSL_PROVIDER_get_params, @@ -13,6 +14,9 @@ OSSL_PROVIDER_add_builtin, OSSL_PROVIDER_name - provider routines typedef struct ossl_provider_st OSSL_PROVIDER; + void OSSL_PROVIDER_set_default_search_path(OPENSSL_CTX *libctx, + const char *path); + OSSL_PROVIDER *OSSL_PROVIDER_load(OPENSSL_CTX *libctx, const char *name); int OSSL_PROVIDER_unload(OSSL_PROVIDER *prov); int OSSL_PROVIDER_available(OPENSSL_CTX *libctx, const char *name); @@ -39,6 +43,11 @@ L for further details. =head2 Functions +OSSL_PROVIDER_set_default_search_path() specifies the default search B +that is to be used for looking for providers in the specified B. +If left unspecified, an environment variable and a fall back default value will +be used instead. + OSSL_PROVIDER_add_builtin() is used to add a built in provider to B store in the given library context, by associating a provider name with a provider initialization function. diff --git a/doc/perlvars.pm b/doc/perlvars.pm index bae8b15e83..82d6e5a157 100644 --- a/doc/perlvars.pm +++ b/doc/perlvars.pm @@ -88,6 +88,17 @@ $OpenSSL::safe::opt_r_item = "" . "\n" . "See L for details."; +# Provider options +$OpenSSL::safe::opt_provider_synopsis = "" +. "[B<-provider> I]\n" +. "[B<-provider_path> I]"; +$OpenSSL::safe::opt_provider_item = "" +. "=item B<-provider> I\n" +. "\n" +. "=item B<-provider_path> I\n" +. "\n" +. "See L."; + # Engine option $OpenSSL::safe::opt_engine_synopsis = "" . "[B<-engine> I]"; diff --git a/include/openssl/provider.h b/include/openssl/provider.h index 86dabf42ce..c17f1d46fc 100644 --- a/include/openssl/provider.h +++ b/include/openssl/provider.h @@ -16,6 +16,9 @@ extern "C" { # endif +/* Set the default provider search path */ +int OSSL_PROVIDER_set_default_search_path(OPENSSL_CTX *, const char *path); + /* Load and unload a provider */ OSSL_PROVIDER *OSSL_PROVIDER_load(OPENSSL_CTX *, const char *name); int OSSL_PROVIDER_unload(OSSL_PROVIDER *prov); diff --git a/util/libcrypto.num b/util/libcrypto.num index 8334b99361..d7a94f8adf 100644 --- a/util/libcrypto.num +++ b/util/libcrypto.num @@ -4955,3 +4955,4 @@ OSSL_SELF_TEST_free ? 3_0_0 EXIST::FUNCTION: OSSL_SELF_TEST_onbegin ? 3_0_0 EXIST::FUNCTION: OSSL_SELF_TEST_oncorrupt_byte ? 3_0_0 EXIST::FUNCTION: OSSL_SELF_TEST_onend ? 3_0_0 EXIST::FUNCTION: +OSSL_PROVIDER_set_default_search_path ? 3_0_0 EXIST::FUNCTION: From beldmit at gmail.com Sat Mar 7 10:10:26 2020 From: beldmit at gmail.com (beldmit at gmail.com) Date: Sat, 07 Mar 2020 10:10:26 +0000 Subject: [openssl] master update Message-ID: <1583575826.608392.16107.nullmailer@dev.openssl.org> The branch master has been updated via d462b5ff21e9fcdef98447c8f8d8c694b1e79602 (commit) from 6bd4e3f231d74578b97821d981d42583fec5c2f3 (commit) - Log ----------------------------------------------------------------- commit d462b5ff21e9fcdef98447c8f8d8c694b1e79602 Author: Rich Salz Date: Wed Mar 4 14:41:53 2020 -0500 Add -section option to 'req' command This removes "req" as the hardwired section for the req command. Doing this will let us merge some test configs. Reviewed-by: Tomas Mraz Reviewed-by: Dmitry Belyavskiy (Merged from https://github.com/openssl/openssl/pull/11249) ----------------------------------------------------------------------- Summary of changes: apps/ca.c | 1 + apps/req.c | 40 +++++++++++++++++++++++----------------- doc/man1/openssl-ca.pod.in | 5 ++++- doc/man1/openssl-req.pod.in | 15 +++++++++++++-- test/recipes/25-test_req.t | 30 +++++++++++++++++++++++++++++- test/test.cnf | 35 ++++++++++++++--------------------- 6 files changed, 84 insertions(+), 42 deletions(-) diff --git a/apps/ca.c b/apps/ca.c index 84e1905d38..e3e2fd2e7e 100644 --- a/apps/ca.c +++ b/apps/ca.c @@ -177,6 +177,7 @@ const OPTIONS ca_options[] = { OPT_SECTION("Configuration"), {"config", OPT_CONFIG, 's', "A config file"}, {"name", OPT_NAME, 's', "The particular CA definition to use"}, + {"section", OPT_NAME, 's', "An alias for -name"}, {"policy", OPT_POLICY, 's', "The CA 'policy' to support"}, OPT_SECTION("Certificate"), diff --git a/apps/req.c b/apps/req.c index dcad9dc238..5186017282 100644 --- a/apps/req.c +++ b/apps/req.c @@ -32,7 +32,6 @@ # include #endif -#define SECTION "req" #define BITS "default_bits" #define KEYFILE "default_keyfile" @@ -77,6 +76,8 @@ static int join(char buf[], size_t buf_size, const char *name, static EVP_PKEY_CTX *set_keygen_ctx(const char *gstr, int *pkey_type, long *pkeylen, char **palgnam, ENGINE *keygen_engine); + +static const char *section = "req"; static CONF *req_conf = NULL; static CONF *addext_conf = NULL; static int batch = 0; @@ -91,6 +92,7 @@ typedef enum OPTION_choice { OPT_NAMEOPT, OPT_REQOPT, OPT_SUBJ, OPT_SUBJECT, OPT_TEXT, OPT_X509, OPT_MULTIVALUE_RDN, OPT_DAYS, OPT_SET_SERIAL, OPT_ADDEXT, OPT_EXTENSIONS, OPT_REQEXTS, OPT_PRECERT, OPT_MD, OPT_SM2ID, OPT_SM2HEXID, + OPT_SECTION, OPT_R_ENUM, OPT_PROV_ENUM } OPTION_CHOICE; @@ -109,6 +111,7 @@ const OPTIONS req_options[] = { OPT_SECTION("Certificate"), {"new", OPT_NEW, '-', "New request"}, {"config", OPT_CONFIG, '<', "Request template file"}, + {"section", OPT_SECTION, 's', "Config section to use (default \"req\")"}, {"utf8", OPT_UTF8, '-', "Input characters are UTF8 (default ASCII)"}, {"nameopt", OPT_NAMEOPT, 's', "Various certificate name options"}, {"reqopt", OPT_REQOPT, 's', "Various request text options"}, @@ -309,6 +312,9 @@ int req_main(int argc, char **argv) case OPT_CONFIG: template = opt_arg(); break; + case OPT_SECTION: + section = opt_arg(); + break; case OPT_KEYFORM: if (!opt_format(opt_arg(), OPT_FMT_ANY, &keyform)) goto opthelp; @@ -519,7 +525,7 @@ int req_main(int argc, char **argv) goto end; if (md_alg == NULL) { - p = NCONF_get_string(req_conf, SECTION, "default_md"); + p = NCONF_get_string(req_conf, section, "default_md"); if (p == NULL) { ERR_clear_error(); } else { @@ -530,7 +536,7 @@ int req_main(int argc, char **argv) } if (extensions == NULL) { - extensions = NCONF_get_string(req_conf, SECTION, V3_EXTENSIONS); + extensions = NCONF_get_string(req_conf, section, V3_EXTENSIONS); if (extensions == NULL) ERR_clear_error(); } @@ -558,19 +564,19 @@ int req_main(int argc, char **argv) if (passin == NULL) { passin = nofree_passin = - NCONF_get_string(req_conf, SECTION, "input_password"); + NCONF_get_string(req_conf, section, "input_password"); if (passin == NULL) ERR_clear_error(); } if (passout == NULL) { passout = nofree_passout = - NCONF_get_string(req_conf, SECTION, "output_password"); + NCONF_get_string(req_conf, section, "output_password"); if (passout == NULL) ERR_clear_error(); } - p = NCONF_get_string(req_conf, SECTION, STRING_MASK); + p = NCONF_get_string(req_conf, section, STRING_MASK); if (p == NULL) ERR_clear_error(); @@ -580,7 +586,7 @@ int req_main(int argc, char **argv) } if (chtype != MBSTRING_UTF8) { - p = NCONF_get_string(req_conf, SECTION, UTF8_IN); + p = NCONF_get_string(req_conf, section, UTF8_IN); if (p == NULL) ERR_clear_error(); else if (strcmp(p, "yes") == 0) @@ -588,7 +594,7 @@ int req_main(int argc, char **argv) } if (req_exts == NULL) { - req_exts = NCONF_get_string(req_conf, SECTION, REQ_EXTENSIONS); + req_exts = NCONF_get_string(req_conf, section, REQ_EXTENSIONS); if (req_exts == NULL) ERR_clear_error(); } @@ -611,14 +617,14 @@ int req_main(int argc, char **argv) /* load_key() has already printed an appropriate message */ goto end; } else { - app_RAND_load_conf(req_conf, SECTION); + app_RAND_load_conf(req_conf, section); } } if (newreq && (pkey == NULL)) { - app_RAND_load_conf(req_conf, SECTION); + app_RAND_load_conf(req_conf, section); - if (!NCONF_get_number(req_conf, SECTION, BITS, &newkey)) { + if (!NCONF_get_number(req_conf, section, BITS, &newkey)) { newkey = DEFAULT_KEY_LENGTH; } @@ -688,7 +694,7 @@ int req_main(int argc, char **argv) genctx = NULL; if (keyout == NULL) { - keyout = NCONF_get_string(req_conf, SECTION, KEYFILE); + keyout = NCONF_get_string(req_conf, section, KEYFILE); if (keyout == NULL) ERR_clear_error(); } @@ -701,10 +707,10 @@ int req_main(int argc, char **argv) if (out == NULL) goto end; - p = NCONF_get_string(req_conf, SECTION, "encrypt_rsa_key"); + p = NCONF_get_string(req_conf, section, "encrypt_rsa_key"); if (p == NULL) { ERR_clear_error(); - p = NCONF_get_string(req_conf, SECTION, "encrypt_key"); + p = NCONF_get_string(req_conf, section, "encrypt_key"); if (p == NULL) ERR_clear_error(); } @@ -1062,13 +1068,13 @@ static int make_REQ(X509_REQ *req, EVP_PKEY *pkey, char *subj, int multirdn, STACK_OF(CONF_VALUE) *dn_sk, *attr_sk = NULL; char *tmp, *dn_sect, *attr_sect; - tmp = NCONF_get_string(req_conf, SECTION, PROMPT); + tmp = NCONF_get_string(req_conf, section, PROMPT); if (tmp == NULL) ERR_clear_error(); if ((tmp != NULL) && strcmp(tmp, "no") == 0) no_prompt = 1; - dn_sect = NCONF_get_string(req_conf, SECTION, DISTINGUISHED_NAME); + dn_sect = NCONF_get_string(req_conf, section, DISTINGUISHED_NAME); if (dn_sect == NULL) { BIO_printf(bio_err, "unable to find '%s' in config\n", DISTINGUISHED_NAME); @@ -1080,7 +1086,7 @@ static int make_REQ(X509_REQ *req, EVP_PKEY *pkey, char *subj, int multirdn, goto err; } - attr_sect = NCONF_get_string(req_conf, SECTION, ATTRIBUTES); + attr_sect = NCONF_get_string(req_conf, section, ATTRIBUTES); if (attr_sect == NULL) { ERR_clear_error(); attr_sk = NULL; diff --git a/doc/man1/openssl-ca.pod.in b/doc/man1/openssl-ca.pod.in index 8eef310ca4..a3c83d8076 100644 --- a/doc/man1/openssl-ca.pod.in +++ b/doc/man1/openssl-ca.pod.in @@ -12,6 +12,7 @@ B B [B<-verbose>] [B<-config> I] [B<-name> I
] +[B<-section> I
] [B<-gencrl>] [B<-revoke> I] [B<-valid> I] @@ -94,7 +95,7 @@ Specifies the configuration file to use. Optional; for a description of the default value, see L. -=item B<-name> I
+=item B<-name> I
, B<-section> I
Specifies the configuration file section to use (overrides B in the B section). @@ -772,6 +773,8 @@ seeding mechanism. The new seeding mechanism makes it unnecessary to define a RANDFILE for saving and restoring randomness. This option is retained mainly for compatibility reasons. +The B<-section> option was added in OpenSSL 3.0.0. + =head1 SEE ALSO L, diff --git a/doc/man1/openssl-req.pod.in b/doc/man1/openssl-req.pod.in index 703a208bc1..7587cb5a71 100644 --- a/doc/man1/openssl-req.pod.in +++ b/doc/man1/openssl-req.pod.in @@ -30,6 +30,7 @@ B B [B<-keygen_engine> I] [B<-I>] [B<-config> I] +[B<-section> I] [B<-multivalue-rdn>] [B<-x509>] [B<-days> I] @@ -206,6 +207,10 @@ This allows an alternative configuration file to be specified. Optional; for a description of the default value, see L. +=item B<-section> I + +Specifies the name of the section to use; the default is B. + =item B<-subj> I Sets subject name for new request or supersedes the subject name @@ -331,8 +336,10 @@ argument for this option is string of hexadecimal digits. =head1 CONFIGURATION FILE FORMAT The configuration options are specified in the B section of -the configuration file. As with all configuration files if no -value is specified in the specific section (i.e. B) then +the configuration file. An alternate name be specified by using the +B<-section> option. +As with all configuration files, if no +value is specified in the specific section then the initial unnamed or B section is searched too. The options available are described in detail below. @@ -678,6 +685,10 @@ L, L, L +=head1 HISTORY + +The B<-section> option was added in OpenSSL 3.0.0. + =head1 COPYRIGHT Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved. diff --git a/test/recipes/25-test_req.t b/test/recipes/25-test_req.t index 1a6efa8be2..662109c896 100644 --- a/test/recipes/25-test_req.t +++ b/test/recipes/25-test_req.t @@ -15,7 +15,7 @@ use OpenSSL::Test qw/:DEFAULT srctop_file/; setup("test_req"); -plan tests => 15; +plan tests => 16; require_ok(srctop_file('test','recipes','tconversion.pl')); @@ -42,6 +42,34 @@ ok(!run(app([@addext_args, "-addext", $val, "-addext", $val2]))); ok(!run(app([@addext_args, "-addext", $val, "-addext", $val3]))); ok(!run(app([@addext_args, "-addext", $val2, "-addext", $val3]))); +subtest "generating alt certificate requests with RSA" => sub { + plan tests => 3; + + SKIP: { + skip "RSA is not supported by this OpenSSL build", 2 + if disabled("rsa"); + + ok(run(app(["openssl", "req", + "-config", srctop_file("test", "test.cnf"), + "-section", "altreq", + "-new", "-out", "testreq-rsa.pem", "-utf8", + "-key", srctop_file("test", "testrsa.pem")])), + "Generating request"); + + ok(run(app(["openssl", "req", + "-config", srctop_file("test", "test.cnf"), + "-verify", "-in", "testreq-rsa.pem", "-noout"])), + "Verifying signature on request"); + + ok(run(app(["openssl", "req", + "-config", srctop_file("test", "test.cnf"), + "-section", "altreq", + "-verify", "-in", "testreq-rsa.pem", "-noout"])), + "Verifying signature on request"); + } +}; + + subtest "generating certificate requests with RSA" => sub { plan tests => 2; diff --git a/test/test.cnf b/test/test.cnf index 1e2fa31cce..a686c3d8bd 100644 --- a/test/test.cnf +++ b/test/test.cnf @@ -1,7 +1,3 @@ -# -# SSLeay example configuration file. -# This is mostly being used for generation of certificate requests. -# #################################################################### [ ca ] @@ -58,28 +54,25 @@ default_keyfile = testkey.pem distinguished_name = req_distinguished_name encrypt_rsa_key = no +# Make altreq be identical to req +[ altreq ] +default_bits = 2048 +default_keyfile = testkey.pem +distinguished_name = req_distinguished_name +encrypt_rsa_key = no + [ req_distinguished_name ] -countryName = Country Name (2 letter code) -countryName_default = AU +countryName = C field countryName_value = AU - -stateOrProvinceName = State or Province Name (full name) -stateOrProvinceName_default = Queensland +stateOrProvinceName = SP field stateOrProvinceName_value = - -localityName = Locality Name (eg, city) +localityName = L field localityName_value = Brisbane - -organizationName = Organization Name (eg, company) -organizationName_default = +organizationName = O field organizationName_value = CryptSoft Pty Ltd - -organizationalUnitName = Organizational Unit Name (eg, section) -organizationalUnitName_default = +organizationalUnitName = OU field organizationalUnitName_value = . - -commonName = Common Name (eg, YOUR name) +commonName = CN field commonName_value = Eric Young - -emailAddress = Email Address +emailAddress = email field emailAddress_value = eay at mincom.oz.au From builds at travis-ci.org Sat Mar 7 10:31:46 2020 From: builds at travis-ci.org (Travis CI) Date: Sat, 07 Mar 2020 10:31:46 +0000 Subject: Still Failing: openssl/openssl#32928 (master - 6bd4e3f) In-Reply-To: Message-ID: <5e63781227b57_43f94b9e1b594547ce@8ff7504b-b5ed-41bd-b8a0-5dbd028e6132.mail> Build Update for openssl/openssl ------------------------------------- Build: #32928 Status: Still Failing Duration: 47 mins and 38 secs Commit: 6bd4e3f (master) Author: Pauli Message: cmdline app: add provider commandline options. Add a -provider option to allow providers to be loaded. This option can be specified multiple times. Add a -provider_path option to allow the path to providers to be specified. Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/11167) View the changeset: https://github.com/openssl/openssl/compare/55f02cb6849f...6bd4e3f231d7 View the full build log and details: https://travis-ci.org/openssl/openssl/builds/659483296?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the openssl/openssl repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=5849220&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From builds at travis-ci.org Sat Mar 7 10:59:06 2020 From: builds at travis-ci.org (Travis CI) Date: Sat, 07 Mar 2020 10:59:06 +0000 Subject: Still Failing: openssl/openssl#32929 (master - d462b5f) In-Reply-To: Message-ID: <5e637e79c32f3_43f94b9e1b594577a0@8ff7504b-b5ed-41bd-b8a0-5dbd028e6132.mail> Build Update for openssl/openssl ------------------------------------- Build: #32929 Status: Still Failing Duration: 48 mins and 19 secs Commit: d462b5f (master) Author: Rich Salz Message: Add -section option to 'req' command This removes "req" as the hardwired section for the req command. Doing this will let us merge some test configs. Reviewed-by: Tomas Mraz Reviewed-by: Dmitry Belyavskiy (Merged from https://github.com/openssl/openssl/pull/11249) View the changeset: https://github.com/openssl/openssl/compare/6bd4e3f231d7...d462b5ff21e9 View the full build log and details: https://travis-ci.org/openssl/openssl/builds/659489592?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the openssl/openssl repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=5849220&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From levitte at openssl.org Sun Mar 8 15:49:52 2020 From: levitte at openssl.org (Richard Levitte) Date: Sun, 08 Mar 2020 15:49:52 +0000 Subject: [openssl] OpenSSL_1_1_1-stable update Message-ID: <1583682592.739434.9033.nullmailer@dev.openssl.org> The branch OpenSSL_1_1_1-stable has been updated via 9aba5c5ff2ccfe59e1c7d77918804919d549ebbc (commit) from 4eca3ec728f328a1b05553814e58ca9aa1cb4e78 (commit) - Log ----------------------------------------------------------------- commit 9aba5c5ff2ccfe59e1c7d77918804919d549ebbc Author: Bastian Germann Date: Thu Feb 13 11:58:27 2020 +0100 apps x509: passing PKCS#11 URL as -signkey OpenSSL 1.1.0 has extended option checking, and rejects passing a PKCS#11 engine URL to "-signkey" option. The actual code is ready to take it. Change the option parsing to allow an engine URL to be passed and modify the manpage accordingly. CLA: trivial (cherry picked from commit 16d560439d8b1be5082228a87576a8f79b3525ac) Reviewed-by: Shane Lontis Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/11173) ----------------------------------------------------------------------- Summary of changes: apps/x509.c | 2 +- doc/man1/x509.pod | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/x509.c b/apps/x509.c index 79518a4e62..49117151e2 100644 --- a/apps/x509.c +++ b/apps/x509.c @@ -107,7 +107,7 @@ const OPTIONS x509_options[] = { {"checkend", OPT_CHECKEND, 'M', "Check whether the cert expires in the next arg seconds"}, {OPT_MORE_STR, 1, 1, "Exit 1 if so, 0 if not"}, - {"signkey", OPT_SIGNKEY, '<', "Self sign cert with arg"}, + {"signkey", OPT_SIGNKEY, 's', "Self sign cert with arg"}, {"x509toreq", OPT_X509TOREQ, '-', "Output a certification request object"}, {"req", OPT_REQ, '-', "Input is a certificate request, sign and output"}, diff --git a/doc/man1/x509.pod b/doc/man1/x509.pod index e498aee4ff..ab1a39c9c6 100644 --- a/doc/man1/x509.pod +++ b/doc/man1/x509.pod @@ -44,7 +44,7 @@ B B [B<-setalias arg>] [B<-days arg>] [B<-set_serial n>] -[B<-signkey filename>] +[B<-signkey arg>] [B<-passin arg>] [B<-x509toreq>] [B<-req>] @@ -350,10 +350,11 @@ can thus behave like a "mini CA". =over 4 -=item B<-signkey filename> +=item B<-signkey arg> This option causes the input file to be self signed using the supplied -private key. +private key or engine. The private key's format is specified with the +B<-keyform> option. If the input file is a certificate it sets the issuer name to the subject name (i.e. makes it self signed) changes the public key to the From matthias.st.pierre at ncp-e.com Sun Mar 8 21:42:49 2020 From: matthias.st.pierre at ncp-e.com (matthias.st.pierre at ncp-e.com) Date: Sun, 08 Mar 2020 21:42:49 +0000 Subject: [openssl] OpenSSL_1_1_1-stable update Message-ID: <1583703769.328935.14323.nullmailer@dev.openssl.org> The branch OpenSSL_1_1_1-stable has been updated via 53418932416594fda43b58ff64d455457b05c969 (commit) via eed9d03b4f6b7df80a34d274b551f48ae8295ef4 (commit) from 9aba5c5ff2ccfe59e1c7d77918804919d549ebbc (commit) - Log ----------------------------------------------------------------- commit 53418932416594fda43b58ff64d455457b05c969 Author: Richard Levitte Date: Wed Jan 8 11:08:06 2020 +0100 DOC: Make EVP_SignInit.pod conform with man-pages(7) Reviewed-by: Nicola Tuveri (cherry picked from commit 03d65ca2095777cf6314ad813eb7de5779c9b93d) Reviewed-by: Matthias St. Pierre (Merged from https://github.com/openssl/openssl/pull/11232) commit eed9d03b4f6b7df80a34d274b551f48ae8295ef4 Author: Richard Levitte Date: Wed Jan 8 11:04:15 2020 +0100 DOC: New file for EVP_PKEY_size(), EVP_PKEY_bits() and EVP_PKEY_security_bits() We change the description to be about the key rather than the signature. How the key size is related to the signature is explained in the description of EVP_SignFinal() anyway. Reviewed-by: Nicola Tuveri (cherry picked from commit 6942a0d6feb8d3dcbbc6a1ec6be9de7ab2df1530) Reviewed-by: Matthias St. Pierre (Merged from https://github.com/openssl/openssl/pull/11232) ----------------------------------------------------------------------- Summary of changes: doc/man3/EVP_PKEY_size.pod | 80 ++++++++++++++++++++++++++++++++++++++++++++++ doc/man3/EVP_SignInit.pod | 42 ++++++++---------------- 2 files changed, 94 insertions(+), 28 deletions(-) create mode 100644 doc/man3/EVP_PKEY_size.pod diff --git a/doc/man3/EVP_PKEY_size.pod b/doc/man3/EVP_PKEY_size.pod new file mode 100644 index 0000000000..786c503914 --- /dev/null +++ b/doc/man3/EVP_PKEY_size.pod @@ -0,0 +1,80 @@ +=pod + +=head1 NAME + +EVP_PKEY_size, EVP_PKEY_bits, EVP_PKEY_security_bits +- EVP_PKEY information functions + +=head1 SYNOPSIS + + #include + + int EVP_PKEY_size(const EVP_PKEY *pkey); + int EVP_PKEY_bits(const EVP_PKEY *pkey); + int EVP_PKEY_security_bits(const EVP_PKEY *pkey); + +=head1 DESCRIPTION + +EVP_PKEY_size() returns the maximum suitable size for the output +buffers for almost all operations that can be done with I. +The primary documented use is with L and +L, but it isn't limited there. The returned size is +also large enough for the output buffer of L, +L, L, L. + +It must be stressed that, unless the documentation for the operation +that's being performed says otherwise, the size returned by +EVP_PKEY_size() is only preliminary and not exact, so the final +contents of the target buffer may be smaller. It is therefore crucial +to take note of the size given back by the function that performs the +operation, such as L (the I argument will +receive that length), to avoid bugs. + +EVP_PKEY_bits() returns the cryptographic length of the cryptosystem +to which the key in I belongs, in bits. Note that the definition +of cryptographic length is specific to the key cryptosystem. + +EVP_PKEY_security_bits() returns the number of security bits of the given +I, bits of security is defined in NIST SP800-57. + +=head1 RETURN VALUES + +EVP_PKEY_size(), EVP_PKEY_bits() and EVP_PKEY_security_bits() return a +positive number, or 0 if this size isn't available. + +=head1 NOTES + +Most functions that have an output buffer and are mentioned with +EVP_PKEY_size() have a functionality where you can pass NULL for the +buffer and still pass a pointer to an integer and get the exact size +that this function call delivers in the context that it's called in. +This allows those functions to be called twice, once to find out the +exact buffer size, then allocate the buffer in between, and call that +function again actually output the data. For those functions, it +isn't strictly necessary to call EVP_PKEY_size() to find out the +buffer size, but may be useful in cases where it's desirable to know +the upper limit in advance. + +It should also be especially noted that EVP_PKEY_size() shouldn't be +used to get the output size for EVP_DigestSignFinal(), according to +L. + +=head1 SEE ALSO + +L, +L, +L, +L, +L, +L + +=head1 COPYRIGHT + +Copyright 2020 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the Apache License 2.0 (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +L. + +=cut diff --git a/doc/man3/EVP_SignInit.pod b/doc/man3/EVP_SignInit.pod index c26b7f7d5d..becfed4ad3 100644 --- a/doc/man3/EVP_SignInit.pod +++ b/doc/man3/EVP_SignInit.pod @@ -2,10 +2,8 @@ =head1 NAME -EVP_PKEY_size, -EVP_SignInit, EVP_SignInit_ex, EVP_SignUpdate, EVP_SignFinal, -EVP_PKEY_security_bits - EVP signing -functions +EVP_SignInit, EVP_SignInit_ex, EVP_SignUpdate, EVP_SignFinal +- EVP signing functions =head1 SYNOPSIS @@ -17,49 +15,36 @@ functions void EVP_SignInit(EVP_MD_CTX *ctx, const EVP_MD *type); - int EVP_PKEY_size(const EVP_PKEY *pkey); - int EVP_PKEY_security_bits(const EVP_PKEY *pkey); - =head1 DESCRIPTION The EVP signature routines are a high level interface to digital signatures. -EVP_SignInit_ex() sets up signing context B to use digest -B from ENGINE B. B must be created with +EVP_SignInit_ex() sets up signing context I to use digest +I from B I. I must be created with EVP_MD_CTX_new() before calling this function. -EVP_SignUpdate() hashes B bytes of data at B into the -signature context B. This function can be called several times on the -same B to include additional data. +EVP_SignUpdate() hashes I bytes of data at I into the +signature context I. This function can be called several times on the +same I to include additional data. -EVP_SignFinal() signs the data in B using the private key B and -places the signature in B. B must be at least EVP_PKEY_size(pkey) -bytes in size. B is an OUT parameter, and not used as an IN parameter. +EVP_SignFinal() signs the data in I using the private key I and +places the signature in I. I must be at least C +bytes in size. I is an OUT parameter, and not used as an IN parameter. The number of bytes of data written (i.e. the length of the signature) -will be written to the integer at B, at most EVP_PKEY_size(pkey) bytes +will be written to the integer at I, at most C bytes will be written. -EVP_SignInit() initializes a signing context B to use the default -implementation of digest B. - -EVP_PKEY_size() returns the maximum size of a signature in bytes. The actual -signature returned by EVP_SignFinal() may be smaller. - -EVP_PKEY_security_bits() returns the number of security bits of the given B, -bits of security is defined in NIST SP800-57. +EVP_SignInit() initializes a signing context I to use the default +implementation of digest I. =head1 RETURN VALUES EVP_SignInit_ex(), EVP_SignUpdate() and EVP_SignFinal() return 1 for success and 0 for failure. -EVP_PKEY_size() returns the maximum size of a signature in bytes. - The error codes can be obtained by L. -EVP_PKEY_security_bits() returns the number of security bits. - =head1 NOTES The B interface to digital signatures should almost always be used in @@ -95,6 +80,7 @@ The previous two bugs are fixed in the newer EVP_SignDigest*() function. =head1 SEE ALSO +L, L, L, L, L, L, L, L, From levitte at openssl.org Sun Mar 8 21:44:56 2020 From: levitte at openssl.org (Richard Levitte) Date: Sun, 08 Mar 2020 21:44:56 +0000 Subject: [openssl] master update Message-ID: <1583703896.589773.15790.nullmailer@dev.openssl.org> The branch master has been updated via c339c702f6043fabd09904044f967e71629bc40f (commit) from d462b5ff21e9fcdef98447c8f8d8c694b1e79602 (commit) - Log ----------------------------------------------------------------- commit c339c702f6043fabd09904044f967e71629bc40f Author: Kurt Roeckx Date: Sun Feb 16 14:44:06 2020 +0100 Improve small block cipher performance Avoid function calls we don't need to do. In 1.1.1 we have: aes-128-cbc 572267.80k 681197.08k 715430.74k 720508.59k 722359.64k 723004.07k Current master: aes-128-cbc 460663.70k 631125.66k 701283.58k 719794.52k 724732.59k 726668.63k new: aes-128-cbc 582057.64k 684288.62k 715721.90k 724856.15k 717578.24k 727176.53k Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/11102) ----------------------------------------------------------------------- Summary of changes: providers/implementations/ciphers/cipher_aes_ocb.c | 9 +++++++-- providers/implementations/ciphers/ciphercommon.c | 9 +++++++-- providers/implementations/ciphers/ciphercommon_block.c | 17 +++++++---------- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/providers/implementations/ciphers/cipher_aes_ocb.c b/providers/implementations/ciphers/cipher_aes_ocb.c index 2f85604a87..3d4863ea03 100644 --- a/providers/implementations/ciphers/cipher_aes_ocb.c +++ b/providers/implementations/ciphers/cipher_aes_ocb.c @@ -150,9 +150,14 @@ static int aes_ocb_block_update_internal(PROV_AES_OCB_CTX *ctx, size_t outsize, const unsigned char *in, size_t inl, OSSL_ocb_cipher_fn ciph) { - size_t nextblocks = fillblock(buf, bufsz, AES_BLOCK_SIZE, &in, &inl); + size_t nextblocks; size_t outlint = 0; + if (bufsz != 0) + nextblocks = fillblock(buf, bufsz, AES_BLOCK_SIZE, &in, &inl); + else + nextblocks = inl & ~(AES_BLOCK_SIZE-1); + if (*bufsz == AES_BLOCK_SIZE) { if (outsize < AES_BLOCK_SIZE) { ERR_raise(ERR_LIB_PROV, PROV_R_OUTPUT_BUFFER_TOO_SMALL); @@ -179,7 +184,7 @@ static int aes_ocb_block_update_internal(PROV_AES_OCB_CTX *ctx, in += nextblocks; inl -= nextblocks; } - if (!trailingdata(buf, bufsz, AES_BLOCK_SIZE, &in, &inl)) { + if (inl != 0 && !trailingdata(buf, bufsz, AES_BLOCK_SIZE, &in, &inl)) { /* PROVerr already called */ return 0; } diff --git a/providers/implementations/ciphers/ciphercommon.c b/providers/implementations/ciphers/ciphercommon.c index 967622cf64..33afa57585 100644 --- a/providers/implementations/ciphers/ciphercommon.c +++ b/providers/implementations/ciphers/ciphercommon.c @@ -176,7 +176,12 @@ int cipher_generic_block_update(void *vctx, unsigned char *out, size_t *outl, size_t outlint = 0; PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx; size_t blksz = ctx->blocksize; - size_t nextblocks = fillblock(ctx->buf, &ctx->bufsz, blksz, &in, &inl); + size_t nextblocks; + + if (ctx->bufsz != 0) + nextblocks = fillblock(ctx->buf, &ctx->bufsz, blksz, &in, &inl); + else + nextblocks = inl & ~(blksz-1); /* * If we're decrypting and we end an update on a block boundary we hold @@ -218,7 +223,7 @@ int cipher_generic_block_update(void *vctx, unsigned char *out, size_t *outl, in += nextblocks; inl -= nextblocks; } - if (!trailingdata(ctx->buf, &ctx->bufsz, blksz, &in, &inl)) { + if (inl != 0 && !trailingdata(ctx->buf, &ctx->bufsz, blksz, &in, &inl)) { /* ERR_raise already called */ return 0; } diff --git a/providers/implementations/ciphers/ciphercommon_block.c b/providers/implementations/ciphers/ciphercommon_block.c index eff94842ed..ee54f481c6 100644 --- a/providers/implementations/ciphers/ciphercommon_block.c +++ b/providers/implementations/ciphers/ciphercommon_block.c @@ -35,20 +35,17 @@ size_t fillblock(unsigned char *buf, size_t *buflen, size_t blocksize, const unsigned char **in, size_t *inlen) { size_t blockmask = ~(blocksize - 1); + size_t bufremain = blocksize - *buflen; assert(*buflen <= blocksize); assert(blocksize > 0 && (blocksize & (blocksize - 1)) == 0); - if (*buflen != blocksize && (*buflen != 0 || *inlen < blocksize)) { - size_t bufremain = blocksize - *buflen; - - if (*inlen < bufremain) - bufremain = *inlen; - memcpy(buf + *buflen, *in, bufremain); - *in += bufremain; - *inlen -= bufremain; - *buflen += bufremain; - } + if (*inlen < bufremain) + bufremain = *inlen; + memcpy(buf + *buflen, *in, bufremain); + *in += bufremain; + *inlen -= bufremain; + *buflen += bufremain; return *inlen & blockmask; } From matthias.st.pierre at ncp-e.com Sun Mar 8 21:47:26 2020 From: matthias.st.pierre at ncp-e.com (matthias.st.pierre at ncp-e.com) Date: Sun, 08 Mar 2020 21:47:26 +0000 Subject: [openssl] master update Message-ID: <1583704046.968373.17031.nullmailer@dev.openssl.org> The branch master has been updated via a08e2bf548507443ce9a020dd4cc68a57c27a8b7 (commit) from c339c702f6043fabd09904044f967e71629bc40f (commit) - Log ----------------------------------------------------------------- commit a08e2bf548507443ce9a020dd4cc68a57c27a8b7 Author: Dr. Matthias St. Pierre Date: Wed Mar 4 23:13:24 2020 +0100 doc: slightly reformulate 'openssl(1)/Random State Options' section Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/11252) ----------------------------------------------------------------------- Summary of changes: doc/man1/openssl.pod | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/man1/openssl.pod b/doc/man1/openssl.pod index 2f56ab7592..ff66846337 100644 --- a/doc/man1/openssl.pod +++ b/doc/man1/openssl.pod @@ -727,11 +727,11 @@ Do not use the default store. =head2 Random State Options -Prior to OpenSSL 3.0, it was common for applications to store information +Prior to OpenSSL 1.1.1, it was common for applications to store information about the state of the random-number generator in a file that was loaded at startup and rewritten upon exit. On modern operating systems, this is -generally no longer necessary as OpenSSL will seed itself from the -appropriate CPU flags, device files, and so on. These flags are still +generally no longer necessary as OpenSSL will seed itself from a trusted +entropy source provided by the operating system. These flags are still supported for special platforms or circumstances that might require them. It is generally an error to use the same seed file more than once and From builds at travis-ci.org Sun Mar 8 22:43:05 2020 From: builds at travis-ci.org (Travis CI) Date: Sun, 08 Mar 2020 22:43:05 +0000 Subject: Still Failing: openssl/openssl#32941 (master - c339c70) In-Reply-To: Message-ID: <5e6574f92b7a0_43f94ce0bdef01306fd@95d35f90-a776-4ed0-9a63-7d511e031770.mail> Build Update for openssl/openssl ------------------------------------- Build: #32941 Status: Still Failing Duration: 51 mins and 9 secs Commit: c339c70 (master) Author: Kurt Roeckx Message: Improve small block cipher performance Avoid function calls we don't need to do. In 1.1.1 we have: aes-128-cbc 572267.80k 681197.08k 715430.74k 720508.59k 722359.64k 723004.07k Current master: aes-128-cbc 460663.70k 631125.66k 701283.58k 719794.52k 724732.59k 726668.63k new: aes-128-cbc 582057.64k 684288.62k 715721.90k 724856.15k 717578.24k 727176.53k Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/11102) View the changeset: https://github.com/openssl/openssl/compare/d462b5ff21e9...c339c702f604 View the full build log and details: https://travis-ci.org/openssl/openssl/builds/659914123?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the openssl/openssl repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=5849220&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From builds at travis-ci.org Sun Mar 8 22:54:31 2020 From: builds at travis-ci.org (Travis CI) Date: Sun, 08 Mar 2020 22:54:31 +0000 Subject: Still Failing: openssl/openssl#32942 (master - a08e2bf) In-Reply-To: Message-ID: <5e6577a74a8c1_43fcf9f41fc042295ba@0d03a995-29ec-4302-ac47-d44de5c1ffda.mail> Build Update for openssl/openssl ------------------------------------- Build: #32942 Status: Still Failing Duration: 52 mins and 44 secs Commit: a08e2bf (master) Author: Dr. Matthias St. Pierre Message: doc: slightly reformulate 'openssl(1)/Random State Options' section Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/11252) View the changeset: https://github.com/openssl/openssl/compare/c339c702f604...a08e2bf54850 View the full build log and details: https://travis-ci.org/openssl/openssl/builds/659914744?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the openssl/openssl repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=5849220&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From levitte at openssl.org Mon Mar 9 05:24:59 2020 From: levitte at openssl.org (Richard Levitte) Date: Mon, 09 Mar 2020 05:24:59 +0000 Subject: [openssl] master update Message-ID: <1583731499.537044.30891.nullmailer@dev.openssl.org> The branch master has been updated via db4b3d8392fc1c3a1033045efdda222fd76c26b2 (commit) from a08e2bf548507443ce9a020dd4cc68a57c27a8b7 (commit) - Log ----------------------------------------------------------------- commit db4b3d8392fc1c3a1033045efdda222fd76c26b2 Author: Richard Levitte Date: Wed Feb 19 07:05:52 2020 +0100 Refactor CRMF_poposigningkey_init() to work with provider keys The code in this function was almost entirely a copy of the functionality in ASN1_item_sign(), so it gets refactored to actually call ASN1_item_sign(), and thereby automatically gets support for EVP_PKEYs with only provider side keys. Reviewed-by: David von Oheimb (Merged from https://github.com/openssl/openssl/pull/11126) ----------------------------------------------------------------------- Summary of changes: crypto/crmf/crmf_lib.c | 59 ++++++++++---------------------------------------- 1 file changed, 12 insertions(+), 47 deletions(-) diff --git a/crypto/crmf/crmf_lib.c b/crypto/crmf/crmf_lib.c index 4d81569299..863d26f86e 100644 --- a/crypto/crmf/crmf_lib.c +++ b/crypto/crmf/crmf_lib.c @@ -367,65 +367,30 @@ static int CRMF_poposigningkey_init(OSSL_CRMF_POPOSIGNINGKEY *ps, OSSL_CRMF_CERTREQUEST *cr, EVP_PKEY *pkey, int dgst) { - int len; - size_t crlen; - size_t siglen; - unsigned char *crder = NULL, *sig = NULL; - int alg_nid = 0; - int md_nid = 0; - const EVP_MD *alg = NULL; - EVP_MD_CTX *ctx = NULL; int ret = 0; + EVP_MD *fetched_md = NULL; + const EVP_MD *md = EVP_get_digestbynid(dgst); if (ps == NULL || cr == NULL || pkey == NULL) { CRMFerr(CRMF_F_CRMF_POPOSIGNINGKEY_INIT, CRMF_R_NULL_ARGUMENT); return 0; } - /* OpenSSL defaults all bit strings to be encoded as ASN.1 NamedBitList */ - ps->signature->flags &= ~(ASN1_STRING_FLAG_BITS_LEFT | 0x07); - ps->signature->flags |= ASN1_STRING_FLAG_BITS_LEFT; + /* If we didn't find legacy MD, we try an implicit fetch */ + if (md == NULL) + md = fetched_md = EVP_MD_fetch(NULL, OBJ_nid2sn(dgst), NULL); - len = i2d_OSSL_CRMF_CERTREQUEST(cr, &crder); - if (len < 0 || crder == NULL) { - CRMFerr(CRMF_F_CRMF_POPOSIGNINGKEY_INIT, CRMF_R_ERROR); - goto err; - } - crlen = (size_t)len; - - if (!OBJ_find_sigid_by_algs(&alg_nid, dgst, EVP_PKEY_id(pkey))) { - CRMFerr(CRMF_F_CRMF_POPOSIGNINGKEY_INIT, - CRMF_R_UNSUPPORTED_ALG_FOR_POPSIGNINGKEY); - goto err; - } - if (!OBJ_find_sigid_algs(alg_nid, &md_nid, NULL) - || (alg = EVP_get_digestbynid(md_nid)) == NULL) { + if (md == NULL) { CRMFerr(CRMF_F_CRMF_POPOSIGNINGKEY_INIT, CRMF_R_UNSUPPORTED_ALG_FOR_POPSIGNINGKEY); - goto err; - } - if (!X509_ALGOR_set0(ps->algorithmIdentifier, OBJ_nid2obj(alg_nid), - V_ASN1_NULL, NULL) - || (ctx = EVP_MD_CTX_new()) == NULL - || EVP_DigestSignInit(ctx, NULL, alg, NULL, pkey) <= 0 - || EVP_DigestSignUpdate(ctx, crder, crlen) <= 0 - || EVP_DigestSignFinal(ctx, NULL, &siglen) <= 0) { - CRMFerr(CRMF_F_CRMF_POPOSIGNINGKEY_INIT, CRMF_R_ERROR); - goto err; - } - if ((sig = OPENSSL_malloc(siglen)) == NULL) - goto err; - if (EVP_DigestSignFinal(ctx, sig, &siglen) <= 0 - || !ASN1_BIT_STRING_set(ps->signature, sig, siglen)) { - CRMFerr(CRMF_F_CRMF_POPOSIGNINGKEY_INIT, CRMF_R_ERROR); - goto err; + return 0; } - ret = 1; - err: - OPENSSL_free(crder); - EVP_MD_CTX_free(ctx); - OPENSSL_free(sig); + ret = ASN1_item_sign(ASN1_ITEM_rptr(OSSL_CRMF_CERTREQUEST), + ps->algorithmIdentifier, NULL, ps->signature, + cr, pkey, md); + + EVP_MD_free(fetched_md); return ret; } From builds at travis-ci.org Mon Mar 9 06:14:28 2020 From: builds at travis-ci.org (Travis CI) Date: Mon, 09 Mar 2020 06:14:28 +0000 Subject: Still Failing: openssl/openssl#32947 (master - db4b3d8) In-Reply-To: Message-ID: <5e65dec446462_43fa83ee889e41038c4@722a7870-35af-4783-8211-8b4772b65e12.mail> Build Update for openssl/openssl ------------------------------------- Build: #32947 Status: Still Failing Duration: 48 mins and 10 secs Commit: db4b3d8 (master) Author: Richard Levitte Message: Refactor CRMF_poposigningkey_init() to work with provider keys The code in this function was almost entirely a copy of the functionality in ASN1_item_sign(), so it gets refactored to actually call ASN1_item_sign(), and thereby automatically gets support for EVP_PKEYs with only provider side keys. Reviewed-by: David von Oheimb (Merged from https://github.com/openssl/openssl/pull/11126) View the changeset: https://github.com/openssl/openssl/compare/a08e2bf54850...db4b3d8392fc View the full build log and details: https://travis-ci.org/openssl/openssl/builds/659998125?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the openssl/openssl repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=5849220&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt at openssl.org Mon Mar 9 08:06:14 2020 From: matt at openssl.org (Matt Caswell) Date: Mon, 09 Mar 2020 08:06:14 +0000 Subject: [openssl] master update Message-ID: <1583741174.974692.27285.nullmailer@dev.openssl.org> The branch master has been updated via d62be1580bf402f7088cdec5f21a87f27f40f18e (commit) via 3965480c824c9823db7803cc1a403be863cecc00 (commit) via eea1e780a1c2c6952af7b9e00129f5aaefb7207e (commit) via af6d8dd30ff48046f5af7d84095f30356c33264a (commit) from db4b3d8392fc1c3a1033045efdda222fd76c26b2 (commit) - Log ----------------------------------------------------------------- commit d62be1580bf402f7088cdec5f21a87f27f40f18e Author: Matt Caswell Date: Thu Mar 5 17:16:04 2020 +0000 Document the new DigestSign provider functions As well as the newly added "one shot" functions, we also document a number of the other other digestsign functions which were missing documentation in provider-signature.pod. Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/11261) commit 3965480c824c9823db7803cc1a403be863cecc00 Author: Matt Caswell Date: Thu Mar 5 15:42:13 2020 +0000 Implement provider support for Ed25519 annd Ed448 At the moment we only provider support for these algorithms in the default provider. These algorithms only support "one shot" EVP_DigestSign() and EVP_DigestVerify() as per the existing libcrypto versions. Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/11261) commit eea1e780a1c2c6952af7b9e00129f5aaefb7207e Author: Matt Caswell Date: Thu Mar 5 15:40:48 2020 +0000 Add provider awareness of EVP_DigestSign() and EVP_DigestVerify() These "one-shot" functions are the only ones supported by Ed25519 and Ed448, so we need to ensure that libcrypto can handle provider based implementations of these functions. Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/11261) commit af6d8dd30ff48046f5af7d84095f30356c33264a Author: Matt Caswell Date: Mon Feb 17 16:37:24 2020 +0000 Add Key Management support for EdDSA keys Support added for Ed25519 and Ed448 Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/11261) ----------------------------------------------------------------------- Summary of changes: crypto/ec/curve448/curve448_local.h | 9 - crypto/ec/curve448/eddsa.c | 1 + crypto/ec/ec_local.h | 4 - crypto/ec/ecx_meth.c | 4 + crypto/err/openssl.txt | 1 + crypto/evp/evp_local.h | 2 + crypto/evp/m_sigver.c | 62 +++++- crypto/evp/signature.c | 32 +++- doc/man7/provider-signature.pod | 166 +++++++++++++++- include/crypto/ecx.h | 41 ++-- include/openssl/core_numbers.h | 34 ++-- providers/common/include/prov/providercommonerr.h | 1 + providers/common/provider_err.c | 1 + providers/defltprov.c | 6 + .../implementations/include/prov/implementations.h | 4 + providers/implementations/keymgmt/ecx_kmgmt.c | 67 ++++--- providers/implementations/signature/build.info | 5 + providers/implementations/signature/eddsa.c | 211 +++++++++++++++++++++ 18 files changed, 571 insertions(+), 80 deletions(-) create mode 100644 providers/implementations/signature/eddsa.c diff --git a/crypto/ec/curve448/curve448_local.h b/crypto/ec/curve448/curve448_local.h index 36f960ec0e..b70a1b5406 100644 --- a/crypto/ec/curve448/curve448_local.h +++ b/crypto/ec/curve448/curve448_local.h @@ -10,15 +10,6 @@ # define OSSL_CRYPTO_EC_CURVE448_LOCAL_H # include "curve448utils.h" -int ED448_sign(OPENSSL_CTX *ctx, uint8_t *out_sig, const uint8_t *message, - size_t message_len, const uint8_t public_key[57], - const uint8_t private_key[57], const uint8_t *context, - size_t context_len); - -int ED448_verify(OPENSSL_CTX *ctx, const uint8_t *message, size_t message_len, - const uint8_t signature[114], const uint8_t public_key[57], - const uint8_t *context, size_t context_len); - int ED448ph_sign(OPENSSL_CTX *ctx, uint8_t *out_sig, const uint8_t hash[64], const uint8_t public_key[57], const uint8_t private_key[57], const uint8_t *context, size_t context_len); diff --git a/crypto/ec/curve448/eddsa.c b/crypto/ec/curve448/eddsa.c index b5762cb584..1cd76844d9 100644 --- a/crypto/ec/curve448/eddsa.c +++ b/crypto/ec/curve448/eddsa.c @@ -12,6 +12,7 @@ #include #include #include +#include "crypto/ecx.h" #include "curve448_local.h" #include "word.h" #include "ed448.h" diff --git a/crypto/ec/ec_local.h b/crypto/ec/ec_local.h index dacb2ca0af..b5963a7e5f 100644 --- a/crypto/ec/ec_local.h +++ b/crypto/ec/ec_local.h @@ -679,10 +679,6 @@ ECDSA_SIG *ecdsa_simple_sign_sig(const unsigned char *dgst, int dgst_len, int ecdsa_simple_verify_sig(const unsigned char *dgst, int dgst_len, const ECDSA_SIG *sig, EC_KEY *eckey); -int ED25519_sign(uint8_t *out_sig, const uint8_t *message, size_t message_len, - const uint8_t public_key[32], const uint8_t private_key[32]); -int ED25519_verify(const uint8_t *message, size_t message_len, - const uint8_t signature[64], const uint8_t public_key[32]); void ED25519_public_from_private(uint8_t out_public_key[32], const uint8_t private_key[32]); diff --git a/crypto/ec/ecx_meth.c b/crypto/ec/ecx_meth.c index 32817562bf..f107df3aa4 100644 --- a/crypto/ec/ecx_meth.c +++ b/crypto/ec/ecx_meth.c @@ -648,6 +648,8 @@ const EVP_PKEY_ASN1_METHOD ed25519_asn1_meth = { ecx_set_pub_key, ecx_get_priv_key, ecx_get_pub_key, + ecx_pkey_dirty_cnt, + ecx_pkey_export_to }; const EVP_PKEY_ASN1_METHOD ed448_asn1_meth = { @@ -690,6 +692,8 @@ const EVP_PKEY_ASN1_METHOD ed448_asn1_meth = { ecx_set_pub_key, ecx_get_priv_key, ecx_get_pub_key, + ecx_pkey_dirty_cnt, + ecx_pkey_export_to }; static int pkey_ecx_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) diff --git a/crypto/err/openssl.txt b/crypto/err/openssl.txt index f14acc65b6..8689e34925 100644 --- a/crypto/err/openssl.txt +++ b/crypto/err/openssl.txt @@ -2773,6 +2773,7 @@ PROV_R_FAILED_TO_DECRYPT:162:failed to decrypt PROV_R_FAILED_TO_GENERATE_KEY:121:failed to generate key PROV_R_FAILED_TO_GET_PARAMETER:103:failed to get parameter PROV_R_FAILED_TO_SET_PARAMETER:104:failed to set parameter +PROV_R_FAILED_TO_SIGN:175:failed to sign PROV_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE:165:\ illegal or unsupported padding mode PROV_R_INAVLID_UKM_LENGTH:146:inavlid ukm length diff --git a/crypto/evp/evp_local.h b/crypto/evp/evp_local.h index 774db4da8f..858f1c49d6 100644 --- a/crypto/evp/evp_local.h +++ b/crypto/evp/evp_local.h @@ -129,9 +129,11 @@ struct evp_signature_st { OSSL_OP_signature_digest_sign_init_fn *digest_sign_init; OSSL_OP_signature_digest_sign_update_fn *digest_sign_update; OSSL_OP_signature_digest_sign_final_fn *digest_sign_final; + OSSL_OP_signature_digest_sign_fn *digest_sign; OSSL_OP_signature_digest_verify_init_fn *digest_verify_init; OSSL_OP_signature_digest_verify_update_fn *digest_verify_update; OSSL_OP_signature_digest_verify_final_fn *digest_verify_final; + OSSL_OP_signature_digest_verify_fn *digest_verify; OSSL_OP_signature_freectx_fn *freectx; OSSL_OP_signature_dupctx_fn *dupctx; OSSL_OP_signature_get_ctx_params_fn *get_ctx_params; diff --git a/crypto/evp/m_sigver.c b/crypto/evp/m_sigver.c index b6c66722ec..225017b509 100644 --- a/crypto/evp/m_sigver.c +++ b/crypto/evp/m_sigver.c @@ -24,6 +24,18 @@ static int update(EVP_MD_CTX *ctx, const void *data, size_t datalen) return 0; } +/* + * If we get the "NULL" md then the name comes back as "UNDEF". We want to use + * NULL for this. + */ +static const char *canon_mdname(const char *mdname) +{ + if (mdname != NULL && strcmp(mdname, "UNDEF") == 0) + return NULL; + + return mdname; +} + static int do_sigver_init(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, const EVP_MD *type, const char *mdname, const char *props, ENGINE *e, EVP_PKEY *pkey, @@ -134,12 +146,12 @@ static int do_sigver_init(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, if (type != NULL) { ctx->reqdigest = type; if (mdname == NULL) - mdname = EVP_MD_name(type); + mdname = canon_mdname(EVP_MD_name(type)); } else { if (mdname == NULL && EVP_PKEY_get_default_digest_name(locpctx->pkey, locmdname, sizeof(locmdname))) - mdname = locmdname; + mdname = canon_mdname(locmdname); if (mdname != NULL) { /* @@ -280,6 +292,11 @@ int EVP_DigestSignUpdate(EVP_MD_CTX *ctx, const void *data, size_t dsize) || pctx->op.sig.signature == NULL) goto legacy; + if (pctx->op.sig.signature->digest_sign_update == NULL) { + ERR_raise(ERR_LIB_EVP, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + return 0; + } + return pctx->op.sig.signature->digest_sign_update(pctx->op.sig.sigprovctx, data, dsize); @@ -297,6 +314,11 @@ int EVP_DigestVerifyUpdate(EVP_MD_CTX *ctx, const void *data, size_t dsize) || pctx->op.sig.signature == NULL) goto legacy; + if (pctx->op.sig.signature->digest_verify_update == NULL) { + ERR_raise(ERR_LIB_EVP, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + return 0; + } + return pctx->op.sig.signature->digest_verify_update(pctx->op.sig.sigprovctx, data, dsize); @@ -391,8 +413,22 @@ int EVP_DigestSignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, int EVP_DigestSign(EVP_MD_CTX *ctx, unsigned char *sigret, size_t *siglen, const unsigned char *tbs, size_t tbslen) { - if (ctx->pctx->pmeth != NULL && ctx->pctx->pmeth->digestsign != NULL) - return ctx->pctx->pmeth->digestsign(ctx, sigret, siglen, tbs, tbslen); + EVP_PKEY_CTX *pctx = ctx->pctx; + + if (pctx != NULL + && pctx->operation == EVP_PKEY_OP_SIGNCTX + && pctx->op.sig.sigprovctx != NULL + && pctx->op.sig.signature != NULL) { + if (pctx->op.sig.signature->digest_sign != NULL) + return pctx->op.sig.signature->digest_sign(pctx->op.sig.sigprovctx, + sigret, siglen, SIZE_MAX, + tbs, tbslen); + } else { + /* legacy */ + if (ctx->pctx->pmeth != NULL && ctx->pctx->pmeth->digestsign != NULL) + return ctx->pctx->pmeth->digestsign(ctx, sigret, siglen, tbs, tbslen); + } + if (sigret != NULL && EVP_DigestSignUpdate(ctx, tbs, tbslen) <= 0) return 0; return EVP_DigestSignFinal(ctx, sigret, siglen); @@ -454,8 +490,22 @@ int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sig, int EVP_DigestVerify(EVP_MD_CTX *ctx, const unsigned char *sigret, size_t siglen, const unsigned char *tbs, size_t tbslen) { - if (ctx->pctx->pmeth != NULL && ctx->pctx->pmeth->digestverify != NULL) - return ctx->pctx->pmeth->digestverify(ctx, sigret, siglen, tbs, tbslen); + EVP_PKEY_CTX *pctx = ctx->pctx; + + if (pctx != NULL + && pctx->operation == EVP_PKEY_OP_VERIFYCTX + && pctx->op.sig.sigprovctx != NULL + && pctx->op.sig.signature != NULL) { + if (pctx->op.sig.signature->digest_verify != NULL) + return pctx->op.sig.signature->digest_verify(pctx->op.sig.sigprovctx, + sigret, siglen, + tbs, tbslen); + } else { + /* legacy */ + if (ctx->pctx->pmeth != NULL && ctx->pctx->pmeth->digestverify != NULL) + return ctx->pctx->pmeth->digestverify(ctx, sigret, siglen, tbs, tbslen); + } + if (EVP_DigestVerifyUpdate(ctx, tbs, tbslen) <= 0) return -1; return EVP_DigestVerifyFinal(ctx, sigret, siglen); diff --git a/crypto/evp/signature.c b/crypto/evp/signature.c index 3dfd4041e7..c01f076609 100644 --- a/crypto/evp/signature.c +++ b/crypto/evp/signature.c @@ -105,7 +105,6 @@ static void *evp_signature_from_dispatch(int name_id, break; signature->digest_sign_init = OSSL_get_OP_signature_digest_sign_init(fns); - digsignfncnt++; break; case OSSL_FUNC_SIGNATURE_DIGEST_SIGN_UPDATE: if (signature->digest_sign_update != NULL) @@ -121,12 +120,17 @@ static void *evp_signature_from_dispatch(int name_id, = OSSL_get_OP_signature_digest_sign_final(fns); digsignfncnt++; break; + case OSSL_FUNC_SIGNATURE_DIGEST_SIGN: + if (signature->digest_sign != NULL) + break; + signature->digest_sign + = OSSL_get_OP_signature_digest_sign(fns); + break; case OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_INIT: if (signature->digest_verify_init != NULL) break; signature->digest_verify_init = OSSL_get_OP_signature_digest_verify_init(fns); - digverifyfncnt++; break; case OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_UPDATE: if (signature->digest_verify_update != NULL) @@ -142,6 +146,12 @@ static void *evp_signature_from_dispatch(int name_id, = OSSL_get_OP_signature_digest_verify_final(fns); digverifyfncnt++; break; + case OSSL_FUNC_SIGNATURE_DIGEST_VERIFY: + if (signature->digest_verify != NULL) + break; + signature->digest_verify + = OSSL_get_OP_signature_digest_verify(fns); + break; case OSSL_FUNC_SIGNATURE_FREECTX: if (signature->freectx != NULL) break; @@ -216,12 +226,20 @@ static void *evp_signature_from_dispatch(int name_id, && verifyfncnt == 0 && verifyrecfncnt == 0 && digsignfncnt == 0 - && digverifyfncnt == 0) + && digverifyfncnt == 0 + && signature->digest_sign == NULL + && signature->digest_verify == NULL) || (signfncnt != 0 && signfncnt != 2) || (verifyfncnt != 0 && verifyfncnt != 2) || (verifyrecfncnt != 0 && verifyrecfncnt != 2) - || (digsignfncnt != 0 && digsignfncnt != 3) - || (digverifyfncnt != 0 && digverifyfncnt != 3) + || (digsignfncnt != 0 && digsignfncnt != 2) + || (digsignfncnt == 2 && signature->digest_sign_init == NULL) + || (digverifyfncnt != 0 && digverifyfncnt != 2) + || (digverifyfncnt == 2 && signature->digest_verify_init == NULL) + || (signature->digest_sign != NULL + && signature->digest_sign_init == NULL) + || (signature->digest_verify != NULL + && signature->digest_verify_init == NULL) || (gparamfncnt != 0 && gparamfncnt != 2) || (sparamfncnt != 0 && sparamfncnt != 2) || (gmdparamfncnt != 0 && gmdparamfncnt != 2) @@ -234,7 +252,9 @@ static void *evp_signature_from_dispatch(int name_id, * (verify_init verify) or * (verify_recover_init, verify_recover) or * (digest_sign_init, digest_sign_update, digest_sign_final) or - * (digest_verify_init, digest_verify_update, digest_verify_final). + * (digest_verify_init, digest_verify_update, digest_verify_final) or + * (digest_sign_init, digest_sign) or + * (digest_verify_init, digest_verify). * * set_ctx_params and settable_ctx_params are optional, but if one of * them is present then the other one must also be present. The same diff --git a/doc/man7/provider-signature.pod b/doc/man7/provider-signature.pod index d5f0c396c1..771c55f6f5 100644 --- a/doc/man7/provider-signature.pod +++ b/doc/man7/provider-signature.pod @@ -38,12 +38,40 @@ provider-signature - The signature library E-E provider functions size_t *routlen, size_t routsize, const unsigned char *sig, size_t siglen); + /* Digest Sign */ + int OP_signature_digest_sign_init(void *ctx, const char *mdname, + const char *props, void *provkey); + int OP_signature_digest_sign_update(void *ctx, const unsigned char *data, + size_t datalen); + int OP_signature_digest_sign_final(void *ctx, unsigned char *sig, + size_t *siglen, size_t sigsize); + int OP_signature_digest_sign(void *ctx, unsigned char *sigret, size_t *siglen, + size_t sigsize, const unsigned char *tbs, + size_t tbslen); + + /* Digest Verify */ + int OP_signature_digest_verify_init(void *ctx, const char *mdname, + const char *props, void *provkey); + int OP_signature_digest_verify_update(void *ctx, const unsigned char *data, + size_t datalen); + int OP_signature_digest_verify_final(void *ctx, const unsigned char *sig, + size_t siglen); + int OP_signature_digest_verify(void *ctx, const unsigned char *sig, + size_t siglen, const unsigned char *tbs, + size_t tbslen); + /* Signature parameters */ int OP_signature_get_ctx_params(void *ctx, OSSL_PARAM params[]); const OSSL_PARAM *OP_signature_gettable_ctx_params(void); int OP_signature_set_ctx_params(void *ctx, const OSSL_PARAM params[]); const OSSL_PARAM *OP_signature_settable_ctx_params(void); + /* MD parameters */ + int OP_signature_get_ctx_md_params(void *ctx, OSSL_PARAM params[]); + const OSSL_PARAM * OP_signature_gettable_ctx_md_params(void *ctx); + int OP_signature_set_ctx_md_params(void *ctx, const OSSL_PARAM params[]); + const OSSL_PARAM * OP_signature_settable_ctx_md_params(void *ctx); + =head1 DESCRIPTION This documentation is primarily aimed at provider authors. See L @@ -88,18 +116,53 @@ macros in L, as follows: OP_signature_verify_recover_init OSSL_FUNC_SIGNATURE_VERIFY_RECOVER_INIT OP_signature_verify_recover OSSL_FUNC_SIGNATURE_VERIFY_RECOVER + OP_signature_digest_sign_init OSSL_FUNC_SIGNATURE_DIGEST_SIGN_INIT + OP_signature_digest_sign_update OSSL_FUNC_SIGNATURE_DIGEST_SIGN_UPDATE + OP_signature_digest_sign_final OSSL_FUNC_SIGNATURE_DIGEST_SIGN_FINAL + OP_signature_digest_sign OSSL_FUNC_SIGNATURE_DIGEST_SIGN + + OP_signature_digest_verify_init OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_INIT + OP_signature_digest_verify_update OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_UPDATE + OP_signature_digest_verify_final OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_FINAL + OP_signature_digest_verify OSSL_FUNC_SIGNATURE_DIGEST_VERIFY + OP_signature_get_ctx_params OSSL_FUNC_SIGNATURE_GET_CTX_PARAMS OP_signature_gettable_ctx_params OSSL_FUNC_SIGNATURE_GETTABLE_CTX_PARAMS OP_signature_set_ctx_params OSSL_FUNC_SIGNATURE_SET_CTX_PARAMS OP_signature_settable_ctx_params OSSL_FUNC_SIGNATURE_SETTABLE_CTX_PARAMS + OP_signature_get_ctx_md_params OSSL_FUNC_SIGNATURE_GET_CTX_MD_PARAMS + OP_signature_gettable_ctx_md_params OSSL_FUNC_SIGNATURE_GETTABLE_CTX_MD_PARAMS + OP_signature_set_ctx_md_params OSSL_FUNC_SIGNATURE_SET_CTX_MD_PARAMS + OP_signature_settable_ctx_md_params OSSL_FUNC_SIGNATURE_SETTABLE_CTX_MD_PARAMS + A signature algorithm implementation may not implement all of these functions. -In order to be a consistent set of functions a provider must implement -OP_signature_newctx and OP_signature_freectx. -It must also implement both of OP_signature_sign_init and OP_signature_sign, -or both of OP_signature_verify_init and OP_signature_verify, or both of -OP_signature_verify_recover_init and OP_signature_verify_recover. -All other functions are optional. +In order to be a consistent set of functions we must have at least a set of +context functions (OP_signature_newctx and OP_signature_freectx) as well as a +set of "signature" functions, i.e. at least one of: + +=over 4 + +=item OP_signature_sign_init and OP_signature_sign + +=item OP_signature_verify_init and OP_signature_verify + +=item OP_signature_verify_recover_init and OP_signature_verify_init + +=item OP_signature_digest_sign_init, OP_signature_digest_sign_update and OP_signature_digest_sign_final + +=item OP_signature_digest_verify_init, OP_signature_digest_verify_update and OP_signature_digest_verify_final + +=item OP_signature_digest_sign_init and OP_signature_digest_sign + +=item OP_signature_digest_verify_init and OP_signature_digest_verify + +=back + +OP_signature_set_ctx_params and OP_signature_settable_ctx_params are optional, +but if one of them is present then the other one must also be present. The same +applies to OP_signature_get_ctx_params and OP_signature_gettable_ctx_params, as +well as the "md_params" functions. The OP_signature_dupctx function is optional. A signature algorithm must also implement some mechanism for generating, loading or importing keys via the key management (OSSL_OP_KEYMGMT) operation. @@ -176,6 +239,70 @@ The length of the recovered data should be written to I<*routlen>. If I is NULL then the maximum size of the output buffer is written to the I parameter. +=head2 Digest Sign Functions + +OP_signature_digeset_sign_init() initialises a context for signing given a +provider side signature context in the I parameter, and a pointer to a +provider key object in the I parameter. The key object should have been +previously generated, loaded or imported into the provider using the +key management (OSSL_OP_KEYMGMT) operation (see provider-keymgmt(7)>. +The name of the digest to be used will be in the I parameter. There may +also be properties to be used in fetching the digest in the I parameter, +although this may be ignored by providers. + +OP_signature_digest_sign_update() provides data to be signed in the I +parameter which should be of length I. A previously initialised +signature context is passed in the I parameter. This function may be called +multiple times to cummulatively add data to be signed. + +OP_signature_digest_sign_final() finalises a signature operation previously +started through OP_signature_digest_sign_init() and +OP_signature_digest_sign_update() calls. Once finalised no more data will be +added through OP_signature_digest_sign_update(). A previously initialised +signature context is passed in the I parameter. Unless I is NULL, the +signature should be written to the location pointed to by the I parameter +and it should not exceed I bytes in length. The length of the signature +should be written to I<*siglen>. If I is NULL then the maximum length of +the signature should be written to I<*siglen>. + +OP_signature_digest_sign() implements a "one shot" digest sign operation +previously started through OP_signature_digeset_sign_init(). A previously +initialised signature context is passed in the I parameter. The data to be +signed is in I which should be I bytes long. Unless I is NULL, +the signature should be written to the location pointed to by the I +parameter and it should not exceed I bytes in length. The length of the +signature should be written to I<*siglen>. If I is NULL then the maximum +length of the signature should be written to I<*siglen>. + +=head2 Digest Verify Functions + +OP_signature_digeset_verify_init() initialises a context for verifying given a +provider side verification context in the I parameter, and a pointer to a +provider key object in the I parameter. The key object should have been +previously generated, loaded or imported into the provider using the +key management (OSSL_OP_KEYMGMT) operation (see provider-keymgmt(7)>. +The name of the digest to be used will be in the I parameter. There may +also be properties to be used in fetching the digest in the I parameter, +although this may be ignored by providers. + +OP_signature_digest_verify_update() provides data to be verified in the I +parameter which should be of length I. A previously initialised +verification context is passed in the I parameter. This function may be +called multiple times to cummulatively add data to be verified. + +OP_signature_digest_verify_final() finalises a verification operation previously +started through OP_signature_digest_verify_init() and +OP_signature_digest_verify_update() calls. Once finalised no more data will be +added through OP_signature_digest_verify_update(). A previously initialised +verification context is passed in the I parameter. The signature to be +verified is in I which is I bytes long. + +OP_signature_digest_verify() implements a "one shot" digest verify operation +previously started through OP_signature_digeset_verify_init(). A previously +initialised verification context is passed in the I parameter. The data to be +verified is in I which should be I bytes long. The signature to be +verified is in I which is I bytes long. + =head2 Signature Parameters See L for further details on the parameters structure used by @@ -214,11 +341,38 @@ i.e. parameters that can be used with OP_signature_get_ctx_params() and OP_signature_set_ctx_params() respectively. See L for the use of B as parameter descriptor. +=head2 MD Parameters + +See L for further details on the parameters structure used by +the OP_signature_get_md_ctx_params() and OP_signature_set_md_ctx_params() +functions. + +OP_signature_get_md_ctx_params() gets digest parameters associated with the +given provider side digest signature context I and stores them in I. +OP_signature_set_ms_ctx_params() sets the digest parameters associated with the +given provider side digest signature context I to I. +Any parameter settings are additional to any that were previously set. + +Parameters currently recognised by built-in signature algorithms are the same +as those for built-in digest algorithms. See +L for further information. + +OP_signature_gettable_md_ctx_params() and OP_signature_settable_md_ctx_params() +get a constant B array that describes the gettable and settable +digest parameters, i.e. parameters that can be used with +OP_signature_get_md_ctx_params() and OP_signature_set_md_ctx_params() +respectively. See L for the use of B as parameter +descriptor. + =head1 RETURN VALUES OP_signature_newctx() and OP_signature_dupctx() should return the newly created provider side signature, or NULL on failure. +OP_signature_gettable_ctx_params(), OP_signature_settable_ctx_params(), +OP_signature_gettable_md_ctx_params() and OP_signature_settable_md_ctx_params(), +return the gettable or settable parameters in a constant B array. + All other functions should return 1 for success or 0 on error. =head1 SEE ALSO diff --git a/include/crypto/ecx.h b/include/crypto/ecx.h index e179db1b53..3e494bf092 100644 --- a/include/crypto/ecx.h +++ b/include/crypto/ecx.h @@ -19,23 +19,28 @@ # include # include "internal/refcount.h" -# define X25519_KEYLEN 32 -# define X448_KEYLEN 56 -# define ED25519_KEYLEN 32 -# define ED448_KEYLEN 57 +# define X25519_KEYLEN 32 +# define X448_KEYLEN 56 +# define ED25519_KEYLEN 32 +# define ED448_KEYLEN 57 # define MAX_KEYLEN ED448_KEYLEN -# define X25519_BITS 253 -# define X25519_SECURITY_BITS 128 +# define X25519_BITS 253 +# define X25519_SECURITY_BITS 128 -# define ED25519_SIGSIZE 64 +# define X448_BITS 448 +# define X448_SECURITY_BITS 224 -# define X448_BITS 448 -# define ED448_BITS 456 -# define X448_SECURITY_BITS 224 +# define ED25519_BITS 256 +/* RFC8032 Section 8.5 */ +# define ED25519_SECURITY_BITS 128 +# define ED25519_SIGSIZE 64 -# define ED448_SIGSIZE 114 +# define ED448_BITS 456 +/* RFC8032 Section 8.5 */ +# define ED448_SECURITY_BITS 224 +# define ED448_SIGSIZE 114 struct ecx_key_st { unsigned int haspubkey:1; @@ -58,6 +63,20 @@ int X25519(uint8_t out_shared_key[32], const uint8_t private_key[32], void X25519_public_from_private(uint8_t out_public_value[32], const uint8_t private_key[32]); +int ED25519_sign(uint8_t *out_sig, const uint8_t *message, size_t message_len, + const uint8_t public_key[32], const uint8_t private_key[32]); +int ED25519_verify(const uint8_t *message, size_t message_len, + const uint8_t signature[64], const uint8_t public_key[32]); + +int ED448_sign(OPENSSL_CTX *ctx, uint8_t *out_sig, const uint8_t *message, + size_t message_len, const uint8_t public_key[57], + const uint8_t private_key[57], const uint8_t *context, + size_t context_len); + +int ED448_verify(OPENSSL_CTX *ctx, const uint8_t *message, size_t message_len, + const uint8_t signature[114], const uint8_t public_key[57], + const uint8_t *context, size_t context_len); + int X448(uint8_t out_shared_key[56], const uint8_t private_key[56], const uint8_t peer_public_value[56]); void X448_public_from_private(uint8_t out_public_value[56], diff --git a/include/openssl/core_numbers.h b/include/openssl/core_numbers.h index 3314a0f665..c65041894a 100644 --- a/include/openssl/core_numbers.h +++ b/include/openssl/core_numbers.h @@ -480,19 +480,21 @@ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_keyexch_gettable_ctx_params, # define OSSL_FUNC_SIGNATURE_DIGEST_SIGN_INIT 8 # define OSSL_FUNC_SIGNATURE_DIGEST_SIGN_UPDATE 9 # define OSSL_FUNC_SIGNATURE_DIGEST_SIGN_FINAL 10 -# define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_INIT 11 -# define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_UPDATE 12 -# define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_FINAL 13 -# define OSSL_FUNC_SIGNATURE_FREECTX 14 -# define OSSL_FUNC_SIGNATURE_DUPCTX 15 -# define OSSL_FUNC_SIGNATURE_GET_CTX_PARAMS 16 -# define OSSL_FUNC_SIGNATURE_GETTABLE_CTX_PARAMS 17 -# define OSSL_FUNC_SIGNATURE_SET_CTX_PARAMS 18 -# define OSSL_FUNC_SIGNATURE_SETTABLE_CTX_PARAMS 19 -# define OSSL_FUNC_SIGNATURE_GET_CTX_MD_PARAMS 20 -# define OSSL_FUNC_SIGNATURE_GETTABLE_CTX_MD_PARAMS 21 -# define OSSL_FUNC_SIGNATURE_SET_CTX_MD_PARAMS 22 -# define OSSL_FUNC_SIGNATURE_SETTABLE_CTX_MD_PARAMS 23 +# define OSSL_FUNC_SIGNATURE_DIGEST_SIGN 11 +# define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_INIT 12 +# define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_UPDATE 13 +# define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_FINAL 14 +# define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY 15 +# define OSSL_FUNC_SIGNATURE_FREECTX 16 +# define OSSL_FUNC_SIGNATURE_DUPCTX 17 +# define OSSL_FUNC_SIGNATURE_GET_CTX_PARAMS 18 +# define OSSL_FUNC_SIGNATURE_GETTABLE_CTX_PARAMS 19 +# define OSSL_FUNC_SIGNATURE_SET_CTX_PARAMS 20 +# define OSSL_FUNC_SIGNATURE_SETTABLE_CTX_PARAMS 21 +# define OSSL_FUNC_SIGNATURE_GET_CTX_MD_PARAMS 22 +# define OSSL_FUNC_SIGNATURE_GETTABLE_CTX_MD_PARAMS 23 +# define OSSL_FUNC_SIGNATURE_SET_CTX_MD_PARAMS 24 +# define OSSL_FUNC_SIGNATURE_SETTABLE_CTX_MD_PARAMS 25 OSSL_CORE_MAKE_FUNC(void *, OP_signature_newctx, (void *provctx)) OSSL_CORE_MAKE_FUNC(int, OP_signature_sign_init, (void *ctx, void *provkey)) @@ -522,6 +524,9 @@ OSSL_CORE_MAKE_FUNC(int, OP_signature_digest_sign_update, OSSL_CORE_MAKE_FUNC(int, OP_signature_digest_sign_final, (void *ctx, unsigned char *sig, size_t *siglen, size_t sigsize)) +OSSL_CORE_MAKE_FUNC(int, OP_signature_digest_sign, + (void *ctx, unsigned char *sigret, size_t *siglen, + size_t sigsize, const unsigned char *tbs, size_t tbslen)) OSSL_CORE_MAKE_FUNC(int, OP_signature_digest_verify_init, (void *ctx, const char *mdname, const char *props, void *provkey)) @@ -529,6 +534,9 @@ OSSL_CORE_MAKE_FUNC(int, OP_signature_digest_verify_update, (void *ctx, const unsigned char *data, size_t datalen)) OSSL_CORE_MAKE_FUNC(int, OP_signature_digest_verify_final, (void *ctx, const unsigned char *sig, size_t siglen)) +OSSL_CORE_MAKE_FUNC(int, OP_signature_digest_verify, + (void *ctx, const unsigned char *sig, size_t siglen, + const unsigned char *tbs, size_t tbslen)) OSSL_CORE_MAKE_FUNC(void, OP_signature_freectx, (void *ctx)) OSSL_CORE_MAKE_FUNC(void *, OP_signature_dupctx, (void *ctx)) OSSL_CORE_MAKE_FUNC(int, OP_signature_get_ctx_params, diff --git a/providers/common/include/prov/providercommonerr.h b/providers/common/include/prov/providercommonerr.h index 19ecab1f0f..f834a71347 100644 --- a/providers/common/include/prov/providercommonerr.h +++ b/providers/common/include/prov/providercommonerr.h @@ -64,6 +64,7 @@ int ERR_load_PROV_strings(void); # define PROV_R_FAILED_TO_GENERATE_KEY 121 # define PROV_R_FAILED_TO_GET_PARAMETER 103 # define PROV_R_FAILED_TO_SET_PARAMETER 104 +# define PROV_R_FAILED_TO_SIGN 175 # define PROV_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE 165 # define PROV_R_INAVLID_UKM_LENGTH 146 # define PROV_R_INVALID_AAD 108 diff --git a/providers/common/provider_err.c b/providers/common/provider_err.c index f73f82351f..1a65e2cc87 100644 --- a/providers/common/provider_err.c +++ b/providers/common/provider_err.c @@ -39,6 +39,7 @@ static const ERR_STRING_DATA PROV_str_reasons[] = { "failed to get parameter"}, {ERR_PACK(ERR_LIB_PROV, 0, PROV_R_FAILED_TO_SET_PARAMETER), "failed to set parameter"}, + {ERR_PACK(ERR_LIB_PROV, 0, PROV_R_FAILED_TO_SIGN), "failed to sign"}, {ERR_PACK(ERR_LIB_PROV, 0, PROV_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE), "illegal or unsupported padding mode"}, {ERR_PACK(ERR_LIB_PROV, 0, PROV_R_INAVLID_UKM_LENGTH), diff --git a/providers/defltprov.c b/providers/defltprov.c index 0f66aa2b71..7bb23e300e 100644 --- a/providers/defltprov.c +++ b/providers/defltprov.c @@ -385,6 +385,10 @@ static const OSSL_ALGORITHM deflt_signature[] = { { "DSA:dsaEncryption", "provider=default", dsa_signature_functions }, #endif { "RSA:rsaEncryption", "provider=default", rsa_signature_functions }, +#ifndef OPENSSL_NO_EC + { "ED25519:Ed25519", "provider=default", ed25519_signature_functions }, + { "ED448:Ed448", "provider=default", ed448_signature_functions }, +#endif { NULL, NULL, NULL } }; @@ -405,6 +409,8 @@ static const OSSL_ALGORITHM deflt_keymgmt[] = { { "EC:id-ecPublicKey", "provider=default", ec_keymgmt_functions }, { "X25519", "provider=default", x25519_keymgmt_functions }, { "X448", "provider=default", x448_keymgmt_functions }, + { "ED25519", "provider=default", ed25519_keymgmt_functions }, + { "ED448", "provider=default", ed448_keymgmt_functions }, #endif { NULL, NULL, NULL } }; diff --git a/providers/implementations/include/prov/implementations.h b/providers/implementations/include/prov/implementations.h index ea33bedfd8..94265adfc2 100644 --- a/providers/implementations/include/prov/implementations.h +++ b/providers/implementations/include/prov/implementations.h @@ -259,6 +259,8 @@ extern const OSSL_DISPATCH dsa_keymgmt_functions[]; extern const OSSL_DISPATCH rsa_keymgmt_functions[]; extern const OSSL_DISPATCH x25519_keymgmt_functions[]; extern const OSSL_DISPATCH x448_keymgmt_functions[]; +extern const OSSL_DISPATCH ed25519_keymgmt_functions[]; +extern const OSSL_DISPATCH ed448_keymgmt_functions[]; extern const OSSL_DISPATCH ec_keymgmt_functions[]; /* Key Exchange */ @@ -270,6 +272,8 @@ extern const OSSL_DISPATCH ecdh_keyexch_functions[]; /* Signature */ extern const OSSL_DISPATCH dsa_signature_functions[]; extern const OSSL_DISPATCH rsa_signature_functions[]; +extern const OSSL_DISPATCH ed25519_signature_functions[]; +extern const OSSL_DISPATCH ed448_signature_functions[]; /* Asym Cipher */ extern const OSSL_DISPATCH rsa_asym_cipher_functions[]; diff --git a/providers/implementations/keymgmt/ecx_kmgmt.c b/providers/implementations/keymgmt/ecx_kmgmt.c index d3aa9ba1f9..b078c6de58 100644 --- a/providers/implementations/keymgmt/ecx_kmgmt.c +++ b/providers/implementations/keymgmt/ecx_kmgmt.c @@ -18,8 +18,12 @@ static OSSL_OP_keymgmt_new_fn x25519_new_key; static OSSL_OP_keymgmt_new_fn x448_new_key; +static OSSL_OP_keymgmt_new_fn ed25519_new_key; +static OSSL_OP_keymgmt_new_fn ed448_new_key; static OSSL_OP_keymgmt_get_params_fn x25519_get_params; static OSSL_OP_keymgmt_get_params_fn x448_get_params; +static OSSL_OP_keymgmt_get_params_fn ed25519_get_params; +static OSSL_OP_keymgmt_get_params_fn ed448_get_params; static OSSL_OP_keymgmt_gettable_params_fn ecx_gettable_params; static OSSL_OP_keymgmt_has_fn ecx_has; static OSSL_OP_keymgmt_import_fn ecx_import; @@ -39,6 +43,16 @@ static void *x448_new_key(void *provctx) return ecx_key_new(X448_KEYLEN, 0); } +static void *ed25519_new_key(void *provctx) +{ + return ecx_key_new(ED25519_KEYLEN, 0); +} + +static void *ed448_new_key(void *provctx) +{ + return ecx_key_new(ED448_KEYLEN, 0); +} + static int ecx_has(void *keydata, int selection) { ECX_KEY *key = keydata; @@ -186,6 +200,16 @@ static int x448_get_params(void *key, OSSL_PARAM params[]) return ecx_get_params(params, X448_BITS, X448_SECURITY_BITS, X448_KEYLEN); } +static int ed25519_get_params(void *key, OSSL_PARAM params[]) +{ + return ecx_get_params(params, ED25519_BITS, ED25519_SECURITY_BITS, ED25519_KEYLEN); +} + +static int ed448_get_params(void *key, OSSL_PARAM params[]) +{ + return ecx_get_params(params, ED448_BITS, ED448_SECURITY_BITS, ED448_KEYLEN); +} + static const OSSL_PARAM ecx_params[] = { OSSL_PARAM_int(OSSL_PKEY_PARAM_BITS, NULL), OSSL_PARAM_int(OSSL_PKEY_PARAM_SECURITY_BITS, NULL), @@ -198,28 +222,21 @@ static const OSSL_PARAM *ecx_gettable_params(void) return ecx_params; } -const OSSL_DISPATCH x25519_keymgmt_functions[] = { - { OSSL_FUNC_KEYMGMT_NEW, (void (*)(void))x25519_new_key }, - { OSSL_FUNC_KEYMGMT_FREE, (void (*)(void))ecx_key_free }, - { OSSL_FUNC_KEYMGMT_GET_PARAMS, (void (*) (void))x25519_get_params }, - { OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS, (void (*) (void))ecx_gettable_params }, - { OSSL_FUNC_KEYMGMT_HAS, (void (*)(void))ecx_has }, - { OSSL_FUNC_KEYMGMT_IMPORT, (void (*)(void))ecx_import }, - { OSSL_FUNC_KEYMGMT_IMPORT_TYPES, (void (*)(void))ecx_imexport_types }, - { OSSL_FUNC_KEYMGMT_EXPORT, (void (*)(void))ecx_export }, - { OSSL_FUNC_KEYMGMT_EXPORT_TYPES, (void (*)(void))ecx_imexport_types }, - { 0, NULL } -}; - -const OSSL_DISPATCH x448_keymgmt_functions[] = { - { OSSL_FUNC_KEYMGMT_NEW, (void (*)(void))x448_new_key }, - { OSSL_FUNC_KEYMGMT_FREE, (void (*)(void))ecx_key_free }, - { OSSL_FUNC_KEYMGMT_GET_PARAMS, (void (*) (void))x448_get_params }, - { OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS, (void (*) (void))ecx_gettable_params }, - { OSSL_FUNC_KEYMGMT_HAS, (void (*)(void))ecx_has }, - { OSSL_FUNC_KEYMGMT_IMPORT, (void (*)(void))ecx_import }, - { OSSL_FUNC_KEYMGMT_IMPORT_TYPES, (void (*)(void))ecx_imexport_types }, - { OSSL_FUNC_KEYMGMT_EXPORT, (void (*)(void))ecx_export }, - { OSSL_FUNC_KEYMGMT_EXPORT_TYPES, (void (*)(void))ecx_imexport_types }, - { 0, NULL } -}; +#define MAKE_KEYMGMT_FUNCTIONS(alg) \ + const OSSL_DISPATCH alg##_keymgmt_functions[] = { \ + { OSSL_FUNC_KEYMGMT_NEW, (void (*)(void))alg##_new_key }, \ + { OSSL_FUNC_KEYMGMT_FREE, (void (*)(void))ecx_key_free }, \ + { OSSL_FUNC_KEYMGMT_GET_PARAMS, (void (*) (void))alg##_get_params }, \ + { OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS, (void (*) (void))ecx_gettable_params }, \ + { OSSL_FUNC_KEYMGMT_HAS, (void (*)(void))ecx_has }, \ + { OSSL_FUNC_KEYMGMT_IMPORT, (void (*)(void))ecx_import }, \ + { OSSL_FUNC_KEYMGMT_IMPORT_TYPES, (void (*)(void))ecx_imexport_types }, \ + { OSSL_FUNC_KEYMGMT_EXPORT, (void (*)(void))ecx_export }, \ + { OSSL_FUNC_KEYMGMT_EXPORT_TYPES, (void (*)(void))ecx_imexport_types }, \ + { 0, NULL } \ + }; + +MAKE_KEYMGMT_FUNCTIONS(x25519) +MAKE_KEYMGMT_FUNCTIONS(x448) +MAKE_KEYMGMT_FUNCTIONS(ed25519) +MAKE_KEYMGMT_FUNCTIONS(ed448) diff --git a/providers/implementations/signature/build.info b/providers/implementations/signature/build.info index 22b55dcf54..c5d0645a8a 100644 --- a/providers/implementations/signature/build.info +++ b/providers/implementations/signature/build.info @@ -3,11 +3,16 @@ $DSA_GOAL=../../libimplementations.a $RSA_GOAL=../../libimplementations.a +$EC_GOAL=../../libimplementations.a IF[{- !$disabled{dsa} -}] SOURCE[$DSA_GOAL]=dsa.c ENDIF +IF[{- !$disabled{ec} -}] + SOURCE[$EC_GOAL]=eddsa.c +ENDIF + SOURCE[$RSA_GOAL]=rsa.c diff --git a/providers/implementations/signature/eddsa.c b/providers/implementations/signature/eddsa.c new file mode 100644 index 0000000000..d2444f9e36 --- /dev/null +++ b/providers/implementations/signature/eddsa.c @@ -0,0 +1,211 @@ +/* + * Copyright 2020 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#include +#include +#include +#include +#include +#include +#include +#include "internal/nelem.h" +#include "internal/sizes.h" +#include "prov/providercommonerr.h" +#include "prov/implementations.h" +#include "prov/providercommonerr.h" +#include "prov/provider_ctx.h" +#include "crypto/ecx.h" + +static OSSL_OP_signature_newctx_fn eddsa_newctx; +static OSSL_OP_signature_digest_sign_init_fn eddsa_digest_signverify_init; +static OSSL_OP_signature_digest_sign_fn ed25519_digest_sign; +static OSSL_OP_signature_digest_sign_fn ed448_digest_sign; +static OSSL_OP_signature_digest_verify_fn ed25519_digest_verify; +static OSSL_OP_signature_digest_verify_fn ed448_digest_verify; +static OSSL_OP_signature_freectx_fn eddsa_freectx; +static OSSL_OP_signature_dupctx_fn eddsa_dupctx; + +typedef struct { + OPENSSL_CTX *libctx; + ECX_KEY *key; +} PROV_EDDSA_CTX; + +static void *eddsa_newctx(void *provctx) +{ + PROV_EDDSA_CTX *peddsactx = OPENSSL_zalloc(sizeof(PROV_EDDSA_CTX)); + + if (peddsactx == NULL) { + PROVerr(0, ERR_R_MALLOC_FAILURE); + return NULL; + } + + peddsactx->libctx = PROV_LIBRARY_CONTEXT_OF(provctx); + + return peddsactx; +} + +static int eddsa_digest_signverify_init(void *vpeddsactx, const char *mdname, + const char *props, void *vedkey) +{ + PROV_EDDSA_CTX *peddsactx = (PROV_EDDSA_CTX *)vpeddsactx; + ECX_KEY *edkey = (ECX_KEY *)vedkey; + + if (mdname != NULL) { + PROVerr(0, PROV_R_INVALID_DIGEST); + return 0; + } + + if (!ecx_key_up_ref(edkey)) { + PROVerr(0, ERR_R_INTERNAL_ERROR); + return 0; + } + + peddsactx->key = edkey; + + return 1; +} + +int ed25519_digest_sign(void *vpeddsactx, unsigned char *sigret, + size_t *siglen, size_t sigsize, + const unsigned char *tbs, size_t tbslen) +{ + PROV_EDDSA_CTX *peddsactx = (PROV_EDDSA_CTX *)vpeddsactx; + const ECX_KEY *edkey = peddsactx->key; + + if (sigret == NULL) { + *siglen = ED25519_SIGSIZE; + return 1; + } + if (sigsize < ED25519_SIGSIZE) { + PROVerr(0, PROV_R_OUTPUT_BUFFER_TOO_SMALL); + return 0; + } + + if (ED25519_sign(sigret, tbs, tbslen, edkey->pubkey, edkey->privkey) == 0) { + PROVerr(0, PROV_R_FAILED_TO_SIGN); + return 0; + } + *siglen = ED25519_SIGSIZE; + return 1; +} + +int ed448_digest_sign(void *vpeddsactx, unsigned char *sigret, + size_t *siglen, size_t sigsize, + const unsigned char *tbs, size_t tbslen) +{ + PROV_EDDSA_CTX *peddsactx = (PROV_EDDSA_CTX *)vpeddsactx; + const ECX_KEY *edkey = peddsactx->key; + + if (sigret == NULL) { + *siglen = ED448_SIGSIZE; + return 1; + } + if (sigsize < ED448_SIGSIZE) { + PROVerr(0, PROV_R_OUTPUT_BUFFER_TOO_SMALL); + return 0; + } + + if (ED448_sign(peddsactx->libctx, sigret, tbs, tbslen, edkey->pubkey, + edkey->privkey, NULL, 0) == 0) { + PROVerr(0, PROV_R_FAILED_TO_SIGN); + return 0; + } + *siglen = ED448_SIGSIZE; + return 1; +} + +int ed25519_digest_verify(void *vpeddsactx, const unsigned char *sig, + size_t siglen, const unsigned char *tbs, + size_t tbslen) +{ + PROV_EDDSA_CTX *peddsactx = (PROV_EDDSA_CTX *)vpeddsactx; + const ECX_KEY *edkey = peddsactx->key; + + if (siglen != ED25519_SIGSIZE) + return 0; + + return ED25519_verify(tbs, tbslen, sig, edkey->pubkey); +} + +int ed448_digest_verify(void *vpeddsactx, const unsigned char *sig, + size_t siglen, const unsigned char *tbs, + size_t tbslen) +{ + PROV_EDDSA_CTX *peddsactx = (PROV_EDDSA_CTX *)vpeddsactx; + const ECX_KEY *edkey = peddsactx->key; + + if (siglen != ED448_SIGSIZE) + return 0; + + return ED448_verify(peddsactx->libctx, tbs, tbslen, sig, edkey->pubkey, + NULL, 0); +} + +static void eddsa_freectx(void *vpeddsactx) +{ + PROV_EDDSA_CTX *peddsactx = (PROV_EDDSA_CTX *)vpeddsactx; + + ecx_key_free(peddsactx->key); + + OPENSSL_free(peddsactx); +} + +static void *eddsa_dupctx(void *vpeddsactx) +{ + PROV_EDDSA_CTX *srcctx = (PROV_EDDSA_CTX *)vpeddsactx; + PROV_EDDSA_CTX *dstctx; + + dstctx = OPENSSL_zalloc(sizeof(*srcctx)); + if (dstctx == NULL) + return NULL; + + *dstctx = *srcctx; + dstctx->key = NULL; + + if (srcctx->key != NULL && !ecx_key_up_ref(srcctx->key)) { + PROVerr(0, ERR_R_INTERNAL_ERROR); + goto err; + } + dstctx->key = srcctx->key; + + return dstctx; + err: + eddsa_freectx(dstctx); + return NULL; +} + +const OSSL_DISPATCH ed25519_signature_functions[] = { + { OSSL_FUNC_SIGNATURE_NEWCTX, (void (*)(void))eddsa_newctx }, + { OSSL_FUNC_SIGNATURE_DIGEST_SIGN_INIT, + (void (*)(void))eddsa_digest_signverify_init }, + { OSSL_FUNC_SIGNATURE_DIGEST_SIGN, + (void (*)(void))ed25519_digest_sign }, + { OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_INIT, + (void (*)(void))eddsa_digest_signverify_init }, + { OSSL_FUNC_SIGNATURE_DIGEST_VERIFY, + (void (*)(void))ed25519_digest_verify }, + { OSSL_FUNC_SIGNATURE_FREECTX, (void (*)(void))eddsa_freectx }, + { OSSL_FUNC_SIGNATURE_DUPCTX, (void (*)(void))eddsa_dupctx }, + { 0, NULL } +}; + +const OSSL_DISPATCH ed448_signature_functions[] = { + { OSSL_FUNC_SIGNATURE_NEWCTX, (void (*)(void))eddsa_newctx }, + { OSSL_FUNC_SIGNATURE_DIGEST_SIGN_INIT, + (void (*)(void))eddsa_digest_signverify_init }, + { OSSL_FUNC_SIGNATURE_DIGEST_SIGN, + (void (*)(void))ed448_digest_sign }, + { OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_INIT, + (void (*)(void))eddsa_digest_signverify_init }, + { OSSL_FUNC_SIGNATURE_DIGEST_VERIFY, + (void (*)(void))ed448_digest_verify }, + { OSSL_FUNC_SIGNATURE_FREECTX, (void (*)(void))eddsa_freectx }, + { OSSL_FUNC_SIGNATURE_DUPCTX, (void (*)(void))eddsa_dupctx }, + { 0, NULL } +}; From beldmit at gmail.com Mon Mar 9 08:52:30 2020 From: beldmit at gmail.com (beldmit at gmail.com) Date: Mon, 09 Mar 2020 08:52:30 +0000 Subject: [openssl] master update Message-ID: <1583743950.735448.6148.nullmailer@dev.openssl.org> The branch master has been updated via 8293fb6840840a5252bb6671c48486bc86857b5f (commit) from d62be1580bf402f7088cdec5f21a87f27f40f18e (commit) - Log ----------------------------------------------------------------- commit 8293fb6840840a5252bb6671c48486bc86857b5f Author: Vladimir Panteleev Date: Tue Mar 3 18:04:00 2020 +0000 spkac: Check return values of NETSCAPE_SPKI functions Fixes silently producing an invalid SPKAC with non-RSA keys. Reviewed-by: Matt Caswell Reviewed-by: Dmitry Belyavskiy (Merged from https://github.com/openssl/openssl/pull/11224) ----------------------------------------------------------------------- Summary of changes: apps/spkac.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/spkac.c b/apps/spkac.c index dbd3d45216..17c4e5b8d0 100644 --- a/apps/spkac.c +++ b/apps/spkac.c @@ -145,8 +145,15 @@ int spkac_main(int argc, char **argv) if (challenge != NULL) ASN1_STRING_set(spki->spkac->challenge, challenge, (int)strlen(challenge)); - NETSCAPE_SPKI_set_pubkey(spki, pkey); - NETSCAPE_SPKI_sign(spki, pkey, EVP_md5()); + if (!NETSCAPE_SPKI_set_pubkey(spki, pkey)) { + BIO_printf(bio_err, "Error setting public key\n"); + goto end; + } + i = NETSCAPE_SPKI_sign(spki, pkey, EVP_md5()); + if (i <= 0) { + BIO_printf(bio_err, "Error signing SPKAC\n"); + goto end; + } spkstr = NETSCAPE_SPKI_b64_encode(spki); if (spkstr == NULL) goto end; From builds at travis-ci.org Mon Mar 9 08:56:32 2020 From: builds at travis-ci.org (Travis CI) Date: Mon, 09 Mar 2020 08:56:32 +0000 Subject: Errored: openssl/openssl#32953 (master - d62be15) In-Reply-To: Message-ID: <5e6604bfc6188_43fda5b19a03093813@dd1a8925-86dd-4cd7-9c3d-11577b5b5c16.mail> Build Update for openssl/openssl ------------------------------------- Build: #32953 Status: Errored Duration: 49 mins and 41 secs Commit: d62be15 (master) Author: Matt Caswell Message: Document the new DigestSign provider functions As well as the newly added "one shot" functions, we also document a number of the other other digestsign functions which were missing documentation in provider-signature.pod. Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/11261) View the changeset: https://github.com/openssl/openssl/compare/db4b3d8392fc...d62be1580bf4 View the full build log and details: https://travis-ci.org/openssl/openssl/builds/660034421?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the openssl/openssl repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=5849220&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tmraz at fedoraproject.org Mon Mar 9 09:44:08 2020 From: tmraz at fedoraproject.org (tmraz at fedoraproject.org) Date: Mon, 09 Mar 2020 09:44:08 +0000 Subject: [openssl] master update Message-ID: <1583747048.721421.15368.nullmailer@dev.openssl.org> The branch master has been updated via 86cd42fbd3752dec442780867434e828f9a1a749 (commit) from 8293fb6840840a5252bb6671c48486bc86857b5f (commit) - Log ----------------------------------------------------------------- commit 86cd42fbd3752dec442780867434e828f9a1a749 Author: Davide Galassi Date: Sun Feb 23 10:01:45 2020 +0100 Remove double fetch of "OSSL_EX_DATA_GLOBAL" for global lock Fetch once and just pass the global ex_data to the "get_and_lock" static function. Removed a redundant null pointer check within the "get_and_lock" static function (control already performed by the caller). Reviewed-by: Matt Caswell Reviewed-by: Shane Lontis Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/11152) ----------------------------------------------------------------------- Summary of changes: crypto/ex_data.c | 49 ++++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/crypto/ex_data.c b/crypto/ex_data.c index 3cffef897b..defa2b4bda 100644 --- a/crypto/ex_data.c +++ b/crypto/ex_data.c @@ -24,19 +24,18 @@ int do_ex_data_init(OPENSSL_CTX *ctx) /* * Return the EX_CALLBACKS from the |ex_data| array that corresponds to * a given class. On success, *holds the lock.* + * The |global| parameter is assumed to be non null (checked by the caller). */ -static EX_CALLBACKS *get_and_lock(OPENSSL_CTX *ctx, int class_index) +static EX_CALLBACKS *get_and_lock(OSSL_EX_DATA_GLOBAL *global, int class_index) { EX_CALLBACKS *ip; - OSSL_EX_DATA_GLOBAL *global = NULL; if (class_index < 0 || class_index >= CRYPTO_EX_INDEX__COUNT) { CRYPTOerr(CRYPTO_F_GET_AND_LOCK, ERR_R_PASSED_INVALID_ARGUMENT); return NULL; } - global = openssl_ctx_get_ex_data_global(ctx); - if (global == NULL || global->ex_data_lock == NULL) { + if (global->ex_data_lock == NULL) { /* * If we get here, someone (who?) cleaned up the lock, so just * treat it as an error. @@ -111,9 +110,10 @@ int crypto_free_ex_index_ex(OPENSSL_CTX *ctx, int class_index, int idx) if (global == NULL) return 0; - ip = get_and_lock(ctx, class_index); + ip = get_and_lock(global, class_index); if (ip == NULL) return 0; + if (idx < 0 || idx >= sk_EX_CALLBACK_num(ip->meth)) goto err; a = sk_EX_CALLBACK_value(ip->meth, idx); @@ -149,7 +149,7 @@ int crypto_get_ex_new_index_ex(OPENSSL_CTX *ctx, int class_index, long argl, if (global == NULL) return -1; - ip = get_and_lock(ctx, class_index); + ip = get_and_lock(global, class_index); if (ip == NULL) return -1; @@ -216,13 +216,12 @@ int crypto_new_ex_data_ex(OPENSSL_CTX *ctx, int class_index, void *obj, if (global == NULL) return 0; - ip = get_and_lock(ctx, class_index); + ip = get_and_lock(global, class_index); if (ip == NULL) return 0; ad->ctx = ctx; ad->sk = NULL; - mx = sk_EX_CALLBACK_num(ip->meth); if (mx > 0) { if (mx < (int)OSSL_NELEM(stack)) @@ -269,16 +268,19 @@ int CRYPTO_dup_ex_data(int class_index, CRYPTO_EX_DATA *to, EX_CALLBACK **storage = NULL; EX_CALLBACKS *ip; int toret = 0; - OSSL_EX_DATA_GLOBAL *global = openssl_ctx_get_ex_data_global(from->ctx); - - if (global == NULL) - return 0; + OSSL_EX_DATA_GLOBAL *global; to->ctx = from->ctx; if (from->sk == NULL) /* Nothing to copy over */ return 1; - if ((ip = get_and_lock(from->ctx, class_index)) == NULL) + + global = openssl_ctx_get_ex_data_global(from->ctx); + if (global == NULL) + return 0; + + ip = get_and_lock(global, class_index); + if (ip == NULL) return 0; mx = sk_EX_CALLBACK_num(ip->meth); @@ -340,14 +342,15 @@ void CRYPTO_free_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad) EX_CALLBACK *f; EX_CALLBACK *stack[10]; EX_CALLBACK **storage = NULL; - OSSL_EX_DATA_GLOBAL *global; + OSSL_EX_DATA_GLOBAL *global = openssl_ctx_get_ex_data_global(ad->ctx); - if ((ip = get_and_lock(ad->ctx, class_index)) == NULL) - goto err; - global = openssl_ctx_get_ex_data_global(ad->ctx); if (global == NULL) goto err; + ip = get_and_lock(global, class_index); + if (ip == NULL) + goto err; + mx = sk_EX_CALLBACK_num(ip->meth); if (mx > 0) { if (mx < (int)OSSL_NELEM(stack)) @@ -392,18 +395,18 @@ int CRYPTO_alloc_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad, EX_CALLBACK *f; EX_CALLBACKS *ip; void *curval; - OSSL_EX_DATA_GLOBAL *global = openssl_ctx_get_ex_data_global(ad->ctx); - - if (global == NULL) - return 0; + OSSL_EX_DATA_GLOBAL *global; curval = CRYPTO_get_ex_data(ad, idx); - /* Already there, no need to allocate */ if (curval != NULL) return 1; - ip = get_and_lock(ad->ctx, class_index); + global = openssl_ctx_get_ex_data_global(ad->ctx); + if (global == NULL) + return 0; + + ip = get_and_lock(global, class_index); if (ip == NULL) return 0; f = sk_EX_CALLBACK_value(ip->meth, idx); From builds at travis-ci.org Mon Mar 9 09:44:32 2020 From: builds at travis-ci.org (Travis CI) Date: Mon, 09 Mar 2020 09:44:32 +0000 Subject: Still Failing: openssl/openssl#32956 (master - 8293fb6) In-Reply-To: Message-ID: <5e660fffe83b2_43fda5a91b4f410464f@dd1a8925-86dd-4cd7-9c3d-11577b5b5c16.mail> Build Update for openssl/openssl ------------------------------------- Build: #32956 Status: Still Failing Duration: 50 mins and 0 secs Commit: 8293fb6 (master) Author: Vladimir Panteleev Message: spkac: Check return values of NETSCAPE_SPKI functions Fixes silently producing an invalid SPKAC with non-RSA keys. Reviewed-by: Matt Caswell Reviewed-by: Dmitry Belyavskiy (Merged from https://github.com/openssl/openssl/pull/11224) View the changeset: https://github.com/openssl/openssl/compare/d62be1580bf4...8293fb684084 View the full build log and details: https://travis-ci.org/openssl/openssl/builds/660049229?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the openssl/openssl repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=5849220&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From levitte at openssl.org Mon Mar 9 09:46:23 2020 From: levitte at openssl.org (Richard Levitte) Date: Mon, 09 Mar 2020 09:46:23 +0000 Subject: [openssl] master update Message-ID: <1583747183.529494.16719.nullmailer@dev.openssl.org> The branch master has been updated via 5c33a6ba65e4ae4ddac34e3372c962dd49fb6e43 (commit) from 86cd42fbd3752dec442780867434e828f9a1a749 (commit) - Log ----------------------------------------------------------------- commit 5c33a6ba65e4ae4ddac34e3372c962dd49fb6e43 Author: Richard Levitte Date: Thu Mar 5 14:14:09 2020 +0100 util/wrap.pl: do not look at EXE_SHELL Acting on EXE_SHELL was a bit over the top, especially in light of instructions like this (from NOTES.VALGRIND): EXE_SHELL="`/bin/pwd`/util/wrap.pl valgrind --error-exitcode=1 --leak-check=full -q" Fixes #11255 Reviewed-by: Nicola Tuveri Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/11258) ----------------------------------------------------------------------- Summary of changes: util/wrap.pl | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/util/wrap.pl b/util/wrap.pl index 1c3b4e7c29..4c3d4713f1 100755 --- a/util/wrap.pl +++ b/util/wrap.pl @@ -19,11 +19,7 @@ $ENV{OPENSSL_MODULES} = $std_providers my $use_system = 0; my @cmd; -if (($ENV{EXE_SHELL} // '') ne '') { - # We don't know what $ENV{EXE_SHELL} contains, so we must use the one - # string form to ensure that exec invokes a shell as needed. - @cmd = ( join(' ', $ENV{EXE_SHELL}, @ARGV) ); -} elsif (-x $unix_shlib_wrap) { +if (-x $unix_shlib_wrap) { @cmd = ( $unix_shlib_wrap, @ARGV ); } else { # Hope for the best From tmraz at fedoraproject.org Mon Mar 9 09:47:22 2020 From: tmraz at fedoraproject.org (tmraz at fedoraproject.org) Date: Mon, 09 Mar 2020 09:47:22 +0000 Subject: [openssl] master update Message-ID: <1583747242.216982.17893.nullmailer@dev.openssl.org> The branch master has been updated via 9f44e96e245993c8e7aaa9fadf1d6713c9c60915 (commit) from 5c33a6ba65e4ae4ddac34e3372c962dd49fb6e43 (commit) - Log ----------------------------------------------------------------- commit 9f44e96e245993c8e7aaa9fadf1d6713c9c60915 Author: James Peach Date: Thu Mar 5 07:43:54 2020 +0000 docs: fix typo in SSL functions CLA: trivial Reviewed-by: Matthias St. Pierre Reviewed-by: Paul Yang Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/11253) ----------------------------------------------------------------------- Summary of changes: doc/man3/SSL_accept.pod | 4 ++-- doc/man3/SSL_connect.pod | 4 ++-- doc/man3/SSL_do_handshake.pod | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/man3/SSL_accept.pod b/doc/man3/SSL_accept.pod index a8d84ac81d..eda0a35b9e 100644 --- a/doc/man3/SSL_accept.pod +++ b/doc/man3/SSL_accept.pod @@ -56,7 +56,7 @@ established. The TLS/SSL handshake was not successful because a fatal error occurred either at the protocol level or a connection failure occurred. The shutdown was -not clean. It can also occur of action is need to continue the operation +not clean. It can also occur if action is needed to continue the operation for non-blocking BIOs. Call SSL_get_error() with the return value B to find out the reason. @@ -72,7 +72,7 @@ L =head1 COPYRIGHT -Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved. Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/doc/man3/SSL_connect.pod b/doc/man3/SSL_connect.pod index 5777f4ffd6..b74aa1d2b6 100644 --- a/doc/man3/SSL_connect.pod +++ b/doc/man3/SSL_connect.pod @@ -71,7 +71,7 @@ established. The TLS/SSL handshake was not successful, because a fatal error occurred either at the protocol level or a connection failure occurred. The shutdown was -not clean. It can also occur of action is need to continue the operation +not clean. It can also occur if action is needed to continue the operation for non-blocking BIOs. Call SSL_get_error() with the return value B to find out the reason. @@ -87,7 +87,7 @@ L =head1 COPYRIGHT -Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved. Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/doc/man3/SSL_do_handshake.pod b/doc/man3/SSL_do_handshake.pod index b110cb55fa..55a11ccdbc 100644 --- a/doc/man3/SSL_do_handshake.pod +++ b/doc/man3/SSL_do_handshake.pod @@ -57,7 +57,7 @@ established. The TLS/SSL handshake was not successful because a fatal error occurred either at the protocol level or a connection failure occurred. The shutdown was -not clean. It can also occur of action is need to continue the operation +not clean. It can also occur if action is needed to continue the operation for non-blocking BIOs. Call SSL_get_error() with the return value B to find out the reason. @@ -71,7 +71,7 @@ L =head1 COPYRIGHT -Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved. Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy From tmraz at fedoraproject.org Mon Mar 9 09:48:03 2020 From: tmraz at fedoraproject.org (tmraz at fedoraproject.org) Date: Mon, 09 Mar 2020 09:48:03 +0000 Subject: [openssl] OpenSSL_1_1_1-stable update Message-ID: <1583747283.006614.19317.nullmailer@dev.openssl.org> The branch OpenSSL_1_1_1-stable has been updated via 004f570821b1a92cbb733d8e03b54223231bfac3 (commit) from 53418932416594fda43b58ff64d455457b05c969 (commit) - Log ----------------------------------------------------------------- commit 004f570821b1a92cbb733d8e03b54223231bfac3 Author: James Peach Date: Thu Mar 5 07:43:54 2020 +0000 docs: fix typo in SSL functions CLA: trivial Reviewed-by: Matthias St. Pierre Reviewed-by: Paul Yang Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/11253) (cherry picked from commit 9f44e96e245993c8e7aaa9fadf1d6713c9c60915) ----------------------------------------------------------------------- Summary of changes: doc/man3/SSL_accept.pod | 4 ++-- doc/man3/SSL_connect.pod | 4 ++-- doc/man3/SSL_do_handshake.pod | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/man3/SSL_accept.pod b/doc/man3/SSL_accept.pod index 335655f0c8..b1595f7acf 100644 --- a/doc/man3/SSL_accept.pod +++ b/doc/man3/SSL_accept.pod @@ -56,7 +56,7 @@ established. The TLS/SSL handshake was not successful because a fatal error occurred either at the protocol level or a connection failure occurred. The shutdown was -not clean. It can also occur of action is need to continue the operation +not clean. It can also occur if action is needed to continue the operation for non-blocking BIOs. Call SSL_get_error() with the return value B to find out the reason. @@ -72,7 +72,7 @@ L =head1 COPYRIGHT -Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/doc/man3/SSL_connect.pod b/doc/man3/SSL_connect.pod index 426b8ad757..f7d9e57db6 100644 --- a/doc/man3/SSL_connect.pod +++ b/doc/man3/SSL_connect.pod @@ -71,7 +71,7 @@ established. The TLS/SSL handshake was not successful, because a fatal error occurred either at the protocol level or a connection failure occurred. The shutdown was -not clean. It can also occur of action is need to continue the operation +not clean. It can also occur if action is needed to continue the operation for non-blocking BIOs. Call SSL_get_error() with the return value B to find out the reason. @@ -87,7 +87,7 @@ L =head1 COPYRIGHT -Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/doc/man3/SSL_do_handshake.pod b/doc/man3/SSL_do_handshake.pod index a1b973f7b8..8852f9d3e3 100644 --- a/doc/man3/SSL_do_handshake.pod +++ b/doc/man3/SSL_do_handshake.pod @@ -57,7 +57,7 @@ established. The TLS/SSL handshake was not successful because a fatal error occurred either at the protocol level or a connection failure occurred. The shutdown was -not clean. It can also occur of action is need to continue the operation +not clean. It can also occur if action is needed to continue the operation for non-blocking BIOs. Call SSL_get_error() with the return value B to find out the reason. @@ -71,7 +71,7 @@ L =head1 COPYRIGHT -Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy From levitte at openssl.org Mon Mar 9 09:50:36 2020 From: levitte at openssl.org (Richard Levitte) Date: Mon, 09 Mar 2020 09:50:36 +0000 Subject: [openssl] master update Message-ID: <1583747436.647493.20808.nullmailer@dev.openssl.org> The branch master has been updated via b4dc705a73ba2e8257ea3438ee39e661973e2a13 (commit) from 9f44e96e245993c8e7aaa9fadf1d6713c9c60915 (commit) - Log ----------------------------------------------------------------- commit b4dc705a73ba2e8257ea3438ee39e661973e2a13 Author: Richard Levitte Date: Sat Mar 7 08:23:16 2020 +0100 DOCS: Fix documentation on asymmetric keydata types Some type specs didn't correspond to actual use. Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/11275) ----------------------------------------------------------------------- Summary of changes: doc/man7/provider-keymgmt.pod | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/doc/man7/provider-keymgmt.pod b/doc/man7/provider-keymgmt.pod index 0f765f775a..0a2768b5db 100644 --- a/doc/man7/provider-keymgmt.pod +++ b/doc/man7/provider-keymgmt.pod @@ -279,29 +279,29 @@ The following Import/Export types are available for the built-in RSA algorithm: =over 4 -=item "n" (B) +=item "n" (B) The RSA "n" value. -=item "e" (B) +=item "e" (B) The RSA "e" value. -=item "d" (B) +=item "d" (B) The RSA "d" value. -=item "rsa-factor" (B) +=item "rsa-factor" (B) An RSA factor. In 2 prime RSA these are often known as "p" or "q". This value may be repeated up to 10 times in a single key. -=item "rsa-exponent" (B) +=item "rsa-exponent" (B) An RSA CRT (Chinese Remainder Theorem) exponent. This value may be repeated up to 10 times in a single key. -=item "rsa-coefficient" (B) +=item "rsa-coefficient" (B) An RSA CRT (Chinese Remainder Theorem) coefficient. This value may be repeated up to 9 times in a single key. @@ -315,23 +315,23 @@ Diffie-Hellman algorithms: =over 4 -=item "pub" (B) or +=item "pub" (B) The public key value. -=item "priv" (B) or +=item "priv" (B) The private key value. -=item "p" (B) +=item "p" (B) A DSA or Diffie-Hellman "p" value. -=item "q" (B) +=item "q" (B) A DSA or Diffie-Hellman "q" value. -=item "g" (B) +=item "g" (B) A DSA or Diffie-Hellman "g" value. @@ -374,7 +374,7 @@ EC curve's cofactor (note for some curves the cofactor is 1). The public key value in EC point format. -=item "priv" (B) +=item "priv" (B) The private key value. From levitte at openssl.org Mon Mar 9 09:56:23 2020 From: levitte at openssl.org (Richard Levitte) Date: Mon, 09 Mar 2020 09:56:23 +0000 Subject: [openssl] master update Message-ID: <1583747783.898464.23136.nullmailer@dev.openssl.org> The branch master has been updated via c518117b99bc4aad62990e8a31b7bc1dae06d16c (commit) via df13defd4fd4c5a7afff69bc9733e7526e07959a (commit) from b4dc705a73ba2e8257ea3438ee39e661973e2a13 (commit) - Log ----------------------------------------------------------------- commit c518117b99bc4aad62990e8a31b7bc1dae06d16c Author: Richard Levitte Date: Sat Feb 29 08:57:34 2020 +0100 DH: add internal dh_get_method() This should have been publically present a long time ago, to be consistent with the RSA, DSA and EC_KEY APIs. However, since we've now deprecated that kind of function for the other key types, there's no point in adding a public function, but we still need it internally. Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/11193) commit df13defd4fd4c5a7afff69bc9733e7526e07959a Author: Richard Levitte Date: Thu Feb 27 10:51:45 2020 +0100 EVP: Check that key methods aren't foreign when exporting The EVP_PKEY_ASN1_METHOD function export_to() must check that the key we're trying to export has a known libcrypto method, i.e. is a built in RSA_METHOD, DSA_METHOD, etc. Otherwise, the method may be defined by the calling application, by an engine, by another library, and we simply cannot know all the quirks hidden behind that method, if we have access to the key data, or much anything. Such keys are simply deemed impossible to export to provider keys, i.e. have export_to() return 0. This cascades back to functions like evp_pkey_export_to_provider() and evp_pkey_upgrade_to_provider() and their callers. In most cases, this is fine, but if these get mixed in with provider side keys in any function, that function will fail. Fixes #11179 Fixes #9915 Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/11193) ----------------------------------------------------------------------- Summary of changes: crypto/dh/dh_ameth.c | 8 ++++++++ crypto/dh/dh_lib.c | 5 +++++ crypto/dsa/dsa_ameth.c | 7 +++++++ crypto/ec/ec_ameth.c | 7 +++++++ crypto/evp/m_sigver.c | 2 +- crypto/evp/pmeth_fn.c | 2 +- crypto/evp/signature.c | 2 +- crypto/rsa/rsa_ameth.c | 7 +++++++ include/crypto/dh.h | 2 ++ 9 files changed, 39 insertions(+), 3 deletions(-) diff --git a/crypto/dh/dh_ameth.c b/crypto/dh/dh_ameth.c index 14c0842455..ecec5fbcf6 100644 --- a/crypto/dh/dh_ameth.c +++ b/crypto/dh/dh_ameth.c @@ -20,6 +20,7 @@ #include "dh_local.h" #include #include "crypto/asn1.h" +#include "crypto/dh.h" #include "crypto/evp.h" #include #include @@ -499,6 +500,13 @@ static int dh_pkey_export_to(const EVP_PKEY *from, void *to_keydata, OSSL_PARAM *params; int rv; + /* + * If the DH method is foreign, then we can't be sure of anything, and + * can therefore not export or pretend to export. + */ + if (dh_get_method(dh) != DH_OpenSSL()) + return 0; + if (p == NULL || g == NULL) return 0; diff --git a/crypto/dh/dh_lib.c b/crypto/dh/dh_lib.c index 29152dca4d..7666e77d39 100644 --- a/crypto/dh/dh_lib.c +++ b/crypto/dh/dh_lib.c @@ -45,6 +45,11 @@ int DH_set_method(DH *dh, const DH_METHOD *meth) return 1; } +const DH_METHOD *dh_get_method(const DH *dh) +{ + return dh->meth; +} + DH *DH_new(void) { return dh_new_intern(NULL, NULL); diff --git a/crypto/dsa/dsa_ameth.c b/crypto/dsa/dsa_ameth.c index 9715a75d0d..94f3f43b8e 100644 --- a/crypto/dsa/dsa_ameth.c +++ b/crypto/dsa/dsa_ameth.c @@ -528,6 +528,13 @@ static int dsa_pkey_export_to(const EVP_PKEY *from, void *to_keydata, OSSL_PARAM *params; int rv; + /* + * If the DSA method is foreign, then we can't be sure of anything, and + * can therefore not export or pretend to export. + */ + if (DSA_get_method(dsa) != DSA_OpenSSL()) + return 0; + if (p == NULL || q == NULL || g == NULL) return 0; diff --git a/crypto/ec/ec_ameth.c b/crypto/ec/ec_ameth.c index d6807661ff..652086a93a 100644 --- a/crypto/ec/ec_ameth.c +++ b/crypto/ec/ec_ameth.c @@ -637,6 +637,13 @@ int ec_pkey_export_to(const EVP_PKEY *from, void *to_keydata, || (ecg = EC_KEY_get0_group(eckey)) == NULL) return 0; + /* + * If the EC_KEY method is foreign, then we can't be sure of anything, + * and can therefore not export or pretend to export. + */ + if (EC_KEY_get_method(eckey) != EC_KEY_OpenSSL()) + return 0; + ossl_param_bld_init(&tmpl); /* export the domain parameters */ diff --git a/crypto/evp/m_sigver.c b/crypto/evp/m_sigver.c index 225017b509..4b2cb4eb35 100644 --- a/crypto/evp/m_sigver.c +++ b/crypto/evp/m_sigver.c @@ -73,7 +73,7 @@ static int do_sigver_init(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, */ ERR_set_mark(); - if (locpctx->keytype == NULL) + if (locpctx->engine != NULL || locpctx->keytype == NULL) goto legacy; /* diff --git a/crypto/evp/pmeth_fn.c b/crypto/evp/pmeth_fn.c index ca0790fcd6..5d0e21ed68 100644 --- a/crypto/evp/pmeth_fn.c +++ b/crypto/evp/pmeth_fn.c @@ -38,7 +38,7 @@ static int evp_pkey_asym_cipher_init(EVP_PKEY_CTX *ctx, int operation) */ ERR_set_mark(); - if (ctx->keytype == NULL || ctx->engine != NULL) + if (ctx->engine != NULL || ctx->keytype == NULL) goto legacy; /* diff --git a/crypto/evp/signature.c b/crypto/evp/signature.c index c01f076609..acbe76592f 100644 --- a/crypto/evp/signature.c +++ b/crypto/evp/signature.c @@ -359,7 +359,7 @@ static int evp_pkey_signature_init(EVP_PKEY_CTX *ctx, int operation) */ ERR_set_mark(); - if (ctx->keytype == NULL) + if (ctx->engine != NULL || ctx->keytype == NULL) goto legacy; /* diff --git a/crypto/rsa/rsa_ameth.c b/crypto/rsa/rsa_ameth.c index f34eacf552..3411b734e5 100644 --- a/crypto/rsa/rsa_ameth.c +++ b/crypto/rsa/rsa_ameth.c @@ -1092,6 +1092,13 @@ static int rsa_pkey_export_to(const EVP_PKEY *from, void *to_keydata, OSSL_PARAM *params = NULL; int rv = 0; + /* + * If the RSA method is foreign, then we can't be sure of anything, and + * can therefore not export or pretend to export. + */ + if (RSA_get_method(rsa) != RSA_PKCS1_OpenSSL()) + return 0; + /* Public parameters must always be present */ if (n == NULL || e == NULL) goto err; diff --git a/include/crypto/dh.h b/include/crypto/dh.h index 3af3c5222e..7c7cebdc16 100644 --- a/include/crypto/dh.h +++ b/include/crypto/dh.h @@ -23,3 +23,5 @@ int dh_get0_nid(const DH *dh); int dh_check_pub_key_partial(const DH *dh, const BIGNUM *pub_key, int *ret); int dh_check_priv_key(const DH *dh, const BIGNUM *priv_key, int *ret); int dh_check_pairwise(DH *dh); + +const DH_METHOD *dh_get_method(const DH *dh); From dev at ddvo.net Mon Mar 9 10:03:49 2020 From: dev at ddvo.net (dev at ddvo.net) Date: Mon, 09 Mar 2020 10:03:49 +0000 Subject: [openssl] master update Message-ID: <1583748229.011453.26304.nullmailer@dev.openssl.org> The branch master has been updated via 99a16e0459e5089c2cfb92ee775f1221a51b8d05 (commit) from c518117b99bc4aad62990e8a31b7bc1dae06d16c (commit) - Log ----------------------------------------------------------------- commit 99a16e0459e5089c2cfb92ee775f1221a51b8d05 Author: Dr. David von Oheimb Date: Mon Mar 9 11:03:21 2020 +0100 Renew and extend the tool for checking adherence to C coding style rules aims at checking most of https://www.openssl.org/policies/codingstyle.html and various requirements not yet explicitly stated there - see also #10725 add util/check-format.pl and its self-tests in util/check-format-test-{positives,negatives}.c remove util/openssl-format-source Reviewed-by: Richard Levitte Reviewed-by: David von Oheimb (Merged from https://github.com/openssl/openssl/pull/10363) ----------------------------------------------------------------------- Summary of changes: util/check-format-test-negatives.c | 678 ++++++++++++++++++++++ util/check-format-test-positives.c | 345 +++++++++++ util/check-format.pl | 1118 ++++++++++++++++++++++++++++++++++++ util/openssl-format-source | 175 ------ 4 files changed, 2141 insertions(+), 175 deletions(-) create mode 100644 util/check-format-test-negatives.c create mode 100644 util/check-format-test-positives.c create mode 100644 util/check-format.pl delete mode 100755 util/openssl-format-source diff --git a/util/check-format-test-negatives.c b/util/check-format-test-negatives.c new file mode 100644 index 0000000000..c9f781e06b --- /dev/null +++ b/util/check-format-test-negatives.c @@ -0,0 +1,678 @@ +/* + * Copyright 2007-2019 The OpenSSL Project Authors. All Rights Reserved. + * Copyright Nokia 2007-2019 + * Copyright Siemens AG 2015-2019 + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* + * A collection of test cases where check-format.pl should not report issues. + * There are some known false positives, though, which are marked below. + */ + +/*- + * allow double space in format-tagged multi-line comment + */ +int f(void) /* + * trailing multi-line comment + */ +{ + if (ctx == NULL) { /* non-leading intra-line comment */ + if (pem_name != NULL) + /* entire-line comment indent usually like for the following line */ + return NULL; /* hanging indent also for this line after comment */ + /* leading comment has same indentation as normal code */ stmt; + /* entire-line comment may have same indent as normal code */ + } + +#if X + if (1) /* bad style: just part of control structure depends on #if */ +#else + if (2) /*@ resulting false positive */ +#endif + c; /*@ resulting false positive */ + + if (1) + if (2) + c; + else + e; + else + f; + do + do + 2; + while (1); + while (2); + + if (1) + f(a, b); + do + 1; while (2); /*@ more than one stmt just to construct case */ + if (1) + f(a, b); + else + do + 1; + while (2); + if (1) + f(a, b); + else do /*@ (non-brace) code before 'do' just to construct case */ + 1; + while (2); + f1234(a, + b); do /*@ (non-brace) code before 'do' just to construct case */ + 1; + while (2); + if (1) + f(a, + b); do /*@ (non-brace) code before 'do' just to construct case */ + 1; + while (2); + if (1) + f(a, b); + else + do f(c, c); /*@ (non-brace) code after 'do' just to construct case */ + while (2); + + if (1) + f(a, b); + else + return; + if (1) + f(a, + b); else /*@ (non-brace) code before 'else' just to construct case */ + do + 1; + while (2); + + if (1) + { /*@ brace after 'if' not on same line just to construct case */ + c; + d; + } + /* this comment is correctly indented if it refers to the following line */ + d; + + if (1) { + 2; + } else /*@ no brace after 'else' just to construct case */ + 3; + do { + } while (x); + if (1) { + 2; + } else { + 3; + } + if (4) + 5; + else + 6; +} +typedef * d(int) + x; +typedef (int) +x; +typedef (int)*() + x; +typedef *int * +x; +typedef OSSL_CMP_MSG *(*cmp_srv_process_cb_t) + (OSSL_CMP_SRV_CTX *ctx, OSSL_CMP_MSG *msg) + xx; +int f() +{ + c; + if (1) { + c; + } + c; + if (1) + if (2) + { /*@ brace after 'if' not on same line just to construct case */ + c; + } + e; + const usign = { + 0xDF, + { + dd + }, + dd + }; + const unsign = { + 0xDF, { + dd + }, + dd + }; +} +const unsigned char trans_id[OSSL_CMP_TRANSACTIONID_LENGTH] = { + 0xDF, +}; +const unsigned char trans_id[OSSL_CMP_TRANSACTIONID_LENGTH] = + { + 0xDF, + }; +typedef +int +a; + +typedef +struct +{ + int a; +} b; +typedef enum { + w = 0 +} e_type; +typedef struct { + enum { + w = 0 + } e_type; + enum { + w = 0 + } e_type; +} e; +struct s_type { + enum e_type { + w = 0 + }; +}; +struct s_type +{ + enum e_type { + w = 0 + }; + enum e2_type { + w = 0 + }; +}; + +#define X 1 + 1 +#define Y /* .. */ 2 + 2 +#define Z 3 + 3 + +static varref cmp_vars[] = { /* comment */ + {&opt_config}, {&opt_section}, + + {&opt_server}, {&opt_proxy}, {&opt_path}, +}; + +#define SWITCH(x) \ + switch (x) { \ + case 0: \ + break; \ + default: \ + break; \ + } + +#define DEFINE_SET_GET_BASE_TEST(PREFIX, SETN, GETN, DUP, FIELD, TYPE, ERR, \ + DEFAULT, NEW, FREE) \ + static int execute_CTX_##SETN##_##GETN##_##FIELD( \ + TEST_FIXTURE *fixture) \ + { \ + CTX *ctx = fixture->ctx; \ + int (*set_fn)(CTX *ctx, TYPE) = \ + (int (*)(CTX *ctx, TYPE))PREFIX##_##SETN##_##FIELD; \ + /* comment */ \ + } + +/* 'struct' in function header */ +static int f(struct pem_pass_data *pass_data) +{ + if (pass_data == NULL) + return 0; +} + +static void *fun(void) +{ + if (pem_name != NULL) + /* comment */ + return NULL; + + do { + size_t available_len, data_len; + const char *curr = txt, *next = txt; + char *tmp; + } while (1); + + char *intraline_string_with_comment_delimiters_and_dbl_space = "1 /*1"; + char *multiline_string_with_comment_delimiters_and_dbl_space = "1 /*1\ +2222222\'22222222222222222\"222222222" "33333 /*3333333333" "44 /*44444444444\ +55555555555555\ +6666"; +} + +ASN1_CHOICE(OSSL_CRMF_POPO) = { + ASN1_IMP(OSSL_CRMF_POPO, value.raVerified, ASN1_NULL, 0), + ASN1_EXP(OSSL_CRMF_POPO, value.keyAgreement, OSSL_CRMF_POPOPRIVKEY, 3) +} ASN1_CHOICE_END(OSSL_CRMF_POPO) +IMPLEMENT_ASN1_FUNCTIONS(OSSL_CRMF_POPO) + +ASN1_ADB(OSSL_CRMF_ATTRIBUTETYPEANDVALUE) = { + ADB_ENTRY(NID_id_regCtrl_regToken, + ASN1_SIMPLE(OSSL_CRMF_ATTRIBUTETYPEANDVALUE, + value.regToken, ASN1_UTF8STRING)), +} ASN1_ADB_END(OSSL_CRMF_ATTRIBUTETYPEANDVALUE, 0, type, 0, + &attributetypeandvalue_default_tt, NULL); + +ASN1_ITEM_TEMPLATE(OSSL_CRMF_MSGS) = + ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, + OSSL_CRMF_MSGS, OSSL_CRMF_MSG) +ASN1_ITEM_TEMPLATE_END(OSSL_CRMF_MSGS) + +void f_looong_body_200() +{ /* function body length up to 200 lines accepted */ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +} + +void f_looong_body_201() +{ /* function body length > 200 lines, but LONG BODY marker present */ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +} diff --git a/util/check-format-test-positives.c b/util/check-format-test-positives.c new file mode 100644 index 0000000000..d14ceb375b --- /dev/null +++ b/util/check-format-test-positives.c @@ -0,0 +1,345 @@ +/* + * Copyright 2007-2019 The OpenSSL Project Authors. All Rights Reserved. + * Copyright Nokia 2007-2019 + * Copyright Siemens AG 2015-2019 + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* + * This demonstrates/tests cases where check-format.pl should report issues. + * Some of the reports are due to sanity checks for proper nesting of comment + * delimiters and parenthesis-like symbols, e.g., on unexpected/unclosed braces. + */ + +/* + * The '@'s after '*' are used for self-tests: they mark lines containing + * a single flaw that should be reported. Normally it should be reported + * while handling the given line, but in case of delayed checks there is a + * following digit indicating the number of reports expected for this line. + */ + +/* For each of the following set of lines the tool should complain once */ +/*@ tab character: */ +/*@ intra-line carriage return character: */ +/*@ non-printable ASCII character:  */ +/*@ non-ASCII character: ? */ +/*@ whitespace at EOL: */ +// /*@ end-of-line comment style not allowed (for C90 compatibility) */ + /*@0 intra-line comment indent off by 1, reported unless sloppy-cmt */ +/*X */ /*@2 no space nor '*' after comment start, reported unless sloppy-spc */ +/* X*/ /*@ no space before comment end , reported unless sloppy-spc */ +/*@ comment starting delimiter: /* inside intra-line comment */ + /*@0 + *@ above multi-line comment start indent off by 1, reported unless sloppy-cmt; this comment line is too long + *@ multi-line comment indent further off by 1 relative to comment start + *@ multi-line comment ending with text on last line */ +/*@2 multi-line comment starting with text on first line + *@ comment starting delimiter: /* inside multi-line comment +*@ multi-line comment indent off by -1 + *X*@ no spc after leading '*' in multi-line comment, reported unless sloppy-spc + *@0 more than two spaces after . in comment, reported unless sloppy-spc +*/ /*@2 multi-line comment end indent off by -1 (relative to comment start) */ +*/ /*@ unexpected comment ending delimiter outside comment */ +/*@ comment line is 4 columns tooooooooooooooooo wide, reported unless sloppy-len */ +/*@ comment line is 5 columns toooooooooooooooooooooooooooooooooooooooooooooo wide */ +#define X 1 /*@0 double space false negative due to coincidence */ + #define Y 2 /*@ indent of preprocessor directive off by 1 (must be 0) */ +typedef struct { /*@0 double space in code, reported unless sloppy-spc */ + enum { /*@1 double space in comment, reported unless sloppy-spc */ + w = 0 /*@2 hanging expr indent off by 1, or 3 for lines after '{' */ + && 1, /*@ hanging expr indent off by 3, or -1 for leading '&&' */ + x = 1, /*@ hanging expr indent off by -1 */ + y,z /*@ no space after ',', reported unless sloppy-spc */ + } e_member ; /*@ space before ';', reported unless sloppy-spc */ + int v[1; /*@ unclosed bracket in type declaration */ + union { /*@ statement/type declaration indent off by -1 */ + struct{} s; /*@ no space before '{', reported unless sloppy-spc */ + }u_member; /*@ no space after '}', reported unless sloppy-spc */ + } s_type; /*@ statement/type declaration indent off by 4 */ +int* somefunc(); /*@ no space before '*' in type decl, r unless sloppy-spc */ +void main(int n) { /*@ opening brace at end of function definition header */ + for (;;n++) { /*@ no space after ';', reported unless sloppy-spc */ + return; /*@0 (1-line) single statement in braces */ + }} /*@2 code after '}' outside expr */ +} /*@ unexpected closing brace (too many '}') outside expr */ +) /*@ unexpected closing paren outside expr */ +#endif /*@ unexpected #endif */ +int f (int a, /*@ space after fn before '(', reported unless sloppy-spc */ + int b, /*@ hanging expr indent off by -1 */ + long l) /*@ one-letter name 'l' */ +{ int /*@ code after '{' opening a block */ + xx = 1) + /*@ unexpected closing parenthesis */ + 2] - /*@ unexpected closing bracket */ + 3: * /*@ unexpected ':' (without preceding '?') within expr */ + 4}; /*@ unexpected closing brace within expression */ + char y[] = { /*@0 unclosed brace within initializer/enum expression */ + 1* 1, /*@ no space etc. before '*', reported unless sloppy-spc */ + 2, /*@ hanging expr indent (for lines after '{') off by 1 */ + (xx /*@0 unclosed parenthesis in expression */ + ? y /*@0 unclosed '? (conditional expression) */ + [0; /*@4 unclosed bracket in expression */ + s_type s; /*@ local variable declaration indent off by -1 */ + somefunc(a, /*@ statement indent off by -1 */ + "aligned" /*@ expr indent off by -2 accepted if sloppy-hang */ "right" + , b, /*@ expr indent off by -1 */ + b, /*@ expr indent as on line above, accepted if sloppy-hang */ + b, /*@ expr indent off -8 but @ extra indent accepted if sloppy-hang */ + "again aligned" /*@ expr indent off by -9 (left of stmt indent, */ "right", + 123 == /*@ .. so reported also with sloppy-hang; this line is too long */ 456 +# define MAC(A) (A) /*@ nesting indent of preprocessor directive off by 1 */ + ? 1 /*@ hanging expr indent off by 1 */ + : 2); /*@ hanging expr indent off by 2, or 1 for leading ':' */ + if(a /*@ no space after 'if', reported unless sloppy-spc */ + /*@0 intra-line comment indent off by -1 (not: by 3 due to '&&') */ + && ! 0 /*@2 space after '!', reported unless sloppy-spc */ + || b == /*@ hanging expr indent off by 2, or -2 for leading '||' */ + (xx+= 2) + /*@ no space before '+=', reported unless sloppy-spc */ + (a^ 1) + /*@ no space before '^', reported unless sloppy-spc */ + a %2 / /*@ no space after '%', reported unless sloppy-spc */ + 1 +/* */ /*@ no space before comment, reported unless sloppy-spc */ + /* */+ /*@ no space after comment, reported unless sloppy-spc */ + s. e_member) /*@ space after '.', reported unless sloppy-spc */ + xx = a + b /*@ extra single-statement indent off by 1 */ + + 0; /*@ two times extra single-statement indent off by 3 */ + if (a ++) /*@ space before postfix '++', reported unless sloppy-spc */ + { /*@ {' not on same line as preceding 'if' */ + c; /*@0 single stmt in braces, reported on 1-stmt */ + } else /*@ no '{' on same line after '} else' */ + { /*@ statement indent off by 2 */ + d; /*@0 single stmt in braces, reported on 1-stmt */ + } /*@ statement indent off by 6 */ + if (1) f(a, /*@ (non-brace) code after end of 'if' condition */ + b); else /*@ (non-brace) code before 'else' */ + do f(c, c); /*@ (non-brace) code after 'do' */ + while ( 2); /*@ space after '(', reported unless sloppy-spc */ + b; c; /*@ more than one statement per line */ + do{ /*@ no space before '{', reported unless sloppy-spc */ + f (3, /*@ space after fn before '(', reported unless sloppy-spc */ + 4); /*@0 false negative: should report single stmt in braces */ + } /*@0 'while' not on same line as preceding '}' */ + while (a+ 0); /*@2 no space before '+', reported unless sloppy-spc */ + switch (b ) { /*@ space before ')', reported unless sloppy-spc */ + case 1: /*@ 'case' special statement indent off by -1 */ + case(2): /*@ no space after 'case', reported unless sloppy-spc */ + default: ; /*@ code after 'default:' */ +} /*@ statement indent off by -4 */ + label: /*@ label special statement indent off by 1 */ + return( /*@ no space after 'return', reported unless sloppy-spc */ + x); } /*@ code before block-level '}' */ +/* Here the tool should stop complaining apart from the below issues at EOF */ + +void f_looong_body() +{ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +} /*@ function body length > 200 lines */ + +#if 0 /*@0 unclosed #if */ +struct t { /*@0 unclosed brace at decl/block level */ + enum { /*@0 unclosed brace at enum/expression level */ + v = (1 /*@0 unclosed parenthesis */ + etyp /*@0 empty line follows just before EOF: */ + diff --git a/util/check-format.pl b/util/check-format.pl new file mode 100644 index 0000000000..af77d20920 --- /dev/null +++ b/util/check-format.pl @@ -0,0 +1,1118 @@ +#!/usr/bin/perl +# +# Copyright 2020 The OpenSSL Project Authors. All Rights Reserved. +# Copyright Siemens AG 2019-2020 +# +# Licensed under the Apache License 2.0 (the "License"). +# You may not use this file except in compliance with the License. +# You can obtain a copy in the file LICENSE in the source distribution +# or at https://www.openssl.org/source/license.html +# +# check-format.pl +# - check formatting of C source according to OpenSSL coding style +# +# usage: +# check-format.pl [-l|--sloppy-len] [-l|--sloppy-bodylen] +# [-s|--sloppy-spc] [-c|--sloppy-cmt] [-m|--sloppy-macro] +# [-h|--sloppy-hang] [-1|--1-stmt] +# +# +# checks adherence to the formatting rules of the OpenSSL coding guidelines +# assuming that the input files contain syntactically correct C code. +# This pragmatic tool is incomplete and yields some false positives. +# Still it should be useful for detecting most typical glitches. +# +# options: +# -l | --sloppy-len increase accepted max line length from 80 to 84 +# -l | --sloppy-bodylen do not report function body length > 200 +# -s | --sloppy-spc do not report whitespace nits +# -c | --sloppy-cmt do not report indentation of comments +# Otherwise for each multi-line comment the indentation of +# its lines is checked for consistency. For each comment +# that does not begin to the right of normal code its +# indentation must be as for normal code, while in case it +# also has no normal code to its right it is considered to +# refer to the following line and may be indented equally. +# -m | --sloppy-macro allow missing extra indentation of macro bodies +# -h | --sloppy-hang when checking hanging indentation, do not report +# * same indentation as on line before +# * same indentation as non-hanging indent level +# * indentation moved left (not beyond non-hanging indent) +# just to fit contents within the line length limit +# -1 | --1-stmt do more aggressive checks for { 1 stmt } - see below +# +# There are non-trivial false positives and negatives such as the following. +# +# * When a line contains several issues of the same kind only one is reported. +# +# * When a line contains more than one statement this is (correctly) reported +# but in some situations the indentation checks for subsequent lines go wrong. +# +# * There is the special OpenSSL rule not to unnecessarily use braces around +# single statements: +# { +# stmt; +# } +# except within if ... else constructs where some branch contains more than one +# statement. Since the exception is hard to recognize when such branches occur +# after the current position (such that false positives would be reported) +# the tool by checks for this rule by defaul only for do/while/for bodies. +# Yet with the --1-stmt option false positives are preferred over negatives. +# False negatives occur if the braces are more than two non-empty lines apart. +# +# * Use of multiple consecutive spaces is regarded a coding style nit except +# when done in order to align certain columns over multiple lines, e.g.: +# # define AB 1 +# # define CDE 22 +# # define F 3333 +# This pattern is recognized - and consequently double space not reported - +# for a given line if in the nonempty line before or after (if existing) +# for each occurrence of " \S" (where \S means non-space) in the given line +# there is " \S" in the other line in the respective column position. +# This may lead to both false negatives (in case of coincidental " \S") +# and false positives (in case of more complex multi-column alignment). +# +# * When just part of control structures depend on #if(n)(def), which can be +# considered bad programming style, indentation false positives occur, e.g.: +# #if X +# if (1) /* bad style */ +# #else +# if (2) /* bad style resulting in false positive */ +# #endif +# c; /* resulting further false positive */ + +use strict; +# use List::Util qw[min max]; +use POSIX; + +use constant INDENT_LEVEL => 4; +use constant MAX_LINE_LENGTH => 80; +use constant MAX_BODY_LENGTH => 200; + +# global variables @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + +# command-line options +my $max_length = MAX_LINE_LENGTH; +my $sloppy_bodylen = 0; +my $sloppy_SPC = 0; +my $sloppy_hang = 0; +my $sloppy_cmt = 0; +my $sloppy_macro = 0; +my $extended_1_stmt = 0; + +while ($ARGV[0] =~ m/^-(\w|-[\w\-]+)$/) { + my $arg = $1; shift; + if ($arg =~ m/^(l|-sloppy-len)$/) { + $max_length += INDENT_LEVEL; + } elsif ($arg =~ m/^(b|-sloppy-bodylen)$/) { + $sloppy_bodylen = 1; + } elsif ($arg =~ m/^(s|-sloppy-spc)$/) { + $sloppy_SPC = 1; + } elsif ($arg =~ m/^(c|-sloppy-cmt)$/) { + $sloppy_cmt = 1; + } elsif ($arg =~ m/^(m|-sloppy-macro)$/) { + $sloppy_macro = 1; + } elsif ($arg =~ m/^(h|-sloppy-hang)$/) { + $sloppy_hang = 1; + } elsif ($arg =~ m/^(1|-1-stmt)$/) { + $extended_1_stmt = 1; + } else { + die("unknown option: -$arg"); + } +} + +# status variables +my $self_test; # whether the current input file is regarded to contain (positive/negative) self-tests +my $line; # current line number +my $line_before; # number of previous not essentially empty line (containing at most whitespace and '\') +my $line_before2; # number of not essentially empty line before previous not essentially empty line +my $contents; # contents of current line +my $contents_before; # contents of $line_before, if $line_before > 0 +my $contents_before_; # contents of $line_before after blinding comments etc., if $line_before > 0 +my $contents_before2; # contents of $line_before2, if $line_before2 > 0 +my $contents_before_2; # contents of $line_before2 after blinding comments etc., if $line_before2 > 0 +my $in_multiline_string; # line starts within multi-line string literal +my $count; # -1 or number of leading whitespace characters (except newline) in current line, + # which should be $block_indent + $hanging_offset + $local_offset or $expr_indent +my $count_before; # number of leading whitespace characters (except line ending chars) in $contents_before +my $has_label; # current line contains label +my $local_offset; # current extra indent due to label, switch case/default, or leading closing brace(s) +my $line_body_start; # number of line where last function body started, or 0 +my $line_function_start; # number of line where last function definition started, used if $line_body_start != 0 +my $last_function_header; # header containing name of last function defined, used if $line_function_start != 0 +my $line_opening_brace; # number of previous line with opening brace after do/while/for, optionally for if/else + +my $keyword_opening_brace; # name of previous keyword, used if $line_opening_brace != 0 +my $ifdef__cplusplus; # line before contained '#ifdef __cplusplus' (used in header files) +my $block_indent; # currently required normal indentation at block/statement level +my $hanging_offset; # extra indent, which may be nested, for just one hanging statement or expr or typedef +my @in_do_hanging_offsets; # stack of hanging offsets for nested 'do' ... 'while' +my @in_if_hanging_offsets; # stack of hanging offsets for nested 'if' (but not its potential 'else' branch) +my $if_maybe_terminated; # 'if' ends and $hanging_offset should be reset unless the next line starts with 'else' +my @nested_block_indents; # stack of indentations at block/statement level, needed due to hanging statements +my @nested_hanging_offsets;# stack of nested $hanging_offset values, in parallel to @nested_block_indents +my @nested_in_typedecl; # stack of nested $in_typedecl values, partly in parallel to @nested_block_indents +my @nested_indents; # stack of hanging indents due to parentheses, braces, brackets, or conditionals +my @nested_symbols; # stack of hanging symbols '(', '{', '[', or '?', in parallel to @nested_indents +my @nested_conds_indents; # stack of hanging indents due to conditionals ('?' ... ':') +my $expr_indent; # resulting hanging indent within (multi-line) expressions including type exprs, else 0 +my $hanging_symbol; # character ('(', '{', '[', not: '?') responsible for $expr_indent, if $expr_indent != 0 +my $in_expr; # in expression after if/while/for/switch/return/enum/LHS of assignment +my $in_paren_expr; # in parenthesized if/while/for condition and switch expression, if $expr_indent != 0 +my $in_typedecl; # nesting level of typedef/struct/union/enum +my $in_directive; # number of lines so far within preprocessor directive, e.g., macro definition +my $directive_nesting; # currently required indentation of preprocessor directive according to #if(n)(def) +my $directive_offset; # indent offset within multi-line preprocessor directive, if $in_directive > 0 +my $in_macro_header; # number of open parentheses + 1 in (multi-line) header of #define, if $in_directive > 0 +my $in_comment; # number of lines so far within multi-line comment, or < 0 when end is on current line +my $leading_comment; # multi-line comment has no code before its beginning delimiter +my $formatted_comment; # multi-line comment beginning with "/*-", which indicates/allows special formatting +my $comment_indent; # comment indent, if $in_comment != 0 +my $num_reports_line = 0; # number of issues found on current line +my $num_reports = 0; # total number of issues found +my $num_indent_reports = 0;# total number of indentation issues found +my $num_nesting_issues = 0;# total number of directive nesting issues found +my $num_syntax_issues = 0; # total number of syntax issues found during sanity checks +my $num_SPC_reports = 0; # total number of whitespace issues found +my $num_length_reports = 0;# total number of line length issues found + +sub reset_file_state { + $line = 0; + $line_before = 0; + $line_before2 = 0; + @nested_block_indents = (); + @nested_hanging_offsets = (); + @nested_in_typedecl = (); + @nested_symbols = (); + @nested_indents = (); + @nested_conds_indents = (); + $expr_indent = 0; + $in_paren_expr = 0; + $in_expr = 0; + $hanging_offset = 0; + @in_do_hanging_offsets = (); + @in_if_hanging_offsets = (); + $if_maybe_terminated = 0; + $block_indent = 0; + $ifdef__cplusplus = 0; + $in_multiline_string = 0; + $line_body_start = 0; + $line_opening_brace = 0; + $in_typedecl = 0; + $in_directive = 0; + $directive_nesting = 0; + $in_comment = 0; +} + +# auxiliary submodules @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + +sub report_flexibly { + my $line = shift; + my $msg = shift; + my $contents = shift; + my $report_SPC = $msg =~ /SPC/; + return if $report_SPC && $sloppy_SPC; + + print "$ARGV:$line:$msg:$contents" unless $self_test; + $num_reports_line++; + $num_reports++; + $num_indent_reports++ if $msg =~ m/indent/; + $num_nesting_issues++ if $msg =~ m/directive nesting/; + $num_syntax_issues++ if $msg =~ m/unclosed|unexpected/; + $num_SPC_reports++ if $report_SPC; + $num_length_reports++ if $msg =~ m/length/; +} + +sub report { + my $msg = shift; + report_flexibly($line, $msg, $contents); +} + +sub parens_balance { # count balance of opening parentheses - closing parentheses + my $str = shift; + return $str =~ tr/\(// - $str =~ tr/\)//; +} + +sub blind_nonspace { # blind non-space text of comment as @, preserving length and spaces + # the @ character is used because it cannot occur in normal program code so there is no confusion + # comment text is not blinded to whitespace in order to be able to check double SPC also in comments + my $comment_text = shift; + $comment_text =~ s/\.\s\s/.. /g; # in double SPC checks allow one extra space after period '.' in comments + return $comment_text =~ tr/ /@/cr; +} + +# submodule for indentation checking/reporting @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + +sub check_indent { # used for lines outside multi-line string literals + my $stmt_indent = $block_indent + $hanging_offset + $local_offset; + $stmt_indent = 0 if $stmt_indent < 0; # TODO maybe give warning/error + my $stmt_desc = $contents =~ + m/^\s*\/\*/ ? "intra-line comment" : + $has_label ? "label" : + ($hanging_offset != 0 ? "hanging " : ""). + ($hanging_offset != 0 ? "stmt/expr" : "stmt/decl"); # $in_typedecl is not fully to the point here + my ($ref_desc, $ref_indent) = $expr_indent == 0 ? ($stmt_desc, $stmt_indent) + : ("hanging '$hanging_symbol'", $expr_indent); + my ($alt_desc, $alt_indent) = ("", $ref_indent); + + # allow indent 1 for labels - this cannot happen for leading ':' + ($alt_desc, $alt_indent) = ("outermost position", 1) if $expr_indent == 0 && $has_label; + + if (@nested_conds_indents != 0 && substr($_, $count, 1) eq ":") { + # leading ':' within stmt/expr/decl - this cannot happen for labels nor leading '&&' or '||' + # allow special indent at level of corresponding "?" + ($alt_desc, $alt_indent) = ("leading ':'", @nested_conds_indents[-1]); + } + # allow extra indent offset leading '&&' or '||' - this cannot happen for leading ":" + ($alt_desc, $alt_indent) = ("leading '$1'", $ref_indent + INDENT_LEVEL) if $contents =~ m/^[\s@]*(\&\&|\|\|)/; + + if ($expr_indent < 0) { # implies @nested_symbols != 0 && @nested_symbols[0] eq "{" && @nested_indents[-1] < 0 + # allow normal stmt indentation level for hanging initializer/enum expressions after trailing '{' + # this cannot happen for labels and overrides special treatment of ':', '&&' and '||' for this line + ($alt_desc, $alt_indent) = ("lines after '{'", $stmt_indent); + # decide depending on current actual indentation, preventing forth and back + @nested_indents[-1] = $count == $stmt_indent ? $stmt_indent : - at nested_indents[-1]; # allow $stmt_indent + $ref_indent = $expr_indent = @nested_indents[-1]; + } + + # check consistency of indentation within multi-line comment (i.e., between its first, inner, and last lines) + if ($in_comment != 0 && $in_comment != 1) { # in multi-line comment but not on its first line + if (!$sloppy_cmt) { + if ($in_comment > 0) { # not at its end + report("indent = $count != $comment_indent within multi-line comment") + if $count != $comment_indent; + } else { + my $tweak = $in_comment == -2 ? 1 : 0; + report("indent = ".($count + $tweak)." != $comment_indent at end of multi-line comment") + if $count + $tweak != $comment_indent; + } + } + # do not check indentation of last line of non-leading multi-line comment + if ($in_comment < 0 && !$leading_comment) { + s/^(\s*)@/$1*/; # blind first '@' as '*' to prevent below delayed check for the line before + return; + } + return if $in_comment > 0; # not on its last line + # $comment_indent will be checked by the below checks for end of multi-line comment + } + + # else check indentation of entire-line comment or entire-line end of multi-line comment + # ... w.r.t. indent of the following line by delayed check for the line before + if (($in_comment == 0 || $in_comment == 1) # no comment, intra-line comment, or begin of multi-line comment + && $line_before > 0 # there is a line before + && $contents_before_ =~ m/^(\s*)@[\s@]*$/) { # line before begins with '@', no code follows (except '\') + report_flexibly($line_before, "entire-line comment indent = $count_before != $count (of following line)", + $contents_before) if !$sloppy_cmt && $count_before != $count; + } + # ... but allow normal indentation for the current line, else above check will be done for the line before + if (($in_comment == 0 || $in_comment < 0) # (no commment,) intra-line comment or end of multi-line comment + && m/^(\s*)@[\s@]*$/) { # line begins with '@', no code follows (except '\') + if ($count == $ref_indent) { # indentation is like for (normal) code in this line + s/^(\s*)@/$1*/; # blind first '@' as '*' to prevent above delayed check for the line before + return; + } + return if !eof; # defer check of entire-line comment to next line + } + + # else check indentation of leading intra-line comment or end of multi-line comment + if (m/^(\s*)@/) { # line begins with '@', i.e., any (remaining type of) comment + if (!$sloppy_cmt && $count != $ref_indent) { + report("intra-line comment indent = $count != $ref_indent") if $in_comment == 0; + report("multi-line comment indent = $count != $ref_indent") if $in_comment < 0; + } + return; + } + + if ($sloppy_hang && ($hanging_offset != 0 || $expr_indent != 0)) { + # do not report same indentation as on the line before (potentially due to same violations) + return if $line_before > 0 && $count == $count_before; + + # do not report indentation at normal indentation level while hanging expression indent would be required + return if $expr_indent != 0 && $count == $stmt_indent; + + # do not report if contents have been shifted left of nested expr indent (but not as far as stmt indent) + # apparently aligned to the right in order to fit within line length limit + return if $stmt_indent < $count && $count < $expr_indent && + length($contents) == MAX_LINE_LENGTH + length("\n"); + } + + report("indent = $count != $ref_indent for $ref_desc". + ($alt_desc eq "" + || $alt_indent == $ref_indent # prevent showing alternative that happens to have equal value + ? "" : " or $alt_indent for $alt_desc")) + if $count != $ref_indent && $count != $alt_indent; +} + +# submodules handling indentation within expressions @@@@@@@@@@@@@@@@@@@@@@@@@@@ + +sub update_nested_indents { # may reset $in_paren_expr and in this case also resets $in_expr + my $str = shift; + my $start = shift; # defaults to 0 + my $terminator_position = -1; + for (my $i = $start; $i < length($str); $i++) { + my $c; + my $curr = substr($str, $i); + if ($curr =~ m/^(.*?)([{}()?:;\[\]])(.*)$/) { # match from position $i the first {}()?:;[] + $c = $2; + } else { + last; + } + my ($head, $tail) = (substr($str, 0, $i).$1, $3); + $i += length($1) + length($2) - 1; + + # stop at terminator outside 'for(..;..;..)', assuming that 'for' is followed by '(' + return $i if $c eq ";" && (!$in_paren_expr || @nested_indents == 0); + + my $in_stmt = $in_expr || @nested_symbols != 0; # not: || $in_typedecl != 0 + if ($c =~ m/[{([?]/) { # $c is '{', '(', '[', or '?' + if ($c eq "{") { # '{' in any context + # cancel newly hanging_offset if opening brace '{' is after non-whitespace non-comment: + $hanging_offset -= INDENT_LEVEL if $hanging_offset > 0 && $head =~ m/[^\s\@]/; + push @nested_block_indents, $block_indent; + push @nested_hanging_offsets, $in_expr ? $hanging_offset : 0; + push @nested_in_typedecl, $in_typedecl if $in_typedecl != 0; + $block_indent += INDENT_LEVEL + $hanging_offset; + $hanging_offset = 0; + } + if ($c ne "{" || $in_stmt) { # for '{' inside stmt/expr (not: decl), for '(', '[', or '?' anywhere + $tail =~ m/^([\s@]*)([^\s\@])/; + push @nested_indents, defined $2 + ? $i + 1 + length($1) # actual indentation of following non-space non-comment + : $c ne "{" ? +($i + 1) # just after '(' or '[' if only whitespace thereafter + : -($i + 1); # allow also $stmt_indent if '{' with only whitespace thereafter + push @nested_symbols, $c; # done also for '?' to be able to check correct nesting + push @nested_conds_indents, $i if $c eq "?"; # remember special alternative indent for ':' + } + } elsif ($c =~ m/[})\]:]/) { # $c is '}', ')', ']', or ':' + my $opening_c = ($c =~ tr/})]:/{([/r); + if (($c ne ":" || $in_stmt # ignore ':' outside stmt/expr/decl + # in the presence of ':', one could add this sanity check: + # && !(# ':' after initial label/case/default + # $head =~ m/^([\s@]*)(case\W.*$|\w+$)/ || # this matching would not work for + # # multi-line expr after 'case' + # # bitfield length within unsigned type decl + # $tail =~ m/^[\s@]*\d+/ # this matching would need improvement + # ) + )) { + if ($c ne "}" || $in_stmt) { # for '}' inside stmt/expr/decl, ')', ']', or ':' + if (@nested_symbols != 0 && + @nested_symbols[-1] == $opening_c) { # for $c there was a corresponding $opening_c + pop @nested_indents; + pop @nested_symbols; + pop @nested_conds_indents if $opening_c eq "?"; + } else { + report("unexpected '$c' @ ".($in_paren_expr ? "(expr)" : "expr")); + next; + } + } + if ($c eq "}") { # '}' at block level but also inside stmt/expr/decl + if (@nested_block_indents == 0) { + report("unexpected '}'"); + } else { + $block_indent = pop @nested_block_indents; + $hanging_offset = pop @nested_hanging_offsets; + $in_typedecl = pop @nested_in_typedecl if @nested_in_typedecl != 0; + } + } + if ($in_paren_expr && !grep(/\(/, @nested_symbols)) { # end of (expr) + check_nested_nonblock_indents("(expr)"); + $in_paren_expr = $in_expr = 0; + report("code after (expr)") + if $tail =~ m/^([^{]*)/ && $1 =~ m/[^\s\@;]/; # non-space non-';' before any '{' + } + } + } + } + return -1; +} + +sub check_nested_nonblock_indents { + my $position = shift; + while (@nested_symbols != 0) { + my $symbol = pop @nested_symbols; + report("unclosed '$symbol' in $position"); + if ($symbol eq "{") { # repair stack of blocks + $block_indent = pop @nested_block_indents; + $hanging_offset = pop @nested_hanging_offsets; + $in_typedecl = pop @nested_in_typedecl if @nested_in_typedecl != 0; + } + } + @nested_indents = (); + @nested_conds_indents = (); +} + +# start of main program @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + +reset_file_state(); + +while (<>) { # loop over all lines of all input files + $self_test = $ARGV =~ m/check-format-test/; + $line++; + s/\r$//; # strip any trailing CR '\r' (which are typical on Windows systems) + $contents = $_; + + # check for illegal characters + if (m/(.*?)([\x00-\x09\x0B-\x1F\x7F-\xFF])/) { + my $col = length($1); + report(($2 eq "\x09" ? "TAB" : $2 eq "\x0D" ? "CR " : $2 =~ m/[\x00-\x1F]/ ? "non-printable" + : "non-7bit char") . " at column $col") ; + } + + # check for whitespace at EOL + report("trailing whitespace at EOL") if m/\s\n$/; + + # assign to $count the actual indentation level of the current line + chomp; # remove trailing NL '\n' + m/^(\s*)/; + $count = length($1); # actual indentation + $has_label = 0; + $local_offset = 0; + + # character/string literals @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + + s/\\["']/@@/g; # blind all '"' and "'" escaped by '\' (typically within character literals or string literals) + + # handle multi-line string literals to avoid confusion on starting/ending '"' and trailing '\' + if ($in_multiline_string) { + if (s#^([^"]*)"#($1 =~ tr/"/@/cr).'@'#e) { # string literal terminated by '"' + # string contents and its terminating '"' have been blinded as '@' + $count = -1; # do not check indentation + } else { + report("multi-line string literal not terminated by '\"' and trailing '\' is missing") + unless s#^([^\\]*)\s*\\\s*$#$1#; # strip trailing '\' plus any whitespace around + goto LINE_FINISHED; + } + } + + # blind contents of character and string literals as @, preserving length (but not spaces) + # this prevents confusing any of the matching below, e.g., of whitespace and comment delimiters + s#('[^']*')#$1 =~ tr/'/@/cr#eg; # handle all intra-line character literals + s#("[^"]*")#$1 =~ tr/"/@/cr#eg; # handle all intra-line string literals + $in_multiline_string = # handle trailing string literal terminated by '\' + s#^(([^"]*"[^"]*")*[^"]*)("[^"]*)\\(\s*)$#$1.($3 =~ tr/"/@/cr).'"'.$4#e; + # its contents have been blinded and the trailing '\' replaced by '"' + + # strip any other trailing '\' along with any whitespace around it such that it does not interfere with various + # matching below; the later handling of multi-line macro definitions uses $contents where it is not stripped + s#^(.*?)\s*\\\s*$#$1#; # trailing '\' possibly preceded and/or followed by whitespace + + # comments @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + + # do/prepare checks within multi-line comments + my $self_test_exception = $self_test ? "@" : ""; + if ($in_comment > 0) { # this still includes the last line of multi-line commment + my ($head, $any_symbol, $cmt_text) = m/^(\s*)(.?)(.*)$/; + if ($any_symbol eq "*") { + report("no SPC after leading '*' in multi-line comment") if $cmt_text =~ m|^[^/\s$self_test_exception]|; + } else { + report("no leading '*' in multi-line comment"); + } + $in_comment++; + } + + # detect end of comment, must be within multi-line comment, check if it is preceded by non-whitespace text + if ((my ($head, $tail) = m|^(.*?)\*/(.*)$|) && $1 ne '/') { # ending comment: '*/' + report("no SPC nor '*' before '*/'") if $head =~ m/[^*\s]$/; + report("no SPC after '*/'") if $tail =~ m/^[^\s,;)}\]]/; # no space or ,;)}] after '*/' + if (!($head =~ m|/\*|)) { # not begin of comment '/*', which is is handled below + if ($in_comment == 0) { + report("unexpected '*/' outside comment"); + $_ = "$head@@".$tail; # blind the "*/" + } else { + report("text before '*/' in multi-line comment") if ($head =~ m/\S/); # non-SPC before '*/' + $in_comment = -1; # indicate that multi-line comment ends on current line + if ($count > 0) { + # make indentation of end of multi-line comment appear like of leading intra-line comment + $head =~ s/^(\s*)\s/$1@/; # replace the last leading space by '@' + $count--; + $in_comment = -2; # indicate that multi-line comment ends on current line, with tweak + } + my $cmt_text = $head; + $_ = blind_nonspace($cmt_text)."@@".$tail; + } + } + } + + # detect begin of comment, check if it is followed by non-space text + MATCH_COMMENT: + if (my ($head, $opt_minus, $tail) = m|^(.*?)/\*(-?)(.*)$|) { # begin of comment: '/*' + report("no SPC before '/*'") + if $head =~ m/[^\s\*]$/; # no space (nor '*', needed to allow '*/' here) before comment delimiter + report("no SPC nor '*' after '/*' or '/*-'") if $tail =~ m/^[^\s*$self_test_exception]/; + my $cmt_text = $opt_minus.$tail; # preliminary + if ($in_comment > 0) { + report("unexpected '/*' inside multi-line comment"); + } elsif ($tail =~ m|^(.*?)\*/(.*)$|) { # comment end: */ on same line + report("unexpected '/*' inside intra-line comment") if $1 =~ /\/\*/; + # blind comment text, preserving length and spaces + ($cmt_text, my $rest) = ($opt_minus.$1, $2); + $_ = "$head@@".blind_nonspace($cmt_text)."@@".$rest; + goto MATCH_COMMENT; + } else { # begin of multi-line comment + my $self_test_exception = $self_test ? "(@\d?)?" : ""; + report("text after '/*' in multi-line comment") + unless $tail =~ m/^$self_test_exception.?\s*$/; + # tail not essentially empty, first char already checked + # adapt to actual indentation of first line + $comment_indent = length($head) + 1; + $_ = "$head@@".blind_nonspace($cmt_text); + $in_comment = 1; + $leading_comment = $head =~ m/^\s*$/; # there is code before beginning delimiter + $formatted_comment = $opt_minus eq "-"; + } + } + + if ($in_comment > 1) { # still inside multi-line comment (not at its begin or end) + m/^(\s*)\*?(\s*)(.*)$/; + $_ = $1."@".$2.blind_nonspace($3); + } + + # handle special case of line after '#ifdef __cplusplus' (which typically appears in header files) + if ($ifdef__cplusplus) { + $ifdef__cplusplus = 0; + $_ = "$1 $2" if $contents =~ m/^(\s*extern\s*"C"\s*)\{(\s*)$/; # ignore opening brace in 'extern "C" {' + goto LINE_FINISHED if m/^\s*\}\s*$/; # ignore closing brace '}' + } + + # check for over-long lines, + # while allowing trailing (also multi-line) string literals to go past $max_length + my $len = length; # total line length (without trailing '\n') + if ($len > $max_length && + !(m/^(.*)"[^"]*"\s*[\)\}\]]*[,;]?\s*$/ # string literal terminated by '"' (or '\'), then maybe )}],; + && length($1) < $max_length) + # this allows over-long trailing string literals with beginning col before $max_length + ) { + report("line length = $len > ".MAX_LINE_LENGTH); + } + + # handle C++ / C99 - style end-of-line comments + if (my ($head, $cmt_text) = m|^(.*?)//(.*$)|) { + report("'//' end-of-line comment"); # the '//' comment style is not allowed for C90 + # blind comment text, preserving length and spaces + $_ = "$head@@".blind_nonspace($cmt_text); + } + + # at this point all non-space portions of any types of comments have been blinded as @ + + goto LINE_FINISHED if m/^\s*$/; # essentially empty line: just whitespace (and maybe a trailing '\') + + # intra-line whitespace nits @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + + my $in_multiline_comment = ($in_comment > 1 || $in_comment < 0); # $in_multiline_comment refers to line before + if (!$sloppy_SPC && !($in_multiline_comment && $formatted_comment)) { + sub dbl_SPC { + my $intra_line = shift; + return "double SPC".($intra_line =~ m/@\s\s/ ? + $in_comment != 0 ? " in multi-line comment" + : " in intra-line comment" : ""); + } + sub split_line_head { + my $comment_symbol = + $in_comment != 0 ? "@" : ""; # '@' will match the blinded leading '*' in multi-line comment + # $in_comment may pertain to the following line due to delayed check + # do not check for double SPC in leading spaces including any '#' (or '*' within multi-line comment) + shift =~ m/^(\s*([#$comment_symbol]\s*)?)(.*?)\s*$/; + return ($1, $3); + } + my ($head , $intra_line ) = split_line_head($_); + my ($head1, $intra_line1) = split_line_head($contents_before_ ) if $line_before > 0; + my ($head2, $intra_line2) = split_line_head($contents_before_2) if $line_before2 > 0; + if ($line_before > 0) { # check with one line delay, such that at least $contents_before is available + sub column_alignments_only { + my $head = shift; + my $intra = shift; + my $contents = shift; + # check if all double SPC in $intra is used only for multi-line column alignment with $contents + my $offset = length($head); + for (my $col = 0; $col < length($intra) - 2; $col++) { + return 0 if substr($intra , $col, 3) =~ m/\s\s\S/ # double space (after leading space) + && !(substr($contents, $col + $offset + 1, 2) =~ m/\s\S/) + } + return 1; + } + report_flexibly($line_before, dbl_SPC($intra_line1), $contents_before) if $intra_line1 =~ m/\s\s\S/ && + !( column_alignments_only($head1, $intra_line1, $_ ) # compare with $line + || ($line_before2 > 0 && + column_alignments_only($head1, $intra_line1, $contents_before_2))); # compare w/ $line_before2 + report(dbl_SPC($intra_line)) if $intra_line =~ m/\s\s\S/ && eof + && ! column_alignments_only($head , $intra_line , $contents_before_ ) ; # compare w/ $line_before + } elsif (eof) { # special case: just one line exists + report(dbl_SPC($intra_line)) if $intra_line =~ m/\s\s\S/; + } + # ignore paths in #include + $intra_line =~ s/^(include\s*)(".*?"|<.*?>)/$1/e if $head =~ m/#/; + # treat op= and comparison operators as simple '=', simplifying matching below + $intra_line =~ s/([\+\-\*\/\/%\&\|\^\!<>=]|<<|>>)=/=/g; + # treat (type) variables within macro, indicated by trailing '\', as 'int' simplifying matching below + $intra_line =~ s/[A-Z_]+/int/g if $contents =~ m/^(.*?)\s*\\\s*$/; + # treat double &&, ||, <<, and >> as single ones, simplifying matching below + $intra_line =~ s/(&&|\|\||<<|>>)/substr($1, 0, 1)/eg; + # remove blinded comments etc. directly before ,;)} + while ($intra_line =~ s/\s*@+([,;)}\]])/$1/e) {} # /g does not work here + # treat remaining blinded comments and string literal contents as (single) space during matching below + $intra_line =~ s/@+/ /g; # note that double SPC has already been handled above + $intra_line =~ s/\s+$//; # strip any (resulting) space at EOL + $intra_line =~ s/(for\s*\();;(\))/"$1$2"/eg; # strip ';;' in for (;;) + $intra_line =~ s/(=\s*)\{ /"$1@ "/eg; # do not report {SPC in initializers such as ' = { 0, };' + $intra_line =~ s/, \};/, @;/g; # do not report SPC} in initializers such as ' = { 0, };' + report("SPC before '$1'") if $intra_line =~ m/[\w)\]]\s+(\+\+|--)/; # postfix ++/-- with preceding space + report("SPC after '$1'") if $intra_line =~ m/(\+\+|--)\s+[a-zA-Z_(]/; # prefix ++/-- with following space + $intra_line =~ s/\.\.\./@/g; # blind '...' + report("SPC before '$1'") if $intra_line =~ m/\s(\.|->)/; # '.' or '->' with preceding space + report("SPC after '$1'") if $intra_line =~ m/(\.|->)\s/; # '.' or '->' with following space + $intra_line =~ s/\-\>|\+\+|\-\-/@/g; # blind '->,', '++', and '--' + report("SPC before '$2'") if $intra_line =~ m/[^:]\s+(;)/; # space before ';' but not after ':' + report("SPC before '$1'") if $intra_line =~ m/\s([,)\]])/; # space before ,)] + report("SPC after '$1'") if $intra_line =~ m/([(\[~!])\s/; # space after ([~! + report("SPC after '$1'") if $intra_line =~ m/(defined)\s/; # space after 'defined' + report("no SPC before '=' or '='") if $intra_line =~ m/\S(=)/; # '=' etc. without preceding space + report("no SPC before '$1'") if $intra_line =~ m/\S([|\/%<>^\?])/; # |/%<>^? without preceding space + # TODO ternary ':' without preceding SPC, while allowing no SPC before ':' after 'case' + report("no SPC before '$1'") if $intra_line =~ m/[^\s{()\[]([+\-])/;# +/- without preceding space or {()[ + # or ')' (which is used f type casts) + report("no SPC before '$1'") if $intra_line =~ m/[^\s{()\[*]([*])/; # '*' without preceding space or {()[* + report("no SPC before '$1'") if $intra_line =~ m/[^\s{()\[]([&])/; # '&' without preceding space or {()[ + report("no SPC after ternary '$1'") if $intra_line =~ m/(:)[^\s\d]/; # ':' without following space or digit + report("no SPC after '$1'") if $intra_line =~ m/([,;=|\/%<>^\?])\S/; # ,;=|/%<>^? without following space + report("no SPC after binary '$1'") if $intra_line=~m/([*])[^\sa-zA-Z_(),*]/;# '*' w/o space or \w(),* after + # TODO unary '*' must not be followed by SPC + report("no SPC after binary '$1'") if $intra_line=~m/([&])[^\sa-zA-Z_(]/; # '&' w/o following space or \w( + # TODO unary '&' must not be followed by SPC + report("no SPC after binary '$1'") if $intra_line=~m/([+\-])[^\s\d(]/; # +/- w/o following space or \d( + # TODO unary '+' and '-' must not be followed by SPC + report("no SPC after '$2'") if $intra_line =~ m/(^|\W)(if|while|for|switch|case)[^\w\s]/; # kw w/o SPC + report("no SPC after '$2'") if $intra_line =~ m/(^|\W)(return)[^\w\s;]/; # return w/o SPC or ';' + report("SPC after function/macro name") + if $intra_line =~ m/(\w+)\s+\(/ # fn/macro name with space before '(' + && !($1 =~ m/^(if|while|for|switch|return|typedef|void|char|unsigned|int|long|float|double)$/) # not keyword + && !(m/^\s*#\s*define\s/); # we skip macro definitions here because macros + # without parameters but with body beginning with '(', e.g., '#define X (1)', + # would lead to false positives - TODO also check for macros with parameters + report("no SPC before '{'") if $intra_line =~ m/[^\s{(\[]\{/; # '{' without preceding space or {([ + report("no SPC after '}'") if $intra_line =~ m/\}[^\s,;\])}]/; # '}' without following space or ,;])} + } + + # preprocessor directives @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + + # handle preprocessor directives + if (m/^\s*#(\s*)(\w+)/) { # line beginning with '#' + my $space_count = length($1); # maybe could also use indentation before '#' + my $directive = $2; + report("indent = $count != 0 for '#'") if $count != 0; + $directive_nesting-- if $directive =~ m/^(else|elif|endif)$/; + if ($directive_nesting < 0) { + $directive_nesting = 0; + report("unexpected '#$directive'"); + } + report("'#' directive nesting = $space_count != $directive_nesting") if $space_count != $directive_nesting; + $directive_nesting++ if $directive =~ m/^if|ifdef|ifndef|else|elif$/; + $ifdef__cplusplus = m/^\s*#\s*ifdef\s+__cplusplus\s*$/; + goto POSTPROCESS_DIRECTIVE unless $directive =~ m/^define$/; # skip normal code handling except for #define + # TODO improve handling of indents of preprocessor directives ('\', $in_directive != 0) vs. normal C code + $count = -1; # do not check indentation of #define + } + + # adapt required indentation @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + + s/(\w*ASN1_[A-Z_]+END\w*([^(]|\(.*?\)|$))/$1;/g; # treat *ASN1_*END*(..) macro calls as if followed by ';' + + my $nested_indents_position = 0; + + # update indents according to leading closing brace(s) '}' or label or switch case + my $in_stmt = $in_expr || @nested_symbols != 0 || $in_typedecl != 0; + if ($in_stmt) { # expr/stmt/type decl/var def/fn hdr, i.e., not at block level + if (m/^([\s@]*\})/) { # leading '}', any preceding blinded comment must not be matched + my $head = $1; + update_nested_indents($head); + $nested_indents_position = length($head); + if (@nested_symbols >= 1) { + $hanging_symbol = @nested_symbols[-1]; + $expr_indent = @nested_indents[-1]; + } else { # typically end of initialiizer expr or enum + $expr_indent = 0; + } + } elsif (m/^([\s@]*)(static_)?ASN1_ITEM_TEMPLATE_END(\W|$)/) { # workaround for ASN1 macro indented as '}' + $local_offset = -INDENT_LEVEL; + $expr_indent = 0; + } elsif (m/;.*?\}/) { # expr ends with ';' before '}' + report("code before '}'"); + } + } + if (@in_do_hanging_offsets != 0 && # note there is nothing like "unexpected 'while'" + m/^[\s@]*while(\W|$)/) { # leading 'while' + $hanging_offset = pop @in_do_hanging_offsets; + } + if ($if_maybe_terminated) { + if (m/(^|\W)else(\W|$)/) { # (not necessarily leading) 'else' + if (@in_if_hanging_offsets == 0) { + report("unexpected 'else'"); + } else { + $hanging_offset = pop @in_if_hanging_offsets; + } + } else { + @in_if_hanging_offsets = (); # note there is nothing like "unclosed 'if'" + $hanging_offset = 0; + } + } + if (!$in_stmt) { # at block level, i.e., outside expr/stmt/type decl/var def/fn hdr + $if_maybe_terminated = 0; + if (my ($head, $before, $tail) = m/^([\s@]*([^{}]*)\})[\s@]*(.*)$/) { # leading closing '}', but possibly + # with non-whitespace non-'{' before + report("code after '}'") unless $tail eq "" || $tail =~ m/(else|while|OSSL_TRACE_END)(\W|$)/; + my $outermost_level = @nested_block_indents == 1 && @nested_block_indents[0] == 0; + if (!$sloppy_bodylen && $outermost_level && $line_body_start != 0) { + my $body_len = $line - $line_body_start - 1; + report_flexibly($line_function_start, "function body length = $body_len > ".MAX_BODY_LENGTH." lines", + $last_function_header) if $body_len > MAX_BODY_LENGTH; + $line_body_start = 0; + } + if ($before ne "") { # non-whitespace non-'{' before '}' + report("code before '}'"); + } else { # leading '}', any preceding blinded comment must not be matched + $local_offset = $block_indent + $hanging_offset - INDENT_LEVEL; + update_nested_indents($head); + $nested_indents_position = length($head); + $local_offset -= ($block_indent + $hanging_offset); + # in effect $local_offset = -INDENT_LEVEL relative to $block_indent + $hanging_offset values before + } + } + + # handle opening brace '{' after if/else/while/for/switch/do on line before + if ($hanging_offset > 0 && m/^[\s@]*{/ && # leading opening '{' + $line_before > 0 && + $contents_before_ =~ m/(^|^.*\W)(if|else|while|for|switch|do)(\W.*$|$)/) { + $keyword_opening_brace = $1; + $hanging_offset -= INDENT_LEVEL; # cancel newly hanging_offset + } + + if (m/^[\s@]*(case|default)(\W.*$|$)/) { # leading 'case' or 'default' + my $keyword = $1; + report("code after $keyword: ") if $2 =~ /:.*[^\s@].*$/; + $local_offset = -INDENT_LEVEL; + } else { + if (m/^([\s@]*)(\w+):/) { # (leading) label, cannot be "default" + $local_offset = -INDENT_LEVEL + 1 ; + $has_label = 1; + } + } + } + + # potential adaptations of indent in first line of macro body in multi-line macro definition + if ($in_directive > 0 && $in_macro_header > 0) { + if ($in_macro_header > 1) { # still in macro definition header + $in_macro_header += parens_balance($_); + } else { # begin of macro body + $in_macro_header = 0; + if ($count == $block_indent - $directive_offset # body began with same indentation as preceding code + && $sloppy_macro) { # workaround for this situation is enabled + $block_indent -= $directive_offset; + $directive_offset = 0; + } + } + } + + # check required indentation @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + + check_indent() if $count >= 0; # not for #define and not if multi-line string literal is continued + + $in_comment = 0 if $in_comment < 0; # multi-line comment has ended + + # do some further checks @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + + my $outermost_level = $block_indent == 0 + ($in_directive > 0 ? $directive_offset : 0); + + report("more than one stmt") if !m/(^|\W)for(\W.*|$)/ && # no 'for' - TODO improve matching + m/;.*;/; # two or more terminators ';', so more than one statement + + # check for code block containing a single line/statement + if ($line_before2 > 0 && !$outermost_level && # within function body + $in_typedecl == 0 && @nested_indents == 0 && # not within type declaration nor inside stmt/expr + m/^[\s@]*\}/) { # leading closing brace '}', any preceding blinded comment must not be matched + # TODO extend detection from single-line to potentially multi-line statement + if ($line_opening_brace > 0 && + ($line_opening_brace == $line_before2 || + $line_opening_brace == $line_before) + && $contents_before =~ m/;/) { # there is at least one terminator ';', so there is some stmt + # TODO do not report cases where a further else branch + # follows with a block containg more than one line/statement + report_flexibly($line_before, "'$keyword_opening_brace' { 1 stmt }", $contents_before); + } + } + + report("one-letter name '$2'") if (m/(^|.*\W)([lIO])(\W.*|$)/); # single-letter name 'l', 'I', or 'O' + + # TODO report empty line within local variable definitions + + # TODO report missing empty line after local variable definitions + + # TODO report needless use of parentheses, while + # macro parameters should always be in parens (except when passed on), e.g., '#define ID(x) (x)' + + # adapt required indentation for following lines @@@@@@@@@@@@@@@@@@@@@@@@@@@ + + # set $in_expr, $in_paren_expr, and $hanging_offset for if/while/for/switch, return/enum, and assignment RHS + my $paren_expr_start = 0; + my $return_enum_start = 0; + my $assignment_start = 0; + my $tmp = $_; + $tmp =~ s/[\!<>=]=/@@/g; # blind (in-)equality symbols like '<=' as '@@' to prevent matching them as '=' below + if (m/^((^|.*\W)(if|while|for|switch))(\W.*|$)$/) { # (last) if/for/while/switch + $paren_expr_start = 1; + } elsif (m/^((^|.*\W)(return|enum))(\W.*|$)/ # (last) return/enum + && !$in_expr && @nested_indents == 0 && parens_balance($1) == 0) { # not nested enum + $return_enum_start = 1; + } elsif ($tmp =~ m/^(([^=]*)(=))(.*)$/ # (last) '=', i.e., assignment + && !$in_expr && @nested_indents == 0 && parens_balance($1) == 0) { # not nested assignment + $assignment_start = 1; + } + if ($paren_expr_start || $return_enum_start || $assignment_start) + { + my ($head, $mid, $tail) = ($1, $3, $4); + $keyword_opening_brace = $mid if $mid ne "=" && $tail =~ m/\{/; + push @in_if_hanging_offsets, $hanging_offset if $mid eq "if"; + + # already handle $head, i.e., anything before expression + update_nested_indents($head, $nested_indents_position); + $nested_indents_position = length($head); + # now can set $in_expr and $in_paren_expr + $in_expr = 1; + $in_paren_expr = 1 if $paren_expr_start; + if ($mid eq "while" && @in_do_hanging_offsets != 0) { + $hanging_offset = pop @in_do_hanging_offsets; + } else { + $hanging_offset += INDENT_LEVEL; # tentatively set hanging_offset, may be canceled by following '{' + } + } + + # set $hanging_offset and $keyword_opening_brace for do/else + if (my ($head, $mid, $tail) = m/(^|^.*\W)(else|do)(\W.*|$)$/) { # last else/do, where 'do' is preferred + my $code_before = $head =~ m/[^\s\@}]/; # leading non-whitespace non-comment non-'}' + report("code before '$mid'") if $code_before; + report("code after '$mid'" ) if $tail =~ m/[^\s\@{]/# trailing non-whitespace non-comment non-'{' (non-'\') + && !($mid eq "else" && $tail =~ m/[\s@]*if(\W|$)/); + if ($mid eq "do") { # workarounds for code before 'do' + if ($head =~ m/(^|^.*\W)(else)(\W.*$|$)/) { # 'else' ... 'do' + $hanging_offset += INDENT_LEVEL; # tentatively set hanging_offset, may be canceled by following '{' + } + if ($head =~ m/;/) { # terminator ';' ... 'do' + @in_if_hanging_offsets = (); # note there is nothing like "unclosed 'if'" + $hanging_offset = 0; + } + } + push @in_do_hanging_offsets, $hanging_offset if $mid eq "do"; + if ($code_before && $mid eq "do") { + $hanging_offset = length($head) - $block_indent; + } + if (!$in_paren_expr) { + $keyword_opening_brace = $mid if $tail =~ m/\{/; + $hanging_offset += INDENT_LEVEL; + } + } + + # set $in_typedecl and potentially $hanging_offset for type declaration + if (!$in_expr && @nested_indents == 0 && # not in expression + m/(^|^.*\W)(typedef|struct|union|enum)(\W.*|$)$/ && + parens_balance($1) == 0) { # not in newly started expression + # not needed: $keyword_opening_brace = $2 if $3 =~ m/\{/; + $in_typedecl++; + $hanging_offset += INDENT_LEVEL if m/\*.*\(/; # '*' followed by '(' - seems consistent with Emacs C mode + } + + my $bak_in_expr = $in_expr; + my $terminator_position = update_nested_indents($_, $nested_indents_position); + + if ($bak_in_expr) { + # on end of non-if/while/for/switch (multi-line) expression (i.e., return/enum/assignment) and + # on end of statement/type declaration/variable definition/function header + if ($terminator_position >= 0 && ($in_typedecl == 0 || @nested_indents == 0)) { + check_nested_nonblock_indents("expr"); + $in_expr = 0; + } + } else { + check_nested_nonblock_indents($in_typedecl == 0 ? "stmt" : "decl") if $terminator_position >= 0; + } + + # on ';', which terminates the current statement/type declaration/variable definition/function declaration + if ($terminator_position >= 0) { + my $tail = substr($_, $terminator_position + 1); + if (@in_if_hanging_offsets != 0) { + if ($tail =~ m/\s*else(\W|$)/) { + pop @in_if_hanging_offsets; + $hanging_offset -= INDENT_LEVEL; + } elsif ($tail =~ m/[^\s@]/) { # code (not just comment) follows + @in_if_hanging_offsets = (); # note there is nothing like "unclosed 'if'" + $hanging_offset = 0; + } else { + $if_maybe_terminated = 1; + } + } elsif ($tail =~ m/^[\s@]*$/) { # ';' has been trailing, i.e. there is nothing but whitespace and comments + $hanging_offset = 0; # reset in case of terminated assignment ('=') etc. + } + $in_typedecl-- if $in_typedecl != 0 && @nested_in_typedecl == 0; # TODO handle multiple type decls per line + m/(;[^;]*)$/; # match last ';' + $terminator_position = length($_) - length($1) if $1; + # new $terminator_position value may be after the earlier one in case multiple terminators on current line + # TODO check treatment in case of multiple terminators on current line + update_nested_indents($_, $terminator_position + 1); + } + + # set hanging expression indent according to nested indents - TODO maybe do better in update_nested_indents() + # also if $in_expr is 0: in statement/type declaration/variable definition/function header + $expr_indent = 0; + for (my $i = -1; $i >= - at nested_symbols; $i--) { + if (@nested_symbols[$i] ne "?") { # conditionals '?' ... ':' are treated specially in check_indent() + $hanging_symbol = @nested_symbols[$i]; + $expr_indent = $nested_indents[$i]; + # $expr_indent is guaranteed to be != 0 unless @nested_indents contains just outer conditionals + last; + } + } + + # remember line number and header containing name of last function defined for reports w.r.t. MAX_BODY_LENGTH + if ($outermost_level && m/(\w+)\s*\(/ && $1 ne "STACK_OF") { + $line_function_start = $line; + $last_function_header = $contents; + } + + # special checks for last, typically trailing opening brace '{' in line + if (my ($head, $tail) = m/^(.*)\{(.*)$/) { # match last ... '{' + if ($in_directive == 0 && !$in_expr && $in_typedecl == 0) { + if ($outermost_level) { + if (!$assignment_start && !$bak_in_expr) { + # at end of function definition header (or stmt or var definition) + report("'{' not at beginning") if $head ne ""; + $line_body_start = $contents =~ m/LONG BODY/ ? 0 : $line; + } + } else { + $line_opening_brace = $line if $keyword_opening_brace =~ m/do|while|for/; + # using, not assigning, $keyword_opening_brace here because it could be on an earlier line + $line_opening_brace = $line if $keyword_opening_brace =~ m/if|else/ && $extended_1_stmt && + # TODO prevent false positives for if/else where braces around single-statement branches + # should be avoided but only if all branches have just single statements + # The following helps detecting the exception when handling multiple 'if ... else' branches: + !($keyword_opening_brace eq "else" && $line_opening_brace < $line_before2); + } + report("code after '{'") if $tail=~ m/[^\s\@]/ && # trailing non-whitespace non-comment (non-'\') + !($tail=~ m/\}/); # no '}' after last '{' + } + } + + # check for opening brace after if/while/for/switch/do not on same line + # note that "no '{' on same line after '} else'" is handled further below + if (/^[\s@]*{/ && # leading '{' + $line_before > 0 && + (my ($head, $mid, $tail) = ($contents_before_ =~ m/(^|^.*\W)(if|while|for|switch|do)(\W.*$|$)/))) { + my $brace_after = $tail =~ /^[\s@]*{/; # any whitespace or comments then '{' + report("'{' not on same line as preceding '$mid'") if !$brace_after; + } + # check for closing brace on line before 'else' not followed by leading '{' + elsif (my ($head, $tail) = m/(^|^.*\W)else(\W.*$|$)/) { + if (parens_balance($tail) == 0 && # avoid false positive due to unfinished expr on current line + !($tail =~ m/{/) && # after 'else' no '{' on same line + !($head =~ m/}[\s@]*$/) && # not: '}' then any whitespace or comments before 'else' + $line_before > 0 && $contents_before_ =~ /}[\s@]*$/) { # trailing '}' on line before + report("no '{' after '} else'"); + } + } + + # check for closing brace before 'while' not on same line + if (my ($head, $tail) = m/(^|^.*\W)while(\W.*$|$)/) { + my $brace_before = $head =~ m/}[\s@]*$/; # '}' then any whitespace or comments + # possibly 'if (...)' (with potentially inner '(' and ')') then any whitespace or comments then '{' + if (!$brace_before && + # does not work here: @in_do_hanging_offsets != 0 && #'while' terminates loop + parens_balance($tail) == 0 && # avoid false positive due to unfinished expr on current line + $tail =~ /;/ && # 'while' terminates loop (by ';') + $line_before > 0 && + $contents_before_ =~ /}[\s@]*$/) { # on line before: '}' then any whitespace or comments + report("'while' not on same line as preceding '}'"); + } + } + + # check for missing brace on same line before or after 'else' + if (my ($head, $tail) = m/(^|^.*\W)else(\W.*$|$)/) { + my $brace_before = $head =~ /}[\s@]*$/; # '}' then any whitespace or comments + my $brace_after = $tail =~ /^[\s@]*if[\s@]*\(.*\)[\s@]*{|[\s@]*{/; + # possibly 'if (...)' (with potentially inner '(' and ')') then any whitespace or comments then '{' + if (!$brace_before) { + if ($line_before > 0 && $contents_before_ =~ /}[\s@]*$/) { + report("'else' not on same line as preceding '}'"); + } elsif (parens_balance($tail) == 0) { # avoid false positive due to unfinished expr on current line + report("no '}' on same line before 'else ... {'") if $brace_after; + } + } elsif (parens_balance($tail) == 0) { # avoid false positive due to unfinished expr on current line + report("no '{' on same line after '} else'") if $brace_before && !$brace_after; + } + } + + POSTPROCESS_DIRECTIVE: + # on begin of multi-line preprocessor directive, adapt indent + # need to use original line contents because trailing '\' may have been stripped above + if ($contents =~ m/^(.*?)[\s@]*\\[\s@]*$/) { # trailing '\' (which is not stripped from $contents), + # typically used in macro definitions (or other preprocessor directives) + if ($in_directive == 0) { + $in_macro_header = m/^\s*#\s*define(\W|$)?(.*)/ ? 1 + parens_balance($2) : 0; # '#define' is beginning + $directive_offset = INDENT_LEVEL; + $block_indent += $directive_offset; + } + $in_directive += 1; + } + + # post-processing at end of line @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + + LINE_FINISHED: + # on end of multi-line preprocessor directive, adapt indent + if ($in_directive > 0 && + # need to use original line contents because trailing \ may have been stripped + !($contents =~ m/^(.*?)[\s@]*\\[\s@]*$/)) { # no trailing '\' + $block_indent -= $directive_offset; + $in_directive = 0; + # macro body typically does not include terminating ';' + $hanging_offset = 0; # compensate for this in case macro ends, e.g., as 'while (0)' + } + + unless (m/^\s*$/) { # essentially empty line: just whitespace (and maybe a '\') + $line_before2 = $line_before; + $contents_before2 = $contents_before; + $contents_before_2 = $contents_before_; + $line_before = $line; + $contents_before = $contents; + $contents_before_ = $_; + $count_before = $count; + } + + if ($self_test) { # debugging + my $should_report = $contents =~ m/\*@(\d)?/ ? 1 : 0; + $should_report = +$1 if $should_report != 0 && defined $1; + print("$ARGV:$line:$num_reports_line reports on:$contents") + if $num_reports_line != $should_report; + } + $num_reports_line = 0; + + # post-processing at end of file @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + + if (eof) { + # check for essentially empty line (which may include a '\') just before EOF + report(($1 eq "\n" ? "empty line" : $2 ne "" ? "'\\'" : "whitespace")." at EOF") + if $contents =~ m/^(\s*(\\?)\s*)$/; + + # report unclosed expression-level nesting + check_nested_nonblock_indents("expr at EOF"); # also adapts @nested_block_indents + + # sanity-check balance of block-level { ... } via final $block_indent at end of file + report_flexibly($line, + at nested_block_indents." unclosed '{'", "(EOF)\n") if @nested_block_indents != 0; + + # sanity-check balance of #if ... #endif via final preprocessor directive indent at end of file + report_flexibly($line, "$directive_nesting unclosed '#if'", "(EOF)\n") if $directive_nesting != 0; + + reset_file_state(); + } +} + +# final summary report @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + +my $num_other_reports = $num_reports - $num_indent_reports - $num_nesting_issues + - $num_syntax_issues - $num_SPC_reports - $num_length_reports; +print "$num_reports ($num_indent_reports indentation, $num_nesting_issues directive nesting, ". + "$num_syntax_issues syntax, $num_SPC_reports whitespace, $num_length_reports length, $num_other_reports other)". + " issues have been found by $0\n" if $num_reports != 0 && !$self_test; diff --git a/util/openssl-format-source b/util/openssl-format-source deleted file mode 100755 index dc6a65d30e..0000000000 --- a/util/openssl-format-source +++ /dev/null @@ -1,175 +0,0 @@ -#!/bin/sh -# -# Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. -# -# Licensed under the Apache License 2.0 (the "License"). You may not use -# this file except in compliance with the License. You can obtain a copy -# in the file LICENSE in the source distribution or at -# https://www.openssl.org/source/license.html - -# -# openssl-format-source -# - format source tree according to OpenSSL coding style using indent -# -# usage: -# openssl-format-source [-v] [-n] [file|directory] ... -# -# note: the indent options assume GNU indent v2.2.10 which was released -# Feb-2009 so if you have an older indent the options may not -# match what is expected -# -# any marked block comment blocks have to be moved to align manually after -# the reformatting has been completed as marking a block causes indent to -# not move it at all ... -# - -PATH=/usr/local/bin:/bin:/usr/bin:$PATH -export PATH -HERE="`dirname $0`" - -set -e - -INDENT=indent -uname -s | grep BSD > /dev/null && type gindent > /dev/null 2>&1 && INDENT=gindent - -if [ $# -eq 0 ]; then - echo "usage: $0 [-v] [-n] [-c] [sourcefile|sourcedir] ..." >&2 - exit 1 -fi - -VERBOSE=false -DONT=false -STOPARGS=false -COMMENTS=false -CHANGED=false -DEBUG="" - -# for this exercise, we want to force the openssl style, so we roll -# our own indent profile, which is at a well known location -INDENT_PROFILE="$HERE/indent.pro" -export INDENT_PROFILE -if [ ! -f "$INDENT_PROFILE" ]; then - echo "$0: unable to locate the openssl indent.pro file" >&2 - exit 1 -fi - -# Extra arguments; for adding the comment-formatting -INDENT_ARGS="" -for i -do - if [ "$STOPARGS" != "true" ]; then - case $i in - --) STOPARGS="true"; continue;; - -n) DONT="true"; continue;; - -v) VERBOSE="true"; - echo "INDENT_PROFILE=$INDENT_PROFILE"; - continue;; - -c) COMMENTS="true"; - INDENT_ARGS="-fc1 -fca -cdb -sc"; - continue;; - -nc) COMMENTS="true"; - continue;; - -d) DEBUG='eval tee "$j.pre" |' - continue;; - esac - fi - - if [ -d "$i" ]; then - LIST=`find "$i" -name '*.[ch]' -print` - else - if [ ! -f "$i" ]; then - echo "$0: source file not found: $i" >&2 - exit 1 - fi - LIST="$i" - fi - - for j in $LIST - do - # ignore symlinks - we only ever process the base file - so if we - # expand a directory tree we need to ignore any located symlinks - if [ -d "$i" ]; then - if [ -h "$j" ]; then - continue; - fi - fi - - if [ "$DONT" = "false" ]; then - tmp=$(mktemp /tmp/indent.XXXXXX) - trap 'rm -f "$tmp"' HUP INT TERM EXIT - - case `basename $j` in - # the list of files that indent is unable to handle correctly - # that we simply leave alone for manual formatting now - obj_dat.h|aes_core.c|aes_x86core.c|ecp_nistz256.c) - echo "skipping $j" - ;; - *) - if [ "$COMMENTS" = "true" ]; then - # we have to mark single line comments as /*- ...*/ to stop indent - # messing with them, run expand then indent as usual but with the - # the process-comments options and then undo that marking, and then - # finally re-run indent without process-comments so the marked-to- - # be-ignored comments we did automatically end up getting moved - # into the right position within the code as indent leaves marked - # comments entirely untouched - we appear to have no way to avoid - # the double processing and get the desired output - cat "$j" | \ - expand | \ - perl -0 -np \ - -e 's/(\n#[ \t]*ifdef[ \t]+__cplusplus\n[^\n]*\n#[ \t]*endif\n)/\n\/**INDENT-OFF**\/$1\/**INDENT-ON**\/\n/g;' \ - -e 's/(\n\/\*\!)/\n\/**/g;' \ - -e 's/(STACK_OF|LHASH_OF)\(([^ \t,\)]+)\)( |\n)/$1_$2_$3/g;' \ - | \ - perl -np \ - -e 's/^([ \t]*)\/\*([ \t]+.*)\*\/[ \t]*$/my ($x1,$x2) = ($1, $2); if (length("$x1$x2")<75 && $x2 !~ m#^\s*\*INDENT-(ON|OFF)\*\s*$#) {$c="-"}else{$c=""}; "$x1\/*$c$x2*\/"/e;' \ - -e 's/^\/\* ((Copyright|=|----).*)$/\/*-$1/;' \ - -e 's/^((DECLARE|IMPLEMENT)_.*)$/\/**INDENT-OFF**\/\n$1\n\/**INDENT-ON**\//;' \ - -e 's/^([ \t]*(make_dh|make_dh_bn|make_rfc5114_td)\(.*\)[ \t,]*)$/\/**INDENT-OFF**\/\n$1\n\/**INDENT-ON**\//;' \ - -e 's/^(ASN1_ADB_TEMPLATE\(.*)$/\/**INDENT-OFF**\/\n$1\n\/**INDENT-ON**\//;' \ - -e 's/^((ASN1|ADB)_.*_(end|END)\(.*[\){=,;]+[ \t]*)$/$1\n\/**INDENT-ON**\//;' \ - -e '/ASN1_(ITEM_ref|ITEM_ptr|ITEM_rptr|PCTX)/ || s/^((ASN1|ADB)_[^\*]*[){=,]+[ \t]*)$/\/**INDENT-OFF**\/\n$1/;' \ - -e 's/^(} (ASN1|ADB)_[^\*]*[\){=,;]+)$/$1\n\/**INDENT-ON**\//;' \ - | \ - $DEBUG $INDENT $INDENT_ARGS | \ - perl -np \ - -e 's/^([ \t]*)\/\*-(.*)\*\/[ \t]*$/$1\/*$2*\//;' \ - -e 's/^\/\*-((Copyright|=|----).*)$/\/* $1/;' \ - | $INDENT | \ - perl -0 -np \ - -e 's/\/\*\*INDENT-(ON|OFF)\*\*\/\n//g;' \ - | perl -np \ - -e 's/(STACK_OF|LHASH_OF)_([^ \t,]+)_( |\/)/$1($2)$3/g;' \ - -e 's/(STACK_OF|LHASH_OF)_([^ \t,]+)_$/$1($2)/g;' \ - | perl "$HERE"/su-filter.pl \ - > "$tmp" - else - expand "$j" | $INDENT $INDENT_ARGS > "$tmp" - fi; - if cmp -s "$tmp" "$j"; then - if [ "$VERBOSE" = "true" ]; then - echo "$j unchanged" - fi - rm "$tmp" - else - if [ "$VERBOSE" = "true" ]; then - echo "$j changed" - fi - CHANGED=true - mv "$tmp" "$j" - fi - ;; - esac - fi - done -done - - -if [ "$VERBOSE" = "true" ]; then - echo - if [ "$CHANGED" = "true" ]; then - echo "SOURCE WAS MODIFIED" - else - echo "SOURCE WAS NOT MODIFIED" - fi -fi From builds at travis-ci.org Mon Mar 9 10:36:40 2020 From: builds at travis-ci.org (Travis CI) Date: Mon, 09 Mar 2020 10:36:40 +0000 Subject: Failed: openssl/openssl#32960 (master - 86cd42f) In-Reply-To: Message-ID: <5e661c381bfd6_43fa83ee8904c1394a1@722a7870-35af-4783-8211-8b4772b65e12.mail> Build Update for openssl/openssl ------------------------------------- Build: #32960 Status: Failed Duration: 49 mins and 29 secs Commit: 86cd42f (master) Author: Davide Galassi Message: Remove double fetch of "OSSL_EX_DATA_GLOBAL" for global lock Fetch once and just pass the global ex_data to the "get_and_lock" static function. Removed a redundant null pointer check within the "get_and_lock" static function (control already performed by the caller). Reviewed-by: Matt Caswell Reviewed-by: Shane Lontis Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/11152) View the changeset: https://github.com/openssl/openssl/compare/8293fb684084...86cd42fbd375 View the full build log and details: https://travis-ci.org/openssl/openssl/builds/660067291?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the openssl/openssl repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=5849220&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From builds at travis-ci.org Mon Mar 9 10:55:41 2020 From: builds at travis-ci.org (Travis CI) Date: Mon, 09 Mar 2020 10:55:41 +0000 Subject: Still Failing: openssl/openssl#32962 (master - 5c33a6b) In-Reply-To: Message-ID: <5e6620ad461d2_43fc93a8f50501109d1@99803ea1-9667-48b3-bec0-580240b2926a.mail> Build Update for openssl/openssl ------------------------------------- Build: #32962 Status: Still Failing Duration: 45 mins and 29 secs Commit: 5c33a6b (master) Author: Richard Levitte Message: util/wrap.pl: do not look at EXE_SHELL Acting on EXE_SHELL was a bit over the top, especially in light of instructions like this (from NOTES.VALGRIND): EXE_SHELL="`/bin/pwd`/util/wrap.pl valgrind --error-exitcode=1 --leak-check=full -q" Fixes #11255 Reviewed-by: Nicola Tuveri Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/11258) View the changeset: https://github.com/openssl/openssl/compare/86cd42fbd375...5c33a6ba65e4 View the full build log and details: https://travis-ci.org/openssl/openssl/builds/660068012?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the openssl/openssl repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=5849220&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From builds at travis-ci.org Mon Mar 9 11:14:37 2020 From: builds at travis-ci.org (Travis CI) Date: Mon, 09 Mar 2020 11:14:37 +0000 Subject: Errored: openssl/openssl#32963 (master - 9f44e96) In-Reply-To: Message-ID: <5e66251d6dbb6_43fd1b65133cc13254f@12ba2142-c361-44ef-9481-475fe8b27194.mail> Build Update for openssl/openssl ------------------------------------- Build: #32963 Status: Errored Duration: 54 mins and 33 secs Commit: 9f44e96 (master) Author: James Peach Message: docs: fix typo in SSL functions CLA: trivial Reviewed-by: Matthias St. Pierre Reviewed-by: Paul Yang Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/11253) View the changeset: https://github.com/openssl/openssl/compare/5c33a6ba65e4...9f44e96e2459 View the full build log and details: https://travis-ci.org/openssl/openssl/builds/660068401?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the openssl/openssl repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=5849220&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From builds at travis-ci.org Mon Mar 9 11:48:50 2020 From: builds at travis-ci.org (Travis CI) Date: Mon, 09 Mar 2020 11:48:50 +0000 Subject: Errored: openssl/openssl#32966 (master - b4dc705) In-Reply-To: Message-ID: <5e662d22454bf_43fa39b18cdb4101158@138e18a7-8bd7-48e5-a888-3549781439c4.mail> Build Update for openssl/openssl ------------------------------------- Build: #32966 Status: Errored Duration: 51 mins and 33 secs Commit: b4dc705 (master) Author: Richard Levitte Message: DOCS: Fix documentation on asymmetric keydata types Some type specs didn't correspond to actual use. Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/11275) View the changeset: https://github.com/openssl/openssl/compare/9f44e96e2459...b4dc705a73ba View the full build log and details: https://travis-ci.org/openssl/openssl/builds/660069234?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the openssl/openssl repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=5849220&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From builds at travis-ci.org Mon Mar 9 12:04:42 2020 From: builds at travis-ci.org (Travis CI) Date: Mon, 09 Mar 2020 12:04:42 +0000 Subject: Errored: openssl/openssl#32969 (master - c518117) In-Reply-To: Message-ID: <5e6630d94b40b_43fc93970d9781265cf@99803ea1-9667-48b3-bec0-580240b2926a.mail> Build Update for openssl/openssl ------------------------------------- Build: #32969 Status: Errored Duration: 51 mins and 53 secs Commit: c518117 (master) Author: Richard Levitte Message: DH: add internal dh_get_method() This should have been publically present a long time ago, to be consistent with the RSA, DSA and EC_KEY APIs. However, since we've now deprecated that kind of function for the other key types, there's no point in adding a public function, but we still need it internally. Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/11193) View the changeset: https://github.com/openssl/openssl/compare/b4dc705a73ba...c518117b99bc View the full build log and details: https://travis-ci.org/openssl/openssl/builds/660070954?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the openssl/openssl repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=5849220&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From builds at travis-ci.org Mon Mar 9 12:18:38 2020 From: builds at travis-ci.org (Travis CI) Date: Mon, 09 Mar 2020 12:18:38 +0000 Subject: Still Failing: openssl/openssl#32970 (master - 99a16e0) In-Reply-To: Message-ID: <5e66341e687e8_43fd1b65133cc1499fc@12ba2142-c361-44ef-9481-475fe8b27194.mail> Build Update for openssl/openssl ------------------------------------- Build: #32970 Status: Still Failing Duration: 50 mins and 15 secs Commit: 99a16e0 (master) Author: Dr. David von Oheimb Message: Renew and extend the tool for checking adherence to C coding style rules aims at checking most of https://www.openssl.org/policies/codingstyle.html and various requirements not yet explicitly stated there - see also #10725 add util/check-format.pl and its self-tests in util/check-format-test-{positives,negatives}.c remove util/openssl-format-source Reviewed-by: Richard Levitte Reviewed-by: David von Oheimb (Merged from https://github.com/openssl/openssl/pull/10363) View the changeset: https://github.com/openssl/openssl/compare/c518117b99bc...99a16e0459e5 View the full build log and details: https://travis-ci.org/openssl/openssl/builds/660073893?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the openssl/openssl repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=5849220&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From openssl at openssl.org Mon Mar 9 22:03:39 2020 From: openssl at openssl.org (OpenSSL run-checker) Date: Mon, 09 Mar 2020 22:03:39 +0000 Subject: FAILED build of OpenSSL branch master with options -d --strict-warnings Message-ID: <1583791419.189045.22552.nullmailer@run.openssl.org> Platform and configuration command: $ uname -a Linux run 4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux $ CC=clang ../openssl/config -d --strict-warnings Commit log since last time: 99a16e0459 Renew and extend the tool for checking adherence to C coding style rules c518117b99 DH: add internal dh_get_method() df13defd4f EVP: Check that key methods aren't foreign when exporting b4dc705a73 DOCS: Fix documentation on asymmetric keydata types 9f44e96e24 docs: fix typo in SSL functions 5c33a6ba65 util/wrap.pl: do not look at EXE_SHELL 86cd42fbd3 Remove double fetch of "OSSL_EX_DATA_GLOBAL" for global lock 8293fb6840 spkac: Check return values of NETSCAPE_SPKI functions d62be1580b Document the new DigestSign provider functions 3965480c82 Implement provider support for Ed25519 annd Ed448 eea1e780a1 Add provider awareness of EVP_DigestSign() and EVP_DigestVerify() af6d8dd30f Add Key Management support for EdDSA keys db4b3d8392 Refactor CRMF_poposigningkey_init() to work with provider keys a08e2bf548 doc: slightly reformulate 'openssl(1)/Random State Options' section c339c702f6 Improve small block cipher performance d462b5ff21 Add -section option to 'req' command 6bd4e3f231 cmdline app: add provider commandline options. 5e98904c23 man1: make all openssl command line tool documentation generated. 55f02cb684 Change DH_get_nid() to set the value of q if it is not already set f529fc7d53 Clarify the usage of EVP_PKEY_get_raw_[private|public]_key() 433deaffce Use .cnf for config files, not .conf 5e828e2a5f Remove unused files Build log ended with (last 100 lines): $ CC=clang ../openssl/config -d --strict-warnings Operating system: x86_64-whatever-linux2 Configuring OpenSSL version 3.0.0-dev for target linux-x86_64-clang Using os-specific seed configuration Creating configdata.pm Running configdata.pm Creating Makefile ********************************************************************** *** *** *** OpenSSL has been successfully configured *** *** *** *** If you encounter a problem while building, please open an *** *** issue on GitHub *** *** and include the output from the following command: *** *** *** *** perl configdata.pm --dump *** *** *** *** (If you are new to OpenSSL, you might want to consult the *** *** 'Troubleshooting' section in the INSTALL file first) *** *** *** ********************************************************************** $ make clean rm -f libcrypto.so.3 rm -f libcrypto.so rm -f libssl.so.3 rm -f libssl.so rm -f apps/libapps.a libcrypto.a libssl.a providers/libcommon.a providers/libfips.a providers/libimplementations.a providers/liblegacy.a providers/libnonfips.a test/libtestutil.a rm -f *.ld rm -f doc/html/man1/CA.pl.html doc/html/man1/openssl-asn1parse.html doc/html/man1/openssl-ca.html doc/html/man1/openssl-ciphers.html doc/html/man1/openssl-cmds.html doc/html/man1/openssl-cms.html doc/html/man1/openssl-crl.html doc/html/man1/openssl-crl2pkcs7.html doc/html/man1/openssl-dgst.html doc/html/man1/openssl-dhparam.html doc/html/man1/openssl-dsa.html doc/html/man1/openssl-dsaparam.html doc/html/man1/openssl-ec.html doc/html/man1/openssl-ecparam.html doc/html/man1/openssl-enc.html doc/html/man1/openssl-engine.html doc/html/man1/openssl-errstr.html doc/html/man1/openssl-fipsinstall.html doc/html/man1/openssl-gendsa.html doc/html/man1/openssl-genpkey.html doc/html/man1/openssl-genrsa.html doc/html/man1/openssl-info.html doc/html/man1/openssl-kdf.html doc/html/man1/openssl-list.html doc/html/man1/openssl-mac.html doc/html/man1/openssl-nseq.html doc/html/man1/openssl-ocsp.html doc/html/man1/openssl-passwd.html doc/html/man1/openssl-pkcs12.html doc/html/man1/openssl-pkcs7.html doc/html/man1/openssl-pkcs8.html doc/html/man1/openssl-pkey.html doc/html/man1/openssl-pkeyparam.html doc/html/man1/openssl-pkeyutl.html doc/html/man1/openssl-prime.html doc/html/man1/openssl-provider.html doc/html/man1/openssl-rand.html doc/html/man1/openssl-rehash.html doc/html/man1/openssl-req.html doc/html/man1/openssl-rsa.html doc/html/man1/openssl-rsautl.html doc/html/man1/openssl-s_client.html doc/html/man1/openssl-s_server.html doc/html/man1/openssl-s_time.html doc/html/man1/openssl-sess_id.html doc/html/man1/openssl-smime.html doc/html/man1/openssl-speed.html doc/html/man1/openssl-spkac.html doc/html/man1/openssl-srp.html doc/html/man1/openssl-storeutl.html doc/html/man1/openssl-ts.html doc/html/man1/openssl-verify.html doc/html/man1/openssl-version.html doc/html/man1/openssl-x509.html doc/html/man1/openssl.html doc/html/man1/tsget.html doc/html/man3/ADMISSIONS.html doc/html/man3/ASN1_INTEGER_get_int64.html doc/html/man3/ASN1_ITEM_lookup.html doc/html/man3/ASN1_OBJECT_new.html doc/html/man3/ASN1_STRING_TABLE_add.html doc/html/man3/ASN1_STRING_length.html doc/html/man3/ASN1_STRING_new.html doc/html/man3/ASN1_STRING_print_ex.html doc/html/man3/ASN1_TIME_set.html doc/html/man3/ASN1_TYPE_get.html doc/html/man3/ASN1_generate_nconf.html doc/html/man3/ASYNC_WAIT_CTX_new.html doc/html/man3/ASYNC_start_job.html doc/html/man3/BF_encrypt.html doc/html/man3/BIO_ADDR.html doc/html/man3/BIO_ADDRINFO.html doc/html/man3/BIO_connect.html doc/html/man3/BIO_ctrl.html doc/html/man3/BIO_f_base64.html doc/html/man3/BIO_f_buffer.html doc/html/man3/BIO_f_cipher.html doc/html/man3/BIO_f_md.html doc/html/man3/BIO_f_null.html doc/html/man3/BIO_f_prefix.html doc/html/man3/BIO_f_ssl.html doc/html/man3/BIO_find_type.html doc/html/man3/BIO_get_data.html doc/html/man3/BIO_get_ex_new_index.html doc/html/man3/BIO_meth_new.html doc/html/man3/BIO_new.html doc/html/man3/BIO_new_CMS.html doc/html/man3/BIO_parse_hostserv.html doc/html/man3/BIO_printf.html doc/html/man3/BIO_push.html doc/html/man3/BIO_read.html doc/html/man3/BIO_s_accept.html doc/html/man3/BIO_s_bio.html doc/html/man3/BIO_s_connect.html doc/html/man3/BIO_s_fd.html doc/html/man3/BIO_s_file.html doc/html/man3/BIO_s_mem.html doc/html/man3/BIO_s_null.html doc/html/man3/BIO_s_socket.html doc/html/man3/BIO_set_callback.html doc/html/man3/BIO_should_retry.html doc/html/man3/BIO_socket_wait.html doc/html/man3/BN_BLINDING_new.html doc/html/man3/BN_CTX_new.html doc/html/man3/BN_CTX_start.html doc/html/man3/BN_add.html doc/html/man3/BN_add_word.html doc/html/man3/BN_bn2bin.html doc/html/man3/BN_cmp.html doc/html/man3/BN_copy.html doc/html/man3/BN_generate_prime.html doc/html/man3/BN_mod_inverse.html doc/html/man3/BN_mod_mul_montgomery.html doc/html/man3/BN_mod_mul_reciprocal.html doc/html/man3/BN_new.html doc/html/man3/BN_num_bytes.html doc/html/man3/BN_rand.html doc/html/man3/BN_security_bits.html doc/html/man3/BN_set_bit.html doc/html/man3/BN_swap.html doc/html/man3/BN_zero.html doc/html/man3/BUF_MEM_new.html doc/html/man3/CMS_add0_cert.html doc/html/man3/CMS_add1_recipient_cert.html doc/html/man3/CMS_add1_signer.html doc/html/man3/CMS_compress.html doc/html/man3/CMS_decrypt.html doc/html/man3/CMS_encrypt.html doc/html/man3/CMS_final.html doc/html/man3/CMS_get0_RecipientInfos.html doc/html/man3/CMS_get0_SignerInfos.html doc/html/man3/CMS_get0_type.html doc/html/man3/CMS_get1_ReceiptRequest.html doc/html/man3/CMS_sign.html doc/html/man3/CMS_sign_receipt.html doc/html/man3/CMS_uncompress.html doc/html/man3/CMS_verify.html doc/html/man3/CMS_verify_receipt.html doc/html/man3/CONF_modules_free.html doc/html/man3/CONF_modules_load_file.html doc/html/man3/CRYPTO_THREAD_run_once.html doc/html/man3/CRYPTO_get_ex_new_index.html doc/html/man3/CRYPTO_memcmp.html doc/html/man3/CTLOG_STORE_get0_log_by_id.html doc/html/man3/CTLOG_STORE_new.html doc/html/man3/CTLOG_new.html doc/html/man3/CT_POLICY_EVAL_CTX_new.html doc/html/man3/DEFINE_STACK_OF.html doc/html/man3/DES_random_key.html doc/html/man3/DH_generate_key.html doc/html/man3/DH_generate_parameters.html doc/html/man3/DH_get0_pqg.html doc/html/man3/DH_get_1024_160.html doc/html/man3/DH_meth_new.html doc/html/man3/DH_new.html doc/html/man3/DH_new_by_nid.html doc/html/man3/DH_set_method.html doc/html/man3/DH_size.html doc/html/man3/DSA_SIG_new.html doc/html/man3/DSA_do_sign.html doc/html/man3/DSA_dup_DH.html doc/html/man3/DSA_generate_key.html doc/html/man3/DSA_generate_parameters.html doc/html/man3/DSA_get0_pqg.html doc/html/man3/DSA_meth_new.html doc/html/man3/DSA_new.html doc/html/man3/DSA_set_method.html doc/html/man3/DSA_sign.html doc/html/man3/DSA_size.html doc/html/man3/DTLS_get_data_mtu.html doc/html/man3/DTLS_set_timer_cb.html doc/html/man3/DTLSv1_listen.html doc/html/man3/ECDSA_SIG_new.html doc/html/man3/ECPKParameters_print.html doc/html/man3/EC_GFp_simple_method.html doc/html/man3/EC_GROUP_copy.html doc/html/man3/EC_GROUP_new.html doc/html/man3/EC_KEY_get_enc_flags.html doc/html/man3/EC_KEY_new.html doc/html/man3/EC_POINT_add.html doc/html/man3/EC_POINT_new.html doc/html/man3/ENGINE_add.html doc/html/man3/ERR_GET_LIB.html doc/html/man3/ERR_clear_error.html doc/html/man3/ERR_error_string.html doc/html/man3/ERR_get_error.html doc/html/man3/ERR_load_crypto_strings.html doc/html/man3/ERR_load_strings.html doc/html/man3/ERR_new.html doc/html/man3/ERR_print_errors.html doc/html/man3/ERR_put_error.html doc/html/man3/ERR_remove_state.html doc/html/man3/ERR_set_mark.html doc/html/man3/EVP_ASYM_CIPHER_free.html doc/html/man3/EVP_BytesToKey.html doc/html/man3/EVP_CIPHER_CTX_get_cipher_data.html doc/html/man3/EVP_CIPHER_meth_new.html doc/html/man3/EVP_DigestInit.html doc/html/man3/EVP_DigestSignInit.html doc/html/man3/EVP_DigestVerifyInit.html doc/html/man3/EVP_EncodeInit.html doc/html/man3/EVP_EncryptInit.html doc/html/man3/EVP_KDF.html doc/html/man3/EVP_KEYEXCH_free.html doc/html/man3/EVP_KEYMGMT.html doc/html/man3/EVP_MAC.html doc/html/man3/EVP_MD_meth_new.html doc/html/man3/EVP_OpenInit.html doc/html/man3/EVP_PKEY_ASN1_METHOD.html doc/html/man3/EVP_PKEY_CTX_ctrl.html doc/html/man3/EVP_PKEY_CTX_new.html doc/html/man3/EVP_PKEY_CTX_set1_pbe_pass.html doc/html/man3/EVP_PKEY_CTX_set_hkdf_md.html doc/html/man3/EVP_PKEY_CTX_set_rsa_pss_keygen_md.html doc/html/man3/EVP_PKEY_CTX_set_scrypt_N.html doc/html/man3/EVP_PKEY_CTX_set_tls1_prf_md.html doc/html/man3/EVP_PKEY_asn1_get_count.html doc/html/man3/EVP_PKEY_check.html doc/html/man3/EVP_PKEY_cmp.html doc/html/man3/EVP_PKEY_decrypt.html doc/html/man3/EVP_PKEY_derive.html doc/html/man3/EVP_PKEY_encrypt.html doc/html/man3/EVP_PKEY_fromdata.html doc/html/man3/EVP_PKEY_get_default_digest_nid.html doc/html/man3/EVP_PKEY_keygen.html doc/html/man3/EVP_PKEY_meth_get_count.html doc/html/man3/EVP_PKEY_meth_new.html doc/html/man3/EVP_PKEY_new.html doc/html/man3/EVP_PKEY_print_private.html doc/html/man3/EVP_PKEY_set1_RSA.html doc/html/man3/EVP_PKEY_sign.html doc/html/man3/EVP_PKEY_size.html doc/html/man3/EVP_PKEY_supports_digest_nid.html doc/html/man3/EVP_PKEY_verify.html doc/html/man3/EVP_PKEY_verify_recover.html doc/html/man3/EVP_SIGNATURE_free.html doc/html/man3/EVP_SealInit.html doc/html/man3/EVP_SignInit.html doc/html/man3/EVP_VerifyInit.html doc/html/man3/EVP_aes_128_gcm.html doc/html/man3/EVP_aria_128_gcm.html doc/html/man3/EVP_bf_cbc.html doc/html/man3/EVP_blake2b512.html doc/html/man3/EVP_camellia_128_ecb.html doc/html/man3/EVP_cast5_cbc.html doc/html/man3/EVP_chacha20.html doc/html/man3/EVP_des_cbc.html doc/html/man3/EVP_desx_cbc.html doc/html/man3/EVP_idea_cbc.html doc/html/man3/EVP_md2.html doc/html/man3/EVP_md4.html doc/html/man3/EVP_md5.html doc/html/man3/EVP_mdc2.html doc/html/man3/EVP_rc2_cbc.html doc/html/man3/EVP_rc4.html doc/html/man3/EVP_rc5_32_12_16_cbc.html doc/html/man3/EVP_ripemd160.html doc/html/man3/EVP_seed_cbc.html doc/html/man3/EVP_set_default_properties.html doc/html/man3/EVP_sha1.html doc/html/man3/EVP_sha224.html doc/html/man3/EVP_sha3_224.html doc/html/man3/EVP_sm3.html doc/html/man3/EVP_sm4_cbc.html doc/html/man3/EVP_whirlpool.html doc/html/man3/HMAC.html doc/html/man3/MD5.html doc/html/man3/MDC2_Init.html doc/html/man3/OBJ_nid2obj.html doc/html/man3/OCSP_REQUEST_new.html doc/html/man3/OCSP_cert_to_id.html doc/html/man3/OCSP_request_add1_nonce.html doc/html/man3/OCSP_resp_find_status.html doc/html/man3/OCSP_response_status.html doc/html/man3/OCSP_sendreq_new.html doc/html/man3/OPENSSL_Applink.html doc/html/man3/OPENSSL_CTX.html doc/html/man3/OPENSSL_FILE.html doc/html/man3/OPENSSL_LH_COMPFUNC.html doc/html/man3/OPENSSL_LH_stats.html doc/html/man3/OPENSSL_config.html doc/html/man3/OPENSSL_fork_prepare.html doc/html/man3/OPENSSL_hexchar2int.html doc/html/man3/OPENSSL_ia32cap.html doc/html/man3/OPENSSL_init_crypto.html doc/html/man3/OPENSSL_init_ssl.html doc/html/man3/OPENSSL_instrument_bus.html doc/html/man3/OPENSSL_load_builtin_modules.html doc/html/man3/OPENSSL_malloc.html doc/html/man3/OPENSSL_s390xcap.html doc/html/man3/OPENSSL_secure_malloc.html doc/html/man3/OSSL_CMP_CTX_new.html doc/html/man3/OSSL_CMP_CTX_snprint_PKIStatus.html doc/html/man3/OSSL_CMP_HDR_get0_transactionID.html doc/html/man3/OSSL_CMP_ITAV_set0.html doc/html/man3/OSSL_CMP_MSG_get0_header.html doc/html/man3/OSSL_CMP_log_open.html doc/html/man3/OSSL_CMP_validate_msg.html doc/html/man3/OSSL_CRMF_MSG_get0_tmpl.html doc/html/man3/OSSL_CRMF_MSG_set1_regCtrl_regToken.html doc/html/man3/OSSL_CRMF_MSG_set1_regInfo_certReq.html doc/html/man3/OSSL_CRMF_MSG_set_validity.html doc/html/man3/OSSL_CRMF_pbmp_new.html doc/html/man3/OSSL_HTTP_transfer.html doc/html/man3/OSSL_PARAM.html doc/html/man3/OSSL_PARAM_allocate_from_text.html doc/html/man3/OSSL_PARAM_int.html doc/html/man3/OSSL_PROVIDER.html doc/html/man3/OSSL_SELF_TEST_new.html doc/html/man3/OSSL_SELF_TEST_set_callback.html doc/html/man3/OSSL_SERIALIZER.html doc/html/man3/OSSL_SERIALIZER_CTX.html doc/html/man3/OSSL_SERIALIZER_CTX_new_by_EVP_PKEY.html doc/html/man3/OSSL_SERIALIZER_to_bio.html doc/html/man3/OSSL_STORE_INFO.html doc/html/man3/OSSL_STORE_LOADER.html doc/html/man3/OSSL_STORE_SEARCH.html doc/html/man3/OSSL_STORE_expect.html doc/html/man3/OSSL_STORE_open.html doc/html/man3/OSSL_trace_enabled.html doc/html/man3/OSSL_trace_get_category_num.html doc/html/man3/OSSL_trace_set_channel.html doc/html/man3/OpenSSL_add_all_algorithms.html doc/html/man3/OpenSSL_version.html doc/html/man3/PEM_bytes_read_bio.html doc/html/man3/PEM_read.html doc/html/man3/PEM_read_CMS.html doc/html/man3/PEM_read_bio_PrivateKey.html doc/html/man3/PEM_read_bio_ex.html doc/html/man3/PEM_write_bio_CMS_stream.html doc/html/man3/PEM_write_bio_PKCS7_stream.html doc/html/man3/PKCS12_SAFEBAG_get0_attrs.html doc/html/man3/PKCS12_add_CSPName_asc.html doc/html/man3/PKCS12_add_friendlyname_asc.html doc/html/man3/PKCS12_add_localkeyid.html doc/html/man3/PKCS12_create.html doc/html/man3/PKCS12_get_friendlyname.html doc/html/man3/PKCS12_newpass.html doc/html/man3/PKCS12_parse.html doc/html/man3/PKCS5_PBKDF2_HMAC.html doc/html/man3/PKCS7_decrypt.html doc/html/man3/PKCS7_encrypt.html doc/html/man3/PKCS7_sign.html doc/html/man3/PKCS7_sign_add_signer.html doc/html/man3/PKCS7_verify.html doc/html/man3/PKCS8_pkey_add1_attr.html doc/html/man3/RAND_DRBG_generate.html doc/html/man3/RAND_DRBG_get0_master.html doc/html/man3/RAND_DRBG_new.html doc/html/man3/RAND_DRBG_reseed.html doc/html/man3/RAND_DRBG_set_callbacks.html doc/html/man3/RAND_add.html doc/html/man3/RAND_bytes.html doc/html/man3/RAND_cleanup.html doc/html/man3/RAND_egd.html doc/html/man3/RAND_load_file.html doc/html/man3/RAND_set_rand_method.html doc/html/man3/RC4_set_key.html doc/html/man3/RIPEMD160_Init.html doc/html/man3/RSA_blinding_on.html doc/html/man3/RSA_check_key.html doc/html/man3/RSA_generate_key.html doc/html/man3/RSA_get0_key.html doc/html/man3/RSA_meth_new.html doc/html/man3/RSA_new.html doc/html/man3/RSA_padding_add_PKCS1_type_1.html doc/html/man3/RSA_print.html doc/html/man3/RSA_private_encrypt.html doc/html/man3/RSA_public_encrypt.html doc/html/man3/RSA_set_method.html doc/html/man3/RSA_sign.html doc/html/man3/RSA_sign_ASN1_OCTET_STRING.html doc/html/man3/RSA_size.html doc/html/man3/SCT_new.html doc/html/man3/SCT_print.html doc/html/man3/SCT_validate.html doc/html/man3/SHA256_Init.html doc/html/man3/SMIME_read_CMS.html doc/html/man3/SMIME_read_PKCS7.html doc/html/man3/SMIME_write_CMS.html doc/html/man3/SMIME_write_PKCS7.html doc/html/man3/SRP_VBASE_new.html doc/html/man3/SRP_create_verifier.html doc/html/man3/SRP_user_pwd_new.html doc/html/man3/SSL_CIPHER_get_name.html doc/html/man3/SSL_COMP_add_compression_method.html doc/html/man3/SSL_CONF_CTX_new.html doc/html/man3/SSL_CONF_CTX_set1_prefix.html doc/html/man3/SSL_CONF_CTX_set_flags.html doc/html/man3/SSL_CONF_CTX_set_ssl_ctx.html doc/html/man3/SSL_CONF_cmd.html doc/html/man3/SSL_CONF_cmd_argv.html doc/html/man3/SSL_CTX_add1_chain_cert.html doc/html/man3/SSL_CTX_add_extra_chain_cert.html doc/html/man3/SSL_CTX_add_session.html doc/html/man3/SSL_CTX_config.html doc/html/man3/SSL_CTX_ctrl.html doc/html/man3/SSL_CTX_dane_enable.html doc/html/man3/SSL_CTX_flush_sessions.html doc/html/man3/SSL_CTX_free.html doc/html/man3/SSL_CTX_get0_param.html doc/html/man3/SSL_CTX_get_verify_mode.html doc/html/man3/SSL_CTX_has_client_custom_ext.html doc/html/man3/SSL_CTX_load_verify_locations.html doc/html/man3/SSL_CTX_new.html doc/html/man3/SSL_CTX_sess_number.html doc/html/man3/SSL_CTX_sess_set_cache_size.html doc/html/man3/SSL_CTX_sess_set_get_cb.html doc/html/man3/SSL_CTX_sessions.html doc/html/man3/SSL_CTX_set0_CA_list.html doc/html/man3/SSL_CTX_set1_curves.html doc/html/man3/SSL_CTX_set1_sigalgs.html doc/html/man3/SSL_CTX_set1_verify_cert_store.html doc/html/man3/SSL_CTX_set_alpn_select_cb.html doc/html/man3/SSL_CTX_set_cert_cb.html doc/html/man3/SSL_CTX_set_cert_store.html doc/html/man3/SSL_CTX_set_cert_verify_callback.html doc/html/man3/SSL_CTX_set_cipher_list.html doc/html/man3/SSL_CTX_set_client_cert_cb.html doc/html/man3/SSL_CTX_set_client_hello_cb.html doc/html/man3/SSL_CTX_set_ct_validation_callback.html doc/html/man3/SSL_CTX_set_ctlog_list_file.html doc/html/man3/SSL_CTX_set_default_passwd_cb.html doc/html/man3/SSL_CTX_set_generate_session_id.html doc/html/man3/SSL_CTX_set_info_callback.html doc/html/man3/SSL_CTX_set_keylog_callback.html doc/html/man3/SSL_CTX_set_max_cert_list.html doc/html/man3/SSL_CTX_set_min_proto_version.html doc/html/man3/SSL_CTX_set_mode.html doc/html/man3/SSL_CTX_set_msg_callback.html doc/html/man3/SSL_CTX_set_num_tickets.html doc/html/man3/SSL_CTX_set_options.html doc/html/man3/SSL_CTX_set_psk_client_callback.html doc/html/man3/SSL_CTX_set_quiet_shutdown.html doc/html/man3/SSL_CTX_set_read_ahead.html doc/html/man3/SSL_CTX_set_record_padding_callback.html doc/html/man3/SSL_CTX_set_security_level.html doc/html/man3/SSL_CTX_set_session_cache_mode.html doc/html/man3/SSL_CTX_set_session_id_context.html doc/html/man3/SSL_CTX_set_session_ticket_cb.html doc/html/man3/SSL_CTX_set_split_send_fragment.html doc/html/man3/SSL_CTX_set_srp_password.html doc/html/man3/SSL_CTX_set_ssl_version.html doc/html/man3/SSL_CTX_set_stateless_cookie_generate_cb.html doc/html/man3/SSL_CTX_set_timeout.html doc/html/man3/SSL_CTX_set_tlsext_servername_callback.html doc/html/man3/SSL_CTX_set_tlsext_status_cb.html doc/html/man3/SSL_CTX_set_tlsext_ticket_key_cb.html doc/html/man3/SSL_CTX_set_tlsext_use_srtp.html doc/html/man3/SSL_CTX_set_tmp_dh_callback.html doc/html/man3/SSL_CTX_set_tmp_ecdh.html doc/html/man3/SSL_CTX_set_verify.html doc/html/man3/SSL_CTX_use_certificate.html doc/html/man3/SSL_CTX_use_psk_identity_hint.html doc/html/man3/SSL_CTX_use_serverinfo.html doc/html/man3/SSL_SESSION_free.html doc/html/man3/SSL_SESSION_get0_cipher.html doc/html/man3/SSL_SESSION_get0_hostname.html doc/html/man3/SSL_SESSION_get0_id_context.html doc/html/man3/SSL_SESSION_get0_peer.html doc/html/man3/SSL_SESSION_get_compress_id.html doc/html/man3/SSL_SESSION_get_protocol_version.html doc/html/man3/SSL_SESSION_get_time.html doc/html/man3/SSL_SESSION_has_ticket.html doc/html/man3/SSL_SESSION_is_resumable.html doc/html/man3/SSL_SESSION_print.html doc/html/man3/SSL_SESSION_set1_id.html doc/html/man3/SSL_accept.html doc/html/man3/SSL_alert_type_string.html doc/html/man3/SSL_alloc_buffers.html doc/html/man3/SSL_check_chain.html doc/html/man3/SSL_clear.html doc/html/man3/SSL_connect.html doc/html/man3/SSL_do_handshake.html doc/html/man3/SSL_export_keying_material.html doc/html/man3/SSL_extension_supported.html doc/html/man3/SSL_free.html doc/html/man3/SSL_get0_peer_scts.html doc/html/man3/SSL_get_SSL_CTX.html doc/html/man3/SSL_get_all_async_fds.html doc/html/man3/SSL_get_ciphers.html doc/html/man3/SSL_get_client_random.html doc/html/man3/SSL_get_current_cipher.html doc/html/man3/SSL_get_default_timeout.html doc/html/man3/SSL_get_error.html doc/html/man3/SSL_get_extms_support.html doc/html/man3/SSL_get_fd.html doc/html/man3/SSL_get_peer_cert_chain.html doc/html/man3/SSL_get_peer_certificate.html doc/html/man3/SSL_get_peer_signature_nid.html doc/html/man3/SSL_get_peer_tmp_key.html doc/html/man3/SSL_get_psk_identity.html doc/html/man3/SSL_get_rbio.html doc/html/man3/SSL_get_session.html doc/html/man3/SSL_get_shared_sigalgs.html doc/html/man3/SSL_get_verify_result.html doc/html/man3/SSL_get_version.html doc/html/man3/SSL_in_init.html doc/html/man3/SSL_key_update.html doc/html/man3/SSL_library_init.html doc/html/man3/SSL_load_client_CA_file.html doc/html/man3/SSL_new.html doc/html/man3/SSL_pending.html doc/html/man3/SSL_read.html doc/html/man3/SSL_read_early_data.html doc/html/man3/SSL_rstate_string.html doc/html/man3/SSL_session_reused.html doc/html/man3/SSL_set1_host.html doc/html/man3/SSL_set_async_callback.html doc/html/man3/SSL_set_bio.html doc/html/man3/SSL_set_connect_state.html doc/html/man3/SSL_set_fd.html doc/html/man3/SSL_set_session.html doc/html/man3/SSL_set_shutdown.html doc/html/man3/SSL_set_verify_result.html doc/html/man3/SSL_shutdown.html doc/html/man3/SSL_state_string.html doc/html/man3/SSL_want.html doc/h From no-reply at appveyor.com Tue Mar 10 07:25:54 2020 From: no-reply at appveyor.com (AppVeyor) Date: Tue, 10 Mar 2020 07:25:54 +0000 Subject: Build failed: openssl master.32437 Message-ID: <20200310072554.1.520E35121AC5EAED@appveyor.com> An HTML attachment was scrubbed... URL: From levitte at openssl.org Tue Mar 10 12:33:55 2020 From: levitte at openssl.org (Richard Levitte) Date: Tue, 10 Mar 2020 12:33:55 +0000 Subject: [openssl] master update Message-ID: <1583843635.954539.19224.nullmailer@dev.openssl.org> The branch master has been updated via 041a96e7acc89685228980b5615a53bee7f07b0f (commit) via b5b91a79633dbecb6f4d74d469ea28748ba606d7 (commit) via 2f3a709807e37f5a4f2242f18f121aa525971a93 (commit) via 1e55cbc874826af63e178a3fd26d23981599effe (commit) via c5926e930cc9a4bdf0932d14e17f1f122a70205b (commit) from 99a16e0459e5089c2cfb92ee775f1221a51b8d05 (commit) - Log ----------------------------------------------------------------- commit 041a96e7acc89685228980b5615a53bee7f07b0f Author: Richard Levitte Date: Sat Mar 7 08:00:51 2020 +0100 DOCS: Clean up doc/man3/EVP_DigestInit.pod We touch it, we clean it up! Accordding to common man-pages(7) guidelines. Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/11270) commit b5b91a79633dbecb6f4d74d469ea28748ba606d7 Author: Richard Levitte Date: Sat Mar 7 07:51:27 2020 +0100 DOCS: Add translation information for EVP_MD_CTX_ctrl() EVP_MD_CTX_ctrl() translates some known control commands when faced with a fetched EVP_MD, so we need to document it. This also ensures that we don't drop the information on the "micalg" parameter entirely. Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/11270) commit 2f3a709807e37f5a4f2242f18f121aa525971a93 Author: Richard Levitte Date: Fri Mar 6 14:33:17 2020 +0100 DOCS: Add missing documentation in util/missingcrypto.txt These lines will be taken away as documentation moves from diverse provider operation interface manuals to implementation specific docs. Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/11270) commit 1e55cbc874826af63e178a3fd26d23981599effe Author: Richard Levitte Date: Fri Mar 6 14:29:00 2020 +0100 DOCS: Move implementation specific docs away from provider-digest(7) The provider- manuals are meant to describe the general interface for their respective operation. This is not the place to describe implementation specific details. This change creates a number of doc/man7/EVP_MD manuals, one for each algorithm or set of algorithms, as well as doc/man7/EVP_MD-common.pod to describe what's common to them all. While we're at it, correct the SHA3 settable context params array to match what's actually settable. Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/11270) commit c5926e930cc9a4bdf0932d14e17f1f122a70205b Author: Richard Levitte Date: Fri Mar 6 14:25:42 2020 +0100 DOCS: Start restructuring our provider and implementation documentation This adds doc/man7/OSSL_PROVIDER-default.pod and OSSL_PROVIDER-legacy.pod, and fills in currently implemented operations and algorithms in them, as well as in doc/man7/OSSL_PROVIDER-FIPS.pod, with links to documentation to come. Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/11270) ----------------------------------------------------------------------- Summary of changes: doc/man3/EVP_DigestInit.pod | 92 ++++++----- doc/man7/EVP_MD-BLAKE2.pod | 46 ++++++ doc/man7/EVP_MD-MD2.pod | 34 ++++ doc/man7/EVP_MD-MD4.pod | 34 ++++ doc/man7/EVP_MD-MD5-SHA1.pod | 56 +++++++ doc/man7/EVP_MD-MD5.pod | 34 ++++ doc/man7/EVP_MD-MDC2.pod | 50 ++++++ doc/man7/EVP_MD-RIPEMD160.pod | 35 ++++ doc/man7/EVP_MD-SHA1.pod | 55 +++++++ doc/man7/EVP_MD-SHA2.pod | 77 +++++++++ doc/man7/EVP_MD-SHA3.pod | 46 ++++++ doc/man7/EVP_MD-SHAKE.pod | 73 +++++++++ doc/man7/EVP_MD-SM3.pod | 34 ++++ doc/man7/EVP_MD-WHIRLPOOL.pod | 34 ++++ doc/man7/EVP_MD-common.pod | 67 ++++++++ doc/man7/OSSL_PROVIDER-FIPS.pod | 131 ++++++++++++++- doc/man7/OSSL_PROVIDER-default.pod | 226 ++++++++++++++++++++++++++ doc/man7/OSSL_PROVIDER-legacy.pod | 92 +++++++++++ doc/man7/provider-digest.pod | 41 +---- providers/implementations/digests/sha3_prov.c | 2 +- util/missingcrypto.txt | 39 +++++ 21 files changed, 1215 insertions(+), 83 deletions(-) create mode 100644 doc/man7/EVP_MD-BLAKE2.pod create mode 100644 doc/man7/EVP_MD-MD2.pod create mode 100644 doc/man7/EVP_MD-MD4.pod create mode 100644 doc/man7/EVP_MD-MD5-SHA1.pod create mode 100644 doc/man7/EVP_MD-MD5.pod create mode 100644 doc/man7/EVP_MD-MDC2.pod create mode 100644 doc/man7/EVP_MD-RIPEMD160.pod create mode 100644 doc/man7/EVP_MD-SHA1.pod create mode 100644 doc/man7/EVP_MD-SHA2.pod create mode 100644 doc/man7/EVP_MD-SHA3.pod create mode 100644 doc/man7/EVP_MD-SHAKE.pod create mode 100644 doc/man7/EVP_MD-SM3.pod create mode 100644 doc/man7/EVP_MD-WHIRLPOOL.pod create mode 100644 doc/man7/EVP_MD-common.pod create mode 100644 doc/man7/OSSL_PROVIDER-default.pod create mode 100644 doc/man7/OSSL_PROVIDER-legacy.pod diff --git a/doc/man3/EVP_DigestInit.pod b/doc/man3/EVP_DigestInit.pod index ef40ae49f8..628e7c234f 100644 --- a/doc/man3/EVP_DigestInit.pod +++ b/doc/man3/EVP_DigestInit.pod @@ -110,8 +110,8 @@ The B type is a structure for digest method implementation. =item EVP_MD_fetch() -Fetches the digest implementation for the given B from any -provider offering it, within the criteria given by the B. +Fetches the digest implementation for the given I from any +provider offering it, within the criteria given by the I. See L for further information. The returned value must eventually be freed with EVP_MD_free(). @@ -133,37 +133,45 @@ Allocates and returns a digest context. =item EVP_MD_CTX_reset() -Resets the digest context B. This can be used to reuse an already +Resets the digest context I. This can be used to reuse an already existing context. =item EVP_MD_CTX_free() -Cleans up digest context B and frees up the space allocated to it. +Cleans up digest context I and frees up the space allocated to it. =item EVP_MD_CTX_ctrl() -This is a legacy method. EVP_MD_CTX_set_params() and EVP_MD_CTX_get_params() +I. The control command -is indicated in B and any additional arguments in B and B. +providers.> + +Performs digest-specific control actions on context I. The control command +is indicated in I and any additional arguments in I and I. EVP_MD_CTX_ctrl() must be called after EVP_DigestInit_ex(). Other restrictions may apply depending on the control type and digest implementation. -See L below for more information. + +If this function happens to be used with a fetched B, it will +translate the controls that are known to OpenSSL into L +parameters with keys defined by OpenSSL and call EVP_MD_CTX_get_params() or +EVP_MD_CTX_set_params() as is appropriate for each control command. + +See L below for more information, including what translations are +being done. =item EVP_MD_get_params() -Retrieves the requested list of B from a MD B. +Retrieves the requested list of I from a MD I. See L below for more information. =item EVP_MD_CTX_get_params() -Retrieves the requested list of B from a MD context B. +Retrieves the requested list of I from a MD context I. See L below for more information. =item EVP_MD_CTX_set_params() -Sets the list of B into a MD context B. +Sets the list of I into a MD context I. See L below for more information. =item EVP_MD_gettable_params(), EVP_MD_gettable_ctx_params(), @@ -181,36 +189,36 @@ See L for the use of B as parameter descriptor. =item EVP_MD_CTX_set_flags(), EVP_MD_CTX_clear_flags(), EVP_MD_CTX_test_flags() -Sets, clears and tests B flags. See L below for more information. +Sets, clears and tests I flags. See L below for more information. =item EVP_Digest() A wrapper around the Digest Init_ex, Update and Final_ex functions. -Hashes B bytes of data at B using a digest B from ENGINE -B. The digest value is placed in B and its length is written at B +Hashes I bytes of data at I using a digest I from ENGINE +I. The digest value is placed in I and its length is written at I if the pointer is not NULL. At most B bytes will be written. -If B is NULL the default implementation of digest B is used. +If I is NULL the default implementation of digest I is used. =item EVP_DigestInit_ex() -Sets up digest context B to use a digest B. -B is typically supplied by a function such as EVP_sha1(), or a +Sets up digest context I to use a digest I. +I is typically supplied by a function such as EVP_sha1(), or a value explicitly fetched with EVP_MD_fetch(). -If B is non-NULL, its implementation of the digest B is used if +If I is non-NULL, its implementation of the digest I is used if there is one, and if not, the default implementation is used. =item EVP_DigestUpdate() -Hashes B bytes of data at B into the digest context B. This -function can be called several times on the same B to hash additional +Hashes I bytes of data at I into the digest context I. This +function can be called several times on the same I to hash additional data. =item EVP_DigestFinal_ex() -Retrieves the digest value from B and places it in B. If the B +Retrieves the digest value from I and places it in I. If the I parameter is not NULL then the number of bytes of data written (i.e. the -length of the digest) will be written to the integer at B, at most +length of the digest) will be written to the integer at I, at most B bytes will be written. After calling EVP_DigestFinal_ex() no additional calls to EVP_DigestUpdate() can be made, but EVP_DigestInit_ex() can be called to initialize a new digest operation. @@ -218,13 +226,13 @@ EVP_DigestInit_ex() can be called to initialize a new digest operation. =item EVP_DigestFinalXOF() Interfaces to extendable-output functions, XOFs, such as SHAKE128 and SHAKE256. -It retrieves the digest value from B and places it in B-sized md. +It retrieves the digest value from I and places it in I-sized md. After calling this function no additional calls to EVP_DigestUpdate() can be made, but EVP_DigestInit_ex() can be called to initialize a new operation. =item EVP_MD_CTX_copy_ex() -Can be used to copy the message digest state from B to B. This is +Can be used to copy the message digest state from I to I. This is useful if large amounts of data are to be hashed which only differ in the last few bytes. @@ -235,12 +243,12 @@ default digest implementation and calls EVP_MD_CTX_reset(). =item EVP_DigestFinal() -Similar to EVP_DigestFinal_ex() except the digest context B is +Similar to EVP_DigestFinal_ex() except the digest context I is automatically cleaned up. =item EVP_MD_CTX_copy() -Similar to EVP_MD_CTX_copy_ex() except the destination B does not have to +Similar to EVP_MD_CTX_copy_ex() except the destination I does not have to be initialized. =item EVP_MD_is_a() @@ -311,17 +319,17 @@ should not be used after the EVP_MD_CTX is freed. =item EVP_MD_CTX_set_update_fn() -Sets the update function for B to B. +Sets the update function for I to I. This is the function that is called by EVP_DigestUpdate. If not set, the update function from the B type specified at initialization is used. =item EVP_MD_CTX_update_fn() -Returns the update function for B. +Returns the update function for I. =item EVP_MD_flags() -Returns the B flags. Note that these are different from the B +Returns the I flags. Note that these are different from the B ones. See L for more information. =item EVP_MD_pkey_type() @@ -345,16 +353,16 @@ B structure respectively. =item EVP_MD_CTX_pkey_ctx() -Returns the B assigned to B. The returned pointer should not +Returns the B assigned to I. The returned pointer should not be freed by the caller. =item EVP_MD_CTX_set_pkey_ctx() Assigns an B to B. This is usually used to provide a customized B to L or -L. The B passed to this function should be freed -by the caller. A NULL B pointer is also allowed to clear the B -assigned to B. In such case, freeing the cleared B or not +L. The I passed to this function should be freed +by the caller. A NULL I pointer is also allowed to clear the B +assigned to I. In such case, freeing the cleared B or not depends on how the B is created. =item EVP_MD_do_all_provided() @@ -382,7 +390,7 @@ using a B. =item "pad_type" (B) -Sets the pad type. +Sets the padding type. It is used by the MDC2 algorithm. =back @@ -409,15 +417,21 @@ EVP_MD_CTX_ctrl() can be used to send the following standard controls: Gets the digest Message Integrity Check algorithm string. This is used when creating S/MIME multipart/signed messages, as specified in RFC 3851. -The string value is written to B. +The string value is written to I. + +When used with a fetched B, EVP_MD_CTX_get_params() gets called with +an L item with the key "micalg" (B). =item EVP_MD_CTRL_XOF_LEN -This control sets the digest length for extendable output functions to B. +This control sets the digest length for extendable output functions to I. Sending this control directly should not be necessary, the use of -C is preferred. +EVP_DigestFinalXOF() is preferred. Currently used by SHAKE. +When used with a fetched B, EVP_MD_CTX_get_params() gets called with +an L item with the key "xoflen" (B). + =back =head1 FLAGS @@ -529,7 +543,7 @@ New applications should use the SHA-2 (such as L) or the SHA-3 digest algorithms (such as L). The other digest algorithms are still in common use. -For most applications the B parameter to EVP_DigestInit_ex() will be +For most applications the I parameter to EVP_DigestInit_ex() will be set to NULL to use the default digest implementation. The functions EVP_DigestInit(), EVP_DigestFinal() and EVP_MD_CTX_copy() are diff --git a/doc/man7/EVP_MD-BLAKE2.pod b/doc/man7/EVP_MD-BLAKE2.pod new file mode 100644 index 0000000000..be3b0b9286 --- /dev/null +++ b/doc/man7/EVP_MD-BLAKE2.pod @@ -0,0 +1,46 @@ +=pod + +=head1 NAME + +EVP_MD-BLAKE2 - The BLAKE2 EVP_MD implementation + +=head1 DESCRIPTION + +Support for computing SHA2 digests through the B API. + +=head2 Identities + +This implementation is only available with the default provider, and +includes the following varieties: + +=over 4 + +=item BLAKE2S-256 + +Known names are "BLAKE2S-256" and "BLAKE2s256". + +=item BLAKE2B-512 + +Known names are "BLAKE2B-512" and "BLAKE2b512". + +=back + +=head2 Gettable Parameters + +This implementation supports the common gettable parameters described +in L. + +=head1 SEE ALSO + +L, L + +=head1 COPYRIGHT + +Copyright 2020 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the Apache License 2.0 (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +L. + +=cut diff --git a/doc/man7/EVP_MD-MD2.pod b/doc/man7/EVP_MD-MD2.pod new file mode 100644 index 0000000000..61fc42fc4d --- /dev/null +++ b/doc/man7/EVP_MD-MD2.pod @@ -0,0 +1,34 @@ +=pod + +=head1 NAME + +EVP_MD-MD2 - The MD2 EVP_MD implementation + +=head1 DESCRIPTION + +Support for computing MD2 digests through the B API. + +=head2 Identity + +This implementation is only available with the legacy provider, and is +identified with the name "MD2". + +=head2 Gettable Parameters + +This implementation supports the common gettable parameters described +in L. + +=head1 SEE ALSO + +L, L + +=head1 COPYRIGHT + +Copyright 2020 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the Apache License 2.0 (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +L. + +=cut diff --git a/doc/man7/EVP_MD-MD4.pod b/doc/man7/EVP_MD-MD4.pod new file mode 100644 index 0000000000..0a3f97c47b --- /dev/null +++ b/doc/man7/EVP_MD-MD4.pod @@ -0,0 +1,34 @@ +=pod + +=head1 NAME + +EVP_MD-MD4 - The MD4 EVP_MD implementation + +=head1 DESCRIPTION + +Support for computing MD4 digests through the B API. + +=head2 Identity + +This implementation is only available with the legacy provider, and is +identified with the name "MD4". + +=head2 Gettable Parameters + +This implementation supports the common gettable parameters described +in L. + +=head1 SEE ALSO + +L, L + +=head1 COPYRIGHT + +Copyright 2020 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the Apache License 2.0 (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +L. + +=cut diff --git a/doc/man7/EVP_MD-MD5-SHA1.pod b/doc/man7/EVP_MD-MD5-SHA1.pod new file mode 100644 index 0000000000..61652ad5c6 --- /dev/null +++ b/doc/man7/EVP_MD-MD5-SHA1.pod @@ -0,0 +1,56 @@ +=pod + +=head1 NAME + +EVP_MD-MD5-SHA1 - The MD5-SHA1 EVP_MD implementation + +=head1 DESCRIPTION + +Support for computing MD5-SHA1 digests through the B API. + +MD5-SHA1 is a rather special digest that's used with SSLv3. + +=head2 Identity + +This implementation is only available with the default provider, and is +identified with the name "MD5-SHA1". + +=head2 Gettable Parameters + +This implementation supports the common gettable parameters described +in L. + +=head2 Settable Context Parameters + +This implementation supports the following L entries, +settable for an B with L: + +=over 4 + +=item "ssl3-ms" (B) + +This parameter is set by libssl in order to calculate a signature hash for an +SSLv3 CertificateVerify message as per RFC6101. +It is only set after all handshake messages have already been digested via +OP_digest_update() calls. +The parameter provides the master secret value to be added to the digest. +The digest implementation should calculate the complete digest as per RFC6101 +section 5.6.8. +The next call after setting this parameter should be OP_digest_final(). + +=back + +=head1 SEE ALSO + +L, L, L + +=head1 COPYRIGHT + +Copyright 2020 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the Apache License 2.0 (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +L. + +=cut diff --git a/doc/man7/EVP_MD-MD5.pod b/doc/man7/EVP_MD-MD5.pod new file mode 100644 index 0000000000..98ae2c5be5 --- /dev/null +++ b/doc/man7/EVP_MD-MD5.pod @@ -0,0 +1,34 @@ +=pod + +=head1 NAME + +EVP_MD-MD5 - The MD5 EVP_MD implementation + +=head1 DESCRIPTION + +Support for computing MD5 digests through the B API. + +=head2 Identity + +This implementation is only available with the default provider, and is +identified with the name "MD5". + +=head2 Gettable Parameters + +This implementation supports the common gettable parameters described +in L. + +=head1 SEE ALSO + +L, L + +=head1 COPYRIGHT + +Copyright 2020 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the Apache License 2.0 (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +L. + +=cut diff --git a/doc/man7/EVP_MD-MDC2.pod b/doc/man7/EVP_MD-MDC2.pod new file mode 100644 index 0000000000..516e19da19 --- /dev/null +++ b/doc/man7/EVP_MD-MDC2.pod @@ -0,0 +1,50 @@ +=pod + +=head1 NAME + +EVP_MD-MDC2 - The MDC2 EVP_MD implementation + +=head1 DESCRIPTION + +Support for computing MDC2 digests through the B API. + +=head2 Identity + +This implementation is only available with the legacy provider, and is +identified with the name "MDC2". + +=head2 Gettable Parameters + +This implementation supports the common gettable parameters described +in L. + +=head2 Settable Context Parameters + +This implementation supports the following L entries, +settable for an B with L: + +=over 4 + +=item "pad_type" (B) + +Sets the padding type to be used. +Normally the final MDC2 block is padded with zeros. +If the pad type is set to 2 then the final block is padded with 0x80 followed by +zeros. + +=back + +=head1 SEE ALSO + +L, L, L + +=head1 COPYRIGHT + +Copyright 2020 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the Apache License 2.0 (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +L. + +=cut diff --git a/doc/man7/EVP_MD-RIPEMD160.pod b/doc/man7/EVP_MD-RIPEMD160.pod new file mode 100644 index 0000000000..0504e9b302 --- /dev/null +++ b/doc/man7/EVP_MD-RIPEMD160.pod @@ -0,0 +1,35 @@ +=pod + +=head1 NAME + +EVP_MD-RIPEMD160 - The RIPEMD160 EVP_MD implementation + +=head1 DESCRIPTION + +Support for computing RIPEMD160 digests through the B API. + +=head2 Identities + +This implementation is only available with the legacy provider, and is +identified with any of the names "RIPEMD-160", "RIPEMD160", "RIPEMD" and +"RMD160". + +=head2 Gettable Parameters + +This implementation supports the common gettable parameters described +in L. + +=head1 SEE ALSO + +L, L + +=head1 COPYRIGHT + +Copyright 2020 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the Apache License 2.0 (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +L. + +=cut diff --git a/doc/man7/EVP_MD-SHA1.pod b/doc/man7/EVP_MD-SHA1.pod new file mode 100644 index 0000000000..5fd94df4ce --- /dev/null +++ b/doc/man7/EVP_MD-SHA1.pod @@ -0,0 +1,55 @@ +=pod + +=head1 NAME + +EVP_MD-SHA1 - The SHA1 EVP_MD implementation + +=head1 DESCRIPTION + +Support for computing SHA1 digests through the B API. + +=head2 Identities + +This implementation is available with the FIPS provider as well as the +default provider, and is identified with the names "SHA1" and "SHA-1". + +=head2 Gettable Parameters + +This implementation supports the common gettable parameters described +in L. + +=head2 Settable Context Parameters + +This implementation supports the following L entries, +settable for an B with L: + +=over 4 + +=item "ssl3-ms" (B) + +This parameter is set by libssl in order to calculate a signature hash for an +SSLv3 CertificateVerify message as per RFC6101. +It is only set after all handshake messages have already been digested via +OP_digest_update() calls. +The parameter provides the master secret value to be added to the digest. +The digest implementation should calculate the complete digest as per RFC6101 +section 5.6.8. +The next call after setting this parameter should be OP_digest_final(). + +=back + +=head1 SEE ALSO + +L, L, +L, L + +=head1 COPYRIGHT + +Copyright 2020 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the Apache License 2.0 (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +L. + +=cut diff --git a/doc/man7/EVP_MD-SHA2.pod b/doc/man7/EVP_MD-SHA2.pod new file mode 100644 index 0000000000..2a2e799d89 --- /dev/null +++ b/doc/man7/EVP_MD-SHA2.pod @@ -0,0 +1,77 @@ +=pod + +=head1 NAME + +EVP_MD-SHA2 - The SHA2 EVP_MD implementation + +=head1 DESCRIPTION + +Support for computing SHA2 digests through the B API. + +=head2 Identities + +This implementation includes the following varieties: + +=over 4 + +=item * + +Available with the FIPS provider as well as the default provider: + +=over 4 + +=item SHA2-224 + +Known names are "SHA2-224", "SHA-224" and "SHA224". + +=item SHA2-256 + +Known names are "SHA2-256", "SHA-256" and "SHA256". + +=item SHA2-384 + +Known names are "SHA2-384", "SHA-384" and "SHA384". + +=item SHA2-512 + +Known names are "SHA2-512", "SHA-512" and "SHA512". + +=back + +=item * + +Available with the default provider: + +=over 4 + +=item SHA2-512/224 + +Known names are "SHA2-512/224", "SHA-512/224" and "SHA512-224". + +=item SHA2-512/256 + +Known names are "SHA2-512/256", "SHA-512/256" and "SHA512-256". + +=back + +=back + +=head2 Gettable Parameters + +This implementation supports the common gettable parameters described +in L. + +=head1 SEE ALSO + +L, L, L + +=head1 COPYRIGHT + +Copyright 2020 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the Apache License 2.0 (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +L. + +=cut diff --git a/doc/man7/EVP_MD-SHA3.pod b/doc/man7/EVP_MD-SHA3.pod new file mode 100644 index 0000000000..bc5c3508be --- /dev/null +++ b/doc/man7/EVP_MD-SHA3.pod @@ -0,0 +1,46 @@ +=pod + +=head1 NAME + +EVP_MD-SHA3 - The SHA3 EVP_MD implementations + +=head1 DESCRIPTION + +Support for computing SHA3 digests through the B API. + +=head2 Identities + +This implementation is available with the FIPS provider as well as the +default provider, and includes the following varieties: + +=over 4 + +=item "SHA3-224" + +=item "SHA3-256" + +=item "SHA3-384" + +=item "SHA3-512" + +=back + +=head2 Gettable Parameters + +This implementation supports the common gettable parameters described +in L. + +=head1 SEE ALSO + +L, L, L + +=head1 COPYRIGHT + +Copyright 2020 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the Apache License 2.0 (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +L. + +=cut diff --git a/doc/man7/EVP_MD-SHAKE.pod b/doc/man7/EVP_MD-SHAKE.pod new file mode 100644 index 0000000000..2426d5a4a2 --- /dev/null +++ b/doc/man7/EVP_MD-SHAKE.pod @@ -0,0 +1,73 @@ +=pod + +=head1 NAME + +EVP_MD-SHAKE, EVP_MD-KECCAK-KMAC +- The SHAKE / KECCAK family EVP_MD implementations + +=head1 DESCRIPTION + +Support for computing SHAKE or KECCAK-KMAC digests through the +B API. + +KECCAK-KMAC is a special digest that's used by the KMAC EVP_MAC +implementation (see L). + +=head2 Identities + +This implementation is only available with the default provider, and +includes the following varieties: + +=over 4 + +=item KECCAK-KMAC-128 + +Known names are "KECCAK-KMAC-128" and "KECCAK-KMAC128" + +=item KECCAK-KMAC-256 + +Known names are "KECCAK-KMAC-256" and "KECCAK-KMAC256" + +=item SHAKE-128 + +Known names are "SHAKE-128" and "SHAKE128" + +=item SHAKE-256 + +Known names are "SHAKE-256" and "SHAKE256" + +=back + +=head2 Gettable Parameters + +This implementation supports the common gettable parameters described +in L. + +=head2 Settable Context Parameters + +These implementations support the following L entries, +settable for an B with L: + +=over 4 + +=item "xoflen" (B) + +Sets the digest length for extendable output functions. +The length of the "xoflen" parameter should not exceed that of a B. + +=back + +=head1 SEE ALSO + +L, L, L + +=head1 COPYRIGHT + +Copyright 2020 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the Apache License 2.0 (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +L. + +=cut diff --git a/doc/man7/EVP_MD-SM3.pod b/doc/man7/EVP_MD-SM3.pod new file mode 100644 index 0000000000..355c52ec84 --- /dev/null +++ b/doc/man7/EVP_MD-SM3.pod @@ -0,0 +1,34 @@ +=pod + +=head1 NAME + +EVP_MD-SM3 - The SM3 EVP_MD implementations + +=head1 DESCRIPTION + +Support for computing SM3 digests through the B API. + +=head2 Identity + +This implementation is only available with the default provider, and is +identified with the name "SM3". + +=head2 Gettable Parameters + +This implementation supports the common gettable parameters described +in L. + +=head1 SEE ALSO + +L, L + +=head1 COPYRIGHT + +Copyright 2020 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the Apache License 2.0 (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +L. + +=cut diff --git a/doc/man7/EVP_MD-WHIRLPOOL.pod b/doc/man7/EVP_MD-WHIRLPOOL.pod new file mode 100644 index 0000000000..2252ab2dba --- /dev/null +++ b/doc/man7/EVP_MD-WHIRLPOOL.pod @@ -0,0 +1,34 @@ +=pod + +=head1 NAME + +EVP_MD-WHIRLPOOL - The WHIRLPOOL EVP_MD implementation + +=head1 DESCRIPTION + +Support for computing WHIRLPOOL digests through the B API. + +=head2 Identity + +This implementation is only available with the legacy provider, and is +identified with the name "WHIRLPOOL". + +=head2 Gettable Parameters + +This implementation supports the common gettable parameters described +in L. + +=head1 SEE ALSO + +L, L + +=head1 COPYRIGHT + +Copyright 2020 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the Apache License 2.0 (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +L. + +=cut diff --git a/doc/man7/EVP_MD-common.pod b/doc/man7/EVP_MD-common.pod new file mode 100644 index 0000000000..783844988b --- /dev/null +++ b/doc/man7/EVP_MD-common.pod @@ -0,0 +1,67 @@ +=pod + +=head1 NAME + +EVP_MD-common - The OpenSSL EVP_MD implementations, common things + +=head1 DESCRIPTION + +All the OpenSSL EVP_MD implementations understand the following +L entries: + +=over 4 + +Gettable with L: + +=over 4 + +=item "blocksize" (B) + +The digest block size. +The length of the "blocksize" parameter should not exceed that of a +B. + +This value can also be retrieved with L. + +=item "size" (B) + +The digest output size. +The length of the "size" parameter should not exceed that of a B. + +This value can also be retrieved with L. + +=item "flags" (B) + +Diverse flags that describe exceptional behaviour for the digest. +These flags are described in L. + +The length of the "flags" parameter should equal that of an +B. + +=begin comment + +The description of these flags should probably be moved. Also, +EVP_MD_FLAG_FIPS isn't relevant any more. + +=end comment + +This value can also be retrieved with L. + +=back + +=back + +=head1 SEE ALSO + +L, L + +=head1 COPYRIGHT + +Copyright 2020 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the Apache License 2.0 (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +L. + +=cut diff --git a/doc/man7/OSSL_PROVIDER-FIPS.pod b/doc/man7/OSSL_PROVIDER-FIPS.pod index 1cb75e7c87..56844deeb9 100644 --- a/doc/man7/OSSL_PROVIDER-FIPS.pod +++ b/doc/man7/OSSL_PROVIDER-FIPS.pod @@ -2,15 +2,136 @@ =head1 NAME -OSSL_PROVIDER-FIPS - OPENSSL FIPS provider +OSSL_PROVIDER-FIPS - OpenSSL FIPS provider =head1 DESCRIPTION -The OPENSSL FIPS provider is a special provider that conforms to the Federal +The OpenSSL FIPS provider is a special provider that conforms to the Federal Information Processing Standards (FIPS) specified in FIPS 140-2. This 'module' contains an approved set of cryptographic algorithms that is validated by an accredited testing laboratory. +=head2 Properties + +The implementations in this provider specifically have these properties +defined: + +=over 4 + +"provider=default" + +"fips=yes" + +=back + +It may be used in a property query string with fetching functions such as +L or L, as well as with other +functions that take a property query string, such as +L. + +It isn't mandatory to query for any of these properties, except to +make sure to get implementations of this provider and none other. + +The "fips=yes" property can be use to make sure only FIPS approved +implementations are used for crypto operations. This may also include +other non-crypto support operations that are not in the fips provider, +such as asymmetric key serializers, +see L. + +=head1 OPERATIONS AND ALGORITHMS + +The OpenSSL FIPS provider supports these operations and algorithms: + +=head2 Hashing Algorithms / Message Digests + +=over 4 + +=item SHA1, see L + +=item SHA2, see L + +=item SHA3, see L + +=item KECCAK-KMAC, see L + +=back + +=head2 Symmetric Ciphers + +=over 4 + +=item AES, see L + +=item DES-EDE3 (TrippleDES), see L + +=back + +=head2 Message Authentication Code (MAC) + +=over 4 + +=item CMAC, see L + +=item GMAC, see L + +=item HMAC, see L + +=item KMAC, see L + +=back + +=head2 Key Derivation Function (KDF) + +=over 4 + +=item HKDF, see L + +=item SSKDF, see L + +=item PBKDF2, see L + +=item TLS1-PRF, see L + +=item KBKDF, see L + +=back + +=head2 Key Exchange + +=over 4 + +=item DH, see L + +=back + +=head2 Asymmetric Signature + +=over 4 + +=item DSA, see L + +=back + +=head2 Asymmetric Cipher + +=over 4 + +=item RSA, see L + +=back + +=head2 Asymmetric Key Management + +=over 4 + +=item DH, see L + +=item DSA, see L + +=item RSA, see L + +=back + =head1 SELF TESTING One of the requirements for the FIPS module is self testing. An optional callback @@ -19,7 +140,7 @@ L. The parameters passed to the callback are described in L -The OPENSSL FIPS module uses the following mechanism to provide information +The OpenSSL FIPS module uses the following mechanism to provide information about the self tests as they run. This is useful for debugging if a self test is failing. The callback also allows forcing any self test to fail, in order to check that @@ -196,7 +317,9 @@ L, L, L, L, -L +L, +L, +L =head1 HISTORY diff --git a/doc/man7/OSSL_PROVIDER-default.pod b/doc/man7/OSSL_PROVIDER-default.pod new file mode 100644 index 0000000000..acfd4d0e07 --- /dev/null +++ b/doc/man7/OSSL_PROVIDER-default.pod @@ -0,0 +1,226 @@ +=pod + +=head1 NAME + +OSSL_PROVIDER-default - OpenSSL default provider + +=head1 DESCRIPTION + +The OpenSSL default provider supplies the majority of OpenSSL's diverse +algorithm implementations. It also acts as a fallback when no other +provider has been loaded. + +=head2 Properties + +The implementations in this provider specifically have this property +defined: + +=over 4 + +"provider=default" + +=back + +It may be used in a property query string with fetching functions such as +L or L, as well as with other +functions that take a property query string, such as +L. + +It isn't mandatory to query for this property, except to make sure to get +implementations of this provider and none other. + +Some implementations may define additional properties. Exact information is +listed below + +=head1 OPERATIONS AND ALGORITHMS + +The OpenSSL default provider supports these operations and algorithms: + +=head2 Hashing Algorithms / Message Digests + +=over 4 + +=item SHA1, see L + +=item SHA2, see L + +=item SHA3, see L + +=item KECCAK-KMAC, see L + +=item SHAKE, see L + +=item BLAKE2, see L + +=item SM3, see L + +=item MD5, see L + +=item MD5-SHA1, see L + +=back + +=head2 Symmetric Ciphers + +=over 4 + +=item AES, see L + +=item ARIA, see L + +=item CAMELLIA, see L + +=item DES, see L + +=item BF, see L + +=item IDEA, see L + +=item CAST5, see L + +=item SEED, see L + +=item SM4, see L + +=item RC2, see L + +=item RC4, see L + +=item RC5, see L + +=item ChaCha20, see L + +=item ChaCha20-Poly1305, see L + +=back + +=head2 Message Authentication Code (MAC) + +=over 4 + +=item BLAKE2, see L + +=item CMAC, see L + +=item GMAC, see L + +=item HMAC, see L + +=item KMAC, see L + +=item SIPHASH, see L + +=item POLY1305, see L + +=back + +=head2 Key Derivation Function (KDF) + +=over 4 + +=item HKDF, see L + +=item SSKDF, see L + +=item PBKDF2, see L + +=item SSHKDF, see L + +=item TLS1-PRF, see L + +=item KBKDF, see L + +=item X942KDF, see L + +=item SCRYPT, see L + +=item KRB5KDF, see L + +=back + +=head2 Key Exchange + +=over 4 + +=item DH, see L + +=item ECDH, see L + +=item X25519, see L + +=item X448, see L + +=back + +=head2 Asymmetric Signature + +=over 4 + +=item DSA, see L + +=item RSA, see L + +=back + +=head2 Asymmetric Cipher + +=over 4 + +=item RSA, see L + +=back + +=head2 Asymmetric Key Management + +=over 4 + +=item DH, see L + +=item DSA, see L + +=item RSA, see L + +=item EC, see L + +=item X25519, see L + +=item X448, see L + +=back + +=head2 Asymmetric Key Serializer + +In addition to "provider=default", this set of implementations define the +property "fips=yes", to allow them to be used together with the FIPS +provider. + +=over 4 + +=item RSA, see L + +=item DH, see L + +=item DSA, see L + +=item EC, see L + +=item X25519, see L + +=item X448, see L + +=back + +=head1 SEE ALSO + +L, L, L + +=head1 COPYRIGHT + +Copyright 2020 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the Apache License 2.0 (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +L. + +=cut diff --git a/doc/man7/OSSL_PROVIDER-legacy.pod b/doc/man7/OSSL_PROVIDER-legacy.pod new file mode 100644 index 0000000000..27ed3080bf --- /dev/null +++ b/doc/man7/OSSL_PROVIDER-legacy.pod @@ -0,0 +1,92 @@ +=pod + +=head1 NAME + +OSSL_PROVIDER-legacy - OpenSSL legacy provider + +=head1 DESCRIPTION + +The OpenSSL legacy provider supplies OpenSSL implementations of algorithms +that have been deemed legacy. Such algorithms have commonly fallen out of +use, have been deemed insecure by the cryptography community, or something +similar. + +We can consider this the retirement home of cryptographic algorithms. + +=head2 Properties + +The implementations in this provider specifically have these property +defined: + +=over 4 + +"provider=legacy" + +=back + +It may be used in a property query string with fetching functions such as +L or L, as well as with other +functions that take a property query string, such as +L. + +It isn't mandatory to query for any of these properties, except to +make sure to get implementations of this provider and none other. + +=head1 OPERATIONS AND ALGORITHMS + +The OpenSSL legacy provider supports these operations and algorithms: + +=head2 Hashing Algorithms / Message Digests + +=over 4 + +=item MD2, see L + +=item MD4, see L + +=item MDC2, see L + +=item WHIRLPOOL, see L + +=item RIPEMD160, see L + +=back + +=begin comment + +When algorithms for other operations start appearing, the +following =head2 titles are appropriate to use: + +- Symmetric Ciphers + +- Message Authentication Code (MAC) + +- Key Derivation Function (KDF) + +- Key Exchange + +- Signature + +- Asymmetric Cipher + +- Asymmetric Key Management + +=end comment + +=head1 SEE ALSO + +L, +L, +L, +L + +=head1 COPYRIGHT + +Copyright 2020 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the Apache License 2.0 (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +L. + +=cut diff --git a/doc/man7/provider-digest.pod b/doc/man7/provider-digest.pod index 576ea581b4..1cac58b4bb 100644 --- a/doc/man7/provider-digest.pod +++ b/doc/man7/provider-digest.pod @@ -227,44 +227,6 @@ values associated with the give provider side digest context I and stores them in I. See L for further details on the parameters structure. -Parameters currently recognised by built-in digests are as follows. Not all -parameters are relevant to, or are understood by all digests: - -=over 4 - -=item "xoflen" (B) - -Sets the digest length for extendable output functions. -The length of the "xoflen" parameter should not exceed that of a B. - -=item "ssl3-ms" (B) - -This parameter is set by libssl in order to calculate a signature hash for an -SSLv3 CertificateVerify message as per RFC6101. -It is only set after all handshake messages have already been digested via -OP_digest_update() calls. -The parameter provides the master secret value to be added to the digest. -The digest implementation should calculate the complete digest as per RFC6101 -section 5.6.8. -The next call after setting this parameter will be OP_digest_final(). -This is only relevant for implementations of SHA1 or MD5_SHA1. - -=item "pad_type" (B) - -Sets the pad type to be used. -The only built-in digest that uses this is MDC2. -Normally the final MDC2 block is padded with 0s. -If the pad type is set to 2 then the final block is padded with 0x80 followed by -0s. - -=item "micalg" (B) - -Gets the digest Message Integrity Check algorithm string. -This is used when creating S/MIME multipart/signed messages, as specified in -RFC 5751. - -=back - =head1 RETURN VALUES OP_digest_newctx() and OP_digest_dupctx() should return the newly created @@ -281,7 +243,8 @@ algorithm. =head1 SEE ALSO -L +L, L, L, +L =head1 HISTORY diff --git a/providers/implementations/digests/sha3_prov.c b/providers/implementations/digests/sha3_prov.c index 44471959a7..e6b9ba7a3d 100644 --- a/providers/implementations/digests/sha3_prov.c +++ b/providers/implementations/digests/sha3_prov.c @@ -247,7 +247,7 @@ static void *keccak_dupctx(void *ctx) } static const OSSL_PARAM known_shake_settable_ctx_params[] = { - {OSSL_DIGEST_PARAM_SSL3_MS, OSSL_PARAM_OCTET_STRING, NULL, 0, 0}, + {OSSL_DIGEST_PARAM_XOFLEN, OSSL_PARAM_UNSIGNED_INTEGER, NULL, 0, 0}, OSSL_PARAM_END }; static const OSSL_PARAM *shake_settable_ctx_params(void) diff --git a/util/missingcrypto.txt b/util/missingcrypto.txt index 99c2883bd0..956ce7ce6e 100644 --- a/util/missingcrypto.txt +++ b/util/missingcrypto.txt @@ -572,6 +572,39 @@ ENGINE_setup_bsd_cryptodev(3) ENGINE_unregister_EC(3) ENGINE_unregister_pkey_asn1_meths(3) ENGINE_unregister_pkey_meths(3) +EVP_ASYM_CIPHER-RSA(7) +EVP_CIPHER-AES(7) +EVP_CIPHER-ARIA(7) +EVP_CIPHER-BF(7) +EVP_CIPHER-DES(7) +EVP_CIPHER-CAMELLIA(7) +EVP_CIPHER-CAST5(7) +EVP_CIPHER-ChaCha20(7) +EVP_CIPHER-ChaCha20-Poly1305(7) +EVP_CIPHER-DES(7) +EVP_CIPHER-IDEA(7) +EVP_CIPHER-RC2(7) +EVP_CIPHER-RC4(7) +EVP_CIPHER-RC5(7) +EVP_CIPHER-SEED(7) +EVP_CIPHER-SM4(7) +EVP_KDF-KBKDF(7) +EVP_KDF-SSKDF(7) +EVP_KDF-TLS1-PRF(7) +EVP_KEYEXCH-DH(7) +EVP_KEYEXCH-ECDH(7) +EVP_KEYEXCH-DSA(7) +EVP_KEYEXCH-RSA(7) +EVP_KEYEXCH-X25519(7) +EVP_KEYEXCH-X448(7) +EVP_KEYMGMT-DH(7) +EVP_KEYMGMT-EC(7) +EVP_KEYMGMT-DSA(7) +EVP_KEYMGMT-RSA(7) +EVP_KEYMGMT-X25519(7) +EVP_KEYMGMT-X448(7) +EVP_SIGNATURE-DSA(7) +EVP_SIGNATURE-RSA(7) ERR_clear_last_mark(3) ERR_get_state(3) ERR_load_ASN1_strings(3) @@ -886,6 +919,12 @@ OSSL_CMP_MSG_http_perform(3) OSSL_CMP_exec_GENM_ses(3) OSSL_CMP_exec_IR_ses(3) OSSL_CMP_exec_KUR_ses(3) +OSSL_SERIALIZER-DH(7) +OSSL_SERIALIZER-DSA(7) +OSSL_SERIALIZER-EC(7) +OSSL_SERIALIZER-RSA(7) +OSSL_SERIALIZER-X25519(7) +OSSL_SERIALIZER-X448(7) OSSL_STORE_do_all_loaders(3) OSSL_STORE_vctrl(3) OTHERNAME_cmp(3) From builds at travis-ci.org Tue Mar 10 13:25:31 2020 From: builds at travis-ci.org (Travis CI) Date: Tue, 10 Mar 2020 13:25:31 +0000 Subject: Still Failing: openssl/openssl#33010 (master - 041a96e) In-Reply-To: Message-ID: <5e67954b57b0d_43f9b55992cf0208348@a9519123-fb1b-4e50-8d77-0b76fbc34ef7.mail> Build Update for openssl/openssl ------------------------------------- Build: #33010 Status: Still Failing Duration: 49 mins and 19 secs Commit: 041a96e (master) Author: Richard Levitte Message: DOCS: Clean up doc/man3/EVP_DigestInit.pod We touch it, we clean it up! Accordding to common man-pages(7) guidelines. Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/11270) View the changeset: https://github.com/openssl/openssl/compare/99a16e0459e5...041a96e7acc8 View the full build log and details: https://travis-ci.org/openssl/openssl/builds/660602571?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the openssl/openssl repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=5849220&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Tue Mar 10 14:38:21 2020 From: no-reply at appveyor.com (AppVeyor) Date: Tue, 10 Mar 2020 14:38:21 +0000 Subject: Build failed: openssl master.32445 Message-ID: <20200310143821.1.19DB1D2BEE7541E6@appveyor.com> An HTML attachment was scrubbed... URL: From dev at ddvo.net Tue Mar 10 15:13:59 2020 From: dev at ddvo.net (dev at ddvo.net) Date: Tue, 10 Mar 2020 15:13:59 +0000 Subject: [openssl] master update Message-ID: <1583853239.251657.1379.nullmailer@dev.openssl.org> The branch master has been updated via 44387c9000197b219e7673d5522517a1a6499af8 (commit) via cfca56dfaee0518c2cd99a9c5cda29ad557380e1 (commit) via 7269071e5eb54683353a1d2f8831a4ed03485b86 (commit) via 62dcd2aa17b27b7892ad62540f9034c9192f6530 (commit) via da42c2a3d752628e15b47aa7511e7044745080cb (commit) via b5adba204244563346d4acefb06723629e6d8f11 (commit) via 4c7f8981e8b9919529707be03015601a29ed7a08 (commit) from 041a96e7acc89685228980b5615a53bee7f07b0f (commit) - Log ----------------------------------------------------------------- commit 44387c9000197b219e7673d5522517a1a6499af8 Author: Dr. David von Oheimb Date: Thu Mar 5 09:16:29 2020 +0100 Move OSSL_CMP_X509_digest() to x_all.c, renaming it to X509_digest_sig() Reviewed-by: Matt Caswell Reviewed-by: David von Oheimb (Merged from https://github.com/openssl/openssl/pull/11142) commit cfca56dfaee0518c2cd99a9c5cda29ad557380e1 Author: Dr. David von Oheimb Date: Wed Feb 26 21:41:47 2020 +0100 Fix handling of CMP msg senderKID and improve doc of related CTX functions Reviewed-by: Matt Caswell Reviewed-by: David von Oheimb (Merged from https://github.com/openssl/openssl/pull/11142) commit 7269071e5eb54683353a1d2f8831a4ed03485b86 Author: Dr. David von Oheimb Date: Tue Feb 25 08:58:39 2020 +0100 Fix error in case CMP msg POPO is not provided in OSSL_CRMF_MSGS_verify_popo() Reviewed-by: Matt Caswell Reviewed-by: David von Oheimb (Merged from https://github.com/openssl/openssl/pull/11142) commit 62dcd2aa17b27b7892ad62540f9034c9192f6530 Author: Dr. David von Oheimb Date: Tue Mar 10 10:29:46 2020 +0100 Chunk 8 of CMP contribution to OpenSSL: CMP server and cmp_mock_srv.c for testing Certificate Management Protocol (CMP, RFC 4210) extension to OpenSSL Also includes CRMF (RFC 4211) and HTTP transfer (RFC 6712). Adds the CMP and CRMF API to libcrypto and the "cmp" app to the CLI. Adds extensive documentation and tests. Reviewed-by: Matt Caswell Reviewed-by: David von Oheimb (Merged from https://github.com/openssl/openssl/pull/11142) commit da42c2a3d752628e15b47aa7511e7044745080cb Author: Dr. David von Oheimb Date: Thu Mar 5 08:43:06 2020 +0100 Extract sk_ASN1_UTF8STRING2text() from ts_get_status_text() in ts_rsp_verify.c to asn1_lib.c Reviewed-by: Matt Caswell Reviewed-by: David von Oheimb (Merged from https://github.com/openssl/openssl/pull/11142) commit b5adba204244563346d4acefb06723629e6d8f11 Author: Dr. David von Oheimb Date: Tue Mar 10 10:40:43 2020 +0100 fix coding style nits w.r.t. 'defined' in http_local.h, http.h, and ocsp.h Reviewed-by: Matt Caswell Reviewed-by: David von Oheimb (Merged from https://github.com/openssl/openssl/pull/11142) commit 4c7f8981e8b9919529707be03015601a29ed7a08 Author: Dr. David von Oheimb Date: Tue Mar 10 10:39:22 2020 +0100 fix two mistakes w.r.t. ERR_LIB_* parameters in ERR_add_error_txt() Reviewed-by: Matt Caswell Reviewed-by: David von Oheimb (Merged from https://github.com/openssl/openssl/pull/11142) ----------------------------------------------------------------------- Summary of changes: apps/build.info | 3 + apps/cmp_mock_srv.c | 406 ++++++++++++++ apps/cmp_mock_srv.h | 34 ++ crypto/asn1/asn1_lib.c | 97 +++- crypto/cmp/build.info | 3 +- crypto/cmp/cmp_err.c | 13 +- crypto/cmp/cmp_hdr.c | 64 +-- crypto/cmp/cmp_local.h | 65 +-- crypto/cmp/cmp_msg.c | 131 +++-- crypto/cmp/cmp_protect.c | 15 +- crypto/cmp/cmp_server.c | 615 +++++++++++++++++++++ crypto/cmp/cmp_status.c | 98 ++-- crypto/cmp/cmp_util.c | 20 + crypto/crmf/crmf_err.c | 13 +- crypto/crmf/crmf_lib.c | 80 +-- crypto/err/err_prn.c | 4 +- crypto/err/openssl.txt | 12 +- crypto/http/http_local.h | 2 +- crypto/ts/ts_rsp_verify.c | 29 +- crypto/x509/x_all.c | 29 + doc/internal/man3/ossl_cmp_hdr_init.pod | 13 +- doc/internal/man3/ossl_cmp_mock_srv_new.pod | 85 +++ ...sinfo_new.pod => ossl_cmp_pkisi_get_status.pod} | 53 +- doc/man3/OSSL_CMP_CTX_new.pod | 85 +-- doc/man3/OSSL_CMP_CTX_snprint_PKIStatus.pod | 46 -- doc/man3/OSSL_CMP_MSG_get0_header.pod | 17 +- doc/man3/OSSL_CMP_SRV_CTX_new.pod | 159 ++++++ doc/man3/OSSL_CMP_STATUSINFO_new.pod | 66 +++ doc/man3/X509_digest.pod | 17 +- doc/man3/X509_dup.pod | 4 + doc/man3/d2i_X509.pod | 2 + include/internal/cryptlib.h | 3 + include/openssl/cmp.h | 71 ++- include/openssl/cmp_util.h | 4 +- include/openssl/cmperr.h | 14 +- include/openssl/crmf.h | 17 +- include/openssl/crmferr.h | 14 +- include/openssl/http.h | 2 +- include/openssl/ocsp.h | 2 +- include/openssl/x509.h | 1 + test/build.info | 9 +- test/cmp_ctx_test.c | 1 + test/cmp_hdr_test.c | 17 +- test/cmp_msg_test.c | 10 +- test/cmp_protect_test.c | 35 +- test/cmp_server_test.c | 160 ++++++ test/cmp_status_test.c | 16 +- test/cmp_vfy_test.c | 10 +- test/recipes/65-test_cmp_server.t | 26 + .../CR_protected_PBM_1234.der | Bin 0 -> 420 bytes util/libcrypto.num | 24 + util/other.syms | 6 + 52 files changed, 2257 insertions(+), 465 deletions(-) create mode 100644 apps/cmp_mock_srv.c create mode 100644 apps/cmp_mock_srv.h create mode 100644 crypto/cmp/cmp_server.c create mode 100644 doc/internal/man3/ossl_cmp_mock_srv_new.pod rename doc/internal/man3/{ossl_cmp_statusinfo_new.pod => ossl_cmp_pkisi_get_status.pod} (58%) delete mode 100644 doc/man3/OSSL_CMP_CTX_snprint_PKIStatus.pod create mode 100644 doc/man3/OSSL_CMP_SRV_CTX_new.pod create mode 100644 doc/man3/OSSL_CMP_STATUSINFO_new.pod create mode 100644 test/cmp_server_test.c create mode 100644 test/recipes/65-test_cmp_server.t create mode 100644 test/recipes/65-test_cmp_server_data/CR_protected_PBM_1234.der diff --git a/apps/build.info b/apps/build.info index 495e56065e..2186de3a27 100644 --- a/apps/build.info +++ b/apps/build.info @@ -23,6 +23,9 @@ IF[{- !$disabled{'deprecated-3.0'} -}] $OPENSSLSRC=$OPENSSLSRC \ dhparam.c dsa.c dsaparam.c gendsa.c rsa.c rsautl.c genrsa.c ENDIF +IF[{- !$disabled{'cmp'} -}] + $OPENSSLSRC=$OPENSSLSRC cmp_mock_srv.c +ENDIF IF[{- !$disabled{apps} -}] PROGRAMS=openssl diff --git a/apps/cmp_mock_srv.c b/apps/cmp_mock_srv.c new file mode 100644 index 0000000000..2e02104884 --- /dev/null +++ b/apps/cmp_mock_srv.c @@ -0,0 +1,406 @@ +/* + * Copyright 2018-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright Siemens AG 2018-2020 + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or atf + * https://www.openssl.org/source/license.html + */ + +#include "apps.h" +#include "cmp_mock_srv.h" + +#include +#include +#include + +/* the context for the CMP mock server */ +typedef struct +{ + X509 *certOut; /* certificate to be returned in cp/ip/kup msg */ + STACK_OF(X509) *chainOut; /* chain of certOut to add to extraCerts field */ + STACK_OF(X509) *caPubsOut; /* certs to return in caPubs field of ip msg */ + OSSL_CMP_PKISI *statusOut; /* status for ip/cp/kup/rp msg unless polling */ + int sendError; /* send error response also on valid requests */ + OSSL_CMP_MSG *certReq; /* ir/cr/p10cr/kur remembered while polling */ + int certReqId; /* id of last ir/cr/kur, used for polling */ + int pollCount; /* number of polls before actual cert response */ + int checkAfterTime; /* time the client should wait between polling */ +} mock_srv_ctx; + + +static void mock_srv_ctx_free(mock_srv_ctx *ctx) +{ + if (ctx == NULL) + return; + + OSSL_CMP_PKISI_free(ctx->statusOut); + X509_free(ctx->certOut); + sk_X509_pop_free(ctx->chainOut, X509_free); + sk_X509_pop_free(ctx->caPubsOut, X509_free); + OSSL_CMP_MSG_free(ctx->certReq); + OPENSSL_free(ctx); +} + +static mock_srv_ctx *mock_srv_ctx_new(void) +{ + mock_srv_ctx *ctx = OPENSSL_zalloc(sizeof(mock_srv_ctx)); + + if (ctx == NULL) + goto err; + + if ((ctx->statusOut = OSSL_CMP_PKISI_new()) == NULL) + goto err; + + ctx->certReqId = -1; + + /* all other elements are initialized to 0 or NULL, respectively */ + return ctx; + err: + mock_srv_ctx_free(ctx); + return NULL; +} + +int ossl_cmp_mock_srv_set1_certOut(OSSL_CMP_SRV_CTX *srv_ctx, X509 *cert) +{ + mock_srv_ctx *ctx = OSSL_CMP_SRV_CTX_get0_custom_ctx(srv_ctx); + + if (ctx == NULL) { + CMPerr(0, CMP_R_NULL_ARGUMENT); + return 0; + } + if (cert == NULL || X509_up_ref(cert)) { + X509_free(ctx->certOut); + ctx->certOut = cert; + return 1; + } + return 0; +} + +int ossl_cmp_mock_srv_set1_chainOut(OSSL_CMP_SRV_CTX *srv_ctx, + STACK_OF(X509) *chain) +{ + mock_srv_ctx *ctx = OSSL_CMP_SRV_CTX_get0_custom_ctx(srv_ctx); + STACK_OF(X509) *chain_copy = NULL; + + if (ctx == NULL) { + CMPerr(0, CMP_R_NULL_ARGUMENT); + return 0; + } + if (chain != NULL && (chain_copy = X509_chain_up_ref(chain)) == NULL) + return 0; + sk_X509_pop_free(ctx->chainOut, X509_free); + ctx->chainOut = chain_copy; + return 1; +} + +int ossl_cmp_mock_srv_set1_caPubsOut(OSSL_CMP_SRV_CTX *srv_ctx, + STACK_OF(X509) *caPubs) +{ + mock_srv_ctx *ctx = OSSL_CMP_SRV_CTX_get0_custom_ctx(srv_ctx); + STACK_OF(X509) *caPubs_copy = NULL; + + if (ctx == NULL) { + CMPerr(0, CMP_R_NULL_ARGUMENT); + return 0; + } + if (caPubs != NULL && (caPubs_copy = X509_chain_up_ref(caPubs)) == NULL) + return 0; + sk_X509_pop_free(ctx->caPubsOut, X509_free); + ctx->caPubsOut = caPubs_copy; + return 1; +} + +int ossl_cmp_mock_srv_set_statusInfo(OSSL_CMP_SRV_CTX *srv_ctx, int status, + int fail_info, const char *text) +{ + mock_srv_ctx *ctx = OSSL_CMP_SRV_CTX_get0_custom_ctx(srv_ctx); + OSSL_CMP_PKISI *si; + + if (ctx == NULL) { + CMPerr(0, CMP_R_NULL_ARGUMENT); + return 0; + } + if ((si = OSSL_CMP_STATUSINFO_new(status, fail_info, text)) == NULL) + return 0; + OSSL_CMP_PKISI_free(ctx->statusOut); + ctx->statusOut = si; + return 1; +} + +int ossl_cmp_mock_srv_set_send_error(OSSL_CMP_SRV_CTX *srv_ctx, int val) +{ + mock_srv_ctx *ctx = OSSL_CMP_SRV_CTX_get0_custom_ctx(srv_ctx); + + if (ctx == NULL) { + CMPerr(0, CMP_R_NULL_ARGUMENT); + return 0; + } + ctx->sendError = val != 0; + return 1; +} + +int ossl_cmp_mock_srv_set_pollCount(OSSL_CMP_SRV_CTX *srv_ctx, int count) +{ + mock_srv_ctx *ctx = OSSL_CMP_SRV_CTX_get0_custom_ctx(srv_ctx); + + if (ctx == NULL) { + CMPerr(0, CMP_R_NULL_ARGUMENT); + return 0; + } + if (count < 0) { + CMPerr(0, CMP_R_INVALID_ARGS); + return 0; + } + ctx->pollCount = count; + return 1; +} + +int ossl_cmp_mock_srv_set_checkAfterTime(OSSL_CMP_SRV_CTX *srv_ctx, int sec) +{ + mock_srv_ctx *ctx = OSSL_CMP_SRV_CTX_get0_custom_ctx(srv_ctx); + + if (ctx == NULL) { + CMPerr(0, CMP_R_NULL_ARGUMENT); + return 0; + } + ctx->checkAfterTime = sec; + return 1; +} + +static OSSL_CMP_PKISI *process_cert_request(OSSL_CMP_SRV_CTX *srv_ctx, + const OSSL_CMP_MSG *cert_req, + int certReqId, + const OSSL_CRMF_MSG *crm, + const X509_REQ *p10cr, + X509 **certOut, + STACK_OF(X509) **chainOut, + STACK_OF(X509) **caPubs) +{ + mock_srv_ctx *ctx = OSSL_CMP_SRV_CTX_get0_custom_ctx(srv_ctx); + OSSL_CMP_PKISI *si = NULL; + + if (ctx == NULL || cert_req == NULL + || certOut == NULL || chainOut == NULL || caPubs == NULL) { + CMPerr(0, CMP_R_NULL_ARGUMENT); + return NULL; + } + if (ctx->sendError) { + CMPerr(0, CMP_R_ERROR_PROCESSING_MSG); + return NULL; + } + + *certOut = NULL; + *chainOut = NULL; + *caPubs = NULL; + ctx->certReqId = certReqId; + if (ctx->pollCount > 0) { + ctx->pollCount--; + OSSL_CMP_MSG_free(ctx->certReq); + if ((ctx->certReq = OSSL_CMP_MSG_dup(cert_req)) == NULL) + return NULL; + return OSSL_CMP_STATUSINFO_new(OSSL_CMP_PKISTATUS_waiting, 0, NULL); + } + if (ctx->certOut != NULL + && (*certOut = X509_dup(ctx->certOut)) == NULL) + goto err; + if (ctx->chainOut != NULL + && (*chainOut = X509_chain_up_ref(ctx->chainOut)) == NULL) + goto err; + if (ctx->caPubsOut != NULL + && (*caPubs = X509_chain_up_ref(ctx->caPubsOut)) == NULL) + goto err; + if (ctx->statusOut != NULL + && (si = OSSL_CMP_PKISI_dup(ctx->statusOut)) == NULL) + goto err; + return si; + + err: + X509_free(*certOut); + *certOut = NULL; + sk_X509_pop_free(*chainOut, X509_free); + *chainOut = NULL; + sk_X509_pop_free(*caPubs, X509_free); + *caPubs = NULL; + return NULL; +} + +static OSSL_CMP_PKISI *process_rr(OSSL_CMP_SRV_CTX *srv_ctx, + const OSSL_CMP_MSG *rr, + const X509_NAME *issuer, + const ASN1_INTEGER *serial) +{ + mock_srv_ctx *ctx = OSSL_CMP_SRV_CTX_get0_custom_ctx(srv_ctx); + + if (ctx == NULL || rr == NULL || issuer == NULL || serial == NULL) { + CMPerr(0, CMP_R_NULL_ARGUMENT); + return NULL; + } + if (ctx->sendError || ctx->certOut == NULL) { + CMPerr(0, CMP_R_ERROR_PROCESSING_MSG); + return NULL; + } + + /* accept revocation only for the certificate we sent in ir/cr/kur */ + if (X509_NAME_cmp(issuer, X509_get_issuer_name(ctx->certOut)) != 0 + || ASN1_INTEGER_cmp(serial, + X509_get0_serialNumber(ctx->certOut)) != 0) { + CMPerr(0, CMP_R_REQUEST_NOT_ACCEPTED); + return NULL; + } + return OSSL_CMP_PKISI_dup(ctx->statusOut); +} + +static int process_genm(OSSL_CMP_SRV_CTX *srv_ctx, + const OSSL_CMP_MSG *genm, + const STACK_OF(OSSL_CMP_ITAV) *in, + STACK_OF(OSSL_CMP_ITAV) **out) +{ + mock_srv_ctx *ctx = OSSL_CMP_SRV_CTX_get0_custom_ctx(srv_ctx); + + if (ctx == NULL || genm == NULL || in == NULL || out == NULL) { + CMPerr(0, CMP_R_NULL_ARGUMENT); + return 0; + } + if (ctx->sendError) { + CMPerr(0, CMP_R_ERROR_PROCESSING_MSG); + return 0; + } + + *out = sk_OSSL_CMP_ITAV_deep_copy(in, OSSL_CMP_ITAV_dup, + OSSL_CMP_ITAV_free); + return *out != NULL; +} + +static void process_error(OSSL_CMP_SRV_CTX *srv_ctx, const OSSL_CMP_MSG *error, + const OSSL_CMP_PKISI *statusInfo, + const ASN1_INTEGER *errorCode, + const OSSL_CMP_PKIFREETEXT *errorDetails) +{ + mock_srv_ctx *ctx = OSSL_CMP_SRV_CTX_get0_custom_ctx(srv_ctx); + char buf[OSSL_CMP_PKISI_BUFLEN]; + char *sibuf; + int i; + + if (ctx == NULL || error == NULL) { + CMPerr(0, CMP_R_NULL_ARGUMENT); + return; + } + + BIO_printf(bio_err, "mock server received error:\n"); + + if (statusInfo == NULL) { + BIO_printf(bio_err, "pkiStatusInfo absent\n"); + } else { + sibuf = OSSL_CMP_snprint_PKIStatusInfo(statusInfo, buf, sizeof(buf)); + BIO_printf(bio_err, "pkiStatusInfo: %s\n", + sibuf != NULL ? sibuf: ""); + } + + if (errorCode == NULL) + BIO_printf(bio_err, "errorCode absent\n"); + else + BIO_printf(bio_err, "errorCode: %ld\n", ASN1_INTEGER_get(errorCode)); + + if (sk_ASN1_UTF8STRING_num(errorDetails) <= 0) { + BIO_printf(bio_err, "errorDetails absent\n"); + } else { + BIO_printf(bio_err, "errorDetails: "); + for (i = 0; i < sk_ASN1_UTF8STRING_num(errorDetails); i++) { + if (i > 0) + BIO_printf(bio_err, ", "); + BIO_printf(bio_err, "\""); + ASN1_STRING_print(bio_err, + sk_ASN1_UTF8STRING_value(errorDetails, i)); + BIO_printf(bio_err, "\""); + } + BIO_printf(bio_err, "\n"); + } +} + +static int process_certConf(OSSL_CMP_SRV_CTX *srv_ctx, + const OSSL_CMP_MSG *certConf, int certReqId, + const ASN1_OCTET_STRING *certHash, + const OSSL_CMP_PKISI *si) +{ + mock_srv_ctx *ctx = OSSL_CMP_SRV_CTX_get0_custom_ctx(srv_ctx); + ASN1_OCTET_STRING *digest; + + if (ctx == NULL || certConf == NULL || certHash == NULL) { + CMPerr(0, CMP_R_NULL_ARGUMENT); + return 0; + } + if (ctx->sendError || ctx->certOut == NULL) { + CMPerr(0, CMP_R_ERROR_PROCESSING_MSG); + return 0; + } + + if (certReqId != ctx->certReqId) { + /* in case of error, invalid reqId -1 */ + CMPerr(0, CMP_R_BAD_REQUEST_ID); + return 0; + } + + if ((digest = X509_digest_sig(ctx->certOut)) == NULL) + return 0; + if (ASN1_OCTET_STRING_cmp(certHash, digest) != 0) { + ASN1_OCTET_STRING_free(digest); + CMPerr(0, CMP_R_CERTHASH_UNMATCHED); + return 0; + } + ASN1_OCTET_STRING_free(digest); + return 1; +} + +static int process_pollReq(OSSL_CMP_SRV_CTX *srv_ctx, + const OSSL_CMP_MSG *pollReq, int certReqId, + OSSL_CMP_MSG **certReq, int64_t *check_after) +{ + mock_srv_ctx *ctx = OSSL_CMP_SRV_CTX_get0_custom_ctx(srv_ctx); + + if (ctx == NULL || pollReq == NULL + || certReq == NULL || check_after == NULL) { + CMPerr(0, CMP_R_NULL_ARGUMENT); + return 0; + } + if (ctx->sendError || ctx->certReq == NULL) { + *certReq = NULL; + CMPerr(0, CMP_R_ERROR_PROCESSING_MSG); + return 0; + } + + if (ctx->pollCount == 0) { + *certReq = ctx->certReq; + ctx->certReq = NULL; + *check_after = 0; + } else { + ctx->pollCount--; + *certReq = NULL; + *check_after = ctx->checkAfterTime; + } + return 1; +} + +OSSL_CMP_SRV_CTX *ossl_cmp_mock_srv_new(void) +{ + OSSL_CMP_SRV_CTX *srv_ctx = OSSL_CMP_SRV_CTX_new(); + mock_srv_ctx *ctx = mock_srv_ctx_new(); + + if (srv_ctx != NULL && ctx != NULL + && OSSL_CMP_SRV_CTX_init(srv_ctx, ctx, process_cert_request, + process_rr, process_genm, process_error, + process_certConf, process_pollReq)) + return srv_ctx; + + mock_srv_ctx_free(ctx); + OSSL_CMP_SRV_CTX_free(srv_ctx); + return NULL; +} + +void ossl_cmp_mock_srv_free(OSSL_CMP_SRV_CTX *srv_ctx) +{ + if (srv_ctx != NULL) + mock_srv_ctx_free(OSSL_CMP_SRV_CTX_get0_custom_ctx(srv_ctx)); + OSSL_CMP_SRV_CTX_free(srv_ctx); +} diff --git a/apps/cmp_mock_srv.h b/apps/cmp_mock_srv.h new file mode 100644 index 0000000000..bddc44df5b --- /dev/null +++ b/apps/cmp_mock_srv.h @@ -0,0 +1,34 @@ +/* + * Copyright 2018-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright Siemens AG 2018-2020 + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OSSL_APPS_CMP_MOCK_SRV_H +# define OSSL_APPS_CMP_MOCK_SRV_H + +# include +# ifndef OPENSSL_NO_CMP + +# include + +OSSL_CMP_SRV_CTX *ossl_cmp_mock_srv_new(void); +void ossl_cmp_mock_srv_free(OSSL_CMP_SRV_CTX *srv_ctx); + +int ossl_cmp_mock_srv_set1_certOut(OSSL_CMP_SRV_CTX *srv_ctx, X509 *cert); +int ossl_cmp_mock_srv_set1_chainOut(OSSL_CMP_SRV_CTX *srv_ctx, + STACK_OF(X509) *chain); +int ossl_cmp_mock_srv_set1_caPubsOut(OSSL_CMP_SRV_CTX *srv_ctx, + STACK_OF(X509) *caPubs); +int ossl_cmp_mock_srv_set_statusInfo(OSSL_CMP_SRV_CTX *srv_ctx, int status, + int fail_info, const char *text); +int ossl_cmp_mock_srv_set_send_error(OSSL_CMP_SRV_CTX *srv_ctx, int val); +int ossl_cmp_mock_srv_set_pollCount(OSSL_CMP_SRV_CTX *srv_ctx, int count); +int ossl_cmp_mock_srv_set_checkAfterTime(OSSL_CMP_SRV_CTX *srv_ctx, int sec); + +# endif /* !defined(OPENSSL_NO_CMP) */ +#endif /* !defined(OSSL_APPS_CMP_MOCK_SRV_H) */ diff --git a/crypto/asn1/asn1_lib.c b/crypto/asn1/asn1_lib.c index 52eb16ba9c..765bbda5c7 100644 --- a/crypto/asn1/asn1_lib.c +++ b/crypto/asn1/asn1_lib.c @@ -22,11 +22,13 @@ static int _asn1_check_infinite_end(const unsigned char **p, long len) /* * If there is 0 or 1 byte left, the length check should pick things up */ - if (len <= 0) - return 1; - else if ((len >= 2) && ((*p)[0] == 0) && ((*p)[1] == 0)) { - (*p) += 2; + if (len <= 0) { return 1; + } else { + if ((len >= 2) && ((*p)[0] == 0) && ((*p)[1] == 0)) { + (*p) += 2; + return 1; + } } return 0; } @@ -45,7 +47,7 @@ int ASN1_get_object(const unsigned char **pp, long *plength, int *ptag, int *pclass, long omax) { int i, ret; - long l; + long len; const unsigned char *p = *pp; int tag, xclass, inf; long max = omax; @@ -59,18 +61,18 @@ int ASN1_get_object(const unsigned char **pp, long *plength, int *ptag, p++; if (--max == 0) goto err; - l = 0; + len = 0; while (*p & 0x80) { - l <<= 7L; - l |= *(p++) & 0x7f; + len <<= 7L; + len |= *(p++) & 0x7f; if (--max == 0) goto err; - if (l > (INT_MAX >> 7L)) + if (len > (INT_MAX >> 7L)) goto err; } - l <<= 7L; - l |= *(p++) & 0x7f; - tag = (int)l; + len <<= 7L; + len |= *(p++) & 0x7f; + tag = (int)len; if (--max == 0) goto err; } else { @@ -141,8 +143,9 @@ static int asn1_get_length(const unsigned char **pp, int *inf, long *rl, } if (ret > LONG_MAX) return 0; - } else + } else { ret = i; + } } *pp = p; *rl = (long)ret; @@ -160,9 +163,9 @@ void ASN1_put_object(unsigned char **pp, int constructed, int length, int tag, i = (constructed) ? V_ASN1_CONSTRUCTED : 0; i |= (xclass & V_ASN1_PRIVATE); - if (tag < 31) + if (tag < 31) { *(p++) = i | (tag & V_ASN1_PRIMITIVE_TAG); - else { + } else { *(p++) = i | V_ASN1_PRIMITIVE_TAG; for (i = 0, ttag = tag; ttag > 0; i++) ttag >>= 7; @@ -185,6 +188,7 @@ void ASN1_put_object(unsigned char **pp, int constructed, int length, int tag, int ASN1_put_eoc(unsigned char **pp) { unsigned char *p = *pp; + *p++ = 0; *p++ = 0; *pp = p; @@ -194,20 +198,21 @@ int ASN1_put_eoc(unsigned char **pp) static void asn1_put_length(unsigned char **pp, int length) { unsigned char *p = *pp; - int i, l; - if (length <= 127) + int i, len; + + if (length <= 127) { *(p++) = (unsigned char)length; - else { - l = length; - for (i = 0; l > 0; i++) - l >>= 8; + } else { + len = length; + for (i = 0; len > 0; i++) + len >>= 8; *(p++) = i | 0x80; - l = i; + len = i; while (i-- > 0) { p[i] = length & 0xff; length >>= 8; } - p += l; + p += len; } *pp = p; } @@ -215,6 +220,7 @@ static void asn1_put_length(unsigned char **pp, int length) int ASN1_object_size(int constructed, int length, int tag) { int ret = 1; + if (length < 0) return -1; if (tag >= 31) { @@ -256,6 +262,7 @@ int ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *str) ASN1_STRING *ASN1_STRING_dup(const ASN1_STRING *str) { ASN1_STRING *ret; + if (!str) return NULL; ret = ASN1_STRING_new(); @@ -359,8 +366,9 @@ int ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b) return a->type - b->type; else return i; - } else + } else { return i; + } } int ASN1_STRING_length(const ASN1_STRING *x) @@ -383,9 +391,48 @@ const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *x) return x->data; } -# ifndef OPENSSL_NO_DEPRECATED_1_1_0 +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 unsigned char *ASN1_STRING_data(ASN1_STRING *x) { return x->data; } #endif + +char *sk_ASN1_UTF8STRING2text(STACK_OF(ASN1_UTF8STRING) *text, const char *sep, + size_t max_len /* excluding NUL terminator */) +{ + int i; + ASN1_UTF8STRING *current; + size_t length = 0, sep_len; + char *result = NULL; + char *p; + + if (!ossl_assert(sep != NULL)) + return NULL; + sep_len = strlen(sep); + + for (i = 0; i < sk_ASN1_UTF8STRING_num(text); ++i) { + current = sk_ASN1_UTF8STRING_value(text, i); + if (i > 0) + length += sep_len; + length += ASN1_STRING_length(current); + if (length > max_len) + return NULL; + } + if ((result = OPENSSL_malloc(length + 1)) == NULL) + return NULL; + + for (i = 0, p = result; i < sk_ASN1_UTF8STRING_num(text); ++i) { + current = sk_ASN1_UTF8STRING_value(text, i); + length = ASN1_STRING_length(current); + if (i > 0 && sep_len > 0) { + strncpy(p, sep, sep_len); + p += sep_len; + } + strncpy(p, (const char *)ASN1_STRING_get0_data(current), length); + p += length; + } + *p = '\0'; + + return result; +} diff --git a/crypto/cmp/build.info b/crypto/cmp/build.info index 41a5899319..1667334e2a 100644 --- a/crypto/cmp/build.info +++ b/crypto/cmp/build.info @@ -1,3 +1,4 @@ LIBS=../../libcrypto SOURCE[../../libcrypto]= cmp_asn.c cmp_ctx.c cmp_err.c cmp_util.c \ - cmp_status.c cmp_hdr.c cmp_protect.c cmp_msg.c cmp_vfy.c + cmp_status.c cmp_hdr.c cmp_protect.c cmp_msg.c cmp_vfy.c \ + cmp_server.c diff --git a/crypto/cmp/cmp_err.c b/crypto/cmp/cmp_err.c index f82ef9e325..0d311a8ddf 100644 --- a/crypto/cmp/cmp_err.c +++ b/crypto/cmp/cmp_err.c @@ -1,6 +1,6 @@ /* * Generated by util/mkerr.pl DO NOT EDIT - * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -17,9 +17,12 @@ static const ERR_STRING_DATA CMP_str_reasons[] = { {ERR_PACK(ERR_LIB_CMP, 0, CMP_R_ALGORITHM_NOT_SUPPORTED), "algorithm not supported"}, {ERR_PACK(ERR_LIB_CMP, 0, CMP_R_BAD_REQUEST_ID), "bad request id"}, + {ERR_PACK(ERR_LIB_CMP, 0, CMP_R_CERTHASH_UNMATCHED), "certhash unmatched"}, {ERR_PACK(ERR_LIB_CMP, 0, CMP_R_CERTID_NOT_FOUND), "certid not found"}, {ERR_PACK(ERR_LIB_CMP, 0, CMP_R_CERTIFICATE_NOT_FOUND), "certificate not found"}, + {ERR_PACK(ERR_LIB_CMP, 0, CMP_R_CERTREQMSG_NOT_FOUND), + "certreqmsg not found"}, {ERR_PACK(ERR_LIB_CMP, 0, CMP_R_CERTRESPONSE_NOT_FOUND), "certresponse not found"}, {ERR_PACK(ERR_LIB_CMP, 0, CMP_R_CERT_AND_KEY_DO_NOT_MATCH), @@ -48,10 +51,16 @@ static const ERR_STRING_DATA CMP_str_reasons[] = { {ERR_PACK(ERR_LIB_CMP, 0, CMP_R_ERROR_CREATING_RR), "error creating rr"}, {ERR_PACK(ERR_LIB_CMP, 0, CMP_R_ERROR_PARSING_PKISTATUS), "error parsing pkistatus"}, + {ERR_PACK(ERR_LIB_CMP, 0, CMP_R_ERROR_PROCESSING_MSG), + "error processing msg"}, {ERR_PACK(ERR_LIB_CMP, 0, CMP_R_ERROR_PROTECTING_MESSAGE), "error protecting message"}, {ERR_PACK(ERR_LIB_CMP, 0, CMP_R_ERROR_SETTING_CERTHASH), "error setting certhash"}, + {ERR_PACK(ERR_LIB_CMP, 0, CMP_R_ERROR_TRANSFERRING_OUT), + "error transferring out"}, + {ERR_PACK(ERR_LIB_CMP, 0, CMP_R_ERROR_UNEXPECTED_CERTCONF), + "error unexpected certconf"}, {ERR_PACK(ERR_LIB_CMP, 0, CMP_R_ERROR_VALIDATING_PROTECTION), "error validating protection"}, {ERR_PACK(ERR_LIB_CMP, 0, CMP_R_FAILED_EXTRACTING_PUBKEY), @@ -72,6 +81,8 @@ static const ERR_STRING_DATA CMP_str_reasons[] = { "missing sender identification"}, {ERR_PACK(ERR_LIB_CMP, 0, CMP_R_MISSING_TRUST_STORE), "missing trust store"}, + {ERR_PACK(ERR_LIB_CMP, 0, CMP_R_MULTIPLE_REQUESTS_NOT_SUPPORTED), + "multiple requests not supported"}, {ERR_PACK(ERR_LIB_CMP, 0, CMP_R_MULTIPLE_SAN_SOURCES), "multiple san sources"}, {ERR_PACK(ERR_LIB_CMP, 0, CMP_R_NO_STDIO), "no stdio"}, diff --git a/crypto/cmp/cmp_hdr.c b/crypto/cmp/cmp_hdr.c index 29f477f1b5..9d6d6ceb2c 100644 --- a/crypto/cmp/cmp_hdr.c +++ b/crypto/cmp/cmp_hdr.c @@ -63,31 +63,42 @@ ASN1_OCTET_STRING *OSSL_CMP_HDR_get0_recipNonce(const OSSL_CMP_PKIHEADER *hdr) return hdr->recipNonce; } +int ossl_cmp_general_name_is_NULL_DN(GENERAL_NAME *name) +{ + X509_NAME *null = X509_NAME_new(); + int res = name == NULL || null == NULL + || (name->type == GEN_DIRNAME + && X509_NAME_cmp(name->d.directoryName, null) == 0); + + X509_NAME_free(null); + return res; +} + /* assign to *tgt a copy of src (which may be NULL to indicate an empty DN) */ static int set1_general_name(GENERAL_NAME **tgt, const X509_NAME *src) { - GENERAL_NAME *gen; + GENERAL_NAME *name; if (!ossl_assert(tgt != NULL)) return 0; - if ((gen = GENERAL_NAME_new()) == NULL) + if ((name = GENERAL_NAME_new()) == NULL) goto err; - gen->type = GEN_DIRNAME; + name->type = GEN_DIRNAME; if (src == NULL) { /* NULL-DN */ - if ((gen->d.directoryName = X509_NAME_new()) == NULL) + if ((name->d.directoryName = X509_NAME_new()) == NULL) goto err; - } else if (!X509_NAME_set(&gen->d.directoryName, src)) { + } else if (!X509_NAME_set(&name->d.directoryName, src)) { goto err; } GENERAL_NAME_free(*tgt); - *tgt = gen; + *tgt = name; return 1; err: - GENERAL_NAME_free(gen); + GENERAL_NAME_free(name); return 0; } @@ -153,25 +164,6 @@ int ossl_cmp_hdr_set1_senderKID(OSSL_CMP_PKIHEADER *hdr, } /* push the given text string to the given PKIFREETEXT ft */ -int ossl_cmp_pkifreetext_push_str(OSSL_CMP_PKIFREETEXT *ft, const char *text) -{ - ASN1_UTF8STRING *utf8string; - - if (!ossl_assert(ft != NULL && text != NULL)) - return 0; - if ((utf8string = ASN1_UTF8STRING_new()) == NULL) - return 0; - if (!ASN1_STRING_set(utf8string, text, -1)) - goto err; - if (!sk_ASN1_UTF8STRING_push(ft, utf8string)) - goto err; - return 1; - - err: - ASN1_UTF8STRING_free(utf8string); - return 0; -} - int ossl_cmp_hdr_push0_freeText(OSSL_CMP_PKIHEADER *hdr, ASN1_UTF8STRING *text) { if (!ossl_assert(hdr != NULL && text != NULL)) @@ -193,7 +185,8 @@ int ossl_cmp_hdr_push1_freeText(OSSL_CMP_PKIHEADER *hdr, ASN1_UTF8STRING *text) && (hdr->freeText = sk_ASN1_UTF8STRING_new_null()) == NULL) return 0; - return ossl_cmp_pkifreetext_push_str(hdr->freeText, (char *)text->data); + return + ossl_cmp_sk_ASN1_UTF8STRING_push_str(hdr->freeText, (char *)text->data); } int ossl_cmp_hdr_generalInfo_push0_item(OSSL_CMP_PKIHEADER *hdr, @@ -205,7 +198,7 @@ int ossl_cmp_hdr_generalInfo_push0_item(OSSL_CMP_PKIHEADER *hdr, } int ossl_cmp_hdr_generalInfo_push1_items(OSSL_CMP_PKIHEADER *hdr, - STACK_OF(OSSL_CMP_ITAV) *itavs) + const STACK_OF(OSSL_CMP_ITAV) *itavs) { int i; OSSL_CMP_ITAV *itav; @@ -250,7 +243,7 @@ int ossl_cmp_hdr_set_implicitConfirm(OSSL_CMP_PKIHEADER *hdr) } /* return 1 if implicitConfirm in the generalInfo field of the header is set */ -int ossl_cmp_hdr_check_implicitConfirm(const OSSL_CMP_PKIHEADER *hdr) +int ossl_cmp_hdr_has_implicitConfirm(const OSSL_CMP_PKIHEADER *hdr) { int itavCount; int i; @@ -283,19 +276,12 @@ int ossl_cmp_hdr_init(OSSL_CMP_CTX *ctx, OSSL_CMP_PKIHEADER *hdr) if (!ossl_cmp_hdr_set_pvno(hdr, OSSL_CMP_PVNO)) return 0; - sender = ctx->clCert != NULL ? - X509_get_subject_name(ctx->clCert) : ctx->subjectName; /* * The sender name is copied from the subject of the client cert, if any, - * or else from the the subject name provided for certification requests. - * As required by RFC 4210 section 5.1.1., if the sender name is not known - * to the client it set to NULL-DN. In this case for identification at least - * the senderKID must be set, which we take from any referenceValue given. + * or else from the subject name provided for certification requests. */ - if (sender == NULL && ctx->referenceValue == NULL) { - CMPerr(0, CMP_R_MISSING_SENDER_IDENTIFICATION); - return 0; - } + sender = ctx->clCert != NULL ? + X509_get_subject_name(ctx->clCert) : ctx->subjectName; if (!ossl_cmp_hdr_set1_sender(hdr, sender)) return 0; diff --git a/crypto/cmp/cmp_local.h b/crypto/cmp/cmp_local.h index 015a3d4e67..353c7ce995 100644 --- a/crypto/cmp/cmp_local.h +++ b/crypto/cmp/cmp_local.h @@ -246,7 +246,6 @@ struct ossl_cmp_itav_st { } infoValue; } /* OSSL_CMP_ITAV */; DECLARE_ASN1_FUNCTIONS(OSSL_CMP_ITAV) -DECLARE_ASN1_DUP_FUNCTION(OSSL_CMP_ITAV) typedef struct ossl_cmp_certorenccert_st { int type; @@ -284,8 +283,6 @@ struct ossl_cmp_pkisi_st { OSSL_CMP_PKIFREETEXT *statusString; OSSL_CMP_PKIFAILUREINFO *failInfo; } /* OSSL_CMP_PKISI */; -DECLARE_ASN1_FUNCTIONS(OSSL_CMP_PKISI) -DECLARE_ASN1_DUP_FUNCTION(OSSL_CMP_PKISI) DECLARE_ASN1_DUP_FUNCTION(OSSL_CRMF_CERTID) /*- @@ -296,10 +293,11 @@ DECLARE_ASN1_DUP_FUNCTION(OSSL_CRMF_CERTID) * crlEntryDetails Extensions OPTIONAL * } */ -typedef struct ossl_cmp_revdetails_st { +struct ossl_cmp_revdetails_st { OSSL_CRMF_CERTTEMPLATE *certDetails; X509_EXTENSIONS *crlEntryDetails; -} OSSL_CMP_REVDETAILS; +} /* OSSL_CMP_REVDETAILS */; +typedef struct ossl_cmp_revdetails_st OSSL_CMP_REVDETAILS; DECLARE_ASN1_FUNCTIONS(OSSL_CMP_REVDETAILS) DEFINE_STACK_OF(OSSL_CMP_REVDETAILS) @@ -375,7 +373,6 @@ struct ossl_cmp_certstatus_st { OSSL_CMP_PKISI *statusInfo; } /* OSSL_CMP_CERTSTATUS */; DECLARE_ASN1_FUNCTIONS(OSSL_CMP_CERTSTATUS) - typedef STACK_OF(OSSL_CMP_CERTSTATUS) OSSL_CMP_CERTCONFIRMCONTENT; DECLARE_ASN1_FUNCTIONS(OSSL_CMP_CERTCONFIRMCONTENT) @@ -670,7 +667,6 @@ struct ossl_cmp_msg_st { STACK_OF(X509) *extraCerts; /* 1 */ } /* OSSL_CMP_MSG */; DECLARE_ASN1_FUNCTIONS(OSSL_CMP_MSG) -DECLARE_ASN1_DUP_FUNCTION(OSSL_CMP_MSG) /*- * ProtectedPart ::= SEQUENCE { @@ -728,17 +724,6 @@ DECLARE_ASN1_FUNCTIONS(CMP_PROTECTEDPART) * } */ -/* - * constants - */ -/* certReqId for the first - and so far only - certificate request */ -# define OSSL_CMP_CERTREQID 0 -/* sequence id for the first - and so far only - revocation request */ -# define OSSL_CMP_REVREQSID 0 -/* - * functions - */ - /* from cmp_asn.c */ int ossl_cmp_asn1_get_int(const ASN1_INTEGER *a); @@ -755,6 +740,9 @@ int ossl_cmp_sk_X509_add1_certs(STACK_OF(X509) *sk, STACK_OF(X509) *certs, int no_self_issued, int no_dups, int prepend); int ossl_cmp_X509_STORE_add1_certs(X509_STORE *store, STACK_OF(X509) *certs, int only_self_issued); +STACK_OF(X509) *ossl_cmp_X509_STORE_get1_certs(X509_STORE *store); +int ossl_cmp_sk_ASN1_UTF8STRING_push_str(STACK_OF(ASN1_UTF8STRING) *sk, + const char *text); int ossl_cmp_asn1_octet_string_set1(ASN1_OCTET_STRING **tgt, const ASN1_OCTET_STRING *src); int ossl_cmp_asn1_octet_string_set1_bytes(ASN1_OCTET_STRING **tgt, @@ -800,32 +788,30 @@ int ossl_cmp_ctx_set1_recipNonce(OSSL_CMP_CTX *ctx, const ASN1_OCTET_STRING *nonce); /* from cmp_status.c */ -OSSL_CMP_PKISI * -ossl_cmp_statusinfo_new(int status, int fail_info, const char *text); -int ossl_cmp_pkisi_get_pkistatus(const OSSL_CMP_PKISI *statusInfo); +int ossl_cmp_pkisi_get_status(const OSSL_CMP_PKISI *si); const char *ossl_cmp_PKIStatus_to_string(int status); -OSSL_CMP_PKIFREETEXT *ossl_cmp_pkisi_get0_statusstring(const OSSL_CMP_PKISI *si); +OSSL_CMP_PKIFREETEXT *ossl_cmp_pkisi_get0_statusString(const OSSL_CMP_PKISI *si); int ossl_cmp_pkisi_get_pkifailureinfo(const OSSL_CMP_PKISI *si); -int ossl_cmp_pkisi_pkifailureinfo_check(const OSSL_CMP_PKISI *si, int bit_index); +int ossl_cmp_pkisi_check_pkifailureinfo(const OSSL_CMP_PKISI *si, int index); /* from cmp_hdr.c */ int ossl_cmp_hdr_set_pvno(OSSL_CMP_PKIHEADER *hdr, int pvno); int ossl_cmp_hdr_get_pvno(const OSSL_CMP_PKIHEADER *hdr); ASN1_OCTET_STRING *ossl_cmp_hdr_get0_senderNonce(const OSSL_CMP_PKIHEADER *hdr); +int ossl_cmp_general_name_is_NULL_DN(GENERAL_NAME *name); int ossl_cmp_hdr_set1_sender(OSSL_CMP_PKIHEADER *hdr, const X509_NAME *nm); int ossl_cmp_hdr_set1_recipient(OSSL_CMP_PKIHEADER *hdr, const X509_NAME *nm); int ossl_cmp_hdr_update_messageTime(OSSL_CMP_PKIHEADER *hdr); int ossl_cmp_hdr_set1_senderKID(OSSL_CMP_PKIHEADER *hdr, const ASN1_OCTET_STRING *senderKID); -int ossl_cmp_pkifreetext_push_str(OSSL_CMP_PKIFREETEXT *ft, const char *text); int ossl_cmp_hdr_push0_freeText(OSSL_CMP_PKIHEADER *hdr, ASN1_UTF8STRING *text); int ossl_cmp_hdr_push1_freeText(OSSL_CMP_PKIHEADER *hdr, ASN1_UTF8STRING *text); int ossl_cmp_hdr_generalInfo_push0_item(OSSL_CMP_PKIHEADER *hdr, OSSL_CMP_ITAV *itav); int ossl_cmp_hdr_generalInfo_push1_items(OSSL_CMP_PKIHEADER *hdr, - STACK_OF(OSSL_CMP_ITAV) *itavs); + const STACK_OF(OSSL_CMP_ITAV) *itavs); int ossl_cmp_hdr_set_implicitConfirm(OSSL_CMP_PKIHEADER *hdr); -int ossl_cmp_hdr_check_implicitConfirm(const OSSL_CMP_PKIHEADER *hdr); +int ossl_cmp_hdr_has_implicitConfirm(const OSSL_CMP_PKIHEADER *hdr); # define OSSL_CMP_TRANSACTIONID_LENGTH 16 # define OSSL_CMP_SENDERNONCE_LENGTH 16 int ossl_cmp_hdr_init(OSSL_CMP_CTX *ctx, OSSL_CMP_PKIHEADER *hdr); @@ -860,6 +846,10 @@ int ossl_cmp_hdr_init(OSSL_CMP_CTX *ctx, OSSL_CMP_PKIHEADER *hdr); # define OSSL_CMP_PKIBODY_POLLREQ 25 # define OSSL_CMP_PKIBODY_POLLREP 26 # define OSSL_CMP_PKIBODY_TYPE_MAX OSSL_CMP_PKIBODY_POLLREP +/* certReqId for the first - and so far only - certificate request */ +# define OSSL_CMP_CERTREQID 0 +/* sequence id for the first - and so far only - revocation request */ +# define OSSL_CMP_REVREQSID 0 const char *ossl_cmp_bodytype_to_string(int type); int ossl_cmp_msg_set_bodytype(OSSL_CMP_MSG *msg, int type); int ossl_cmp_msg_get_bodytype(const OSSL_CMP_MSG *msg); @@ -875,24 +865,26 @@ OSSL_CMP_MSG *ossl_cmp_rr_new(OSSL_CMP_CTX *ctx); OSSL_CMP_MSG *ossl_cmp_rp_new(OSSL_CMP_CTX *ctx, OSSL_CMP_PKISI *si, OSSL_CRMF_CERTID *certId, int unprot_err); OSSL_CMP_MSG *ossl_cmp_pkiconf_new(OSSL_CMP_CTX *ctx); +OSSL_CMP_MSG *ossl_cmp_pollRep_new(OSSL_CMP_CTX *ctx, int crid, + int64_t poll_after); int ossl_cmp_msg_gen_push0_ITAV(OSSL_CMP_MSG *msg, OSSL_CMP_ITAV *itav); int ossl_cmp_msg_gen_push1_ITAVs(OSSL_CMP_MSG *msg, - STACK_OF(OSSL_CMP_ITAV) *itavs); + const STACK_OF(OSSL_CMP_ITAV) *itavs); OSSL_CMP_MSG *ossl_cmp_genm_new(OSSL_CMP_CTX *ctx); -OSSL_CMP_MSG *ossl_cmp_genp_new(OSSL_CMP_CTX *ctx); +OSSL_CMP_MSG *ossl_cmp_genp_new(OSSL_CMP_CTX *ctx, + const STACK_OF(OSSL_CMP_ITAV) *itavs); OSSL_CMP_MSG *ossl_cmp_error_new(OSSL_CMP_CTX *ctx, OSSL_CMP_PKISI *si, int errorCode, - OSSL_CMP_PKIFREETEXT *errorDetails, - int unprotected); -int ossl_cmp_certstatus_set_certHash(OSSL_CMP_CERTSTATUS *certStatus, - const X509 *cert); + const char *details, int unprotected); +int ossl_cmp_certstatus_set0_certHash(OSSL_CMP_CERTSTATUS *certStatus, + ASN1_OCTET_STRING *hash); OSSL_CMP_MSG *ossl_cmp_certConf_new(OSSL_CMP_CTX *ctx, int fail_info, const char *text); OSSL_CMP_MSG *ossl_cmp_pollReq_new(OSSL_CMP_CTX *ctx, int crid); OSSL_CMP_MSG *ossl_cmp_pollRep_new(OSSL_CMP_CTX *ctx, int crid, int64_t poll_after); OSSL_CMP_PKISI * -ossl_cmp_revrepcontent_get_pkistatusinfo(OSSL_CMP_REVREPCONTENT *rrep, int rsid); +ossl_cmp_revrepcontent_get_pkisi(OSSL_CMP_REVREPCONTENT *rrep, int rsid); OSSL_CRMF_CERTID *ossl_cmp_revrepcontent_get_CertId(OSSL_CMP_REVREPCONTENT *rrep, int rsid); OSSL_CMP_POLLREP * @@ -904,11 +896,6 @@ ossl_cmp_certrepmessage_get0_certresponse(const OSSL_CMP_CERTREPMESSAGE *crepmsg X509 *ossl_cmp_certresponse_get1_certificate(EVP_PKEY *privkey, const OSSL_CMP_CERTRESPONSE *crep); OSSL_CMP_MSG *ossl_cmp_msg_load(const char *file); -/* BIO definitions */ -# define OSSL_d2i_CMP_MSG_bio(bp, p) \ - ASN1_d2i_bio_of(OSSL_CMP_MSG, OSSL_CMP_MSG_new, d2i_OSSL_CMP_MSG, bp, p) -# define OSSL_i2d_CMP_MSG_bio(bp, o) \ - ASN1_i2d_bio_of(OSSL_CMP_MSG, i2d_OSSL_CMP_MSG, bp, o) /* from cmp_protect.c */ ASN1_BIT_STRING *ossl_cmp_calc_protection(const OSSL_CMP_MSG *msg, @@ -925,4 +912,4 @@ int ossl_cmp_msg_check_received(OSSL_CMP_CTX *ctx, const OSSL_CMP_MSG *msg, ossl_cmp_allow_unprotected_cb_t cb, int cb_arg); int ossl_cmp_verify_popo(const OSSL_CMP_MSG *msg, int accept_RAVerified); -#endif /* !defined OSSL_CRYPTO_CMP_LOCAL_H */ +#endif /* !defined(OSSL_CRYPTO_CMP_LOCAL_H) */ diff --git a/crypto/cmp/cmp_msg.c b/crypto/cmp/cmp_msg.c index c794dc98bb..714c883a0d 100644 --- a/crypto/cmp/cmp_msg.c +++ b/crypto/cmp/cmp_msg.c @@ -205,18 +205,20 @@ static X509_NAME *determine_subj(OSSL_CMP_CTX *ctx, X509 *refcert, * Create CRMF certificate request message for IR/CR/KUR * returns a pointer to the OSSL_CRMF_MSG on success, NULL on error */ -static OSSL_CRMF_MSG *crm_new(OSSL_CMP_CTX *ctx, int bodytype, - int rid, EVP_PKEY *rkey) +static OSSL_CRMF_MSG *crm_new(OSSL_CMP_CTX *ctx, int bodytype, int rid) { OSSL_CRMF_MSG *crm = NULL; X509 *refcert = ctx->oldCert != NULL ? ctx->oldCert : ctx->clCert; /* refcert defaults to current client cert */ + EVP_PKEY *rkey = OSSL_CMP_CTX_get0_newPkey(ctx, 0); STACK_OF(GENERAL_NAME) *default_sans = NULL; X509_NAME *subject = determine_subj(ctx, refcert, bodytype); int crit = ctx->setSubjectAltNameCritical || subject == NULL; /* RFC5280: subjectAltName MUST be critical if subject is null */ X509_EXTENSIONS *exts = NULL; + if (rkey == NULL) + rkey = ctx->pkey; /* default is independent of ctx->oldClCert */ if (rkey == NULL || (bodytype == OSSL_CMP_PKIBODY_KUR && refcert == NULL)) { CMPerr(0, CMP_R_INVALID_ARGS); @@ -300,19 +302,12 @@ static OSSL_CRMF_MSG *crm_new(OSSL_CMP_CTX *ctx, int bodytype, OSSL_CMP_MSG *ossl_cmp_certReq_new(OSSL_CMP_CTX *ctx, int type, int err_code) { - EVP_PKEY *rkey; - EVP_PKEY *privkey; OSSL_CMP_MSG *msg; OSSL_CRMF_MSG *crm = NULL; if (!ossl_assert(ctx != NULL)) return NULL; - rkey = OSSL_CMP_CTX_get0_newPkey(ctx, 0); - if (rkey == NULL) - return NULL; - privkey = OSSL_CMP_CTX_get0_newPkey(ctx, 1); - if (type != OSSL_CMP_PKIBODY_IR && type != OSSL_CMP_PKIBODY_CR && type != OSSL_CMP_PKIBODY_KUR && type != OSSL_CMP_PKIBODY_P10CR) { CMPerr(0, CMP_R_INVALID_ARGS); @@ -329,15 +324,19 @@ OSSL_CMP_MSG *ossl_cmp_certReq_new(OSSL_CMP_CTX *ctx, int type, int err_code) /* body */ /* For P10CR the content has already been set in OSSL_CMP_MSG_create */ if (type != OSSL_CMP_PKIBODY_P10CR) { + EVP_PKEY *privkey = OSSL_CMP_CTX_get0_newPkey(ctx, 1); + + if (privkey == NULL) + privkey = ctx->pkey; /* default is independent of ctx->oldCert */ if (ctx->popoMethod == OSSL_CRMF_POPO_SIGNATURE && privkey == NULL) { CMPerr(0, CMP_R_MISSING_PRIVATE_KEY); goto err; } - if ((crm = crm_new(ctx, type, OSSL_CMP_CERTREQID, rkey)) == NULL - || !OSSL_CRMF_MSG_create_popo(crm, privkey, ctx->digest, - ctx->popoMethod) - /* value.ir is same for cr and kur */ - || !sk_OSSL_CRMF_MSG_push(msg->body->value.ir, crm)) + if ((crm = crm_new(ctx, type, OSSL_CMP_CERTREQID)) == NULL + || !OSSL_CRMF_MSG_create_popo(crm, privkey, ctx->digest, + ctx->popoMethod) + /* value.ir is same for cr and kur */ + || !sk_OSSL_CRMF_MSG_push(msg->body->value.ir, crm)) goto err; crm = NULL; /* TODO: here optional 2nd certreqmsg could be pushed to the stack */ @@ -385,7 +384,7 @@ OSSL_CMP_MSG *ossl_cmp_certRep_new(OSSL_CMP_CTX *ctx, int bodytype, || !ASN1_INTEGER_set(resp->certReqId, certReqId)) goto err; - status = ossl_cmp_pkisi_get_pkistatus(resp->status); + status = ossl_cmp_pkisi_get_status(resp->status); if (status != OSSL_CMP_PKISTATUS_rejection && status != OSSL_CMP_PKISTATUS_waiting && cert != NULL) { if (encrypted) { @@ -416,7 +415,7 @@ OSSL_CMP_MSG *ossl_cmp_certRep_new(OSSL_CMP_CTX *ctx, int bodytype, goto err; if (!unprotectedErrors - || ossl_cmp_pkisi_get_pkistatus(si) != OSSL_CMP_PKISTATUS_rejection) + || ossl_cmp_pkisi_get_status(si) != OSSL_CMP_PKISTATUS_rejection) if (!ossl_cmp_msg_protect(ctx, msg)) goto err; @@ -511,7 +510,7 @@ OSSL_CMP_MSG *ossl_cmp_rp_new(OSSL_CMP_CTX *ctx, OSSL_CMP_PKISI *si, } if (!unprot_err - || ossl_cmp_pkisi_get_pkistatus(si) != OSSL_CMP_PKISTATUS_rejection) + || ossl_cmp_pkisi_get_status(si) != OSSL_CMP_PKISTATUS_rejection) if (!ossl_cmp_msg_protect(ctx, msg)) goto err; @@ -560,7 +559,7 @@ int ossl_cmp_msg_gen_push0_ITAV(OSSL_CMP_MSG *msg, OSSL_CMP_ITAV *itav) } int ossl_cmp_msg_gen_push1_ITAVs(OSSL_CMP_MSG *msg, - STACK_OF(OSSL_CMP_ITAV) *itavs) + const STACK_OF(OSSL_CMP_ITAV) *itavs) { int i; OSSL_CMP_ITAV *itav = NULL; @@ -583,7 +582,9 @@ int ossl_cmp_msg_gen_push1_ITAVs(OSSL_CMP_MSG *msg, * Creates a new General Message/Response with an empty itav stack * returns a pointer to the PKIMessage on success, NULL on error */ -static OSSL_CMP_MSG *gen_new(OSSL_CMP_CTX *ctx, int body_type, int err_code) +static OSSL_CMP_MSG *gen_new(OSSL_CMP_CTX *ctx, + const STACK_OF(OSSL_CMP_ITAV) *itavs, + int body_type, int err_code) { OSSL_CMP_MSG *msg = NULL; @@ -594,7 +595,7 @@ static OSSL_CMP_MSG *gen_new(OSSL_CMP_CTX *ctx, int body_type, int err_code) return NULL; if (ctx->genm_ITAVs != NULL - && !ossl_cmp_msg_gen_push1_ITAVs(msg, ctx->genm_ITAVs)) + && !ossl_cmp_msg_gen_push1_ITAVs(msg, itavs)) goto err; if (!ossl_cmp_msg_protect(ctx, msg)) @@ -610,20 +611,23 @@ static OSSL_CMP_MSG *gen_new(OSSL_CMP_CTX *ctx, int body_type, int err_code) OSSL_CMP_MSG *ossl_cmp_genm_new(OSSL_CMP_CTX *ctx) { - return gen_new(ctx, OSSL_CMP_PKIBODY_GENM, CMP_R_ERROR_CREATING_GENM); + return gen_new(ctx, ctx->genm_ITAVs, + OSSL_CMP_PKIBODY_GENM, CMP_R_ERROR_CREATING_GENM); } -OSSL_CMP_MSG *ossl_cmp_genp_new(OSSL_CMP_CTX *ctx) +OSSL_CMP_MSG *ossl_cmp_genp_new(OSSL_CMP_CTX *ctx, + const STACK_OF(OSSL_CMP_ITAV) *itavs) { - return gen_new(ctx, OSSL_CMP_PKIBODY_GENP, CMP_R_ERROR_CREATING_GENP); + return gen_new(ctx, itavs, + OSSL_CMP_PKIBODY_GENP, CMP_R_ERROR_CREATING_GENP); } OSSL_CMP_MSG *ossl_cmp_error_new(OSSL_CMP_CTX *ctx, OSSL_CMP_PKISI *si, int errorCode, - OSSL_CMP_PKIFREETEXT *errorDetails, - int unprotected) + const char *details, int unprotected) { OSSL_CMP_MSG *msg = NULL; + OSSL_CMP_PKIFREETEXT *ft; if (!ossl_assert(ctx != NULL && si != NULL)) return NULL; @@ -641,11 +645,13 @@ OSSL_CMP_MSG *ossl_cmp_error_new(OSSL_CMP_CTX *ctx, OSSL_CMP_PKISI *si, if (!ASN1_INTEGER_set(msg->body->value.error->errorCode, errorCode)) goto err; } - if (errorDetails != NULL) - if ((msg->body->value.error->errorDetails = - sk_ASN1_UTF8STRING_deep_copy(errorDetails, ASN1_STRING_dup, - ASN1_STRING_free)) == NULL) + if (details != NULL) { + if ((ft = sk_ASN1_UTF8STRING_new_null()) == NULL) + goto err; + msg->body->value.error->errorDetails = ft; + if (!ossl_cmp_sk_ASN1_UTF8STRING_push_str(ft, details)) goto err; + } if (!unprotected && !ossl_cmp_msg_protect(ctx, msg)) goto err; @@ -658,44 +664,18 @@ OSSL_CMP_MSG *ossl_cmp_error_new(OSSL_CMP_CTX *ctx, OSSL_CMP_PKISI *si, } /* - * OSSL_CMP_CERTSTATUS_set_certHash() calculates a hash of the certificate, - * using the same hash algorithm as is used to create and verify the - * certificate signature, and places the hash into the certHash field of a - * OSSL_CMP_CERTSTATUS structure. This is used in the certConf message, - * for example, to confirm that the certificate was received successfully. + * Set the certHash field of a OSSL_CMP_CERTSTATUS structure. + * This is used in the certConf message, for example, + * to confirm that the certificate was received successfully. */ -int ossl_cmp_certstatus_set_certHash(OSSL_CMP_CERTSTATUS *certStatus, - const X509 *cert) +int ossl_cmp_certstatus_set0_certHash(OSSL_CMP_CERTSTATUS *certStatus, + ASN1_OCTET_STRING *hash) { - unsigned int len; - unsigned char hash[EVP_MAX_MD_SIZE]; - int md_NID; - const EVP_MD *md = NULL; - - if (!ossl_assert(certStatus != NULL && cert != NULL)) - return 0; - - /*- - * select hash algorithm, as stated in Appendix F. Compilable ASN.1 defs: - * the hash of the certificate, using the same hash algorithm - * as is used to create and verify the certificate signature - */ - if (OBJ_find_sigid_algs(X509_get_signature_nid(cert), &md_NID, NULL) - && (md = EVP_get_digestbynid(md_NID)) != NULL) { - if (!X509_digest(cert, md, hash, &len)) - goto err; - if (!ossl_cmp_asn1_octet_string_set1_bytes(&certStatus->certHash, hash, - len)) - goto err; - } else { - CMPerr(0, CMP_R_UNSUPPORTED_ALGORITHM); + if (!ossl_assert(certStatus != NULL)) return 0; - } - + ASN1_OCTET_STRING_free(certStatus->certHash); + certStatus->certHash = hash; return 1; - err: - CMPerr(0, CMP_R_ERROR_SETTING_CERTHASH); - return 0; } /* @@ -707,6 +687,7 @@ OSSL_CMP_MSG *ossl_cmp_certConf_new(OSSL_CMP_CTX *ctx, int fail_info, { OSSL_CMP_MSG *msg = NULL; OSSL_CMP_CERTSTATUS *certStatus = NULL; + ASN1_OCTET_STRING *certHash = NULL; OSSL_CMP_PKISI *sinfo; if (!ossl_assert(ctx != NULL && ctx->newCert != NULL)) @@ -732,8 +713,12 @@ OSSL_CMP_MSG *ossl_cmp_certConf_new(OSSL_CMP_CTX *ctx, int fail_info, * the hash of the certificate, using the same hash algorithm * as is used to create and verify the certificate signature */ - if (!ossl_cmp_certstatus_set_certHash(certStatus, ctx->newCert)) + if ((certHash = X509_digest_sig(ctx->newCert)) == NULL) + goto err; + + if (!ossl_cmp_certstatus_set0_certHash(certStatus, certHash)) goto err; + certHash = NULL; /* * For any particular CertStatus, omission of the statusInfo field * indicates ACCEPTANCE of the specified certificate. Alternatively, @@ -742,8 +727,8 @@ OSSL_CMP_MSG *ossl_cmp_certConf_new(OSSL_CMP_CTX *ctx, int fail_info, * the CA/RA. */ sinfo = fail_info != 0 ? - ossl_cmp_statusinfo_new(OSSL_CMP_PKISTATUS_rejection, fail_info, text) : - ossl_cmp_statusinfo_new(OSSL_CMP_PKISTATUS_accepted, 0, text); + OSSL_CMP_STATUSINFO_new(OSSL_CMP_PKISTATUS_rejection, fail_info, text) : + OSSL_CMP_STATUSINFO_new(OSSL_CMP_PKISTATUS_accepted, 0, text); if (sinfo == NULL) goto err; certStatus->statusInfo = sinfo; @@ -756,6 +741,7 @@ OSSL_CMP_MSG *ossl_cmp_certConf_new(OSSL_CMP_CTX *ctx, int fail_info, err: CMPerr(0, CMP_R_ERROR_CREATING_CERTCONF); OSSL_CMP_MSG_free(msg); + ASN1_OCTET_STRING_free(certHash); return NULL; } @@ -827,7 +813,7 @@ OSSL_CMP_MSG *ossl_cmp_pollRep_new(OSSL_CMP_CTX *ctx, int crid, * returns NULL on error */ OSSL_CMP_PKISI * -ossl_cmp_revrepcontent_get_pkistatusinfo(OSSL_CMP_REVREPCONTENT *rrep, int rsid) +ossl_cmp_revrepcontent_get_pkisi(OSSL_CMP_REVREPCONTENT *rrep, int rsid) { OSSL_CMP_PKISI *status; @@ -994,3 +980,14 @@ OSSL_CMP_MSG *ossl_cmp_msg_load(const char *file) BIO_free(bio); return msg; } + +OSSL_CMP_MSG *OSSL_d2i_CMP_MSG_bio(BIO *bio, OSSL_CMP_MSG **msg) +{ + return ASN1_d2i_bio_of(OSSL_CMP_MSG, OSSL_CMP_MSG_new, + d2i_OSSL_CMP_MSG, bio, msg); +} + +int OSSL_i2d_CMP_MSG_bio(BIO *bio, const OSSL_CMP_MSG *msg) +{ + return ASN1_i2d_bio_of(OSSL_CMP_MSG, i2d_OSSL_CMP_MSG, bio, msg); +} diff --git a/crypto/cmp/cmp_protect.c b/crypto/cmp/cmp_protect.c index c1b4b8584d..ce20ef203e 100644 --- a/crypto/cmp/cmp_protect.c +++ b/crypto/cmp/cmp_protect.c @@ -286,6 +286,8 @@ int ossl_cmp_msg_protect(OSSL_CMP_CTX *ctx, OSSL_CMP_MSG *msg) * to section 5.1.1 */ subjKeyIDStr = X509_get0_subject_key_id(ctx->clCert); + if (subjKeyIDStr == NULL) + subjKeyIDStr = ctx->referenceValue; /* fallback */ if (subjKeyIDStr != NULL && !ossl_cmp_hdr_set1_senderKID(msg->header, subjKeyIDStr)) goto err; @@ -306,7 +308,18 @@ int ossl_cmp_msg_protect(OSSL_CMP_CTX *ctx, OSSL_CMP_MSG *msg) } } - return 1; + /* + * As required by RFC 4210 section 5.1.1., if the sender name is not known + * to the client it set to NULL-DN. In this case for identification at least + * the senderKID must be set, where we took the referenceValue as fallback. + */ + + if (ossl_cmp_general_name_is_NULL_DN(msg->header->sender) + && msg->header->senderKID == NULL) + CMPerr(0, CMP_R_MISSING_SENDER_IDENTIFICATION); + else + return 1; + err: CMPerr(0, CMP_R_ERROR_PROTECTING_MESSAGE); return 0; diff --git a/crypto/cmp/cmp_server.c b/crypto/cmp/cmp_server.c new file mode 100644 index 0000000000..a91f67b264 --- /dev/null +++ b/crypto/cmp/cmp_server.c @@ -0,0 +1,615 @@ +/* + * Copyright 2007-2019 The OpenSSL Project Authors. All Rights Reserved. + * Copyright Nokia 2007-2019 + * Copyright Siemens AG 2015-2019 + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* general CMP server functions */ + +#include + +#include "cmp_local.h" + +/* explicit #includes not strictly needed since implied by the above: */ +#include +#include + +/* the context for the generic CMP server */ +struct ossl_cmp_srv_ctx_st +{ + OSSL_CMP_CTX *ctx; /* Client CMP context, partly reused for srv */ + void *custom_ctx; /* pointer to specific server context */ + + OSSL_CMP_SRV_cert_request_cb_t process_cert_request; + OSSL_CMP_SRV_rr_cb_t process_rr; + OSSL_CMP_SRV_genm_cb_t process_genm; + OSSL_CMP_SRV_error_cb_t process_error; + OSSL_CMP_SRV_certConf_cb_t process_certConf; + OSSL_CMP_SRV_pollReq_cb_t process_pollReq; + + int sendUnprotectedErrors; /* Send error and rejection msgs unprotected */ + int acceptUnprotected; /* Accept requests with no/invalid prot. */ + int acceptRAVerified; /* Accept ir/cr/kur with POPO RAVerified */ + int grantImplicitConfirm; /* Grant implicit confirmation if requested */ + +}; /* OSSL_CMP_SRV_CTX */ + +void OSSL_CMP_SRV_CTX_free(OSSL_CMP_SRV_CTX *srv_ctx) +{ + if (srv_ctx == NULL) + return; + + OSSL_CMP_CTX_free(srv_ctx->ctx); + OPENSSL_free(srv_ctx); +} + +OSSL_CMP_SRV_CTX *OSSL_CMP_SRV_CTX_new(void) +{ + OSSL_CMP_SRV_CTX *ctx = OPENSSL_zalloc(sizeof(OSSL_CMP_SRV_CTX)); + + if (ctx == NULL) + goto err; + + if ((ctx->ctx = OSSL_CMP_CTX_new()) == NULL) + goto err; + + /* all other elements are initialized to 0 or NULL, respectively */ + return ctx; + err: + OSSL_CMP_SRV_CTX_free(ctx); + return NULL; +} + +int OSSL_CMP_SRV_CTX_init(OSSL_CMP_SRV_CTX *srv_ctx, void *custom_ctx, + OSSL_CMP_SRV_cert_request_cb_t process_cert_request, + OSSL_CMP_SRV_rr_cb_t process_rr, + OSSL_CMP_SRV_genm_cb_t process_genm, + OSSL_CMP_SRV_error_cb_t process_error, + OSSL_CMP_SRV_certConf_cb_t process_certConf, + OSSL_CMP_SRV_pollReq_cb_t process_pollReq) +{ + if (srv_ctx == NULL) { + CMPerr(0, CMP_R_NULL_ARGUMENT); + return 0; + } + srv_ctx->custom_ctx = custom_ctx; + srv_ctx->process_cert_request = process_cert_request; + srv_ctx->process_rr = process_rr; + srv_ctx->process_genm = process_genm; + srv_ctx->process_error = process_error; + srv_ctx->process_certConf = process_certConf; + srv_ctx->process_pollReq = process_pollReq; + return 1; +} + +OSSL_CMP_CTX *OSSL_CMP_SRV_CTX_get0_cmp_ctx(const OSSL_CMP_SRV_CTX *srv_ctx) +{ + if (srv_ctx == NULL) { + CMPerr(0, CMP_R_NULL_ARGUMENT); + return NULL; + } + return srv_ctx->ctx; +} + +void *OSSL_CMP_SRV_CTX_get0_custom_ctx(const OSSL_CMP_SRV_CTX *srv_ctx) +{ + if (srv_ctx == NULL) { + CMPerr(0, CMP_R_NULL_ARGUMENT); + return NULL; + } + return srv_ctx->custom_ctx; +} + +int OSSL_CMP_SRV_CTX_set_send_unprotected_errors(OSSL_CMP_SRV_CTX *srv_ctx, + int val) +{ + if (srv_ctx == NULL) { + CMPerr(0, CMP_R_NULL_ARGUMENT); + return 0; + } + srv_ctx->sendUnprotectedErrors = val != 0; + return 1; +} + +int OSSL_CMP_SRV_CTX_set_accept_unprotected(OSSL_CMP_SRV_CTX *srv_ctx, int val) +{ + if (srv_ctx == NULL) { + CMPerr(0, CMP_R_NULL_ARGUMENT); + return 0; + } + srv_ctx->acceptUnprotected = val != 0; + return 1; +} + +int OSSL_CMP_SRV_CTX_set_accept_raverified(OSSL_CMP_SRV_CTX *srv_ctx, int val) +{ + if (srv_ctx == NULL) { + CMPerr(0, CMP_R_NULL_ARGUMENT); + return 0; + } + srv_ctx->acceptRAVerified = val != 0; + return 1; +} + +int OSSL_CMP_SRV_CTX_set_grant_implicit_confirm(OSSL_CMP_SRV_CTX *srv_ctx, + int val) +{ + if (srv_ctx == NULL) { + CMPerr(0, CMP_R_NULL_ARGUMENT); + return 0; + } + srv_ctx->grantImplicitConfirm = val != 0; + return 1; +} + +/* + * Processes an ir/cr/p10cr/kur and returns a certification response. + * Only handles the first certification request contained in req + * returns an ip/cp/kup on success and NULL on error + */ +static OSSL_CMP_MSG *process_cert_request(OSSL_CMP_SRV_CTX *srv_ctx, + const OSSL_CMP_MSG *req) +{ + OSSL_CMP_MSG *msg = NULL; + OSSL_CMP_PKISI *si = NULL; + X509 *certOut = NULL; + STACK_OF(X509) *chainOut = NULL, *caPubs = NULL; + const OSSL_CRMF_MSG *crm = NULL; + const X509_REQ *p10cr = NULL; + int bodytype; + int certReqId; + + if (!ossl_assert(srv_ctx != NULL && srv_ctx->ctx != NULL && req != NULL)) + return NULL; + + switch (ossl_cmp_msg_get_bodytype(req)) { + case OSSL_CMP_PKIBODY_P10CR: + case OSSL_CMP_PKIBODY_CR: + bodytype = OSSL_CMP_PKIBODY_CP; + break; + case OSSL_CMP_PKIBODY_IR: + bodytype = OSSL_CMP_PKIBODY_IP; + break; + case OSSL_CMP_PKIBODY_KUR: + bodytype = OSSL_CMP_PKIBODY_KUP; + break; + default: + CMPerr(0, CMP_R_UNEXPECTED_PKIBODY); + return NULL; + } + + if (ossl_cmp_msg_get_bodytype(req) == OSSL_CMP_PKIBODY_P10CR) { + certReqId = OSSL_CMP_CERTREQID; + p10cr = req->body->value.p10cr; + } else { + OSSL_CRMF_MSGS *reqs = req->body->value.ir; /* same for cr and kur */ + + if (sk_OSSL_CRMF_MSG_num(reqs) != 1) { /* TODO: handle case > 1 */ + CMPerr(0, CMP_R_MULTIPLE_REQUESTS_NOT_SUPPORTED); + return NULL; + } + + if ((crm = sk_OSSL_CRMF_MSG_value(reqs, OSSL_CMP_CERTREQID)) == NULL) { + CMPerr(0, CMP_R_CERTREQMSG_NOT_FOUND); + return NULL; + } + certReqId = OSSL_CRMF_MSG_get_certReqId(crm); + } + + if (!ossl_cmp_verify_popo(req, srv_ctx->acceptRAVerified)) { + /* Proof of possession could not be verified */ + si = OSSL_CMP_STATUSINFO_new(OSSL_CMP_PKISTATUS_rejection, + 1 << OSSL_CMP_PKIFAILUREINFO_badPOP, + ERR_reason_error_string(ERR_peek_error())); + if (si == NULL) + return NULL; + } else { + OSSL_CMP_PKIHEADER *hdr = OSSL_CMP_MSG_get0_header(req); + + si = srv_ctx->process_cert_request(srv_ctx, req, certReqId, crm, p10cr, + &certOut, &chainOut, &caPubs); + if (si == NULL) + goto err; + /* set OSSL_CMP_OPT_IMPLICITCONFIRM if and only if transaction ends */ + if (!OSSL_CMP_CTX_set_option(srv_ctx->ctx, OSSL_CMP_OPT_IMPLICITCONFIRM, + ossl_cmp_hdr_has_implicitConfirm(hdr) + && srv_ctx->grantImplicitConfirm + /* do not set if polling starts: */ + && certOut != NULL)) + goto err; + } + + msg = ossl_cmp_certRep_new(srv_ctx->ctx, bodytype, certReqId, si, + certOut, chainOut, caPubs, 0 /* encrypted */, + srv_ctx->sendUnprotectedErrors); + /* + * TODO when implemented in ossl_cmp_certrep_new(): + * in case OSSL_CRMF_POPO_KEYENC, set encrypted + */ + if (msg == NULL) + CMPerr(0, CMP_R_ERROR_CREATING_CERTREP); + + err: + OSSL_CMP_PKISI_free(si); + X509_free(certOut); + sk_X509_pop_free(chainOut, X509_free); + sk_X509_pop_free(caPubs, X509_free); + return msg; +} + +static OSSL_CMP_MSG *process_rr(OSSL_CMP_SRV_CTX *srv_ctx, + const OSSL_CMP_MSG *req) +{ + OSSL_CMP_MSG *msg = NULL; + OSSL_CMP_REVDETAILS *details; + OSSL_CRMF_CERTID *certId; + OSSL_CRMF_CERTTEMPLATE *tmpl; + X509_NAME *issuer; + ASN1_INTEGER *serial; + OSSL_CMP_PKISI *si; + + if (!ossl_assert(srv_ctx != NULL && srv_ctx->ctx != NULL && req != NULL)) + return NULL; + + if (sk_OSSL_CMP_REVDETAILS_num(req->body->value.rr) != 1) { + /* TODO: handle multiple elements if multiple requests have been sent */ + CMPerr(0, CMP_R_MULTIPLE_REQUESTS_NOT_SUPPORTED); + return NULL; + } + + if ((details = sk_OSSL_CMP_REVDETAILS_value(req->body->value.rr, + OSSL_CMP_REVREQSID)) == NULL) { + CMPerr(0, CMP_R_ERROR_PROCESSING_MSG); + return NULL; + } + + tmpl = details->certDetails; + issuer = OSSL_CRMF_CERTTEMPLATE_get0_issuer(tmpl); + serial = OSSL_CRMF_CERTTEMPLATE_get0_serialNumber(tmpl); + /* here issuer and serial may safely be NULL */ + if ((certId = OSSL_CRMF_CERTID_gen(issuer, serial)) == NULL) + return NULL; + if ((si = srv_ctx->process_rr(srv_ctx, req, issuer, serial)) == NULL) + goto err; + + if ((msg = ossl_cmp_rp_new(srv_ctx->ctx, si, certId, + srv_ctx->sendUnprotectedErrors)) == NULL) + CMPerr(0, CMP_R_ERROR_CREATING_RR); + + err: + OSSL_CRMF_CERTID_free(certId); + OSSL_CMP_PKISI_free(si); + return msg; +} + +/* + * Processes genm and creates a genp message mirroring the contents of the + * incoming message + */ +static OSSL_CMP_MSG *process_genm(OSSL_CMP_SRV_CTX *srv_ctx, + const OSSL_CMP_MSG *req) +{ + OSSL_CMP_GENMSGCONTENT *itavs; + OSSL_CMP_MSG *msg; + + if (!ossl_assert(srv_ctx != NULL && srv_ctx->ctx != NULL && req != NULL)) + return NULL; + + if (!srv_ctx->process_genm(srv_ctx, req, req->body->value.genm, &itavs)) + return NULL; + + msg = ossl_cmp_genp_new(srv_ctx->ctx, itavs); + sk_OSSL_CMP_ITAV_pop_free(itavs, OSSL_CMP_ITAV_free); + return msg; +} + +static OSSL_CMP_MSG *process_error(OSSL_CMP_SRV_CTX *srv_ctx, + const OSSL_CMP_MSG *req) +{ + OSSL_CMP_ERRORMSGCONTENT *errorContent; + OSSL_CMP_MSG *msg; + + if (!ossl_assert(srv_ctx != NULL && srv_ctx->ctx != NULL && req != NULL)) + return NULL; + errorContent = req->body->value.error; + srv_ctx->process_error(srv_ctx, req, errorContent->pKIStatusInfo, + errorContent->errorCode, errorContent->errorDetails); + + if ((msg = ossl_cmp_pkiconf_new(srv_ctx->ctx)) == NULL) + CMPerr(0, CMP_R_ERROR_CREATING_PKICONF); + return msg; +} + +static OSSL_CMP_MSG *process_certConf(OSSL_CMP_SRV_CTX *srv_ctx, + const OSSL_CMP_MSG *req) +{ + OSSL_CMP_CTX *ctx; + OSSL_CMP_CERTCONFIRMCONTENT *ccc; + int num; + OSSL_CMP_MSG *msg = NULL; + OSSL_CMP_CERTSTATUS *status = NULL; + + if (!ossl_assert(srv_ctx != NULL && srv_ctx->ctx != NULL && req != NULL)) + return NULL; + + ctx = srv_ctx->ctx; + ccc = req->body->value.certConf; + num = sk_OSSL_CMP_CERTSTATUS_num(ccc); + + if (OSSL_CMP_CTX_get_option(ctx, OSSL_CMP_OPT_IMPLICITCONFIRM) == 1) { + CMPerr(0, CMP_R_ERROR_UNEXPECTED_CERTCONF); + return NULL; + } + + if (num == 0) { + ossl_cmp_err(ctx, "certificate rejected by client"); + } else { + if (num > 1) + ossl_cmp_warn(ctx, "All CertStatus but the first will be ignored"); + status = sk_OSSL_CMP_CERTSTATUS_value(ccc, OSSL_CMP_CERTREQID); + } + + if (status != NULL) { + int certReqId = ossl_cmp_asn1_get_int(status->certReqId); + ASN1_OCTET_STRING *certHash = status->certHash; + OSSL_CMP_PKISI *si = status->statusInfo; + + if (!srv_ctx->process_certConf(srv_ctx, req, certReqId, certHash, si)) + return NULL; /* reason code may be: CMP_R_CERTHASH_UNMATCHED */ + + if (si != NULL && ossl_cmp_pkisi_get_status(si) + != OSSL_CMP_PKISTATUS_accepted) { + int pki_status = ossl_cmp_pkisi_get_status(si); + const char *str = ossl_cmp_PKIStatus_to_string(pki_status); + + ossl_cmp_log2(INFO, ctx, "certificate rejected by client %s %s", + str == NULL ? "without" : "with", + str == NULL ? "PKIStatus" : str); + } + } + + if ((msg = ossl_cmp_pkiconf_new(ctx)) == NULL) + CMPerr(0, CMP_R_ERROR_CREATING_PKICONF); + return msg; +} + +static OSSL_CMP_MSG *process_pollReq(OSSL_CMP_SRV_CTX *srv_ctx, + const OSSL_CMP_MSG *req) +{ + OSSL_CMP_POLLREQCONTENT *prc; + OSSL_CMP_POLLREQ *pr; + int certReqId; + OSSL_CMP_MSG *certReq; + int64_t check_after = 0; + OSSL_CMP_MSG *msg = NULL; + + if (!ossl_assert(srv_ctx != NULL && srv_ctx->ctx != NULL && req != NULL)) + return NULL; + + prc = req->body->value.pollReq; + if (sk_OSSL_CMP_POLLREQ_num(prc) != 1) { /* TODO: handle case > 1 */ + CMPerr(0, CMP_R_MULTIPLE_REQUESTS_NOT_SUPPORTED); + return NULL; + } + + pr = sk_OSSL_CMP_POLLREQ_value(prc, 0); + certReqId = ossl_cmp_asn1_get_int(pr->certReqId); + if (!srv_ctx->process_pollReq(srv_ctx, req, certReqId, + &certReq, &check_after)) + return NULL; + + if (certReq != NULL) { + msg = process_cert_request(srv_ctx, certReq); + OSSL_CMP_MSG_free(certReq); + } else { + if ((msg = ossl_cmp_pollRep_new(srv_ctx->ctx, certReqId, + check_after)) == NULL) + CMPerr(0, CMP_R_ERROR_CREATING_POLLREP); + } + return msg; +} + +/* + * Determines whether missing protection is allowed + */ +static int unprotected_exception(const OSSL_CMP_CTX *ctx, + const OSSL_CMP_MSG *req, + int invalid_protection, + int accept_unprotected_requests) +{ + if (accept_unprotected_requests) { + ossl_cmp_log1(WARN, ctx, "ignoring %s protection of request message", + invalid_protection ? "invalid" : "missing"); + return 1; + } + if (ossl_cmp_msg_get_bodytype(req) == OSSL_CMP_PKIBODY_ERROR + && OSSL_CMP_CTX_get_option(ctx, OSSL_CMP_OPT_UNPROTECTED_ERRORS) == 1) { + ossl_cmp_warn(ctx, "ignoring missing protection of error message"); + return 1; + } + return 0; +} + +/* + * returns created message and NULL on internal error + */ +OSSL_CMP_MSG *OSSL_CMP_SRV_process_request(OSSL_CMP_SRV_CTX *srv_ctx, + const OSSL_CMP_MSG *req) +{ + OSSL_CMP_CTX *ctx; + OSSL_CMP_PKIHEADER *hdr; + int req_type, rsp_type; + OSSL_CMP_MSG *rsp = NULL; + + if (srv_ctx == NULL || srv_ctx->ctx == NULL + || req == NULL || req->body == NULL + || (hdr = OSSL_CMP_MSG_get0_header(req)) == NULL) { + CMPerr(0, CMP_R_NULL_ARGUMENT); + return 0; + } + ctx = srv_ctx->ctx; + + if (hdr->sender->type != GEN_DIRNAME) { + CMPerr(0, CMP_R_SENDER_GENERALNAME_TYPE_NOT_SUPPORTED); + goto err; + } + if (!OSSL_CMP_CTX_set1_recipient(ctx, hdr->sender->d.directoryName)) + goto err; + + req_type = ossl_cmp_msg_get_bodytype(req); + switch (req_type) { + case OSSL_CMP_PKIBODY_IR: + case OSSL_CMP_PKIBODY_CR: + case OSSL_CMP_PKIBODY_P10CR: + case OSSL_CMP_PKIBODY_KUR: + case OSSL_CMP_PKIBODY_RR: + case OSSL_CMP_PKIBODY_GENM: + case OSSL_CMP_PKIBODY_ERROR: + if (ctx->transactionID != NULL) { + char *tid; + + tid = OPENSSL_buf2hexstr(ctx->transactionID->data, + ctx->transactionID->length); + ossl_cmp_log1(WARN, ctx, + "Assuming that last transaction with ID=%s got aborted", + tid); + OPENSSL_free(tid); + } + /* start of a new transaction, set transactionID and senderNonce */ + if (!OSSL_CMP_CTX_set1_transactionID(ctx, hdr->transactionID) + || !ossl_cmp_ctx_set1_recipNonce(ctx, hdr->senderNonce)) + goto err; + break; + default: + /* transactionID should be already initialized */ + if (ctx->transactionID == NULL) { + CMPerr(0, CMP_R_UNEXPECTED_PKIBODY); + /* ignore any (extra) error in next two function calls: */ + (void)OSSL_CMP_CTX_set1_transactionID(ctx, hdr->transactionID); + (void)ossl_cmp_ctx_set1_recipNonce(ctx, hdr->senderNonce); + goto err; + } + } + + if (ossl_cmp_msg_check_received(ctx, req, unprotected_exception, + srv_ctx->acceptUnprotected) < 0) + goto err; + + switch (req_type) { + case OSSL_CMP_PKIBODY_IR: + case OSSL_CMP_PKIBODY_CR: + case OSSL_CMP_PKIBODY_P10CR: + case OSSL_CMP_PKIBODY_KUR: + if (srv_ctx->process_cert_request == NULL) + CMPerr(0, CMP_R_UNEXPECTED_PKIBODY); + else + rsp = process_cert_request(srv_ctx, req); + break; + case OSSL_CMP_PKIBODY_RR: + if (srv_ctx->process_rr == NULL) + CMPerr(0, CMP_R_UNEXPECTED_PKIBODY); + else + rsp = process_rr(srv_ctx, req); + break; + case OSSL_CMP_PKIBODY_GENM: + if (srv_ctx->process_genm == NULL) + CMPerr(0, CMP_R_UNEXPECTED_PKIBODY); + else + rsp = process_genm(srv_ctx, req); + break; + case OSSL_CMP_PKIBODY_ERROR: + if (srv_ctx->process_error == NULL) + CMPerr(0, CMP_R_UNEXPECTED_PKIBODY); + else + rsp = process_error(srv_ctx, req); + break; + case OSSL_CMP_PKIBODY_CERTCONF: + if (srv_ctx->process_certConf == NULL) + CMPerr(0, CMP_R_UNEXPECTED_PKIBODY); + else + rsp = process_certConf(srv_ctx, req); + break; + case OSSL_CMP_PKIBODY_POLLREQ: + if (srv_ctx->process_pollReq == NULL) + CMPerr(0, CMP_R_UNEXPECTED_PKIBODY); + else + rsp = process_pollReq(srv_ctx, req); + break; + default: + /* TODO possibly support further request message types */ + CMPerr(0, CMP_R_UNEXPECTED_PKIBODY); + } + + err: + if (rsp == NULL) { + /* on error, try to respond with CMP error message to client */ + const char *data = NULL; + int flags = 0; + unsigned long err = ERR_peek_error_data(&data, &flags); + int fail_info = 1 << OSSL_CMP_PKIFAILUREINFO_badRequest; + /* TODO fail_info could be more specific */ + OSSL_CMP_PKISI *si = NULL; + + if ((si = OSSL_CMP_STATUSINFO_new(OSSL_CMP_PKISTATUS_rejection, + fail_info, NULL)) == NULL) + return 0; + if (err != 0 && (flags & ERR_TXT_STRING) != 0) + data = ERR_reason_error_string(err); + rsp = ossl_cmp_error_new(srv_ctx->ctx, si, + err != 0 ? ERR_GET_REASON(err) : -1, + data, srv_ctx->sendUnprotectedErrors); + OSSL_CMP_PKISI_free(si); + } + + /* possibly close the transaction */ + rsp_type = + rsp != NULL ? ossl_cmp_msg_get_bodytype(rsp) : OSSL_CMP_PKIBODY_ERROR; + switch (rsp_type) { + case OSSL_CMP_PKIBODY_IP: + case OSSL_CMP_PKIBODY_CP: + case OSSL_CMP_PKIBODY_KUP: + case OSSL_CMP_PKIBODY_RP: + if (OSSL_CMP_CTX_get_option(ctx, OSSL_CMP_OPT_IMPLICITCONFIRM) == 0) + break; + /* fall through */ + + case OSSL_CMP_PKIBODY_PKICONF: + case OSSL_CMP_PKIBODY_GENP: + case OSSL_CMP_PKIBODY_ERROR: + /* TODO possibly support further terminating response message types */ + (void)OSSL_CMP_CTX_set1_transactionID(ctx, NULL); /* ignore any error */ + + default: /* not closing transaction in other cases */ + break; + } + return rsp; +} + +/* + * Server interface that may substitute OSSL_CMP_MSG_http_perform at the client. + * The OSSL_CMP_SRV_CTX must be set as client_ctx->transfer_cb_arg. + * returns received message on success, else NULL and pushes an element on the + * error stack. + */ +OSSL_CMP_MSG * OSSL_CMP_CTX_server_perform(OSSL_CMP_CTX *client_ctx, + const OSSL_CMP_MSG *req) +{ + OSSL_CMP_SRV_CTX *srv_ctx = NULL; + + if (client_ctx == NULL || req == NULL) { + CMPerr(0, CMP_R_NULL_ARGUMENT); + return 0; + } + + if ((srv_ctx = OSSL_CMP_CTX_get_transfer_cb_arg(client_ctx)) == NULL) { + CMPerr(0, CMP_R_ERROR_TRANSFERRING_OUT); + return 0; + } + + return OSSL_CMP_SRV_process_request(srv_ctx, req); +} diff --git a/crypto/cmp/cmp_status.c b/crypto/cmp/cmp_status.c index 7ebc57d37b..6232239237 100644 --- a/crypto/cmp/cmp_status.c +++ b/crypto/cmp/cmp_status.c @@ -28,17 +28,13 @@ /* CMP functions related to PKIStatus */ -int ossl_cmp_pkisi_get_pkistatus(const OSSL_CMP_PKISI *si) +int ossl_cmp_pkisi_get_status(const OSSL_CMP_PKISI *si) { if (!ossl_assert(si != NULL && si->status != NULL)) return -1; return ossl_cmp_asn1_get_int(si->status); } -/* - * return the declared identifier and a short explanation for the PKIStatus - * value as specified in RFC4210, Appendix F. - */ const char *ossl_cmp_PKIStatus_to_string(int status) { switch (status) { @@ -67,21 +63,13 @@ const char *ossl_cmp_PKIStatus_to_string(int status) } } -/* - * returns a pointer to the statusString contained in a PKIStatusInfo - * returns NULL on error - */ -OSSL_CMP_PKIFREETEXT *ossl_cmp_pkisi_get0_statusstring(const OSSL_CMP_PKISI *si) +OSSL_CMP_PKIFREETEXT *ossl_cmp_pkisi_get0_statusString(const OSSL_CMP_PKISI *si) { if (!ossl_assert(si != NULL)) return NULL; return si->statusString; } -/* - * returns the FailureInfo bits of the given PKIStatusInfo - * returns -1 on error - */ int ossl_cmp_pkisi_get_pkifailureinfo(const OSSL_CMP_PKISI *si) { int i; @@ -95,12 +83,9 @@ int ossl_cmp_pkisi_get_pkifailureinfo(const OSSL_CMP_PKISI *si) return res; } -/* - * internal function +/*- * convert PKIFailureInfo number to human-readable string - * - * returns pointer to static string - * returns NULL on error + * returns pointer to static string, or NULL on error */ static const char *CMP_PKIFAILUREINFO_to_string(int number) { @@ -164,11 +149,7 @@ static const char *CMP_PKIFAILUREINFO_to_string(int number) } } -/* - * checks PKIFailureInfo bits in a given PKIStatusInfo - * returns 1 if a given bit is set, 0 if not, -1 on error - */ -int ossl_cmp_pkisi_pkifailureinfo_check(const OSSL_CMP_PKISI *si, int bit_index) +int ossl_cmp_pkisi_check_pkifailureinfo(const OSSL_CMP_PKISI *si, int bit_index) { if (!ossl_assert(si != NULL && si->failInfo != NULL)) return -1; @@ -180,16 +161,17 @@ int ossl_cmp_pkisi_pkifailureinfo_check(const OSSL_CMP_PKISI *si, int bit_index) return ASN1_BIT_STRING_get_bit(si->failInfo, bit_index); } -/* +/*- * place human-readable error string created from PKIStatusInfo in given buffer * returns pointer to the same buffer containing the string, or NULL on error */ -char *OSSL_CMP_CTX_snprint_PKIStatus(OSSL_CMP_CTX *ctx, char *buf, - size_t bufsize) +static +char *snprint_PKIStatusInfo_parts(int status, int fail_info, + const OSSL_CMP_PKIFREETEXT *status_strings, + char *buf, size_t bufsize) { - int status, failure, fail_info; + int failure; const char *status_string, *failure_string; - OSSL_CMP_PKIFREETEXT *status_strings; ASN1_UTF8STRING *text; int i; int printed_chars; @@ -197,22 +179,22 @@ char *OSSL_CMP_CTX_snprint_PKIStatus(OSSL_CMP_CTX *ctx, char *buf, int n_status_strings; char *write_ptr = buf; -#define ADVANCE_BUFFER \ - if (printed_chars < 0 || (size_t)printed_chars >= bufsize) \ - return NULL; \ - write_ptr += printed_chars; \ - bufsize -= printed_chars; - - if (ctx == NULL - || buf == NULL - || (status = OSSL_CMP_CTX_get_status(ctx)) < 0 + if (buf == NULL + || status < 0 || (status_string = ossl_cmp_PKIStatus_to_string(status)) == NULL) return NULL; + +#define ADVANCE_BUFFER \ + if (printed_chars < 0 || (size_t)printed_chars >= bufsize) \ + return NULL; \ + write_ptr += printed_chars; \ + bufsize -= printed_chars; + printed_chars = BIO_snprintf(write_ptr, bufsize, "%s", status_string); ADVANCE_BUFFER; /* failInfo is optional and may be empty */ - if ((fail_info = OSSL_CMP_CTX_get_failInfoCode(ctx)) > 0) { + if (fail_info != 0) { printed_chars = BIO_snprintf(write_ptr, bufsize, "; PKIFailureInfo: "); ADVANCE_BUFFER; for (failure = 0; failure <= OSSL_CMP_PKIFAILUREINFO_MAX; failure++) { @@ -220,7 +202,7 @@ char *OSSL_CMP_CTX_snprint_PKIStatus(OSSL_CMP_CTX *ctx, char *buf, failure_string = CMP_PKIFAILUREINFO_to_string(failure); if (failure_string != NULL) { printed_chars = BIO_snprintf(write_ptr, bufsize, "%s%s", - failure > 0 ? ", " : "", + failinfo_found ? ", " : "", failure_string); ADVANCE_BUFFER; failinfo_found = 1; @@ -235,7 +217,6 @@ char *OSSL_CMP_CTX_snprint_PKIStatus(OSSL_CMP_CTX *ctx, char *buf, } /* statusString sequence is optional and may be empty */ - status_strings = OSSL_CMP_CTX_get0_statusString(ctx); n_status_strings = sk_ASN1_UTF8STRING_num(status_strings); if (n_status_strings > 0) { printed_chars = BIO_snprintf(write_ptr, bufsize, "; StatusString%s: ", @@ -253,13 +234,44 @@ char *OSSL_CMP_CTX_snprint_PKIStatus(OSSL_CMP_CTX *ctx, char *buf, return buf; } -/* +char *OSSL_CMP_snprint_PKIStatusInfo(const OSSL_CMP_PKISI *statusInfo, + char *buf, size_t bufsize) +{ + int failure_info; + + if (statusInfo == NULL) { + CMPerr(0, CMP_R_NULL_ARGUMENT); + return NULL; + } + + failure_info = ossl_cmp_pkisi_get_pkifailureinfo(statusInfo); + + return snprint_PKIStatusInfo_parts(ASN1_INTEGER_get(statusInfo->status), + failure_info, + statusInfo->statusString, buf, bufsize); +} + +char *OSSL_CMP_CTX_snprint_PKIStatus(const OSSL_CMP_CTX *ctx, char *buf, + size_t bufsize) +{ + if (ctx == NULL) { + CMPerr(0, CMP_R_NULL_ARGUMENT); + return NULL; + } + + return snprint_PKIStatusInfo_parts(OSSL_CMP_CTX_get_status(ctx), + OSSL_CMP_CTX_get_failInfoCode(ctx), + OSSL_CMP_CTX_get0_statusString(ctx), + buf, bufsize); +} + +/*- * Creates a new PKIStatusInfo structure and fills it in * returns a pointer to the structure on success, NULL on error * note: strongly overlaps with TS_RESP_CTX_set_status_info() * and TS_RESP_CTX_add_failure_info() in ../ts/ts_rsp_sign.c */ -OSSL_CMP_PKISI *ossl_cmp_statusinfo_new(int status, int fail_info, +OSSL_CMP_PKISI *OSSL_CMP_STATUSINFO_new(int status, int fail_info, const char *text) { OSSL_CMP_PKISI *si = OSSL_CMP_PKISI_new(); diff --git a/crypto/cmp/cmp_util.c b/crypto/cmp/cmp_util.c index ad4ae66454..70c060166a 100644 --- a/crypto/cmp/cmp_util.c +++ b/crypto/cmp/cmp_util.c @@ -320,6 +320,26 @@ STACK_OF(X509) *ossl_cmp_build_cert_chain(STACK_OF(X509) *certs, X509 *cert) return result; } +int ossl_cmp_sk_ASN1_UTF8STRING_push_str(STACK_OF(ASN1_UTF8STRING) *sk, + const char *text) +{ + ASN1_UTF8STRING *utf8string; + + if (!ossl_assert(sk != NULL && text != NULL)) + return 0; + if ((utf8string = ASN1_UTF8STRING_new()) == NULL) + return 0; + if (!ASN1_STRING_set(utf8string, text, -1)) + goto err; + if (!sk_ASN1_UTF8STRING_push(sk, utf8string)) + goto err; + return 1; + + err: + ASN1_UTF8STRING_free(utf8string); + return 0; +} + int ossl_cmp_asn1_octet_string_set1(ASN1_OCTET_STRING **tgt, const ASN1_OCTET_STRING *src) { diff --git a/crypto/crmf/crmf_err.c b/crypto/crmf/crmf_err.c index 87e6a2da60..159d5b2c91 100644 --- a/crypto/crmf/crmf_err.c +++ b/crypto/crmf/crmf_err.c @@ -1,6 +1,6 @@ /* * Generated by util/mkerr.pl DO NOT EDIT - * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -30,6 +30,15 @@ static const ERR_STRING_DATA CRMF_str_reasons[] = { "iterationcount below 100"}, {ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_MALFORMED_IV), "malformed iv"}, {ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_NULL_ARGUMENT), "null argument"}, + {ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_POPO_INCONSISTENT_PUBLIC_KEY), + "popo inconsistent public key"}, + {ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_POPO_MISSING), "popo missing"}, + {ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_POPO_MISSING_PUBLIC_KEY), + "popo missing public key"}, + {ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_POPO_MISSING_SUBJECT), + "popo missing subject"}, + {ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_POPO_RAVERIFIED_NOT_ACCEPTED), + "popo raverified not accepted"}, {ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_SETTING_MAC_ALGOR_FAILURE), "setting mac algor failure"}, {ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_SETTING_OWF_ALGOR_FAILURE), @@ -44,8 +53,6 @@ static const ERR_STRING_DATA CRMF_str_reasons[] = { "unsupported method for creating popo"}, {ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_UNSUPPORTED_POPO_METHOD), "unsupported popo method"}, - {ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_UNSUPPORTED_POPO_NOT_ACCEPTED), - "unsupported popo not accepted"}, {0, NULL} }; diff --git a/crypto/crmf/crmf_lib.c b/crypto/crmf/crmf_lib.c index 863d26f86e..dd69372f3e 100644 --- a/crypto/crmf/crmf_lib.c +++ b/crypto/crmf/crmf_lib.c @@ -303,7 +303,7 @@ static int crmf_asn1_get_int(const ASN1_INTEGER *a) return (int)res; } -int OSSL_CRMF_MSG_get_certReqId(OSSL_CRMF_MSG *crm) +int OSSL_CRMF_MSG_get_certReqId(const OSSL_CRMF_MSG *crm) { if (crm == NULL || /* not really needed: */ crm->certReq == NULL) { CRMFerr(CRMF_F_OSSL_CRMF_MSG_GET_CERTREQID, CRMF_R_NULL_ARGUMENT); @@ -485,21 +485,29 @@ int OSSL_CRMF_MSGS_verify_popo(const OSSL_CRMF_MSGS *reqs, X509_PUBKEY *pubkey = NULL; OSSL_CRMF_POPOSIGNINGKEY *sig = NULL; - if (reqs == NULL - || (req = sk_OSSL_CRMF_MSG_value(reqs, rid)) == NULL - || req->popo == NULL) { - CRMFerr(CRMF_F_OSSL_CRMF_MSGS_VERIFY_POPO, - CRMF_R_NULL_ARGUMENT); + if (reqs == NULL || (req = sk_OSSL_CRMF_MSG_value(reqs, rid)) == NULL) { + CRMFerr(CRMF_F_OSSL_CRMF_MSGS_VERIFY_POPO, CRMF_R_NULL_ARGUMENT); + return 0; + } + + if (req->popo == NULL) { + CRMFerr(0, CRMF_R_POPO_MISSING); return 0; } switch (req->popo->type) { case OSSL_CRMF_POPO_RAVERIFIED: - if (acceptRAVerified) - return 1; + if (!acceptRAVerified) { + CRMFerr(0, CRMF_R_POPO_RAVERIFIED_NOT_ACCEPTED); + return 0; + } break; case OSSL_CRMF_POPO_SIGNATURE: pubkey = req->certReq->certTemplate->publicKey; + if (pubkey == NULL) { + CRMFerr(0, CRMF_R_POPO_MISSING_PUBLIC_KEY); + return 0; + } sig = req->popo->value.signature; if (sig->poposkInput != NULL) { /* @@ -507,26 +515,34 @@ int OSSL_CRMF_MSGS_verify_popo(const OSSL_CRMF_MSGS *reqs, * the public key from the certificate template. This MUST be * exactly the same value as contained in the certificate template. */ - const ASN1_ITEM *rptr = ASN1_ITEM_rptr(OSSL_CRMF_POPOSIGNINGKEYINPUT); - - if (pubkey == NULL - || sig->poposkInput->publicKey == NULL - || X509_PUBKEY_cmp(pubkey, sig->poposkInput->publicKey) - || ASN1_item_verify(rptr, sig->algorithmIdentifier, - sig->signature, sig->poposkInput, - X509_PUBKEY_get0(pubkey)) < 1) - break; + if (sig->poposkInput->publicKey == NULL) { + CRMFerr(0, CRMF_R_POPO_MISSING_PUBLIC_KEY); + return 0; + } + if (X509_PUBKEY_cmp(pubkey, sig->poposkInput->publicKey) != 0) { + CRMFerr(0, CRMF_R_POPO_INCONSISTENT_PUBLIC_KEY); + return 0; + } + /* + * TODO check the contents of the authInfo sub-field, + * see RFC 4211 https://tools.ietf.org/html/rfc4211#section-4.1 + */ + if (ASN1_item_verify(ASN1_ITEM_rptr(OSSL_CRMF_POPOSIGNINGKEYINPUT), + sig->algorithmIdentifier, sig->signature, + sig->poposkInput, + X509_PUBKEY_get0(pubkey)) < 1) + return 0; } else { - if (pubkey == NULL - || req->certReq->certTemplate->subject == NULL - || ASN1_item_verify(ASN1_ITEM_rptr(OSSL_CRMF_CERTREQUEST), - sig->algorithmIdentifier, - sig->signature, - req->certReq, - X509_PUBKEY_get0(pubkey)) < 1) - break; + if (req->certReq->certTemplate->subject == NULL) { + CRMFerr(0, CRMF_R_POPO_MISSING_SUBJECT); + return 0; + } + if (ASN1_item_verify(ASN1_ITEM_rptr(OSSL_CRMF_CERTREQUEST), + sig->algorithmIdentifier, sig->signature, + req->certReq, X509_PUBKEY_get0(pubkey)) < 1) + return 0; } - return 1; + break; case OSSL_CRMF_POPO_KEYENC: /* * TODO: when OSSL_CMP_certrep_new() supports encrypted certs, @@ -540,19 +556,19 @@ int OSSL_CRMF_MSGS_verify_popo(const OSSL_CRMF_MSGS *reqs, CRMF_R_UNSUPPORTED_POPO_METHOD); return 0; } - CRMFerr(CRMF_F_OSSL_CRMF_MSGS_VERIFY_POPO, - CRMF_R_UNSUPPORTED_POPO_NOT_ACCEPTED); - return 0; + return 1; } /* retrieves the serialNumber of the given cert template or NULL on error */ -ASN1_INTEGER *OSSL_CRMF_CERTTEMPLATE_get0_serialNumber(OSSL_CRMF_CERTTEMPLATE *tmpl) +ASN1_INTEGER +*OSSL_CRMF_CERTTEMPLATE_get0_serialNumber(const OSSL_CRMF_CERTTEMPLATE *tmpl) { return tmpl != NULL ? tmpl->serialNumber : NULL; } /* retrieves the issuer name of the given cert template or NULL on error */ -X509_NAME *OSSL_CRMF_CERTTEMPLATE_get0_issuer(OSSL_CRMF_CERTTEMPLATE *tmpl) +X509_NAME +*OSSL_CRMF_CERTTEMPLATE_get0_issuer(const OSSL_CRMF_CERTTEMPLATE *tmpl) { return tmpl != NULL ? tmpl->issuer : NULL; } @@ -606,7 +622,7 @@ int OSSL_CRMF_CERTTEMPLATE_fill(OSSL_CRMF_CERTTEMPLATE *tmpl, * returns a pointer to the decrypted certificate * returns NULL on error or if no certificate available */ -X509 *OSSL_CRMF_ENCRYPTEDVALUE_get1_encCert(OSSL_CRMF_ENCRYPTEDVALUE *ecert, +X509 *OSSL_CRMF_ENCRYPTEDVALUE_get1_encCert(const OSSL_CRMF_ENCRYPTEDVALUE *ecert, EVP_PKEY *pkey) { X509 *cert = NULL; /* decrypted certificate */ diff --git a/crypto/err/err_prn.c b/crypto/err/err_prn.c index 9a5889829d..1647d93043 100644 --- a/crypto/err/err_prn.c +++ b/crypto/err/err_prn.c @@ -68,7 +68,7 @@ void ERR_add_error_txt(const char *separator, const char *txt) if (separator == NULL) separator = ""; if (err == 0) - put_error(ERR_LIB_CMP, NULL, 0, "", 0); + put_error(ERR_LIB_NONE, NULL, 0, "", 0); do { size_t available_len, data_len; @@ -125,7 +125,7 @@ void ERR_add_error_txt(const char *separator, const char *txt) ERR_add_error_data(2, separator, tmp); OPENSSL_free(tmp); } - put_error(ERR_LIB_CMP, func, err, file, line); + put_error(ERR_GET_LIB(err), func, err, file, line); txt = curr; } else { if (trailing_separator) { diff --git a/crypto/err/openssl.txt b/crypto/err/openssl.txt index 8689e34925..c921207698 100644 --- a/crypto/err/openssl.txt +++ b/crypto/err/openssl.txt @@ -2076,8 +2076,10 @@ BN_R_TOO_MANY_ITERATIONS:113:too many iterations BN_R_TOO_MANY_TEMPORARY_VARIABLES:109:too many temporary variables CMP_R_ALGORITHM_NOT_SUPPORTED:139:algorithm not supported CMP_R_BAD_REQUEST_ID:108:bad request id +CMP_R_CERTHASH_UNMATCHED:156:certhash unmatched CMP_R_CERTID_NOT_FOUND:109:certid not found CMP_R_CERTIFICATE_NOT_FOUND:112:certificate not found +CMP_R_CERTREQMSG_NOT_FOUND:157:certreqmsg not found CMP_R_CERTRESPONSE_NOT_FOUND:113:certresponse not found CMP_R_CERT_AND_KEY_DO_NOT_MATCH:114:cert and key do not match CMP_R_ERROR_CALCULATING_PROTECTION:115:error calculating protection @@ -2093,8 +2095,11 @@ CMP_R_ERROR_CREATING_POLLREQ:124:error creating pollreq CMP_R_ERROR_CREATING_RP:125:error creating rp CMP_R_ERROR_CREATING_RR:126:error creating rr CMP_R_ERROR_PARSING_PKISTATUS:107:error parsing pkistatus +CMP_R_ERROR_PROCESSING_MSG:158:error processing msg CMP_R_ERROR_PROTECTING_MESSAGE:127:error protecting message CMP_R_ERROR_SETTING_CERTHASH:128:error setting certhash +CMP_R_ERROR_TRANSFERRING_OUT:159:error transferring out +CMP_R_ERROR_UNEXPECTED_CERTCONF:160:error unexpected certconf CMP_R_ERROR_VALIDATING_PROTECTION:140:error validating protection CMP_R_FAILED_EXTRACTING_PUBKEY:141:failed extracting pubkey CMP_R_FAILURE_OBTAINING_RANDOM:110:failure obtaining random @@ -2107,6 +2112,7 @@ CMP_R_MISSING_PRIVATE_KEY:131:missing private key CMP_R_MISSING_PROTECTION:143:missing protection CMP_R_MISSING_SENDER_IDENTIFICATION:111:missing sender identification CMP_R_MISSING_TRUST_STORE:144:missing trust store +CMP_R_MULTIPLE_REQUESTS_NOT_SUPPORTED:161:multiple requests not supported CMP_R_MULTIPLE_SAN_SOURCES:102:multiple san sources CMP_R_NO_STDIO:194:no stdio CMP_R_NO_SUITABLE_SENDER_CERT:145:no suitable sender cert @@ -2256,6 +2262,11 @@ CRMF_R_FAILURE_OBTAINING_RANDOM:107:failure obtaining random CRMF_R_ITERATIONCOUNT_BELOW_100:108:iterationcount below 100 CRMF_R_MALFORMED_IV:101:malformed iv CRMF_R_NULL_ARGUMENT:109:null argument +CRMF_R_POPO_INCONSISTENT_PUBLIC_KEY:117:popo inconsistent public key +CRMF_R_POPO_MISSING:121:popo missing +CRMF_R_POPO_MISSING_PUBLIC_KEY:118:popo missing public key +CRMF_R_POPO_MISSING_SUBJECT:119:popo missing subject +CRMF_R_POPO_RAVERIFIED_NOT_ACCEPTED:120:popo raverified not accepted CRMF_R_SETTING_MAC_ALGOR_FAILURE:110:setting mac algor failure CRMF_R_SETTING_OWF_ALGOR_FAILURE:111:setting owf algor failure CRMF_R_UNSUPPORTED_ALGORITHM:112:unsupported algorithm @@ -2264,7 +2275,6 @@ CRMF_R_UNSUPPORTED_CIPHER:114:unsupported cipher CRMF_R_UNSUPPORTED_METHOD_FOR_CREATING_POPO:115:\ unsupported method for creating popo CRMF_R_UNSUPPORTED_POPO_METHOD:116:unsupported popo method -CRMF_R_UNSUPPORTED_POPO_NOT_ACCEPTED:117:unsupported popo not accepted CRYPTO_R_BAD_ALGORITHM_NAME:117:bad algorithm name CRYPTO_R_CONFLICTING_NAMES:118:conflicting names CRYPTO_R_FIPS_MODE_NOT_SUPPORTED:101:fips mode not supported diff --git a/crypto/http/http_local.h b/crypto/http/http_local.h index 4e6577f66d..4722750018 100644 --- a/crypto/http/http_local.h +++ b/crypto/http/http_local.h @@ -46,4 +46,4 @@ ASN1_VALUE *HTTP_sendreq_bio(BIO *bio, OSSL_HTTP_bio_cb_t bio_update_fn, int maxline, unsigned long max_resp_len, int timeout, const ASN1_ITEM *rsp_it); -#endif /* !defined OSSL_CRYPTO_HTTP_LOCAL_H */ +#endif /* !defined(OSSL_CRYPTO_HTTP_LOCAL_H) */ diff --git a/crypto/ts/ts_rsp_verify.c b/crypto/ts/ts_rsp_verify.c index 7d2161f2d0..dfb068c8b6 100644 --- a/crypto/ts/ts_rsp_verify.c +++ b/crypto/ts/ts_rsp_verify.c @@ -495,34 +495,7 @@ static int ts_check_status_info(TS_RESP *response) static char *ts_get_status_text(STACK_OF(ASN1_UTF8STRING) *text) { - int i; - int length = 0; - char *result = NULL; - char *p; - - for (i = 0; i < sk_ASN1_UTF8STRING_num(text); ++i) { - ASN1_UTF8STRING *current = sk_ASN1_UTF8STRING_value(text, i); - if (ASN1_STRING_length(current) > TS_MAX_STATUS_LENGTH - length - 1) - return NULL; - length += ASN1_STRING_length(current); - length += 1; /* separator character */ - } - if ((result = OPENSSL_malloc(length)) == NULL) { - TSerr(TS_F_TS_GET_STATUS_TEXT, ERR_R_MALLOC_FAILURE); - return NULL; - } - - for (i = 0, p = result; i < sk_ASN1_UTF8STRING_num(text); ++i) { - ASN1_UTF8STRING *current = sk_ASN1_UTF8STRING_value(text, i); - length = ASN1_STRING_length(current); - if (i > 0) - *p++ = '/'; - strncpy(p, (const char *)ASN1_STRING_get0_data(current), length); - p += length; - } - *p = '\0'; - - return result; + return sk_ASN1_UTF8STRING2text(text, "/", TS_MAX_STATUS_LENGTH); } static int ts_check_policy(const ASN1_OBJECT *req_oid, diff --git a/crypto/x509/x_all.c b/crypto/x509/x_all.c index 6a6748bad4..2d7387b9e0 100644 --- a/crypto/x509/x_all.c +++ b/crypto/x509/x_all.c @@ -450,6 +450,35 @@ int X509_digest(const X509 *data, const EVP_MD *type, unsigned char *md, (ASN1_ITEM_rptr(X509), type, (char *)data, md, len)); } +/* calculate cert digest using the same hash algorithm as in its signature */ +ASN1_OCTET_STRING *X509_digest_sig(const X509 *cert) +{ + unsigned int len; + unsigned char hash[EVP_MAX_MD_SIZE]; + int md_NID; + const EVP_MD *md = NULL; + ASN1_OCTET_STRING *new = NULL; + + if (cert == NULL) { + X509err(0, ERR_R_PASSED_NULL_PARAMETER); + return NULL; + } + + if (!OBJ_find_sigid_algs(X509_get_signature_nid(cert), &md_NID, NULL) + || (md = EVP_get_digestbynid(md_NID)) == NULL) { + CMPerr(0, X509_R_UNSUPPORTED_ALGORITHM); + return NULL; + } + if (!X509_digest(cert, md, hash, &len) + || (new = ASN1_OCTET_STRING_new()) == NULL) + return NULL; + if (!(ASN1_OCTET_STRING_set(new, hash, len))) { + ASN1_OCTET_STRING_free(new); + return NULL; + } + return new; +} + int X509_CRL_digest(const X509_CRL *data, const EVP_MD *type, unsigned char *md, unsigned int *len) { diff --git a/doc/internal/man3/ossl_cmp_hdr_init.pod b/doc/internal/man3/ossl_cmp_hdr_init.pod index a7a4d87f09..5df7486cb0 100644 --- a/doc/internal/man3/ossl_cmp_hdr_init.pod +++ b/doc/internal/man3/ossl_cmp_hdr_init.pod @@ -5,6 +5,7 @@ ossl_cmp_hdr_set_pvno, ossl_cmp_hdr_get_pvno, ossl_cmp_hdr_get0_sendernonce, +ossl_cmp_general_name_is_NULL_DN, ossl_cmp_hdr_set1_sender, ossl_cmp_hdr_set1_recipient, ossl_cmp_hdr_update_messagetime, @@ -14,7 +15,7 @@ ossl_cmp_hdr_push1_freeText, ossl_cmp_hdr_generalinfo_item_push0, ossl_cmp_hdr_generalinfo_items_push1, ossl_cmp_hdr_set_implicitConfirm, -ossl_cmp_hdr_check_implicitConfirm, +ossl_cmp_hdr_has_implicitConfirm, ossl_cmp_hdr_init - functions manipulating CMP message headers @@ -26,6 +27,7 @@ ossl_cmp_hdr_init int ossl_cmp_hdr_get_pvno(const OSSL_CMP_PKIHEADER *hdr); ASN1_OCTET_STRING *ossl_cmp_hdr_get0_sendernonce(const OSSL_CMP_PKIHEADER *hdr); + int ossl_cmp_general_name_is_NULL_DN(GENERAL_NAME *name); int ossl_cmp_hdr_set1_sender(OSSL_CMP_PKIHEADER *hdr, const X509_NAME *nm); int ossl_cmp_hdr_set1_recipient(OSSL_CMP_PKIHEADER *hdr, const X509_NAME *nm); @@ -41,7 +43,7 @@ ossl_cmp_hdr_init int ossl_cmp_hdr_push1_freeText(OSSL_CMP_PKIHEADER *hdr, ASN1_UTF8STRING *text); int ossl_cmp_hdr_set_implicitConfirm(OSSL_CMP_PKIHEADER *hdr); - int ossl_cmp_hdr_check_implicitConfirm(OSSL_CMP_PKIHEADER *hdr); + int ossl_cmp_hdr_has_implicitConfirm(OSSL_CMP_PKIHEADER *hdr); int ossl_cmp_hdr_init(OSSL_CMP_CTX *ctx, OSSL_CMP_PKIHEADER *hdr); =head1 DESCRIPTION @@ -52,6 +54,9 @@ ossl_cmp_hdr_get_pvno() returns the pvno of the given B or -1 on error. ossl_cmp_hdr_get0_sendernonce() returns the sender nonce of the given PKIHeader. +ossl_cmp_general_name_is_NULL_DN() determines if the given GENERAL_NAME +is the NULL-DN. + ossl_cmp_hdr_set1_sender() sets the sender field in the given PKIHeader to the given X509 Name value, without consuming the pointer. @@ -85,7 +90,7 @@ pointer. ossl_cmp_hdr_set_implicitConfirm() sets implicitConfirm in the generalInfo field of the PKIMessage header. -ossl_cmp_hdr_check_implicitConfirm() returns 1 if implicitConfirm is +ossl_cmp_hdr_has_implicitConfirm() returns 1 if implicitConfirm is set int generalInfo field of the given PKIMessage header, 0 if not. ossl_cmp_hdr_init() initializes a PKIHeader structure based on the @@ -107,6 +112,8 @@ ossl_cmp_hdr_get_pvno() returns the pvno of the given B or -1 on error. ossl_cmp_hdr_get0_sendernonce() returns the respective nonce. +ossl_cmp_general_name_is_NULL_DN() returns 1 given a NULL-DN, else 0. + All other functions return 1 on success, 0 on error. See the individual functions above. diff --git a/doc/internal/man3/ossl_cmp_mock_srv_new.pod b/doc/internal/man3/ossl_cmp_mock_srv_new.pod new file mode 100644 index 0000000000..da1f44b391 --- /dev/null +++ b/doc/internal/man3/ossl_cmp_mock_srv_new.pod @@ -0,0 +1,85 @@ +=pod + +=head1 NAME + +ossl_cmp_mock_srv_new, +ossl_cmp_mock_srv_free, +ossl_cmp_mock_srv_set1_certOut, +ossl_cmp_mock_srv_set1_chainOut, +ossl_cmp_mock_srv_set1_caPubsOut, +ossl_cmp_mock_srv_set_statusInfo, +ossl_cmp_mock_srv_set_send_error, +ossl_cmp_mock_srv_set_pollCount, +ossl_cmp_mock_srv_set_checkAfterTime +- functions used for testing with CMP mock server + +=head1 SYNOPSIS + + #include + + OSSL_CMP_SRV_CTX *ossl_cmp_mock_srv_new(void); + void ossl_cmp_mock_srv_free(OSSL_CMP_SRV_CTX *srv_ctx); + + int ossl_cmp_mock_srv_set1_certOut(OSSL_CMP_SRV_CTX *srv_ctx, X509 *cert); + int ossl_cmp_mock_srv_set1_chainOut(OSSL_CMP_SRV_CTX *srv_ctx, + STACK_OF(X509) *chain); + int ossl_cmp_mock_srv_set1_caPubsOut(OSSL_CMP_SRV_CTX *srv_ctx, + STACK_OF(X509) *caPubs); + int ossl_cmp_mock_srv_set_statusInfo(OSSL_CMP_SRV_CTX *srv_ctx, int status, + int fail_info, const char *text); + int ossl_cmp_mock_srv_set_send_error(OSSL_CMP_SRV_CTX *srv_ctx, int val); + int ossl_cmp_mock_srv_set_pollCount(OSSL_CMP_SRV_CTX *srv_ctx, int count); + int ossl_cmp_mock_srv_set_checkAfterTime(OSSL_CMP_SRV_CTX *srv_ctx, int sec); + +=head1 DESCRIPTION + +ossl_cmp_mock_srv_new() allocates the contexts for the CMP mock server. + +ossl_cmp_mock_srv_free() deallocates the contexts for the CMP mock server. + +OSSL_CMP_SRV_CTX_set1_certOut() sets the certificate to be returned in +cp/ip/kup. + +OSSL_CMP_SRV_CTX_set1_chainOut() sets the certificate chain to be added to +the extraCerts in a cp/ip/kup. +It should to useful to validate B. + +OSSL_CMP_SRV_CTX_set1_caPubsOut() sets the caPubs to be returned in an ip. + +OSSL_CMP_SRV_CTX_set_statusInfo() sets the status info to be returned. + +OSSL_CMP_SRV_CTX_set_send_error() enables enforcement of error responses. + +OSSL_CMP_SRV_CTX_set_pollCount() sets the number of polls before cert response. + +OSSL_CMP_SRV_CTX_set_checkAfterTime() sets the number of seconds +the client should wait for the next poll. + + +=head1 NOTES + +CMP is defined in RFC 4210 (and CRMF in RFC 4211). + +=head1 RETURN VALUES + +ossl_cmp_mock_srv() returns a B structure on success, +NULL on error. + +ossl_cmp_mock_srv_free() does not return a value. + +All other functions return 1 on success, 0 on error. + +=head1 HISTORY + +The OpenSSL CMP support was added in OpenSSL 3.0. + +=head1 COPYRIGHT + +Copyright 2007-2020 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the Apache License 2.0 (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +L. + +=cut diff --git a/doc/internal/man3/ossl_cmp_statusinfo_new.pod b/doc/internal/man3/ossl_cmp_pkisi_get_status.pod similarity index 58% rename from doc/internal/man3/ossl_cmp_statusinfo_new.pod rename to doc/internal/man3/ossl_cmp_pkisi_get_status.pod index ee7dd35cf5..deca1aa2bb 100644 --- a/doc/internal/man3/ossl_cmp_statusinfo_new.pod +++ b/doc/internal/man3/ossl_cmp_pkisi_get_status.pod @@ -2,13 +2,11 @@ =head1 NAME -ossl_cmp_statusinfo_new, -ossl_cmp_pkisi_pkistatus_get, -ossl_cmp_pkisi_pkifailureinfo_get, -ossl_cmp_pkisi_pkifailureinfo_check, -ossl_cmp_pkisi_failinfo_get0, -ossl_cmp_pkisi_statusstring_get0, -ossl_pkisi_snprint +ossl_cmp_pkisi_get_status, +ossl_cmp_PKIStatus_to_string, +ossl_cmp_pkisi_get0_statusString, +ossl_cmp_pkisi_get_pkifailureinfo, +ossl_cmp_pkisi_check_pkifailureinfo - functions for managing PKI status information =head1 SYNOPSIS @@ -44,40 +42,27 @@ ossl_pkisi_snprint # define OSSL_CMP_PKIFAILUREINFO_duplicateCertReq 26 # define OSSL_CMP_PKIFAILUREINFO_MAX 26 - OSSL_CMP_PKISI *ossl_cmp_statusinfo_new(int status, int fail_info, - const char *text); - int ossl_cmp_pkisi_pkistatus_get(OSSL_CMP_PKISI *si); - int ossl_cmp_pkisi_pkifailureinfo_get(OSSL_CMP_PKISI *si); - int ossl_cmp_pkisi_pkifailureinfo_check(OSSL_CMP_PKISI *si, int bit_index); - OSSL_CMP_PKIFAILUREINFO *ossl_cmp_pkisi_failinfo_get0(const OSSL_CMP_PKISI *si); - OSSL_CMP_PKIFREETEXT *ossl_cmp_pkisi_statusstring_get0(const OSSL_CMP_PKISI *si); - char *ossl_pkisi_snprint(OSSL_CMP_PKISI *si, char *buf, int bufsize); + int ossl_cmp_pkisi_get_status(const OSSL_CMP_PKISI *si); + const char *ossl_cmp_PKIStatus_to_string(int status); + OSSL_CMP_PKIFREETEXT *ossl_cmp_pkisi_get0_statusString(const OSSL_CMP_PKISI *si); + int ossl_cmp_pkisi_get_pkifailureinfo(const OSSL_CMP_PKISI *si); + int ossl_cmp_pkisi_check_pkifailureinfo(const OSSL_CMP_PKISI *si, int index); =head1 DESCRIPTION -ossl_cmp_statusinfo_new() creates a new PKIStatusInfo structure and fills it -with the given values. It sets the status field to B. -If B is not NULL, it is copied to statusString. -B is is interpreted as bit pattern for the failInfo field. -Returns a pointer to the structure on success, or NULL on error. +ossl_cmp_pkisi_get_status() returns the PKIStatus of B, or -1 on error. -ossl_cmp_pkisi_pkistatus_get() returns the PKIStatus of B, or -1 on error. +ossl_cmp_PKIStatus_to_string() returns a human-readable string representing +the PKIStatus values as specified in RFC 4210, Appendix F. -ossl_cmp_pkisi_pkifailureinfo_get() returns the PKIFailureInfo bits -of B, encoded as integer, or -1 on error. - -ossl_cmp_pkisi_pkifailureinfo_check() returns the state of the bit (0 or 1) -with index B in the PKIFailureInfo of the B, or -1 on error. - -ossl_cmp_pkisi_failinfo_get0() returns a direct pointer to the failInfo -field contained in B, or NULL on error. - -ossl_cmp_pkisi_statusstring_get0() returns a direct pointer to the statusString +ossl_cmp_pkisi_get0_statusString() returns a direct pointer to the statusString field contained in B. -ossl_pkisi_snprint() places at max B characters of human-readable -error string of B in pre-allocated B. Returns pointer to the same -B containing the string, or NULL on error. +ossl_cmp_pkisi_get_pkifailureinfo() returns the PKIFailureInfo bits +of B, encoded as integer, or -1 on error. + +ossl_cmp_pkisi_check_pkifailureinfo() returns the state of the bit (0 or 1) +with index B in the PKIFailureInfo of the B, or -1 on error. =head1 NOTES diff --git a/doc/man3/OSSL_CMP_CTX_new.pod b/doc/man3/OSSL_CMP_CTX_new.pod index b10cfc4801..032ef817c0 100644 --- a/doc/man3/OSSL_CMP_CTX_new.pod +++ b/doc/man3/OSSL_CMP_CTX_new.pod @@ -239,7 +239,7 @@ The following options can be set: OSSL_CMP_OPT_MAC_ALGNID The MAC algorithm NID to be used in RFC 4210's MSG_MAC_ALG, - if applicable used for message protection. + if applicable used for message protection. Default is HMAC-SHA1 as per RFC 4210. =item B @@ -362,7 +362,6 @@ The transfer callback may make use of a custom defined argument stored in the ctx by means of OSSL_CMP_CTX_set_transfer_cb_arg(), which may be retrieved again through OSSL_CMP_CTX_get_transfer_cb_arg(). - OSSL_CMP_CTX_set_transfer_cb_arg() sets an argument, respectively a pointer to a structure containing arguments, optionally to be used by the transfer callback. B is not consumed, and it must therefore explicitly be freed when not @@ -372,9 +371,9 @@ OSSL_CMP_CTX_get_transfer_cb_arg() gets the argument, respectively the pointer to a structure containing arguments, previously set by OSSL_CMP_CTX_set_transfer_cb_arg() or NULL if unset. -OSSL_CMP_CTX_set1_srvCert() pins the server certificate to be directly trusted -(even if it is expired) for verifying response messages. -The cert pointer is not consumed. It may be NULL to clear the entry. +OSSL_CMP_CTX_set1_srvCert() pins the given server certificate B +directly trusts it (even if it is expired) for verifying response messages. +The B argument may be NULL to clear the entry. OSSL_CMP_CTX_set1_expected_sender() sets the Distinguished Name (DN) expected to be given in the sender response for messages protected with MSG_SIG_ALG. This @@ -384,8 +383,7 @@ identify the server certificate. This can be used to ensure that only a particular entity is accepted to act as CMP server, and attackers are not able to use arbitrary certificates of a trusted PKI hierarchy to fraudulently pose as server. -This defaults to the subject DN of the certificate set via -OSSL_CMP_CTX_set1_srvCert(), if any. +This defaults to the subject of the B, if any. OSSL_CMP_CTX_set0_trustedStore() sets the X509_STORE type certificate store containing trusted (root) CA certificates. The certificate store may also hold @@ -404,32 +402,52 @@ The reference counts of those certificates handled successfully are increased. OSSL_CMP_CTX_get0_untrusted_certs(OSSL_CMP_CTX *ctx) returns a pointer to the list of untrusted certs, which my be empty if unset. -OSSL_CMP_CTX_set1_clCert() sets the client certificate in the given -OSSL_CMP_CTX structure. The client certificate will then be used by the -functions to set the "sender" field for outgoing messages and it will be -included in the extraCerts field. - -OSSL_CMP_CTX_set1_pkey() sets the private key corresponding to the client -certificate set with B in the given CMP context. -Used to create the protection in case of MSG_SIG_ALG. - -OSSL_CMP_CTX_set1_referenceValue() sets the given referenceValue in the given -B or clears it if the B argument is NULL. - -OSSL_CMP_CTX_set1_secretValue() sets the B with the length B in the -given B or clears it if the B argument is NULL. +OSSL_CMP_CTX_set1_clCert() sets the client certificate in the given B. +The public key of this B must correspond to +the private key set via B. +When using signature-based protection of CMP request messages +this "protection certificate" will be included first in the extraCerts field. +The subject of this B will be used as the "sender" field +of outgoing CMP messages, with the fallback being +the B set via B. +The B argument may be NULL to clear the entry. + +OSSL_CMP_CTX_set1_pkey() sets the private key corresponding to +the client certificate B set via B. +This key is used create signature-based protection (protectionAlg = MSG_SIG_ALG) +of outgoing messages +unless a PBM secret has been set via B. +The B argument may be NULL to clear the entry. + +OSSL_CMP_CTX_set1_secretValue() sets the byte string B with length B +as PBM secret in the given B or clears it if the B argument is NULL. +If present, this secret is used to create PBM-based protection of outgoing +messages and to verify any PBM-based protection of incoming messages +(protectionAlg = MSG_MAC_ALG). PBM stands for Password-Based MAC. +PBM-based protection takes precedence over signature-based protection. + +OSSL_CMP_CTX_set1_referenceValue() sets the given referenceValue B with +length B in the given B or clears it if the B argument is NULL. +According to RFC 4210 section 5.1.1, if no value for the "sender" field in +CMP message headers can be determined (i.e., no B and no B +is given) then the "sender" field will contain the NULL-DN +and the senderKID field of the CMP message header must be set. +When signature-based protection is used the senderKID will be set to +the subjectKeyIdentifier of the as far as present. +If not present or when PBM-based protection is used +the B value is taken as the fallback value for the senderKID. OSSL_CMP_CTX_set1_recipient() sets the recipient name that will be used in the PKIHeader of a request message, i.e. the X509 name of the (CA) server. -Setting is overruled by subject of srvCert if set. -If neither srvCert nor recipient are set, the recipient of the PKI message is +Setting is overruled by subject of B if set. +If neither B nor recipient are set, the recipient of the PKI message is determined in the following order: issuer, issuer of old cert (oldCert), -issuer of client cert (clCert), else NULL-DN. +issuer of client cert (B), else NULL-DN. When a response is received, its sender must match the recipient of the request. OSSL_CMP_CTX_push0_geninfo_ITAV() adds B to the stack in the B to be added to the GeneralInfo field of the CMP PKIMessage header of a request -message sent with this context. Consumes the pointer to B. +message sent with this context. OSSL_CMP_CTX_set1_extraCertsOut() sets the stack of extraCerts that will be sent to remote. @@ -450,24 +468,22 @@ will be set in the CertTemplate, i.e., the X509 name of the CA server. OSSL_CMP_CTX_set1_subjectName() sets the subject DN that will be used in the CertTemplate structure when requesting a new cert. For Key Update Requests -(KUR), it defaults to the subject DN of the reference certificate, +(KUR), it defaults to the subject DN of the B, see B. This default is used for Initialization Requests (IR) and Certification Requests (CR) only if no SANs are set. - -If clCert is not set (e.g. in case of IR with MSG_MAC_ALG), the subject DN -is also used as sender of the PKI message. +The B is also used as the "sender" field for outgoing CMP messages +if no B has been set (e.g., in case requests are protected using PBM). OSSL_CMP_CTX_push1_subjectAltName() adds the given X509 name to the list of alternate names on the certificate template request. This cannot be used if any Subject Alternative Name extension is set via OSSL_CMP_CTX_set0_reqExtensions(). By default, unless OSSL_CMP_OPT_SUBJECTALTNAME_NODEFAULT has been set, -the Subject Alternative Names are copied from the reference certificate, -see OSSL_CMP_CTX_set1_oldCert(). - +the Subject Alternative Names are copied from the B, +see B. If set and the subject DN is not set with OSSL_CMP_CTX_set1_subjectName(), then the certificate template of an IR and CR will not be filled with the default -subject DN from the reference certificate (see OSSL_CMP_CTX_set1_oldCert(). +subject DN from the B. If a subject DN is desired it needs to be set explicitly with OSSL_CMP_CTX_set1_subjectName(). @@ -483,7 +499,7 @@ to the X509_EXTENSIONS of the requested certificate template. OSSL_CMP_CTX_set1_oldCert() sets the old certificate to be updated in Key Update Requests (KUR) or to be revoked in Revocation Requests (RR). It must be given for RR, else it defaults to B. -The reference certificate determined in this way, if any, is also used for +The B determined in this way, if any, is also used for deriving default subject DN and Subject Alternative Names for IR, CR, and KUR. Its issuer, if any, is used as default recipient in the CMP message header. @@ -491,7 +507,6 @@ OSSL_CMP_CTX_set1_p10CSR() sets the PKCS#10 CSR to be used in P10CR. OSSL_CMP_CTX_push0_genm_ITAV() adds B to the stack in the B which will be the body of a General Message sent with this context. -Consumes the pointer to B. OSSL_CMP_CTX_set_certConf_cb() sets the callback used for evaluating the newly enrolled certificate before the library sends, depending on its result, diff --git a/doc/man3/OSSL_CMP_CTX_snprint_PKIStatus.pod b/doc/man3/OSSL_CMP_CTX_snprint_PKIStatus.pod deleted file mode 100644 index 3ae6831ee2..0000000000 --- a/doc/man3/OSSL_CMP_CTX_snprint_PKIStatus.pod +++ /dev/null @@ -1,46 +0,0 @@ -=pod - -=head1 NAME - -OSSL_CMP_CTX_snprint_PKIStatus -- function(s) for managing the CMP PKIStatus - -=head1 SYNOPSIS - - #include - - char *OSSL_CMP_CTX_snprint_PKIStatus(OSSL_CMP_CTX *ctx, char *buf, int bufsize); - -=head1 DESCRIPTION - -This is the PKIStatus API for using CMP (Certificate Management Protocol) with -OpenSSL. - -OSSL_CMP_CTX_snprint_PKIStatus() takes the PKIStatusInfo components contained -in the given CMP context and places a human-readable string created from them -in the given buffer, with the given maximal length. -On success it returns a copy of the buffer pointer containing the string. - -=head1 NOTES - -CMP is defined in RFC 4210 (and CRMF in RFC 4211). - -=head1 RETURN VALUES - -OSSL_CMP_CTX_snprint_PKIStatus() -returns the intended pointer value as described above or NULL on error. - -=head1 HISTORY - -The OpenSSL CMP support was added in OpenSSL 3.0. - -=head1 COPYRIGHT - -Copyright 2007-2019 The OpenSSL Project Authors. All Rights Reserved. - -Licensed under the Apache License 2.0 (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -L. - -=cut diff --git a/doc/man3/OSSL_CMP_MSG_get0_header.pod b/doc/man3/OSSL_CMP_MSG_get0_header.pod index 3ed1140082..cee99cd00b 100644 --- a/doc/man3/OSSL_CMP_MSG_get0_header.pod +++ b/doc/man3/OSSL_CMP_MSG_get0_header.pod @@ -2,7 +2,9 @@ =head1 NAME -OSSL_CMP_MSG_get0_header +OSSL_CMP_MSG_get0_header, +OSSL_d2i_CMP_MSG_bio, +OSSL_i2d_CMP_MSG_bio - function(s) manipulating CMP messages =head1 SYNOPSIS @@ -10,20 +12,31 @@ OSSL_CMP_MSG_get0_header #include OSSL_CMP_PKIHEADER *OSSL_CMP_MSG_get0_header(const OSSL_CMP_MSG *msg); + OSSL_CMP_MSG *OSSL_d2i_CMP_MSG_bio(BIO *bio, OSSL_CMP_MSG **msg); + int OSSL_i2d_CMP_MSG_bio(BIO *bio, const OSSL_CMP_MSG *msg); =head1 DESCRIPTION OSSL_CMP_MSG_get0_header returns the header of the given CMP message. +OSSL_d2i_CMP_MSG_bio parses an ASN.1-encoded OSSL_CMP_MSG from the BIO I. +It assigns a pointer to the new structure to I<*msg> if I is not NULL. + +OSSL_i2d_CMP_MSG_bio writes the OSSL_CMP_MSG I in ASN.1 encoding to BIO I. + =head1 NOTES CMP is defined in RFC 4210. =head1 RETURN VALUES -CMP_MSG_get0_header() returns the intended pointer value as described above +OSSL_CMP_MSG_get0_header() returns the intended pointer value as described above or NULL if the respective entry does not exist and on error. +OSSL_d2i_CMP_MSG_bio() returns the parsed message or NULL on error. + +OSSL_i2d_CMP_MSG_bio() returns 1 on success or 0 on error. + =head1 HISTORY The OpenSSL CMP support was added in OpenSSL 3.0. diff --git a/doc/man3/OSSL_CMP_SRV_CTX_new.pod b/doc/man3/OSSL_CMP_SRV_CTX_new.pod new file mode 100644 index 0000000000..45ac0174b7 --- /dev/null +++ b/doc/man3/OSSL_CMP_SRV_CTX_new.pod @@ -0,0 +1,159 @@ +=pod + +=head1 NAME + +OSSL_CMP_SRV_process_request, +OSSL_CMP_CTX_server_perform, +OSSL_CMP_SRV_CTX_new, +OSSL_CMP_SRV_CTX_free, +OSSL_CMP_SRV_cert_request_cb_t, +OSSL_CMP_SRV_rr_cb_t, +OSSL_CMP_SRV_certConf_cb_t, +OSSL_CMP_SRV_genm_cb_t, +OSSL_CMP_SRV_error_cb_t, +OSSL_CMP_SRV_pollReq_cb_t, +OSSL_CMP_SRV_CTX_init, +OSSL_CMP_SRV_CTX_get0_cmp_ctx, +OSSL_CMP_SRV_CTX_get0_custom_ctx, +OSSL_CMP_SRV_CTX_set_send_unprotected_errors, +OSSL_CMP_SRV_CTX_set_accept_unprotected, +OSSL_CMP_SRV_CTX_set_accept_raverified, +OSSL_CMP_SRV_CTX_set_grant_implicit_confirm +- generic functions to set up and control a CMP server + +=head1 SYNOPSIS + + #include + + OSSL_CMP_MSG *OSSL_CMP_SRV_process_request(OSSL_CMP_SRV_CTX *srv_ctx, + const OSSL_CMP_MSG *req); + OSSL_CMP_MSG *OSSL_CMP_CTX_server_perform(OSSL_CMP_CTX *client_ctx, + const OSSL_CMP_MSG *req); + OSSL_CMP_SRV_CTX *OSSL_CMP_SRV_CTX_new(void); + void OSSL_CMP_SRV_CTX_free(OSSL_CMP_SRV_CTX *srv_ctx); + + typedef OSSL_CMP_PKISI *(*OSSL_CMP_SRV_cert_request_cb_t)( + OSSL_CMP_SRV_CTX *srv_ctx, + const OSSL_CMP_MSG *req, + int certReqId, + const OSSL_CRMF_MSG *crm, + const X509_REQ *p10cr, + X509 **certOut, + STACK_OF(X509) **chainOut, + STACK_OF(X509) **caPubs); + typedef OSSL_CMP_PKISI *(*OSSL_CMP_SRV_rr_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx, + const OSSL_CMP_MSG *req, + const X509_NAME *issuer, + const ASN1_INTEGER *serial); + typedef int (*OSSL_CMP_SRV_genm_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx, + const OSSL_CMP_MSG *req, + STACK_OF(OSSL_CMP_ITAV) *in, + STACK_OF(OSSL_CMP_ITAV) **out); + typedef void (*OSSL_CMP_SRV_error_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx, + const OSSL_CMP_MSG *req, + const OSSL_CMP_PKISI *statusInfo, + const ASN1_INTEGER *errorCode, + const OSSL_CMP_PKIFREETEXT *errorDetails); + typedef int (*OSSL_CMP_SRV_certConf_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx, + const OSSL_CMP_MSG *req, + int certReqId, + const ASN1_OCTET_STRING *certHash, + const OSSL_CMP_PKISI *si); + typedef int (*OSSL_CMP_SRV_pollReq_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx, + const OSSL_CMP_MSG *req, + int certReqId, + OSSL_CMP_MSG **certReq, + int64_t *check_after); + int OSSL_CMP_SRV_CTX_init(OSSL_CMP_SRV_CTX *srv_ctx, void *custom_ctx, + OSSL_CMP_SRV_cert_request_cb_t process_cert_request, + OSSL_CMP_SRV_rr_cb_t process_rr, + OSSL_CMP_SRV_genm_cb_t process_genm, + OSSL_CMP_SRV_error_cb_t process_error, + OSSL_CMP_SRV_certConf_cb_t process_certConf, + OSSL_CMP_SRV_pollReq_cb_t process_pollReq); + + OSSL_CMP_CTX *OSSL_CMP_SRV_CTX_get0_cmp_ctx(const OSSL_CMP_SRV_CTX *srv_ctx); + void *OSSL_CMP_SRV_CTX_get0_custom_ctx(const OSSL_CMP_SRV_CTX *srv_ctx); + + int OSSL_CMP_SRV_CTX_set_send_unprotected_errors(OSSL_CMP_SRV_CTX *srv_ctx, + int val); + int OSSL_CMP_SRV_CTX_set_accept_unprotected(OSSL_CMP_SRV_CTX *srv_ctx, int val); + int OSSL_CMP_SRV_CTX_set_accept_raverified(OSSL_CMP_SRV_CTX *srv_ctx, int val); + int OSSL_CMP_SRV_CTX_set_grant_implicit_confirm(OSSL_CMP_SRV_CTX *srv_ctx, + int val); + +=head1 DESCRIPTION + +OSSL_CMP_SRV_process_request() implements the generic aspects of a CMP server. +It does the typical generic checks on the given request message, calls +the respective callback function (if present) for more specific processing, +and then assembles a result message, which may be a CMP error message. + +OSSL_CMP_CTX_server_perform() is an interface to +B that can be used by a CMP client +in the same way as B. +The B must be set as B of B. + +OSSL_CMP_SRV_CTX_new() creates and initializes an OSSL_CMP_SRV_CTX structure +and returns a pointer to it on success, NULL on error. + +OSSL_CMP_SRV_CTX_free() deletes the given B. + +OSSL_CMP_SRV_CTX_init() sets in the given B a custom server context +pointer as well as callback functions performing the specific processing of CMP +certificate requests, revocation requests, certificate confirmation requests, +general messages, error messages, and poll requests. +All arguments except B may be NULL. +If a callback for some message type is not given this means that the respective +type of CMP message is not supported by the server. + +OSSL_CMP_SRV_CTX_get0_cmp_ctx() returns the B from the B. + +OSSL_CMP_SRV_CTX_get0_custom_ctx() returns the custom server context from +B that has been set using B. + +OSSL_CMP_SRV_CTX_set_send_unprotected_errors() enables sending error messages +and other forms of negative responses unprotected. + +OSSL_CMP_SRV_CTX_set_accept_unprotected() enables acceptance of requests +without protection of with invalid protection. + +OSSL_CMP_SRV_CTX_set_accept_raverified() enables acceptance of ir/cr/kur +messages with POPO 'RAVerified'. + +OSSL_CMP_SRV_CTX_set_grant_implicit_confirm() enables granting implicit +confirmation of newly enrolled certificates if requested. + +=head1 NOTES + +CMP is defined in RFC 4210 (and CRMF in RFC 4211). + +=head1 RETURN VALUES + +OSSL_CMP_SRV_CTX_new() returns a B structure on success, +NULL on error. + +OSSL_CMP_SRV_CTX_free() does not return a value. + +OSSL_CMP_SRV_CTX_get0_cmp_ctx() returns a B structure on success, +NULL on error. + +OSSL_CMP_SRV_CTX_get0_custom_ctx() returns the custom server context +that has been set using B. + +All other functions return 1 on success, 0 on error. + +=head1 HISTORY + +The OpenSSL CMP support was added in OpenSSL 3.0. + +=head1 COPYRIGHT + +Copyright 2007-2019 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the Apache License 2.0 (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +L. + +=cut diff --git a/doc/man3/OSSL_CMP_STATUSINFO_new.pod b/doc/man3/OSSL_CMP_STATUSINFO_new.pod new file mode 100644 index 0000000000..520a104d7e --- /dev/null +++ b/doc/man3/OSSL_CMP_STATUSINFO_new.pod @@ -0,0 +1,66 @@ +=pod + +=head1 NAME + +OSSL_CMP_STATUSINFO_new, +OSSL_CMP_snprint_PKIStatusInfo, +OSSL_CMP_CTX_snprint_PKIStatus +- function(s) for managing the CMP PKIStatus + +=head1 SYNOPSIS + + #include + + OSSL_CMP_PKISI *OSSL_CMP_STATUSINFO_new(int status, int fail_info, + const char *text); + char *OSSL_CMP_snprint_PKIStatusInfo(const OSSL_CMP_PKISI *statusInfo, + char *buf, size_t bufsize); + char *OSSL_CMP_CTX_snprint_PKIStatus(const OSSL_CMP_CTX *ctx, char *buf, + size_t bufsize); + +=head1 DESCRIPTION + +This is the PKIStatus API for using CMP (Certificate Management Protocol) with +OpenSSL. + +OSSL_CMP_STATUSINFO_new() creates a new PKIStatusInfo structure +and fills in the given values. +It sets the status field to B, +copies B (unless it is NULL) to statusString, +and interprets B as bit pattern for the failInfo field. + +OSSL_CMP_snprint_PKIStatusInfo() places a human-readable string +representing the given statusInfo +in the given buffer, with the given maximal length. + +OSSL_CMP_CTX_snprint_PKIStatus() places a human-readable string +representing the PKIStatusInfo components of the CMP context B +in the given buffer, with the given maximal length. + +=head1 NOTES + +CMP is defined in RFC 4210 (and CRMF in RFC 4211). + +=head1 RETURN VALUES + +OSSL_CMP_STATUSINFO_new() +returns a pointer to the structure on success, or NULL on error. + +OSSL_CMP_snprint_PKIStatusInfo() and +OSSL_CMP_CTX_snprint_PKIStatus() +return a copy of the buffer pointer containing the string or NULL on error. + +=head1 HISTORY + +The OpenSSL CMP support was added in OpenSSL 3.0. + +=head1 COPYRIGHT + +Copyright 2007-2019 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the Apache License 2.0 (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +L. + +=cut diff --git a/doc/man3/X509_digest.pod b/doc/man3/X509_digest.pod index 52eb522b36..dfddd12e10 100644 --- a/doc/man3/X509_digest.pod +++ b/doc/man3/X509_digest.pod @@ -2,7 +2,9 @@ =head1 NAME -X509_digest, X509_CRL_digest, +X509_digest, +X509_digest_sig, +X509_CRL_digest, X509_pubkey_digest, X509_NAME_digest, X509_REQ_digest, @@ -15,6 +17,7 @@ PKCS7_ISSUER_AND_SERIAL_digest int X509_digest(const X509 *data, const EVP_MD *type, unsigned char *md, unsigned int *len); + ASN1_OCTET_STRING *X509_digest_sig(const X509 *cert); int X509_CRL_digest(const X509_CRL *data, const EVP_MD *type, unsigned char *md, unsigned int *len); @@ -36,8 +39,12 @@ PKCS7_ISSUER_AND_SERIAL_digest =head1 DESCRIPTION +X509_digest_sig() calculates a digest of the given certificate +using the same hash algorithm as in its signature. + X509_pubkey_digest() returns a digest of the DER representation of the public key in the specified X509 B object. + All other functions described here return a digest of the DER representation of their entire B objects. @@ -49,12 +56,18 @@ to a place where the digest size will be stored. =head1 RETURN VALUES -All functions described here return 1 for success and 0 for failure. +X509_digest_sig() returns an ASN1_OCTET_STRING on success, else NULL. + +All other functions described here return 1 for success and 0 for failure. =head1 SEE ALSO L +=head1 HISTORY + +The X509_digest_sig() function was added in OpenSSL 3.0. + =head1 COPYRIGHT Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved. diff --git a/doc/man3/X509_dup.pod b/doc/man3/X509_dup.pod index d7d8477896..cb1e9edf2c 100644 --- a/doc/man3/X509_dup.pod +++ b/doc/man3/X509_dup.pod @@ -122,13 +122,17 @@ OCSP_SIGNATURE_free, OCSP_SIGNATURE_new, OCSP_SINGLERESP_free, OCSP_SINGLERESP_new, +OSSL_CMP_ITAV_dup, OSSL_CMP_ITAV_free, +OSSL_CMP_MSG_dup, OSSL_CMP_MSG_it, OSSL_CMP_MSG_free, OSSL_CMP_PKIHEADER_free, OSSL_CMP_PKIHEADER_it, OSSL_CMP_PKIHEADER_new, +OSSL_CMP_PKISI_dup, OSSL_CMP_PKISI_free, +OSSL_CMP_PKISI_it, OSSL_CMP_PKISI_new, OSSL_CMP_PKISTATUS_it, OSSL_CRMF_CERTID_free, diff --git a/doc/man3/d2i_X509.pod b/doc/man3/d2i_X509.pod index d41d2e0c4b..354757387f 100644 --- a/doc/man3/d2i_X509.pod +++ b/doc/man3/d2i_X509.pod @@ -98,6 +98,7 @@ d2i_OCSP_SIGNATURE, d2i_OCSP_SINGLERESP, d2i_OSSL_CMP_MSG, d2i_OSSL_CMP_PKIHEADER, +d2i_OSSL_CMP_PKISI, d2i_OSSL_CRMF_CERTID, d2i_OSSL_CRMF_CERTTEMPLATE, d2i_OSSL_CRMF_ENCRYPTEDVALUE, @@ -289,6 +290,7 @@ i2d_OCSP_SIGNATURE, i2d_OCSP_SINGLERESP, i2d_OSSL_CMP_MSG, i2d_OSSL_CMP_PKIHEADER, +i2d_OSSL_CMP_PKISI, i2d_OSSL_CRMF_CERTID, i2d_OSSL_CRMF_CERTTEMPLATE, i2d_OSSL_CRMF_ENCRYPTEDVALUE, diff --git a/include/internal/cryptlib.h b/include/internal/cryptlib.h index 7ad6007fd9..19e2c9744e 100644 --- a/include/internal/cryptlib.h +++ b/include/internal/cryptlib.h @@ -23,6 +23,7 @@ # include # include # include +# include # include # include "internal/nelem.h" @@ -234,5 +235,7 @@ static ossl_inline void ossl_sleep(unsigned long millis) } #endif /* defined OPENSSL_SYS_UNIX */ +char *sk_ASN1_UTF8STRING2text(STACK_OF(ASN1_UTF8STRING) *text, const char *sep, + size_t max_len); #endif diff --git a/include/openssl/cmp.h b/include/openssl/cmp.h index 43dcc69993..54e756c501 100644 --- a/include/openssl/cmp.h +++ b/include/openssl/cmp.h @@ -207,13 +207,17 @@ typedef struct ossl_cmp_ctx_st OSSL_CMP_CTX; typedef struct ossl_cmp_pkiheader_st OSSL_CMP_PKIHEADER; DECLARE_ASN1_FUNCTIONS(OSSL_CMP_PKIHEADER) typedef struct ossl_cmp_msg_st OSSL_CMP_MSG; +DECLARE_ASN1_DUP_FUNCTION(OSSL_CMP_MSG) DECLARE_ASN1_ENCODE_FUNCTIONS(OSSL_CMP_MSG, OSSL_CMP_MSG, OSSL_CMP_MSG) typedef struct ossl_cmp_certstatus_st OSSL_CMP_CERTSTATUS; DEFINE_STACK_OF(OSSL_CMP_CERTSTATUS) typedef struct ossl_cmp_itav_st OSSL_CMP_ITAV; +DECLARE_ASN1_DUP_FUNCTION(OSSL_CMP_ITAV) DEFINE_STACK_OF(OSSL_CMP_ITAV) typedef struct ossl_cmp_revrepcontent_st OSSL_CMP_REVREPCONTENT; typedef struct ossl_cmp_pkisi_st OSSL_CMP_PKISI; +DECLARE_ASN1_FUNCTIONS(OSSL_CMP_PKISI) +DECLARE_ASN1_DUP_FUNCTION(OSSL_CMP_PKISI) DEFINE_STACK_OF(OSSL_CMP_PKISI) typedef struct ossl_cmp_certrepmessage_st OSSL_CMP_CERTREPMESSAGE; DEFINE_STACK_OF(OSSL_CMP_CERTREPMESSAGE) @@ -272,9 +276,9 @@ void OSSL_CMP_CTX_print_errors(OSSL_CMP_CTX *ctx); int OSSL_CMP_CTX_set1_serverPath(OSSL_CMP_CTX *ctx, const char *path); int OSSL_CMP_CTX_set1_serverName(OSSL_CMP_CTX *ctx, const char *name); int OSSL_CMP_CTX_set_serverPort(OSSL_CMP_CTX *ctx, int port); +# define OSSL_CMP_DEFAULT_PORT 80 int OSSL_CMP_CTX_set1_proxyName(OSSL_CMP_CTX *ctx, const char *name); int OSSL_CMP_CTX_set_proxyPort(OSSL_CMP_CTX *ctx, int port); -# define OSSL_CMP_DEFAULT_PORT 80 int OSSL_CMP_CTX_set_http_cb(OSSL_CMP_CTX *ctx, OSSL_HTTP_bio_cb_t cb); int OSSL_CMP_CTX_set_http_cb_arg(OSSL_CMP_CTX *ctx, void *arg); void *OSSL_CMP_CTX_get_http_cb_arg(const OSSL_CMP_CTX *ctx); @@ -329,32 +333,85 @@ int OSSL_CMP_CTX_get_failInfoCode(const OSSL_CMP_CTX *ctx); X509 *OSSL_CMP_CTX_get0_newCert(const OSSL_CMP_CTX *ctx); STACK_OF(X509) *OSSL_CMP_CTX_get1_caPubs(const OSSL_CMP_CTX *ctx); STACK_OF(X509) *OSSL_CMP_CTX_get1_extraCertsIn(const OSSL_CMP_CTX *ctx); -/* support application-level CMP debugging in cmp.c: */ int OSSL_CMP_CTX_set1_transactionID(OSSL_CMP_CTX *ctx, const ASN1_OCTET_STRING *id); int OSSL_CMP_CTX_set1_senderNonce(OSSL_CMP_CTX *ctx, const ASN1_OCTET_STRING *nonce); /* from cmp_status.c */ -char *OSSL_CMP_CTX_snprint_PKIStatus(OSSL_CMP_CTX *ctx, char *buf, +char *OSSL_CMP_CTX_snprint_PKIStatus(const OSSL_CMP_CTX *ctx, char *buf, size_t bufsize); +char *OSSL_CMP_snprint_PKIStatusInfo(const OSSL_CMP_PKISI *statusInfo, + char *buf, size_t bufsize); +OSSL_CMP_PKISI * +OSSL_CMP_STATUSINFO_new(int status, int fail_info, const char *text); /* from cmp_hdr.c */ -/* support application-level CMP debugging in cmp.c: */ ASN1_OCTET_STRING *OSSL_CMP_HDR_get0_transactionID(const OSSL_CMP_PKIHEADER *hdr); ASN1_OCTET_STRING *OSSL_CMP_HDR_get0_recipNonce(const OSSL_CMP_PKIHEADER *hdr); /* from cmp_msg.c */ -/* support application-level CMP debugging in cmp.c: */ OSSL_CMP_PKIHEADER *OSSL_CMP_MSG_get0_header(const OSSL_CMP_MSG *msg); +OSSL_CMP_MSG *OSSL_d2i_CMP_MSG_bio(BIO *bio, OSSL_CMP_MSG **msg); +int OSSL_i2d_CMP_MSG_bio(BIO *bio, const OSSL_CMP_MSG *msg); /* from cmp_vfy.c */ int OSSL_CMP_validate_msg(OSSL_CMP_CTX *ctx, const OSSL_CMP_MSG *msg); int OSSL_CMP_validate_cert_path(OSSL_CMP_CTX *ctx, X509_STORE *trusted_store, X509 *cert); +/* from cmp_server.c */ +typedef struct ossl_cmp_srv_ctx_st OSSL_CMP_SRV_CTX; +OSSL_CMP_MSG *OSSL_CMP_SRV_process_request(OSSL_CMP_SRV_CTX *srv_ctx, + const OSSL_CMP_MSG *req); +OSSL_CMP_MSG * OSSL_CMP_CTX_server_perform(OSSL_CMP_CTX *client_ctx, + const OSSL_CMP_MSG *req); +OSSL_CMP_SRV_CTX *OSSL_CMP_SRV_CTX_new(void); +void OSSL_CMP_SRV_CTX_free(OSSL_CMP_SRV_CTX *srv_ctx); +typedef OSSL_CMP_PKISI *(*OSSL_CMP_SRV_cert_request_cb_t) + (OSSL_CMP_SRV_CTX *srv_ctx, const OSSL_CMP_MSG *req, int certReqId, + const OSSL_CRMF_MSG *crm, const X509_REQ *p10cr, + X509 **certOut, STACK_OF(X509) **chainOut, STACK_OF(X509) **caPubs); +typedef OSSL_CMP_PKISI *(*OSSL_CMP_SRV_rr_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx, + const OSSL_CMP_MSG *req, + const X509_NAME *issuer, + const ASN1_INTEGER *serial); +typedef int (*OSSL_CMP_SRV_genm_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx, + const OSSL_CMP_MSG *req, + const STACK_OF(OSSL_CMP_ITAV) *in, + STACK_OF(OSSL_CMP_ITAV) **out); +typedef void (*OSSL_CMP_SRV_error_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx, + const OSSL_CMP_MSG *req, + const OSSL_CMP_PKISI *statusInfo, + const ASN1_INTEGER *errorCode, + const OSSL_CMP_PKIFREETEXT *errorDetails); +typedef int (*OSSL_CMP_SRV_certConf_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx, + const OSSL_CMP_MSG *req, + int certReqId, + const ASN1_OCTET_STRING *certHash, + const OSSL_CMP_PKISI *si); +typedef int (*OSSL_CMP_SRV_pollReq_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx, + const OSSL_CMP_MSG *req, int certReqId, + OSSL_CMP_MSG **certReq, + int64_t *check_after); +int OSSL_CMP_SRV_CTX_init(OSSL_CMP_SRV_CTX *srv_ctx, void *custom_ctx, + OSSL_CMP_SRV_cert_request_cb_t process_cert_request, + OSSL_CMP_SRV_rr_cb_t process_rr, + OSSL_CMP_SRV_genm_cb_t process_genm, + OSSL_CMP_SRV_error_cb_t process_error, + OSSL_CMP_SRV_certConf_cb_t process_certConf, + OSSL_CMP_SRV_pollReq_cb_t process_pollReq); +OSSL_CMP_CTX *OSSL_CMP_SRV_CTX_get0_cmp_ctx(const OSSL_CMP_SRV_CTX *srv_ctx); +void *OSSL_CMP_SRV_CTX_get0_custom_ctx(const OSSL_CMP_SRV_CTX *srv_ctx); +int OSSL_CMP_SRV_CTX_set_send_unprotected_errors(OSSL_CMP_SRV_CTX *srv_ctx, + int val); +int OSSL_CMP_SRV_CTX_set_accept_unprotected(OSSL_CMP_SRV_CTX *srv_ctx, int val); +int OSSL_CMP_SRV_CTX_set_accept_raverified(OSSL_CMP_SRV_CTX *srv_ctx, int val); +int OSSL_CMP_SRV_CTX_set_grant_implicit_confirm(OSSL_CMP_SRV_CTX *srv_ctx, + int val); + # ifdef __cplusplus } # endif -# endif /* !defined OPENSSL_NO_CMP */ -#endif /* !defined OPENSSL_CMP_H */ +# endif /* !defined(OPENSSL_NO_CMP) */ +#endif /* !defined(OPENSSL_CMP_H) */ diff --git a/include/openssl/cmp_util.h b/include/openssl/cmp_util.h index 56fb49e188..6b6025b6ce 100644 --- a/include/openssl/cmp_util.h +++ b/include/openssl/cmp_util.h @@ -50,5 +50,5 @@ void OSSL_CMP_print_errors_cb(OSSL_cmp_log_cb_t log_fn); # ifdef __cplusplus } # endif -# endif /* !defined OPENSSL_NO_CMP */ -#endif /* !defined OPENSSL_CMP_UTIL_H */ +# endif /* !defined(OPENSSL_NO_CMP) */ +#endif /* !defined(OPENSSL_CMP_UTIL_H) */ diff --git a/include/openssl/cmperr.h b/include/openssl/cmperr.h index 51795a52ab..f868cc104f 100644 --- a/include/openssl/cmperr.h +++ b/include/openssl/cmperr.h @@ -1,6 +1,6 @@ /* * Generated by util/mkerr.pl DO NOT EDIT - * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -19,7 +19,7 @@ # ifndef OPENSSL_NO_CMP -# ifdef __cplusplus +# ifdef __cplusplus extern "C" # endif int ERR_load_CMP_strings(void); @@ -27,16 +27,18 @@ int ERR_load_CMP_strings(void); /* * CMP function codes. */ -# ifndef OPENSSL_NO_DEPRECATED_3_0 -# endif +# ifndef OPENSSL_NO_DEPRECATED_3_0 +# endif /* * CMP reason codes. */ # define CMP_R_ALGORITHM_NOT_SUPPORTED 139 # define CMP_R_BAD_REQUEST_ID 108 +# define CMP_R_CERTHASH_UNMATCHED 156 # define CMP_R_CERTID_NOT_FOUND 109 # define CMP_R_CERTIFICATE_NOT_FOUND 112 +# define CMP_R_CERTREQMSG_NOT_FOUND 157 # define CMP_R_CERTRESPONSE_NOT_FOUND 113 # define CMP_R_CERT_AND_KEY_DO_NOT_MATCH 114 # define CMP_R_ERROR_CALCULATING_PROTECTION 115 @@ -52,8 +54,11 @@ int ERR_load_CMP_strings(void); # define CMP_R_ERROR_CREATING_RP 125 # define CMP_R_ERROR_CREATING_RR 126 # define CMP_R_ERROR_PARSING_PKISTATUS 107 +# define CMP_R_ERROR_PROCESSING_MSG 158 # define CMP_R_ERROR_PROTECTING_MESSAGE 127 # define CMP_R_ERROR_SETTING_CERTHASH 128 +# define CMP_R_ERROR_TRANSFERRING_OUT 159 +# define CMP_R_ERROR_UNEXPECTED_CERTCONF 160 # define CMP_R_ERROR_VALIDATING_PROTECTION 140 # define CMP_R_FAILED_EXTRACTING_PUBKEY 141 # define CMP_R_FAILURE_OBTAINING_RANDOM 110 @@ -65,6 +70,7 @@ int ERR_load_CMP_strings(void); # define CMP_R_MISSING_PROTECTION 143 # define CMP_R_MISSING_SENDER_IDENTIFICATION 111 # define CMP_R_MISSING_TRUST_STORE 144 +# define CMP_R_MULTIPLE_REQUESTS_NOT_SUPPORTED 161 # define CMP_R_MULTIPLE_SAN_SOURCES 102 # define CMP_R_NO_STDIO 194 # define CMP_R_NO_SUITABLE_SENDER_CERT 145 diff --git a/include/openssl/crmf.h b/include/openssl/crmf.h index 09b57f6bce..b578906a67 100644 --- a/include/openssl/crmf.h +++ b/include/openssl/crmf.h @@ -106,7 +106,7 @@ int OSSL_CRMF_MSG_set1_regInfo_certReq(OSSL_CRMF_MSG *msg, int OSSL_CRMF_MSG_set_validity(OSSL_CRMF_MSG *crm, time_t from, time_t to); int OSSL_CRMF_MSG_set_certReqId(OSSL_CRMF_MSG *crm, int rid); -int OSSL_CRMF_MSG_get_certReqId(OSSL_CRMF_MSG *crm); +int OSSL_CRMF_MSG_get_certReqId(const OSSL_CRMF_MSG *crm); int OSSL_CRMF_MSG_set0_extensions(OSSL_CRMF_MSG *crm, X509_EXTENSIONS *exts); int OSSL_CRMF_MSG_push0_extension(OSSL_CRMF_MSG *crm, X509_EXTENSION *ext); @@ -120,8 +120,10 @@ int OSSL_CRMF_MSG_create_popo(OSSL_CRMF_MSG *crm, EVP_PKEY *pkey, int OSSL_CRMF_MSGS_verify_popo(const OSSL_CRMF_MSGS *reqs, int rid, int acceptRAVerified); OSSL_CRMF_CERTTEMPLATE *OSSL_CRMF_MSG_get0_tmpl(const OSSL_CRMF_MSG *crm); -ASN1_INTEGER *OSSL_CRMF_CERTTEMPLATE_get0_serialNumber(OSSL_CRMF_CERTTEMPLATE *t); -X509_NAME *OSSL_CRMF_CERTTEMPLATE_get0_issuer(OSSL_CRMF_CERTTEMPLATE *tmpl); +ASN1_INTEGER +*OSSL_CRMF_CERTTEMPLATE_get0_serialNumber(const OSSL_CRMF_CERTTEMPLATE *tmpl); +X509_NAME +*OSSL_CRMF_CERTTEMPLATE_get0_issuer(const OSSL_CRMF_CERTTEMPLATE *tmpl); X509_NAME *OSSL_CRMF_CERTID_get0_issuer(const OSSL_CRMF_CERTID *cid); ASN1_INTEGER *OSSL_CRMF_CERTID_get0_serialNumber(const OSSL_CRMF_CERTID *cid); int OSSL_CRMF_CERTTEMPLATE_fill(OSSL_CRMF_CERTTEMPLATE *tmpl, @@ -129,11 +131,12 @@ int OSSL_CRMF_CERTTEMPLATE_fill(OSSL_CRMF_CERTTEMPLATE *tmpl, const X509_NAME *subject, const X509_NAME *issuer, const ASN1_INTEGER *serial); -X509 *OSSL_CRMF_ENCRYPTEDVALUE_get1_encCert(OSSL_CRMF_ENCRYPTEDVALUE *ecert, - EVP_PKEY *pkey); +X509 +*OSSL_CRMF_ENCRYPTEDVALUE_get1_encCert(const OSSL_CRMF_ENCRYPTEDVALUE *ecert, + EVP_PKEY *pkey); # ifdef __cplusplus } # endif -# endif /* !defined OPENSSL_NO_CRMF */ -#endif /* !defined OPENSSL_CRMF_H */ +# endif /* !defined(OPENSSL_NO_CRMF) */ +#endif /* !defined(OPENSSL_CRMF_H) */ diff --git a/include/openssl/crmferr.h b/include/openssl/crmferr.h index 97a3028ce2..22936c620e 100644 --- a/include/openssl/crmferr.h +++ b/include/openssl/crmferr.h @@ -1,6 +1,6 @@ /* * Generated by util/mkerr.pl DO NOT EDIT - * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -19,7 +19,7 @@ # ifndef OPENSSL_NO_CRMF -# ifdef __cplusplus +# ifdef __cplusplus extern "C" # endif int ERR_load_CRMF_strings(void); @@ -27,7 +27,7 @@ int ERR_load_CRMF_strings(void); /* * CRMF function codes. */ -# ifndef OPENSSL_NO_DEPRECATED_3_0 +# ifndef OPENSSL_NO_DEPRECATED_3_0 # define CRMF_F_CRMF_POPOSIGNINGKEY_INIT 0 # define CRMF_F_OSSL_CRMF_CERTID_GEN 0 # define CRMF_F_OSSL_CRMF_CERTTEMPLATE_FILL 0 @@ -47,7 +47,7 @@ int ERR_load_CRMF_strings(void); # define CRMF_F_OSSL_CRMF_MSG_SET_VALIDITY 0 # define CRMF_F_OSSL_CRMF_PBMP_NEW 0 # define CRMF_F_OSSL_CRMF_PBM_NEW 0 -# endif +# endif /* * CRMF reason codes. @@ -62,6 +62,11 @@ int ERR_load_CRMF_strings(void); # define CRMF_R_ITERATIONCOUNT_BELOW_100 108 # define CRMF_R_MALFORMED_IV 101 # define CRMF_R_NULL_ARGUMENT 109 +# define CRMF_R_POPO_INCONSISTENT_PUBLIC_KEY 117 +# define CRMF_R_POPO_MISSING 121 +# define CRMF_R_POPO_MISSING_PUBLIC_KEY 118 +# define CRMF_R_POPO_MISSING_SUBJECT 119 +# define CRMF_R_POPO_RAVERIFIED_NOT_ACCEPTED 120 # define CRMF_R_SETTING_MAC_ALGOR_FAILURE 110 # define CRMF_R_SETTING_OWF_ALGOR_FAILURE 111 # define CRMF_R_UNSUPPORTED_ALGORITHM 112 @@ -69,7 +74,6 @@ int ERR_load_CRMF_strings(void); # define CRMF_R_UNSUPPORTED_CIPHER 114 # define CRMF_R_UNSUPPORTED_METHOD_FOR_CREATING_POPO 115 # define CRMF_R_UNSUPPORTED_POPO_METHOD 116 -# define CRMF_R_UNSUPPORTED_POPO_NOT_ACCEPTED 117 # endif #endif diff --git a/include/openssl/http.h b/include/openssl/http.h index e37f636e05..950acf1408 100644 --- a/include/openssl/http.h +++ b/include/openssl/http.h @@ -69,4 +69,4 @@ int OSSL_HTTP_parse_url(const char *url, char **phost, char **pport, # ifdef __cplusplus } # endif -#endif /* !defined OPENSSL_HTTP_H */ +#endif /* !defined(OPENSSL_HTTP_H) */ diff --git a/include/openssl/ocsp.h b/include/openssl/ocsp.h index 209afd6f5d..4b0f635cf7 100644 --- a/include/openssl/ocsp.h +++ b/include/openssl/ocsp.h @@ -371,5 +371,5 @@ int OCSP_basic_verify(OCSP_BASICRESP *bs, STACK_OF(X509) *certs, # ifdef __cplusplus } # endif -# endif /* !defined OPENSSL_NO_OCSP */ +# endif /* !defined(OPENSSL_NO_OCSP) */ #endif diff --git a/include/openssl/x509.h b/include/openssl/x509.h index a2d6e44e96..80328cb2eb 100644 --- a/include/openssl/x509.h +++ b/include/openssl/x509.h @@ -382,6 +382,7 @@ int X509_pubkey_digest(const X509 *data, const EVP_MD *type, unsigned char *md, unsigned int *len); int X509_digest(const X509 *data, const EVP_MD *type, unsigned char *md, unsigned int *len); +ASN1_OCTET_STRING *X509_digest_sig(const X509 *cert); int X509_CRL_digest(const X509_CRL *data, const EVP_MD *type, unsigned char *md, unsigned int *len); int X509_REQ_digest(const X509_REQ *data, const EVP_MD *type, diff --git a/test/build.info b/test/build.info index 1573087c28..fcf2ac57ac 100644 --- a/test/build.info +++ b/test/build.info @@ -438,7 +438,8 @@ IF[{- !$disabled{tests} -}] IF[{- !$disabled{cmp} -}] PROGRAMS{noinst}=cmp_asn_test cmp_ctx_test cmp_status_test cmp_hdr_test \ - cmp_protect_test cmp_msg_test cmp_vfy_test + cmp_protect_test cmp_msg_test cmp_vfy_test \ + cmp_server_test ENDIF SOURCE[cmp_asn_test]=cmp_asn_test.c cmp_testlib.c @@ -465,10 +466,14 @@ IF[{- !$disabled{tests} -}] INCLUDE[cmp_msg_test]=.. ../include ../apps/include DEPEND[cmp_msg_test]=../libcrypto.a libtestutil.a - SOURCE[cmp_vfy_test]=cmp_status_test.c cmp_testlib.c + SOURCE[cmp_vfy_test]=cmp_vfy_test.c cmp_testlib.c INCLUDE[cmp_vfy_test]=.. ../include ../apps/include DEPEND[cmp_vfy_test]=../libcrypto.a libtestutil.a + SOURCE[cmp_server_test]=cmp_server_test.c cmp_testlib.c + INCLUDE[cmp_server_test]=.. ../include ../apps/include + DEPEND[cmp_server_test]=../libcrypto.a libtestutil.a + # Internal test programs. These are essentially a collection of internal # test routines. Some of them need to reach internal symbols that aren't # available through the shared library (at least on Linux, Solaris, Windows diff --git a/test/cmp_ctx_test.c b/test/cmp_ctx_test.c index 26c65778b9..903e204622 100644 --- a/test/cmp_ctx_test.c +++ b/test/cmp_ctx_test.c @@ -118,6 +118,7 @@ static int msg_total_size_log_cb(const char *func, const char *file, int line, OSSL_CMP_severity level, const char *msg) { msg_total_size += strlen(msg); + TEST_note("total=%d len=%ld msg='%s'\n", msg_total_size, strlen(msg), msg); return 1; } diff --git a/test/cmp_hdr_test.c b/test/cmp_hdr_test.c index c12b72f29e..feba118c44 100644 --- a/test/cmp_hdr_test.c +++ b/test/cmp_hdr_test.c @@ -350,9 +350,9 @@ static int execute_HDR_set_and_check_implicitConfirm_test(CMP_HDR_TEST_FIXTURE * fixture) { - return TEST_false(ossl_cmp_hdr_check_implicitConfirm(fixture->hdr)) + return TEST_false(ossl_cmp_hdr_has_implicitConfirm(fixture->hdr)) && TEST_true(ossl_cmp_hdr_set_implicitConfirm(fixture->hdr)) - && TEST_true(ossl_cmp_hdr_check_implicitConfirm(fixture->hdr)); + && TEST_true(ossl_cmp_hdr_has_implicitConfirm(fixture->hdr)); } static int test_HDR_set_and_check_implicit_confirm(void) @@ -397,7 +397,7 @@ static int execute_HDR_init_test(CMP_HDR_TEST_FIXTURE *fixture) return 1; } -static int test_HDR_init(void) +static int test_HDR_init_with_ref(void) { SETUP_TEST_FIXTURE(CMP_HDR_TEST_FIXTURE, set_up); unsigned char ref[CMP_TEST_REFVALUE_LENGTH]; @@ -431,14 +431,6 @@ static int test_HDR_init_with_subject(void) return result; } -static int test_HDR_init_no_ref_no_subject(void) -{ - SETUP_TEST_FIXTURE(CMP_HDR_TEST_FIXTURE, set_up); - fixture->expected = 0; - EXECUTE_TEST(execute_HDR_init_test, tear_down); - return result; -} - void cleanup_tests(void) { @@ -464,9 +456,8 @@ int setup_tests(void) /* also tests public function OSSL_CMP_HDR_get0_transactionID(): */ /* also tests public function OSSL_CMP_HDR_get0_recipNonce(): */ /* also tests internal function ossl_cmp_hdr_get_pvno(): */ - ADD_TEST(test_HDR_init); + ADD_TEST(test_HDR_init_with_ref); ADD_TEST(test_HDR_init_with_subject); - ADD_TEST(test_HDR_init_no_ref_no_subject); /* * TODO make sure that total number of tests (here currently 24) is shown, * also for other cmp_*text.c. Currently the test drivers always show 1. diff --git a/test/cmp_msg_test.c b/test/cmp_msg_test.c index 8f95865869..3919480610 100644 --- a/test/cmp_msg_test.c +++ b/test/cmp_msg_test.c @@ -91,8 +91,7 @@ static int execute_errormsg_create_test(CMP_MSG_TEST_FIXTURE *fixture) { EXECUTE_MSG_CREATION_TEST(ossl_cmp_error_new(fixture->cmp_ctx, fixture->si, fixture->err_code, - NULL /* fixture->free_text */, - 0)); + "details", 0)); } static int execute_rr_create_test(CMP_MSG_TEST_FIXTURE *fixture) @@ -317,7 +316,7 @@ static int test_cmp_create_certconf_fail_info_max(void) static int test_cmp_create_error_msg(void) { SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up); - fixture->si = ossl_cmp_statusinfo_new(OSSL_CMP_PKISTATUS_rejection, + fixture->si = OSSL_CMP_STATUSINFO_new(OSSL_CMP_PKISTATUS_rejection, OSSL_CMP_PKIFAILUREINFO_systemFailure, NULL); fixture->err_code = -1; @@ -419,7 +418,7 @@ static int test_cmp_create_certrep(void) static int execute_rp_create(CMP_MSG_TEST_FIXTURE *fixture) { - OSSL_CMP_PKISI *si = ossl_cmp_statusinfo_new(33, 44, "a text"); + OSSL_CMP_PKISI *si = OSSL_CMP_STATUSINFO_new(33, 44, "a text"); X509_NAME *issuer = X509_NAME_new(); ASN1_INTEGER *serial = ASN1_INTEGER_new(); OSSL_CRMF_CERTID *cid = NULL; @@ -439,8 +438,7 @@ static int execute_rp_create(CMP_MSG_TEST_FIXTURE *fixture) if (!TEST_ptr(ossl_cmp_revrepcontent_get_CertId(rpmsg->body->value.rp, 0))) goto err; - if (!TEST_ptr(ossl_cmp_revrepcontent_get_pkistatusinfo(rpmsg->body-> - value.rp, 0))) + if (!TEST_ptr(ossl_cmp_revrepcontent_get_pkisi(rpmsg->body->value.rp, 0))) goto err; res = 1; diff --git a/test/cmp_protect_test.c b/test/cmp_protect_test.c index 5d5df89abd..a506ec33ea 100644 --- a/test/cmp_protect_test.c +++ b/test/cmp_protect_test.c @@ -278,6 +278,38 @@ static int test_MSG_protect_no_key_no_secret(void) return result; } +static int test_MSG_protect_pbmac_no_sender(int with_ref) +{ + static unsigned char secret[] = { 47, 11, 8, 15 }; + static unsigned char ref[] = { 0xca, 0xfe, 0xba, 0xbe }; + + SETUP_TEST_FIXTURE(CMP_PROTECT_TEST_FIXTURE, set_up); + fixture->expected = with_ref; + if (!TEST_ptr(fixture->msg = OSSL_CMP_MSG_dup(ir_unprotected)) + || !SET_OPT_UNPROTECTED_SEND(fixture->cmp_ctx, 0) + || !ossl_cmp_hdr_set1_sender(fixture->msg->header, NULL) + || !OSSL_CMP_CTX_set1_secretValue(fixture->cmp_ctx, + secret, sizeof(secret)) + || (!OSSL_CMP_CTX_set1_referenceValue(fixture->cmp_ctx, + with_ref ? ref : NULL, + sizeof(ref)))) { + tear_down(fixture); + fixture = NULL; + } + EXECUTE_TEST(execute_MSG_protect_test, tear_down); + return result; +} + +static int test_MSG_protect_pbmac_no_sender_with_ref(void) +{ + return test_MSG_protect_pbmac_no_sender(1); +} + +static int test_MSG_protect_pbmac_no_sender_no_ref(void) +{ + return test_MSG_protect_pbmac_no_sender(0); +} + static int execute_MSG_add_extraCerts_test(CMP_PROTECT_TEST_FIXTURE *fixture) { return TEST_true(ossl_cmp_msg_add_extraCerts(fixture->cmp_ctx, @@ -511,7 +543,8 @@ int setup_tests(void) ADD_TEST(test_MSG_protect_certificate_based_without_cert); ADD_TEST(test_MSG_protect_unprotected_request); ADD_TEST(test_MSG_protect_no_key_no_secret); - + ADD_TEST(test_MSG_protect_pbmac_no_sender_with_ref); + ADD_TEST(test_MSG_protect_pbmac_no_sender_no_ref); ADD_TEST(test_MSG_add_extraCerts); #ifndef OPENSSL_NO_EC diff --git a/test/cmp_server_test.c b/test/cmp_server_test.c new file mode 100644 index 0000000000..13159299e9 --- /dev/null +++ b/test/cmp_server_test.c @@ -0,0 +1,160 @@ +/* + * Copyright 2007-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright Nokia 2007-2020 + * Copyright Siemens AG 2015-2020 + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#include "cmp_testlib.h" + +typedef struct test_fixture { + const char *test_case_name; + int expected; + OSSL_CMP_SRV_CTX *srv_ctx; + OSSL_CMP_MSG *req; +} CMP_SRV_TEST_FIXTURE; + +static OSSL_CMP_MSG *request = NULL; + +static void tear_down(CMP_SRV_TEST_FIXTURE *fixture) +{ + OSSL_CMP_SRV_CTX_free(fixture->srv_ctx); + OPENSSL_free(fixture); +} + +static CMP_SRV_TEST_FIXTURE *set_up(const char *const test_case_name) +{ + CMP_SRV_TEST_FIXTURE *fixture; + + if (!TEST_ptr(fixture = OPENSSL_zalloc(sizeof(*fixture)))) + return NULL; + fixture->test_case_name = test_case_name; + if (!TEST_ptr(fixture->srv_ctx = OSSL_CMP_SRV_CTX_new())) + goto err; + return fixture; + + err: + tear_down(fixture); + return NULL; +} + +static int dummy_errorCode = CMP_R_MULTIPLE_SAN_SOURCES; /* any reason code */ + +static OSSL_CMP_PKISI *process_cert_request(OSSL_CMP_SRV_CTX *srv_ctx, + const OSSL_CMP_MSG *cert_req, + int certReqId, + const OSSL_CRMF_MSG *crm, + const X509_REQ *p10cr, + X509 **certOut, + STACK_OF(X509) **chainOut, + STACK_OF(X509) **caPubs) +{ + CMPerr(0, dummy_errorCode); + return NULL; +} + +static int execute_test_handle_request(CMP_SRV_TEST_FIXTURE *fixture) +{ + OSSL_CMP_SRV_CTX *ctx = fixture->srv_ctx; + OSSL_CMP_CTX *client_ctx; + OSSL_CMP_CTX *cmp_ctx; + char *dummy_custom_ctx = "@test_dummy", *custom_ctx; + OSSL_CMP_MSG *rsp = NULL; + OSSL_CMP_ERRORMSGCONTENT *errorContent; + int res = 0; + + if (!TEST_ptr(client_ctx = OSSL_CMP_CTX_new()) + || !TEST_true(OSSL_CMP_CTX_set_transfer_cb_arg(client_ctx, ctx))) + goto end; + + if (!TEST_true(OSSL_CMP_SRV_CTX_init(ctx, dummy_custom_ctx, + process_cert_request, NULL, NULL, + NULL, NULL, NULL)) + || !TEST_ptr(custom_ctx = OSSL_CMP_SRV_CTX_get0_custom_ctx(ctx)) + || !TEST_int_eq(strcmp(custom_ctx, dummy_custom_ctx), 0)) + goto end; + + if (!TEST_true(OSSL_CMP_SRV_CTX_set_send_unprotected_errors(ctx, 0)) + || !TEST_true(OSSL_CMP_SRV_CTX_set_accept_unprotected(ctx, 0)) + || !TEST_true(OSSL_CMP_SRV_CTX_set_accept_raverified(ctx, 1)) + || !TEST_true(OSSL_CMP_SRV_CTX_set_grant_implicit_confirm(ctx, 1))) + goto end; + + if (!TEST_ptr(cmp_ctx = OSSL_CMP_SRV_CTX_get0_cmp_ctx(ctx)) + || !OSSL_CMP_CTX_set1_referenceValue(cmp_ctx, + (unsigned char *)"server", 6) + || !OSSL_CMP_CTX_set1_secretValue(cmp_ctx, + (unsigned char *)"1234", 4)) + goto end; + + if (!TEST_ptr(rsp = OSSL_CMP_CTX_server_perform(client_ctx, fixture->req)) + || !TEST_int_eq(ossl_cmp_msg_get_bodytype(rsp), + OSSL_CMP_PKIBODY_ERROR) + || !TEST_ptr(errorContent = rsp->body->value.error) + || !TEST_int_eq(ASN1_INTEGER_get(errorContent->errorCode), + dummy_errorCode)) + goto end; + + res = 1; + + end: + OSSL_CMP_MSG_free(rsp); + OSSL_CMP_CTX_free(client_ctx); + return res; +} + +static int test_handle_request(void) +{ + SETUP_TEST_FIXTURE(CMP_SRV_TEST_FIXTURE, set_up); + fixture->req = request; + fixture->expected = 1; + EXECUTE_TEST(execute_test_handle_request, tear_down); + return result; +} + +void cleanup_tests(void) +{ + OSSL_CMP_MSG_free(request); + return; +} + +int setup_tests(void) +{ + const char *request_f; + + if (!test_skip_common_options()) { + TEST_error("Error parsing test options\n"); + return 0; + } + + if (!TEST_ptr(request_f = test_get_argument(0))) { + TEST_error("usage: cmp_server_test CR_protected_PBM_1234.der\n"); + return 0; + } + + if (!TEST_ptr(request = load_pkimsg(request_f))) { + cleanup_tests(); + return 0; + } + + /* + * this (indirectly) calls + * OSSL_CMP_SRV_CTX_new(), + * OSSL_CMP_SRV_CTX_free(), + * OSSL_CMP_CTX_server_perform(), + * OSSL_CMP_SRV_process_request(), + * OSSL_CMP_SRV_CTX_init(), + * OSSL_CMP_SRV_CTX_get0_cmp_ctx(), + * OSSL_CMP_SRV_CTX_get0_custom_ctx(), + * OSSL_CMP_SRV_CTX_set_send_unprotected_errors(), + * OSSL_CMP_SRV_CTX_set_accept_unprotected(), + * OSSL_CMP_SRV_CTX_set_accept_raverified(), and + * OSSL_CMP_SRV_CTX_set_grant_implicit_confirm() + */ + ADD_TEST(test_handle_request); + return 1; +} diff --git a/test/cmp_status_test.c b/test/cmp_status_test.c index 7311c2e444..15cd6a5fd0 100644 --- a/test/cmp_status_test.c +++ b/test/cmp_status_test.c @@ -45,18 +45,18 @@ static int execute_PKISI_test(CMP_STATUS_TEST_FIXTURE *fixture) ASN1_UTF8STRING *statusString = NULL; int res = 0, i; - if (!TEST_ptr(si = ossl_cmp_statusinfo_new(fixture->pkistatus, + if (!TEST_ptr(si = OSSL_CMP_STATUSINFO_new(fixture->pkistatus, fixture->pkifailure, fixture->text))) goto end; - status = ossl_cmp_pkisi_get_pkistatus(si); + status = ossl_cmp_pkisi_get_status(si); if (!TEST_int_eq(fixture->pkistatus, status) || !TEST_str_eq(fixture->str, ossl_cmp_PKIStatus_to_string(status))) goto end; if (!TEST_ptr(statusString = - sk_ASN1_UTF8STRING_value(ossl_cmp_pkisi_get0_statusstring(si), + sk_ASN1_UTF8STRING_value(ossl_cmp_pkisi_get0_statusString(si), 0)) || !TEST_str_eq(fixture->text, (char *)statusString->data)) goto end; @@ -66,7 +66,7 @@ static int execute_PKISI_test(CMP_STATUS_TEST_FIXTURE *fixture) goto end; for (i = 0; i <= OSSL_CMP_PKIFAILUREINFO_MAX; i++) if (!TEST_int_eq((fixture->pkifailure >> i) & 1, - ossl_cmp_pkisi_pkifailureinfo_check(si, i))) + ossl_cmp_pkisi_check_pkifailureinfo(si, i))) goto end; res = 1; @@ -99,12 +99,12 @@ int setup_tests(void) { /*- * this tests all of: - * ossl_cmp_statusinfo_new() - * ossl_cmp_pkisi_get_pkistatus() + * OSSL_CMP_STATUSINFO_new() + * ossl_cmp_pkisi_get_status() * ossl_cmp_PKIStatus_to_string() - * ossl_cmp_pkisi_get0_statusstring() + * ossl_cmp_pkisi_get0_statusString() * ossl_cmp_pkisi_get_pkifailureinfo() - * ossl_cmp_pkisi_pkifailureinfo_check() + * ossl_cmp_pkisi_check_pkifailureinfo() */ ADD_TEST(test_PKISI); return 1; diff --git a/test/cmp_vfy_test.c b/test/cmp_vfy_test.c index 41ddad86ba..f52efa9855 100644 --- a/test/cmp_vfy_test.c +++ b/test/cmp_vfy_test.c @@ -69,7 +69,7 @@ static CMP_VFY_TEST_FIXTURE *set_up(const char *const test_case_name) return NULL; } X509_VERIFY_PARAM_set_time(X509_STORE_get0_param(ts), test_time_valid); - X509_STORE_set_verify_cb(ts, OSSL_CMP_print_cert_verify_cb); + X509_STORE_set_verify_cb(ts, X509_STORE_CTX_print_verify_cb); return fixture; } @@ -437,8 +437,7 @@ static void setup_check_received(CMP_VFY_TEST_FIXTURE **fixture, int expected, nonce_data, nonce_len))) { tear_down((*fixture)); (*fixture) = NULL; - } - else if (trid_data != NULL) { + } else if (trid_data != NULL) { ASN1_OCTET_STRING *trid = ASN1_OCTET_STRING_new(); if (trid == NULL || !ASN1_OCTET_STRING_set(trid, trid_data, @@ -549,6 +548,11 @@ int setup_tests(void) ts.tm_year += 10; /* February 18th 2028 */ test_time_after_expiration = mktime(&ts); + if (!test_skip_common_options()) { + TEST_error("Error parsing test options\n"); + return 0; + } + RAND_bytes(rand_data, OSSL_CMP_TRANSACTIONID_LENGTH); if (!TEST_ptr(server_f = test_get_argument(0)) || !TEST_ptr(client_f = test_get_argument(1)) diff --git a/test/recipes/65-test_cmp_server.t b/test/recipes/65-test_cmp_server.t new file mode 100644 index 0000000000..87dbdb10b2 --- /dev/null +++ b/test/recipes/65-test_cmp_server.t @@ -0,0 +1,26 @@ +#! /usr/bin/env perl +# Copyright 2007-2020 The OpenSSL Project Authors. All Rights Reserved. +# Copyright Nokia 2007-2020 +# Copyright Siemens AG 2015-2020 +# +# Licensed under the Apache License 2.0 (the "License"). You may not use +# this file except in compliance with the License. You can obtain a copy +# in the file LICENSE in the source distribution or at +# https://www.openssl.org/source/license.html + +use strict; +use OpenSSL::Test qw/:DEFAULT data_file/; +use OpenSSL::Test::Utils; + +setup("test_cmp_server"); + +plan skip_all => "This test is not supported in a no-cmp build" + if disabled("cmp"); + +plan skip_all => "This test is not supported in a no-ec build" + if disabled("ec"); + +plan tests => 1; + +ok(run(test(["cmp_server_test", + data_file("CR_protected_PBM_1234.der")]))); diff --git a/test/recipes/65-test_cmp_server_data/CR_protected_PBM_1234.der b/test/recipes/65-test_cmp_server_data/CR_protected_PBM_1234.der new file mode 100644 index 0000000000..fc1c0aff9b Binary files /dev/null and b/test/recipes/65-test_cmp_server_data/CR_protected_PBM_1234.der differ diff --git a/util/libcrypto.num b/util/libcrypto.num index d7a94f8adf..15dd512a49 100644 --- a/util/libcrypto.num +++ b/util/libcrypto.num @@ -4956,3 +4956,27 @@ OSSL_SELF_TEST_onbegin ? 3_0_0 EXIST::FUNCTION: OSSL_SELF_TEST_oncorrupt_byte ? 3_0_0 EXIST::FUNCTION: OSSL_SELF_TEST_onend ? 3_0_0 EXIST::FUNCTION: OSSL_PROVIDER_set_default_search_path ? 3_0_0 EXIST::FUNCTION: +X509_digest_sig ? 3_0_0 EXIST::FUNCTION: +OSSL_CMP_MSG_dup ? 3_0_0 EXIST::FUNCTION:CMP +OSSL_CMP_ITAV_dup ? 3_0_0 EXIST::FUNCTION:CMP +d2i_OSSL_CMP_PKISI ? 3_0_0 EXIST::FUNCTION:CMP +i2d_OSSL_CMP_PKISI ? 3_0_0 EXIST::FUNCTION:CMP +OSSL_CMP_PKISI_free ? 3_0_0 EXIST::FUNCTION:CMP +OSSL_CMP_PKISI_new ? 3_0_0 EXIST::FUNCTION:CMP +OSSL_CMP_PKISI_it ? 3_0_0 EXIST::FUNCTION:CMP +OSSL_CMP_PKISI_dup ? 3_0_0 EXIST::FUNCTION:CMP +OSSL_CMP_snprint_PKIStatusInfo ? 3_0_0 EXIST::FUNCTION:CMP +OSSL_CMP_STATUSINFO_new ? 3_0_0 EXIST::FUNCTION:CMP +OSSL_d2i_CMP_MSG_bio ? 3_0_0 EXIST::FUNCTION:CMP +OSSL_i2d_CMP_MSG_bio ? 3_0_0 EXIST::FUNCTION:CMP +OSSL_CMP_SRV_process_request ? 3_0_0 EXIST::FUNCTION:CMP +OSSL_CMP_CTX_server_perform ? 3_0_0 EXIST::FUNCTION:CMP +OSSL_CMP_SRV_CTX_new ? 3_0_0 EXIST::FUNCTION:CMP +OSSL_CMP_SRV_CTX_free ? 3_0_0 EXIST::FUNCTION:CMP +OSSL_CMP_SRV_CTX_init ? 3_0_0 EXIST::FUNCTION:CMP +OSSL_CMP_SRV_CTX_get0_cmp_ctx ? 3_0_0 EXIST::FUNCTION:CMP +OSSL_CMP_SRV_CTX_get0_custom_ctx ? 3_0_0 EXIST::FUNCTION:CMP +OSSL_CMP_SRV_CTX_set_send_unprotected_errors ? 3_0_0 EXIST::FUNCTION:CMP +OSSL_CMP_SRV_CTX_set_accept_unprotected ? 3_0_0 EXIST::FUNCTION:CMP +OSSL_CMP_SRV_CTX_set_accept_raverified ? 3_0_0 EXIST::FUNCTION:CMP +OSSL_CMP_SRV_CTX_set_grant_implicit_confirm ? 3_0_0 EXIST::FUNCTION:CMP diff --git a/util/other.syms b/util/other.syms index 4996dd874b..1d2a2689ef 100644 --- a/util/other.syms +++ b/util/other.syms @@ -367,6 +367,12 @@ OSSL_CMP_severity datatype OSSL_cmp_certConf_cb_t datatype OSSL_cmp_log_cb_t datatype OSSL_cmp_transfer_cb_t datatype +OSSL_CMP_SRV_cert_request_cb_t datatype +OSSL_CMP_SRV_rr_cb_t datatype +OSSL_CMP_SRV_certConf_cb_t datatype +OSSL_CMP_SRV_genm_cb_t datatype +OSSL_CMP_SRV_error_cb_t datatype +OSSL_CMP_SRV_pollReq_cb_t datatype OSSL_PARAM_TYPE define OSSL_PARAM_octet_ptr define OSSL_PARAM_octet_string define From builds at travis-ci.org Tue Mar 10 16:07:28 2020 From: builds at travis-ci.org (Travis CI) Date: Tue, 10 Mar 2020 16:07:28 +0000 Subject: Still Failing: openssl/openssl#33013 (master - 44387c9) In-Reply-To: Message-ID: <5e67bb3f69e14_43fa05a2170e81584e2@8a8471f5-25fb-4ca7-8d30-7e10858c801a.mail> Build Update for openssl/openssl ------------------------------------- Build: #33013 Status: Still Failing Duration: 51 mins and 10 secs Commit: 44387c9 (master) Author: Dr. David von Oheimb Message: Move OSSL_CMP_X509_digest() to x_all.c, renaming it to X509_digest_sig() Reviewed-by: Matt Caswell Reviewed-by: David von Oheimb (Merged from https://github.com/openssl/openssl/pull/11142) View the changeset: https://github.com/openssl/openssl/compare/041a96e7acc8...44387c900019 View the full build log and details: https://travis-ci.org/openssl/openssl/builds/660670511?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the openssl/openssl repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=5849220&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From openssl at openssl.org Tue Mar 10 22:07:12 2020 From: openssl at openssl.org (OpenSSL run-checker) Date: Tue, 10 Mar 2020 22:07:12 +0000 Subject: Still FAILED build of OpenSSL branch master with options -d --strict-warnings Message-ID: <1583878032.524711.22877.nullmailer@run.openssl.org> Platform and configuration command: $ uname -a Linux run 4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux $ CC=clang ../openssl/config -d --strict-warnings Commit log since last time: 44387c9000 Move OSSL_CMP_X509_digest() to x_all.c, renaming it to X509_digest_sig() cfca56dfae Fix handling of CMP msg senderKID and improve doc of related CTX functions 7269071e5e Fix error in case CMP msg POPO is not provided in OSSL_CRMF_MSGS_verify_popo() 62dcd2aa17 Chunk 8 of CMP contribution to OpenSSL: CMP server and cmp_mock_srv.c for testing da42c2a3d7 Extract sk_ASN1_UTF8STRING2text() from ts_get_status_text() in ts_rsp_verify.c to asn1_lib.c b5adba2042 fix coding style nits w.r.t. 'defined' in http_local.h, http.h, and ocsp.h 4c7f8981e8 fix two mistakes w.r.t. ERR_LIB_* parameters in ERR_add_error_txt() 041a96e7ac DOCS: Clean up doc/man3/EVP_DigestInit.pod b5b91a7963 DOCS: Add translation information for EVP_MD_CTX_ctrl() 2f3a709807 DOCS: Add missing documentation in util/missingcrypto.txt 1e55cbc874 DOCS: Move implementation specific docs away from provider-digest(7) c5926e930c DOCS: Start restructuring our provider and implementation documentation Build log ended with (last 100 lines): clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/libfips-lib-sparse_array.d.tmp -MT crypto/libfips-lib-sparse_array.o -c -o crypto/libfips-lib-sparse_array.o ../openssl/crypto/sparse_array.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/libfips-lib-threads_none.d.tmp -MT crypto/libfips-lib-threads_none.o -c -o crypto/libfips-lib-threads_none.o ../openssl/crypto/threads_none.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/libfips-lib-threads_pthread.d.tmp -MT crypto/libfips-lib-threads_pthread.o -c -o crypto/libfips-lib-threads_pthread.o ../openssl/crypto/threads_pthread.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/libfips-lib-threads_win.d.tmp -MT crypto/libfips-lib-threads_win.o -c -o crypto/libfips-lib-threads_win.o ../openssl/crypto/threads_win.c clang -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -c -o crypto/libfips-lib-x86_64cpuid.o crypto/x86_64cpuid.s clang -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -c -o crypto/modes/libfips-lib-aesni-gcm-x86_64.o crypto/modes/aesni-gcm-x86_64.s clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/modes/libfips-lib-cbc128.d.tmp -MT crypto/modes/libfips-lib-cbc128.o -c -o crypto/modes/libfips-lib-cbc128.o ../openssl/crypto/modes/cbc128.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/modes/libfips-lib-ccm128.d.tmp -MT crypto/modes/libfips-lib-ccm128.o -c -o crypto/modes/libfips-lib-ccm128.o ../openssl/crypto/modes/ccm128.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/modes/libfips-lib-cfb128.d.tmp -MT crypto/modes/libfips-lib-cfb128.o -c -o crypto/modes/libfips-lib-cfb128.o ../openssl/crypto/modes/cfb128.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/modes/libfips-lib-ctr128.d.tmp -MT crypto/modes/libfips-lib-ctr128.o -c -o crypto/modes/libfips-lib-ctr128.o ../openssl/crypto/modes/ctr128.c clang -Icrypto -I../openssl/crypto -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/modes/libfips-lib-gcm128.d.tmp -MT crypto/modes/libfips-lib-gcm128.o -c -o crypto/modes/libfips-lib-gcm128.o ../openssl/crypto/modes/gcm128.c clang -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -c -o crypto/modes/libfips-lib-ghash-x86_64.o crypto/modes/ghash-x86_64.s clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/modes/libfips-lib-ofb128.d.tmp -MT crypto/modes/libfips-lib-ofb128.o -c -o crypto/modes/libfips-lib-ofb128.o ../openssl/crypto/modes/ofb128.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/modes/libfips-lib-wrap128.d.tmp -MT crypto/modes/libfips-lib-wrap128.o -c -o crypto/modes/libfips-lib-wrap128.o ../openssl/crypto/modes/wrap128.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/modes/libfips-lib-xts128.d.tmp -MT crypto/modes/libfips-lib-xts128.o -c -o crypto/modes/libfips-lib-xts128.o ../openssl/crypto/modes/xts128.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/property/libfips-lib-defn_cache.d.tmp -MT crypto/property/libfips-lib-defn_cache.o -c -o crypto/property/libfips-lib-defn_cache.o ../openssl/crypto/property/defn_cache.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/property/libfips-lib-property.d.tmp -MT crypto/property/libfips-lib-property.o -c -o crypto/property/libfips-lib-property.o ../openssl/crypto/property/property.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/property/libfips-lib-property_parse.d.tmp -MT crypto/property/libfips-lib-property_parse.o -c -o crypto/property/libfips-lib-property_parse.o ../openssl/crypto/property/property_parse.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/property/libfips-lib-property_string.d.tmp -MT crypto/property/libfips-lib-property_string.o -c -o crypto/property/libfips-lib-property_string.o ../openssl/crypto/property/property_string.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/rand/libfips-lib-drbg_ctr.d.tmp -MT crypto/rand/libfips-lib-drbg_ctr.o -c -o crypto/rand/libfips-lib-drbg_ctr.o ../openssl/crypto/rand/drbg_ctr.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/rand/libfips-lib-drbg_hash.d.tmp -MT crypto/rand/libfips-lib-drbg_hash.o -c -o crypto/rand/libfips-lib-drbg_hash.o ../openssl/crypto/rand/drbg_hash.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/rand/libfips-lib-drbg_hmac.d.tmp -MT crypto/rand/libfips-lib-drbg_hmac.o -c -o crypto/rand/libfips-lib-drbg_hmac.o ../openssl/crypto/rand/drbg_hmac.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/rand/libfips-lib-drbg_lib.d.tmp -MT crypto/rand/libfips-lib-drbg_lib.o -c -o crypto/rand/libfips-lib-drbg_lib.o ../openssl/crypto/rand/drbg_lib.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/rand/libfips-lib-rand_crng_test.d.tmp -MT crypto/rand/libfips-lib-rand_crng_test.o -c -o crypto/rand/libfips-lib-rand_crng_test.o ../openssl/crypto/rand/rand_crng_test.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/rand/libfips-lib-rand_lib.d.tmp -MT crypto/rand/libfips-lib-rand_lib.o -c -o crypto/rand/libfips-lib-rand_lib.o ../openssl/crypto/rand/rand_lib.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/rand/libfips-lib-rand_unix.d.tmp -MT crypto/rand/libfips-lib-rand_unix.o -c -o crypto/rand/libfips-lib-rand_unix.o ../openssl/crypto/rand/rand_unix.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/rand/libfips-lib-rand_vms.d.tmp -MT crypto/rand/libfips-lib-rand_vms.o -c -o crypto/rand/libfips-lib-rand_vms.o ../openssl/crypto/rand/rand_vms.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/rand/libfips-lib-rand_vxworks.d.tmp -MT crypto/rand/libfips-lib-rand_vxworks.o -c -o crypto/rand/libfips-lib-rand_vxworks.o ../openssl/crypto/rand/rand_vxworks.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/rand/libfips-lib-rand_win.d.tmp -MT crypto/rand/libfips-lib-rand_win.o -c -o crypto/rand/libfips-lib-rand_win.o ../openssl/crypto/rand/rand_win.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/rsa/libfips-lib-rsa_aid.d.tmp -MT crypto/rsa/libfips-lib-rsa_aid.o -c -o crypto/rsa/libfips-lib-rsa_aid.o ../openssl/crypto/rsa/rsa_aid.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/rsa/libfips-lib-rsa_chk.d.tmp -MT crypto/rsa/libfips-lib-rsa_chk.o -c -o crypto/rsa/libfips-lib-rsa_chk.o ../openssl/crypto/rsa/rsa_chk.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/rsa/libfips-lib-rsa_crpt.d.tmp -MT crypto/rsa/libfips-lib-rsa_crpt.o -c -o crypto/rsa/libfips-lib-rsa_crpt.o ../openssl/crypto/rsa/rsa_crpt.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/rsa/libfips-lib-rsa_gen.d.tmp -MT crypto/rsa/libfips-lib-rsa_gen.o -c -o crypto/rsa/libfips-lib-rsa_gen.o ../openssl/crypto/rsa/rsa_gen.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/rsa/libfips-lib-rsa_lib.d.tmp -MT crypto/rsa/libfips-lib-rsa_lib.o -c -o crypto/rsa/libfips-lib-rsa_lib.o ../openssl/crypto/rsa/rsa_lib.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/rsa/libfips-lib-rsa_none.d.tmp -MT crypto/rsa/libfips-lib-rsa_none.o -c -o crypto/rsa/libfips-lib-rsa_none.o ../openssl/crypto/rsa/rsa_none.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/rsa/libfips-lib-rsa_oaep.d.tmp -MT crypto/rsa/libfips-lib-rsa_oaep.o -c -o crypto/rsa/libfips-lib-rsa_oaep.o ../openssl/crypto/rsa/rsa_oaep.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/rsa/libfips-lib-rsa_ossl.d.tmp -MT crypto/rsa/libfips-lib-rsa_ossl.o -c -o crypto/rsa/libfips-lib-rsa_ossl.o ../openssl/crypto/rsa/rsa_ossl.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/rsa/libfips-lib-rsa_pk1.d.tmp -MT crypto/rsa/libfips-lib-rsa_pk1.o -c -o crypto/rsa/libfips-lib-rsa_pk1.o ../openssl/crypto/rsa/rsa_pk1.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/rsa/libfips-lib-rsa_pss.d.tmp -MT crypto/rsa/libfips-lib-rsa_pss.o -c -o crypto/rsa/libfips-lib-rsa_pss.o ../openssl/crypto/rsa/rsa_pss.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/rsa/libfips-lib-rsa_sign.d.tmp -MT crypto/rsa/libfips-lib-rsa_sign.o -c -o crypto/rsa/libfips-lib-rsa_sign.o ../openssl/crypto/rsa/rsa_sign.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/rsa/libfips-lib-rsa_sp800_56b_check.d.tmp -MT crypto/rsa/libfips-lib-rsa_sp800_56b_check.o -c -o crypto/rsa/libfips-lib-rsa_sp800_56b_check.o ../openssl/crypto/rsa/rsa_sp800_56b_check.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/rsa/libfips-lib-rsa_sp800_56b_gen.d.tmp -MT crypto/rsa/libfips-lib-rsa_sp800_56b_gen.o -c -o crypto/rsa/libfips-lib-rsa_sp800_56b_gen.o ../openssl/crypto/rsa/rsa_sp800_56b_gen.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/rsa/libfips-lib-rsa_x931.d.tmp -MT crypto/rsa/libfips-lib-rsa_x931.o -c -o crypto/rsa/libfips-lib-rsa_x931.o ../openssl/crypto/rsa/rsa_x931.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/rsa/libfips-lib-rsa_x931g.d.tmp -MT crypto/rsa/libfips-lib-rsa_x931g.o -c -o crypto/rsa/libfips-lib-rsa_x931g.o ../openssl/crypto/rsa/rsa_x931g.c clang -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -c -o crypto/sha/libfips-lib-keccak1600-x86_64.o crypto/sha/keccak1600-x86_64.s clang -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -c -o crypto/sha/libfips-lib-sha1-mb-x86_64.o crypto/sha/sha1-mb-x86_64.s clang -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -c -o crypto/sha/libfips-lib-sha1-x86_64.o crypto/sha/sha1-x86_64.s clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/sha/libfips-lib-sha1dgst.d.tmp -MT crypto/sha/libfips-lib-sha1dgst.o -c -o crypto/sha/libfips-lib-sha1dgst.o ../openssl/crypto/sha/sha1dgst.c clang -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -c -o crypto/sha/libfips-lib-sha256-mb-x86_64.o crypto/sha/sha256-mb-x86_64.s clang -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -c -o crypto/sha/libfips-lib-sha256-x86_64.o crypto/sha/sha256-x86_64.s clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/sha/libfips-lib-sha256.d.tmp -MT crypto/sha/libfips-lib-sha256.o -c -o crypto/sha/libfips-lib-sha256.o ../openssl/crypto/sha/sha256.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/sha/libfips-lib-sha3.d.tmp -MT crypto/sha/libfips-lib-sha3.o -c -o crypto/sha/libfips-lib-sha3.o ../openssl/crypto/sha/sha3.c clang -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -c -o crypto/sha/libfips-lib-sha512-x86_64.o crypto/sha/sha512-x86_64.s clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/sha/libfips-lib-sha512.d.tmp -MT crypto/sha/libfips-lib-sha512.o -c -o crypto/sha/libfips-lib-sha512.o ../openssl/crypto/sha/sha512.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/stack/libfips-lib-stack.d.tmp -MT crypto/stack/libfips-lib-stack.o -c -o crypto/stack/libfips-lib-stack.o ../openssl/crypto/stack/stack.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF providers/common/libfips-lib-provider_util.d.tmp -MT providers/common/libfips-lib-provider_util.o -c -o providers/common/libfips-lib-provider_util.o ../openssl/providers/common/provider_util.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF providers/implementations/ciphers/libfips-lib-cipher_aes_xts_fips.d.tmp -MT providers/implementations/ciphers/libfips-lib-cipher_aes_xts_fips.o -c -o providers/implementations/ciphers/libfips-lib-cipher_aes_xts_fips.o ../openssl/providers/implementations/ciphers/cipher_aes_xts_fips.c clang -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -DAES_ASM -DBSAES_ASM -DECP_NISTZ256_ASM -DFIPS_MODE -DGHASH_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF providers/implementations/kdfs/libfips-lib-pbkdf2_fips.d.tmp -MT providers/implementations/kdfs/libfips-lib-pbkdf2_fips.o -c -o providers/implementations/kdfs/libfips-lib-pbkdf2_fips.o ../openssl/providers/implementations/kdfs/pbkdf2_fips.c ar r providers/libimplementations.a providers/implementations/asymciphers/libimplementations-lib-rsa_enc.o providers/implementations/ciphers/libimplementations-lib-cipher_aes.o providers/implementations/ciphers/libimplementations-lib-cipher_aes_cbc_hmac_sha.o providers/implementations/ciphers/libimplementations-lib-cipher_aes_cbc_hmac_sha1_hw.o providers/implementations/ciphers/libimplementations-lib-cipher_aes_cbc_hmac_sha256_hw.o providers/implementations/ciphers/libimplementations-lib-cipher_aes_ccm.o providers/implementations/ciphers/libimplementations-lib-cipher_aes_ccm_hw.o providers/implementations/ciphers/libimplementations-lib-cipher_aes_gcm.o providers/implementations/ciphers/libimplementations-lib-cipher_aes_gcm_hw.o providers/implementations/ciphers/libimplementations-lib-cipher_aes_hw.o providers/implementations/ciphers/libimplementations-lib-cipher_aes_ocb.o providers/implementations/ciphers/libimplementations-lib-cipher_aes_ocb_hw.o providers/implementations/ciphers/libimplementations-lib-cipher_aes_siv.o providers/implementations/ciphers/libimplementations-lib-cipher_aes_siv_hw.o providers/implementations/ciphers/libimplementations-lib-cipher_aes_wrp.o providers/implementations/ciphers/libimplementations-lib-cipher_aes_xts.o providers/implementations/ciphers/libimplementations-lib-cipher_aes_xts_hw.o providers/implementations/ciphers/libimplementations-lib-cipher_aria.o providers/implementations/ciphers/libimplementations-lib-cipher_aria_ccm.o providers/implementations/ciphers/libimplementations-lib-cipher_aria_ccm_hw.o providers/implementations/ciphers/libimplementations-lib-cipher_aria_gcm.o providers/implementations/ciphers/libimplementations-lib-cipher_aria_gcm_hw.o providers/implementations/ciphers/libimplementations-lib-cipher_aria_hw.o providers/implementations/ciphers/libimplementations-lib-cipher_blowfish.o providers/implementations/ciphers/libimplementations-lib-cipher_blowfish_hw.o providers/implementations/ciphers/libimplementations-lib-cipher_camellia.o providers/implementations/ciphers/libimplementations-lib-cipher_camellia_hw.o providers/implementations/ciphers/libimplementations-lib-cipher_cast5.o providers/implementations/ciphers/libimplementations-lib-cipher_cast5_hw.o providers/implementations/ciphers/libimplementations-lib-cipher_chacha20.o providers/implementations/ciphers/libimplementations-lib-cipher_chacha20_hw.o providers/implementations/ciphers/libimplementations-lib-cipher_chacha20_poly1305.o providers/implementations/ciphers/libimplementations-lib-cipher_chacha20_poly1305_hw.o providers/implementations/ciphers/libimplementations-lib-cipher_des.o providers/implementations/ciphers/libimplementations-lib-cipher_des_hw.o providers/implementations/ciphers/libimplementations-lib-cipher_desx.o providers/implementations/ciphers/libimplementations-lib-cipher_desx_hw.o providers/implementations/ciphers/libimplementations-lib-cipher_idea.o providers/implementations/ciphers/libimplementations-lib-cipher_idea_hw.o providers/implementations/ciphers/libimplementations-lib-cipher_null.o providers/implementations/ciphers/libimplementations-lib-cipher_rc2.o providers/implementations/ciphers/libimplementations-lib-cipher_rc2_hw.o providers/implementations/ciphers/libimplementations-lib-cipher_rc4.o providers/implementations/ciphers/libimplementations-lib-cipher_rc4_hmac_md5.o providers/implementations/ciphers/libimplementations-lib-cipher_rc4_hmac_md5_hw.o providers/implementations/ciphers/libimplementations-lib-cipher_rc4_hw.o providers/implementations/ciphers/libimplementations-lib-cipher_seed.o providers/implementations/ciphers/libimplementations-lib-cipher_seed_hw.o providers/implementations/ciphers/libimplementations-lib-cipher_sm4.o providers/implementations/ciphers/libimplementations-lib-cipher_sm4_hw.o providers/implementations/ciphers/libimplementations-lib-cipher_tdes.o providers/implementations/ciphers/libimplementations-lib-cipher_tdes_default.o providers/implementations/ciphers/libimplementations-lib-cipher_tdes_default_hw.o providers/implementations/ciphers/libimplementations-lib-cipher_tdes_hw.o providers/implementations/ciphers/libimplementations-lib-cipher_tdes_wrap.o providers/implementations/ciphers/libimplementations-lib-cipher_tdes_wrap_hw.o providers/implementations/digests/libimplementations-lib-blake2_prov.o providers/implementations/digests/libimplementations-lib-blake2b_prov.o providers/implementations/digests/libimplementations-lib-blake2s_prov.o providers/implementations/digests/libimplementations-lib-md5_prov.o providers/implementations/digests/libimplementations-lib-md5_sha1_prov.o providers/implementations/digests/libimplementations-lib-sha2_prov.o providers/implementations/digests/libimplementations-lib-sha3_prov.o providers/implementations/digests/libimplementations-lib-sm3_prov.o providers/implementations/exchange/libimplementations-lib-dh_exch.o providers/implementations/exchange/libimplementations-lib-ecdh_exch.o providers/implementations/exchange/libimplementations-lib-ecx_exch.o providers/implementations/kdfs/libimplementations-lib-hkdf.o providers/implementations/kdfs/libimplementations-lib-kbkdf.o providers/implementations/kdfs/libimplementations-lib-krb5kdf.o providers/implementations/kdfs/libimplementations-lib-pbkdf2.o providers/implementations/kdfs/libimplementations-lib-scrypt.o providers/implementations/kdfs/libimplementations-lib-sshkdf.o providers/implementations/kdfs/libimplementations-lib-sskdf.o providers/implementations/kdfs/libimplementations-lib-tls1_prf.o providers/implementations/kdfs/libimplementations-lib-x942kdf.o providers/implementations/keymgmt/libimplementations-lib-dh_kmgmt.o providers/implementations/keymgmt/libimplementations-lib-dsa_kmgmt.o providers/implementations/keymgmt/libimplementations-lib-ec_kmgmt.o providers/implementations/keymgmt/libimplementations-lib-ecx_kmgmt.o providers/implementations/keymgmt/libimplementations-lib-rsa_kmgmt.o providers/implementations/macs/libimplementations-lib-blake2b_mac.o providers/implementations/macs/libimplementations-lib-blake2s_mac.o providers/implementations/macs/libimplementations-lib-cmac_prov.o providers/implementations/macs/libimplementations-lib-gmac_prov.o providers/implementations/macs/libimplementations-lib-hmac_prov.o providers/implementations/macs/libimplementations-lib-kmac_prov.o providers/implementations/macs/libimplementations-lib-poly1305_prov.o providers/implementations/macs/libimplementations-lib-siphash_prov.o providers/implementations/serializers/libimplementations-lib-serializer_common.o providers/implementations/serializers/libimplementations-lib-serializer_dh.o providers/implementations/serializers/libimplementations-lib-serializer_dh_param.o providers/implementations/serializers/libimplementations-lib-serializer_dh_priv.o providers/implementations/serializers/libimplementations-lib-serializer_dh_pub.o providers/implementations/serializers/libimplementations-lib-serializer_dsa.o providers/implementations/serializers/libimplementations-lib-serializer_dsa_param.o providers/implementations/serializers/libimplementations-lib-serializer_dsa_priv.o providers/implementations/serializers/libimplementations-lib-serializer_dsa_pub.o providers/implementations/serializers/libimplementations-lib-serializer_ec.o providers/implementations/serializers/libimplementations-lib-serializer_ec_param.o providers/implementations/serializers/libimplementations-lib-serializer_ec_priv.o providers/implementations/serializers/libimplementations-lib-serializer_ec_pub.o providers/implementations/serializers/libimplementations-lib-serializer_ecx.o providers/implementations/serializers/libimplementations-lib-serializer_ecx_priv.o providers/implementations/serializers/libimplementations-lib-serializer_ecx_pub.o providers/implementations/serializers/libimplementations-lib-serializer_rsa.o providers/implementations/serializers/libimplementations-lib-serializer_rsa_priv.o providers/implementations/serializers/libimplementations-lib-serializer_rsa_pub.o providers/implementations/signature/libimplementations-lib-dsa.o providers/implementations/signature/libimplementations-lib-eddsa.o providers/implementations/signature/libimplementations-lib-rsa.o ar: creating providers/libimplementations.a ranlib providers/libimplementations.a || echo Never mind. clang -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF providers/implementations/digests/liblegacy-lib-md4_prov.d.tmp -MT providers/implementations/digests/liblegacy-lib-md4_prov.o -c -o providers/implementations/digests/liblegacy-lib-md4_prov.o ../openssl/providers/implementations/digests/md4_prov.c clang -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF providers/implementations/digests/liblegacy-lib-mdc2_prov.d.tmp -MT providers/implementations/digests/liblegacy-lib-mdc2_prov.o -c -o providers/implementations/digests/liblegacy-lib-mdc2_prov.o ../openssl/providers/implementations/digests/mdc2_prov.c clang -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF providers/implementations/digests/liblegacy-lib-ripemd_prov.d.tmp -MT providers/implementations/digests/liblegacy-lib-ripemd_prov.o -c -o providers/implementations/digests/liblegacy-lib-ripemd_prov.o ../openssl/providers/implementations/digests/ripemd_prov.c clang -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl/crypto -I../openssl/include -I../openssl/providers/implementations/include -I../openssl/providers/common/include -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF providers/implementations/digests/liblegacy-lib-wp_prov.d.tmp -MT providers/implementations/digests/liblegacy-lib-wp_prov.o -c -o providers/implementations/digests/liblegacy-lib-wp_prov.o ../openssl/providers/implementations/digests/wp_prov.c ar r providers/libnonfips.a providers/common/libnonfips-lib-nid_to_name.o providers/common/libnonfips-lib-provider_util.o providers/implementations/ciphers/libnonfips-lib-cipher_aes_xts_fips.o providers/implementations/kdfs/libnonfips-lib-pbkdf2_fips.o ar: creating providers/libnonfips.a ranlib providers/libnonfips.a || echo Never mind. clang -Iinclude -Iapps/include -I. -I../openssl/include -I../openssl/apps/include -I../openssl -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF apps/lib/libtestutil-lib-opt.d.tmp -MT apps/lib/libtestutil-lib-opt.o -c -o apps/lib/libtestutil-lib-opt.o ../openssl/apps/lib/opt.c clang -Iinclude -Iapps/include -I. -I../openssl/include -I../openssl/apps/include -I../openssl -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF test/testutil/libtestutil-lib-apps_mem.d.tmp -MT test/testutil/libtestutil-lib-apps_mem.o -c -o test/testutil/libtestutil-lib-apps_mem.o ../openssl/test/testutil/apps_mem.c clang -Iinclude -Iapps/include -I. -I../openssl/include -I../openssl/apps/include -I../openssl -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF test/testutil/libtestutil-lib-basic_output.d.tmp -MT test/testutil/libtestutil-lib-basic_output.o -c -o test/testutil/libtestutil-lib-basic_output.o ../openssl/test/testutil/basic_output.c clang -Iinclude -Iapps/include -I. -I../openssl/include -I../openssl/apps/include -I../openssl -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF test/testutil/libtestutil-lib-cb.d.tmp -MT test/testutil/libtestutil-lib-cb.o -c -o test/testutil/libtestutil-lib-cb.o ../openssl/test/testutil/cb.c clang -Iinclude -Iapps/include -I. -I../openssl/include -I../openssl/apps/include -I../openssl -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF test/testutil/libtestutil-lib-driver.d.tmp -MT test/testutil/libtestutil-lib-driver.o -c -o test/testutil/libtestutil-lib-driver.o ../openssl/test/testutil/driver.c clang -Iinclude -Iapps/include -I. -I../openssl/include -I../openssl/apps/include -I../openssl -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF test/testutil/libtestutil-lib-format_output.d.tmp -MT test/testutil/libtestutil-lib-format_output.o -c -o test/testutil/libtestutil-lib-format_output.o ../openssl/test/testutil/format_output.c clang -Iinclude -Iapps/include -I. -I../openssl/include -I../openssl/apps/include -I../openssl -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF test/testutil/libtestutil-lib-main.d.tmp -MT test/testutil/libtestutil-lib-main.o -c -o test/testutil/libtestutil-lib-main.o ../openssl/test/testutil/main.c clang -Iinclude -Iapps/include -I. -I../openssl/include -I../openssl/apps/include -I../openssl -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF test/testutil/libtestutil-lib-options.d.tmp -MT test/testutil/libtestutil-lib-options.o -c -o test/testutil/libtestutil-lib-options.o ../openssl/test/testutil/options.c clang -Iinclude -Iapps/include -I. -I../openssl/include -I../openssl/apps/include -I../openssl -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF test/testutil/libtestutil-lib-output_helpers.d.tmp -MT test/testutil/libtestutil-lib-output_helpers.o -c -o test/testutil/libtestutil-lib-output_helpers.o ../openssl/test/testutil/output_helpers.c clang -Iinclude -Iapps/include -I. -I../openssl/include -I../openssl/apps/include -I../openssl -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF test/testutil/libtestutil-lib-random.d.tmp -MT test/testutil/libtestutil-lib-random.o -c -o test/testutil/libtestutil-lib-random.o ../openssl/test/testutil/random.c clang -Iinclude -Iapps/include -I. -I../openssl/include -I../openssl/apps/include -I../openssl -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF test/testutil/libtestutil-lib-stanza.d.tmp -MT test/testutil/libtestutil-lib-stanza.o -c -o test/testutil/libtestutil-lib-stanza.o ../openssl/test/testutil/stanza.c clang -Iinclude -Iapps/include -I. -I../openssl/include -I../openssl/apps/include -I../openssl -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF test/testutil/libtestutil-lib-tap_bio.d.tmp -MT test/testutil/libtestutil-lib-tap_bio.o -c -o test/testutil/libtestutil-lib-tap_bio.o ../openssl/test/testutil/tap_bio.c clang -Iinclude -Iapps/include -I. -I../openssl/include -I../openssl/apps/include -I../openssl -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF test/testutil/libtestutil-lib-test_cleanup.d.tmp -MT test/testutil/libtestutil-lib-test_cleanup.o -c -o test/testutil/libtestutil-lib-test_cleanup.o ../openssl/test/testutil/test_cleanup.c clang -Iinclude -Iapps/include -I. -I../openssl/include -I../openssl/apps/include -I../openssl -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF test/testutil/libtestutil-lib-test_options.d.tmp -MT test/testutil/libtestutil-lib-test_options.o -c -o test/testutil/libtestutil-lib-test_options.o ../openssl/test/testutil/test_options.c clang -Iinclude -Iapps/include -I. -I../openssl/include -I../openssl/apps/include -I../openssl -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF test/testutil/libtestutil-lib-tests.d.tmp -MT test/testutil/libtestutil-lib-tests.o -c -o test/testutil/libtestutil-lib-tests.o ../openssl/test/testutil/tests.c clang -Iinclude -Iapps/include -I. -I../openssl/include -I../openssl/apps/include -I../openssl -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF test/testutil/libtestutil-lib-testutil_init.d.tmp -MT test/testutil/libtestutil-lib-testutil_init.o -c -o test/testutil/libtestutil-lib-testutil_init.o ../openssl/test/testutil/testutil_init.c clang -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -c -o crypto/aes/libcrypto-shlib-aes-x86_64.o crypto/aes/aes-x86_64.s clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/aes/libcrypto-shlib-aes_cfb.d.tmp -MT crypto/aes/libcrypto-shlib-aes_cfb.o -c -o crypto/aes/libcrypto-shlib-aes_cfb.o ../openssl/crypto/aes/aes_cfb.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/aes/libcrypto-shlib-aes_ecb.d.tmp -MT crypto/aes/libcrypto-shlib-aes_ecb.o -c -o crypto/aes/libcrypto-shlib-aes_ecb.o ../openssl/crypto/aes/aes_ecb.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/aes/libcrypto-shlib-aes_ige.d.tmp -MT crypto/aes/libcrypto-shlib-aes_ige.o -c -o crypto/aes/libcrypto-shlib-aes_ige.o ../openssl/crypto/aes/aes_ige.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/aes/libcrypto-shlib-aes_misc.d.tmp -MT crypto/aes/libcrypto-shlib-aes_misc.o -c -o crypto/aes/libcrypto-shlib-aes_misc.o ../openssl/crypto/aes/aes_misc.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/aes/libcrypto-shlib-aes_ofb.d.tmp -MT crypto/aes/libcrypto-shlib-aes_ofb.o -c -o crypto/aes/libcrypto-shlib-aes_ofb.o ../openssl/crypto/aes/aes_ofb.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/aes/libcrypto-shlib-aes_wrap.d.tmp -MT crypto/aes/libcrypto-shlib-aes_wrap.o -c -o crypto/aes/libcrypto-shlib-aes_wrap.o ../openssl/crypto/aes/aes_wrap.c clang -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -c -o crypto/aes/libcrypto-shlib-aesni-mb-x86_64.o crypto/aes/aesni-mb-x86_64.s clang -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -c -o crypto/aes/libcrypto-shlib-aesni-sha1-x86_64.o crypto/aes/aesni-sha1-x86_64.s clang -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -c -o crypto/aes/libcrypto-shlib-aesni-sha256-x86_64.o crypto/aes/aesni-sha256-x86_64.s clang -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -c -o crypto/aes/libcrypto-shlib-aesni-x86_64.o crypto/aes/aesni-x86_64.s clang -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -c -o crypto/aes/libcrypto-shlib-bsaes-x86_64.o crypto/aes/bsaes-x86_64.s clang -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -c -o crypto/aes/libcrypto-shlib-vpaes-x86_64.o crypto/aes/vpaes-x86_64.s clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/aria/libcrypto-shlib-aria.d.tmp -MT crypto/aria/libcrypto-shlib-aria.o -c -o crypto/aria/libcrypto-shlib-aria.o ../openssl/crypto/aria/aria.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -fPIC -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_BUILDING_OPENSSL -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -MMD -MF crypto/asn1/libcrypto-shlib-a_bitstr.d.tmp -MT crypto/asn1/libcrypto-shlib-a_bitstr.o -c -o crypto/asn1/libcrypto-shlib-a_bitstr.o ../openssl/crypto/asn1/a_bitstr.c clang -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -Icrypto/include -I../openssl -I../openssl/include -I../openssl/providers/common/include -I../openssl/providers/implementations/include -I../openssl/crypto/include -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DE From no-reply at appveyor.com Tue Mar 10 23:32:29 2020 From: no-reply at appveyor.com (AppVeyor) Date: Tue, 10 Mar 2020 23:32:29 +0000 Subject: Build failed: openssl master.32455 Message-ID: <20200310233229.1.4BB785C3DB452EE1@appveyor.com> An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Tue Mar 10 23:50:50 2020 From: no-reply at appveyor.com (AppVeyor) Date: Tue, 10 Mar 2020 23:50:50 +0000 Subject: Build failed: openssl master.32458 Message-ID: <20200310235050.1.6982FD7E5E2437FA@appveyor.com> An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Wed Mar 11 00:44:26 2020 From: no-reply at appveyor.com (AppVeyor) Date: Wed, 11 Mar 2020 00:44:26 +0000 Subject: Build completed: openssl master.32459 Message-ID: <20200311004426.1.5142FAA224CDFE41@appveyor.com> An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Wed Mar 11 03:40:30 2020 From: no-reply at appveyor.com (AppVeyor) Date: Wed, 11 Mar 2020 03:40:30 +0000 Subject: Build failed: openssl master.32460 Message-ID: <20200311034030.1.BCC4A8C5B67EA872@appveyor.com> An HTML attachment was scrubbed... URL: From levitte at openssl.org Wed Mar 11 05:19:09 2020 From: levitte at openssl.org (Richard Levitte) Date: Wed, 11 Mar 2020 05:19:09 +0000 Subject: [openssl] master update Message-ID: <1583903949.240611.7219.nullmailer@dev.openssl.org> The branch master has been updated via 4b5371913ed9bb4bfd8a55a30458932799296ab9 (commit) from 44387c9000197b219e7673d5522517a1a6499af8 (commit) - Log ----------------------------------------------------------------- commit 4b5371913ed9bb4bfd8a55a30458932799296ab9 Author: Rich Salz Date: Tue Feb 18 11:52:12 2020 -0500 DOCS: Use "command" not "tool" or "utility" Reviewed-by: Paul Yang Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/11123) ----------------------------------------------------------------------- Summary of changes: doc/man1/openssl-asn1parse.pod.in | 2 +- doc/man1/openssl-ca.pod.in | 9 +++++---- doc/man1/openssl-ciphers.pod.in | 4 ++-- doc/man1/openssl-cms.pod.in | 2 +- doc/man1/openssl-crl.pod.in | 2 +- doc/man1/openssl-ocsp.pod.in | 2 +- doc/man1/openssl-pkcs12.pod.in | 2 +- doc/man1/openssl-pkcs7.pod.in | 2 +- doc/man1/openssl-pkcs8.pod.in | 2 +- doc/man1/openssl-pkey.pod.in | 2 +- doc/man1/openssl-pkeyparam.pod.in | 2 +- doc/man1/openssl-pkeyutl.pod.in | 2 +- doc/man1/openssl-req.pod.in | 2 +- doc/man1/openssl-rsa.pod.in | 2 +- doc/man1/openssl-rsautl.pod.in | 4 ++-- doc/man1/openssl-sess_id.pod.in | 2 +- doc/man1/openssl-smime.pod.in | 2 +- doc/man1/openssl-spkac.pod.in | 2 +- doc/man1/openssl-storeutl.pod.in | 2 +- doc/man1/openssl-ts.pod.in | 2 +- doc/man1/openssl-verify.pod.in | 2 +- doc/man1/openssl-x509.pod.in | 4 ++-- doc/man1/openssl.pod | 20 ++++++++++---------- util/find-doc-nits | 7 +++++++ 24 files changed, 46 insertions(+), 38 deletions(-) diff --git a/doc/man1/openssl-asn1parse.pod.in b/doc/man1/openssl-asn1parse.pod.in index 9b95966440..e1c7f261a5 100644 --- a/doc/man1/openssl-asn1parse.pod.in +++ b/doc/man1/openssl-asn1parse.pod.in @@ -3,7 +3,7 @@ =head1 NAME -openssl-asn1parse - ASN.1 parsing tool +openssl-asn1parse - ASN.1 parsing command =head1 SYNOPSIS diff --git a/doc/man1/openssl-ca.pod.in b/doc/man1/openssl-ca.pod.in index a3c83d8076..5192b25fa5 100644 --- a/doc/man1/openssl-ca.pod.in +++ b/doc/man1/openssl-ca.pod.in @@ -155,8 +155,9 @@ Names and values of these options are algorithm-specific. =for openssl foreign manual ps(1) The password used to encrypt the private key. Since on some -systems the command line arguments are visible (e.g. Unix with -the L utility) this option should be used with caution. +systems the command line arguments are visible (e.g., when using +L on Unix), +this option should be used with caution. =item B<-selfsign> @@ -712,8 +713,8 @@ numbers of certificates are present because, as the name implies the database has to be kept in memory. This command really needs rewriting or the required functionality -exposed at either a command or interface level so a more friendly utility -(perl script or GUI) can handle things properly. The script +exposed at either a command or interface level so that a more user-friendly +replacement could handle things properly. The script B helps a little but not very much. Any fields in a request that are not present in a policy are silently diff --git a/doc/man1/openssl-ciphers.pod.in b/doc/man1/openssl-ciphers.pod.in index 6e6b150d24..690c28705c 100644 --- a/doc/man1/openssl-ciphers.pod.in +++ b/doc/man1/openssl-ciphers.pod.in @@ -3,7 +3,7 @@ =head1 NAME -openssl-ciphers - SSL cipher display and cipher list tool +openssl-ciphers - SSL cipher display and cipher list command =head1 SYNOPSIS @@ -31,7 +31,7 @@ B B =head1 DESCRIPTION This command converts textual OpenSSL cipher lists into -ordered SSL cipher preference lists. It can be used as a test tool to +ordered SSL cipher preference lists. It can be used to determine the appropriate cipherlist. =head1 OPTIONS diff --git a/doc/man1/openssl-cms.pod.in b/doc/man1/openssl-cms.pod.in index 944135bbed..5cf8172f2c 100644 --- a/doc/man1/openssl-cms.pod.in +++ b/doc/man1/openssl-cms.pod.in @@ -3,7 +3,7 @@ =head1 NAME -openssl-cms - CMS utility +openssl-cms - CMS command =head1 SYNOPSIS diff --git a/doc/man1/openssl-crl.pod.in b/doc/man1/openssl-crl.pod.in index c1bd31a4a2..fd50602bc7 100644 --- a/doc/man1/openssl-crl.pod.in +++ b/doc/man1/openssl-crl.pod.in @@ -3,7 +3,7 @@ =head1 NAME -openssl-crl - CRL utility +openssl-crl - CRL command =head1 SYNOPSIS diff --git a/doc/man1/openssl-ocsp.pod.in b/doc/man1/openssl-ocsp.pod.in index efa627b8a9..2edbfc8887 100644 --- a/doc/man1/openssl-ocsp.pod.in +++ b/doc/man1/openssl-ocsp.pod.in @@ -3,7 +3,7 @@ =head1 NAME -openssl-ocsp - Online Certificate Status Protocol utility +openssl-ocsp - Online Certificate Status Protocol command =head1 SYNOPSIS diff --git a/doc/man1/openssl-pkcs12.pod.in b/doc/man1/openssl-pkcs12.pod.in index 631eec7282..655f718001 100644 --- a/doc/man1/openssl-pkcs12.pod.in +++ b/doc/man1/openssl-pkcs12.pod.in @@ -3,7 +3,7 @@ =head1 NAME -openssl-pkcs12 - PKCS#12 file utility +openssl-pkcs12 - PKCS#12 file command =head1 SYNOPSIS diff --git a/doc/man1/openssl-pkcs7.pod.in b/doc/man1/openssl-pkcs7.pod.in index 0a12d2379a..d31ae2a0a7 100644 --- a/doc/man1/openssl-pkcs7.pod.in +++ b/doc/man1/openssl-pkcs7.pod.in @@ -7,7 +7,7 @@ =head1 NAME -openssl-pkcs7 - PKCS#7 utility +openssl-pkcs7 - PKCS#7 command =head1 SYNOPSIS diff --git a/doc/man1/openssl-pkcs8.pod.in b/doc/man1/openssl-pkcs8.pod.in index f9e5fb1dcb..38b50a6d14 100644 --- a/doc/man1/openssl-pkcs8.pod.in +++ b/doc/man1/openssl-pkcs8.pod.in @@ -3,7 +3,7 @@ =head1 NAME -openssl-pkcs8 - PKCS#8 format private key conversion tool +openssl-pkcs8 - PKCS#8 format private key conversion command =head1 SYNOPSIS diff --git a/doc/man1/openssl-pkey.pod.in b/doc/man1/openssl-pkey.pod.in index 8460aed1fa..2785f29857 100644 --- a/doc/man1/openssl-pkey.pod.in +++ b/doc/man1/openssl-pkey.pod.in @@ -7,7 +7,7 @@ =head1 NAME -openssl-pkey - public or private key processing tool +openssl-pkey - public or private key processing command =head1 SYNOPSIS diff --git a/doc/man1/openssl-pkeyparam.pod.in b/doc/man1/openssl-pkeyparam.pod.in index 7f9d351ac2..d5ea4012b4 100644 --- a/doc/man1/openssl-pkeyparam.pod.in +++ b/doc/man1/openssl-pkeyparam.pod.in @@ -7,7 +7,7 @@ =head1 NAME -openssl-pkeyparam - public key algorithm parameter processing tool +openssl-pkeyparam - public key algorithm parameter processing command =head1 SYNOPSIS diff --git a/doc/man1/openssl-pkeyutl.pod.in b/doc/man1/openssl-pkeyutl.pod.in index 0bca483871..583ea68734 100644 --- a/doc/man1/openssl-pkeyutl.pod.in +++ b/doc/man1/openssl-pkeyutl.pod.in @@ -3,7 +3,7 @@ =head1 NAME -openssl-pkeyutl - public key algorithm utility +openssl-pkeyutl - public key algorithm command =head1 SYNOPSIS diff --git a/doc/man1/openssl-req.pod.in b/doc/man1/openssl-req.pod.in index 7587cb5a71..ca3416e799 100644 --- a/doc/man1/openssl-req.pod.in +++ b/doc/man1/openssl-req.pod.in @@ -3,7 +3,7 @@ =head1 NAME -openssl-req - PKCS#10 certificate request and certificate generating utility +openssl-req - PKCS#10 certificate request and certificate generating command =head1 SYNOPSIS diff --git a/doc/man1/openssl-rsa.pod.in b/doc/man1/openssl-rsa.pod.in index e2c0b24a1a..fa1a20ea45 100644 --- a/doc/man1/openssl-rsa.pod.in +++ b/doc/man1/openssl-rsa.pod.in @@ -7,7 +7,7 @@ =head1 NAME -openssl-rsa - RSA key processing tool +openssl-rsa - RSA key processing command =head1 SYNOPSIS diff --git a/doc/man1/openssl-rsautl.pod.in b/doc/man1/openssl-rsautl.pod.in index d28e672817..0bb0a136d3 100644 --- a/doc/man1/openssl-rsautl.pod.in +++ b/doc/man1/openssl-rsautl.pod.in @@ -3,7 +3,7 @@ =head1 NAME -openssl-rsautl - RSA utility +openssl-rsautl - RSA command =head1 SYNOPSIS @@ -167,7 +167,7 @@ encrypt and decrypt the block would have been of type 2 (the second byte) and random padding data visible instead of the 0xff bytes. It is possible to analyse the signature of certificates using this -utility in conjunction with L. Consider the self signed +command in conjunction with L. Consider the self signed example in F. Running L as follows yields: diff --git a/doc/man1/openssl-sess_id.pod.in b/doc/man1/openssl-sess_id.pod.in index f68f180739..e18ef6f9c2 100644 --- a/doc/man1/openssl-sess_id.pod.in +++ b/doc/man1/openssl-sess_id.pod.in @@ -3,7 +3,7 @@ =head1 NAME -openssl-sess_id - SSL/TLS session handling utility +openssl-sess_id - SSL/TLS session handling command =head1 SYNOPSIS diff --git a/doc/man1/openssl-smime.pod.in b/doc/man1/openssl-smime.pod.in index c6775505a9..69bf918743 100644 --- a/doc/man1/openssl-smime.pod.in +++ b/doc/man1/openssl-smime.pod.in @@ -3,7 +3,7 @@ =head1 NAME -openssl-smime - S/MIME utility +openssl-smime - S/MIME command =head1 SYNOPSIS diff --git a/doc/man1/openssl-spkac.pod.in b/doc/man1/openssl-spkac.pod.in index 4ea15fa57a..77e4d7ce08 100644 --- a/doc/man1/openssl-spkac.pod.in +++ b/doc/man1/openssl-spkac.pod.in @@ -7,7 +7,7 @@ =head1 NAME -openssl-spkac - SPKAC printing and generating utility +openssl-spkac - SPKAC printing and generating command =head1 SYNOPSIS diff --git a/doc/man1/openssl-storeutl.pod.in b/doc/man1/openssl-storeutl.pod.in index 75c30651fc..3de2059e0c 100644 --- a/doc/man1/openssl-storeutl.pod.in +++ b/doc/man1/openssl-storeutl.pod.in @@ -7,7 +7,7 @@ =head1 NAME -openssl-storeutl - STORE utility +openssl-storeutl - STORE command =head1 SYNOPSIS diff --git a/doc/man1/openssl-ts.pod.in b/doc/man1/openssl-ts.pod.in index 8d5e66e6d6..38fcf530fe 100644 --- a/doc/man1/openssl-ts.pod.in +++ b/doc/man1/openssl-ts.pod.in @@ -3,7 +3,7 @@ =head1 NAME -openssl-ts - Time Stamping Authority tool (client/server) +openssl-ts - Time Stamping Authority command =head1 SYNOPSIS diff --git a/doc/man1/openssl-verify.pod.in b/doc/man1/openssl-verify.pod.in index fd41bbeb37..7a15e73721 100644 --- a/doc/man1/openssl-verify.pod.in +++ b/doc/man1/openssl-verify.pod.in @@ -3,7 +3,7 @@ =head1 NAME -openssl-verify - Utility to verify certificates +openssl-verify - certificate verification command =head1 SYNOPSIS diff --git a/doc/man1/openssl-x509.pod.in b/doc/man1/openssl-x509.pod.in index 8cf03d937e..98b4e71231 100644 --- a/doc/man1/openssl-x509.pod.in +++ b/doc/man1/openssl-x509.pod.in @@ -3,7 +3,7 @@ =head1 NAME -openssl-x509 - Certificate display and signing utility +openssl-x509 - Certificate display and signing command =head1 SYNOPSIS @@ -81,7 +81,7 @@ B B =head1 DESCRIPTION -This command is a multi purpose certificate utility. It can +This command is a multi-purposes certificate command. It can be used to display certificate information, convert certificates to various forms, sign certificate requests like a "mini CA" or edit certificate trust settings. diff --git a/doc/man1/openssl.pod b/doc/man1/openssl.pod index ff66846337..c05fc29f67 100644 --- a/doc/man1/openssl.pod +++ b/doc/man1/openssl.pod @@ -2,7 +2,7 @@ =head1 NAME -openssl - OpenSSL command line tool +openssl - OpenSSL command line program =head1 SYNOPSIS @@ -29,7 +29,7 @@ OpenSSL is a cryptography toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) network protocols and related cryptography standards required by them. -The B program is a command line tool for using the various +The B program is a command line program for using the various cryptography functions of OpenSSL's B library from the shell. It can be used for @@ -104,7 +104,7 @@ Cipher Suite Description Determination. =item B -CMS (Cryptographic Message Syntax) utility. +CMS (Cryptographic Message Syntax) command. =item B @@ -196,7 +196,7 @@ Create or examine a Netscape certificate sequence. =item B -Online Certificate Status Protocol utility. +Online Certificate Status Protocol command. =item B @@ -212,7 +212,7 @@ PKCS#7 Data Management. =item B -PKCS#8 format private key conversion tool. +PKCS#8 format private key conversion command. =item B @@ -224,7 +224,7 @@ Public key algorithm parameter management. =item B -Public key algorithm cryptographic operation utility. +Public key algorithm cryptographic operation command. =item B @@ -252,7 +252,7 @@ RSA key management. =item B -RSA utility for signing, verification, encryption, and decryption. Superseded +RSA command for signing, verification, encryption, and decryption. Superseded by L. =item B @@ -289,7 +289,7 @@ Algorithm Speed Measurement. =item B -SPKAC printing and generating utility. +SPKAC printing and generating command. =item B @@ -297,11 +297,11 @@ Maintain SRP password file. =item B -Utility to list and display certificates, keys, CRLs, etc. +Command to list and display certificates, keys, CRLs, etc. =item B -Time Stamping Authority tool (client/server). +Time Stamping Authority command. =item B diff --git a/util/find-doc-nits b/util/find-doc-nits index f02edabcef..c508e242fe 100755 --- a/util/find-doc-nits +++ b/util/find-doc-nits @@ -601,6 +601,13 @@ sub wording { } err($id, "found 'epoch' should use 'Epoch'") if $contents =~ /\bepoch\b/; + if ( $id =~ m at man1/@ ) { + err($id, "found 'tool' in NAME, should use 'command'") + if $contents =~ /=head1 NAME.*\btool\b.*=head1 SYNOPSIS/s; + err($id, "found 'utility' in NAME, should use 'command'") + if $contents =~ /NAME.*\butility\b.*=head1 SYNOPSIS/s; + + } } # Perform all sorts of nit/error checks on a manpage From builds at travis-ci.org Wed Mar 11 06:10:44 2020 From: builds at travis-ci.org (Travis CI) Date: Wed, 11 Mar 2020 06:10:44 +0000 Subject: Errored: openssl/openssl#33024 (master - 4b53719) In-Reply-To: Message-ID: <5e6880e46ee4_43f97c188d0b8151732@8e67f1fc-3bd7-4ffe-a86e-0c024a75d3eb.mail> Build Update for openssl/openssl ------------------------------------- Build: #33024 Status: Errored Duration: 50 mins and 56 secs Commit: 4b53719 (master) Author: Rich Salz Message: DOCS: Use "command" not "tool" or "utility" Reviewed-by: Paul Yang Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/11123) View the changeset: https://github.com/openssl/openssl/compare/44387c900019...4b5371913ed9 View the full build log and details: https://travis-ci.org/openssl/openssl/builds/660933558?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the openssl/openssl repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=5849220&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From patrick.steuer at de.ibm.com Wed Mar 11 11:23:48 2020 From: patrick.steuer at de.ibm.com (patrick.steuer at de.ibm.com) Date: Wed, 11 Mar 2020 11:23:48 +0000 Subject: [openssl] master update Message-ID: <1583925828.356204.20399.nullmailer@dev.openssl.org> The branch master has been updated via 4d6d787c4937706676355ce241c6e538475295d2 (commit) via 28bdbe1aaa474ae8cd83e520d02e463e46ce89d9 (commit) from 4b5371913ed9bb4bfd8a55a30458932799296ab9 (commit) - Log ----------------------------------------------------------------- commit 4d6d787c4937706676355ce241c6e538475295d2 Author: Patrick Steuer Date: Sat Feb 22 01:34:20 2020 +0100 AES CTR-DRGB: add test for 32-bit counter overflow Signed-off-by: Patrick Steuer Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/10457) commit 28bdbe1aaa474ae8cd83e520d02e463e46ce89d9 Author: Patrick Steuer Date: Fri Nov 15 23:27:09 2019 +0100 AES CTR-DRGB: performance improvement Optimize the the AES-based implementation of the CTR_DRBG construction, see 10.2.1 in [1]. Due to the optimizations, the code may deviate (more) from the pseudocode in [1], but it is functional equivalence being decisive for compliance: "All DRBG mechanisms and algorithms are described in this document in pseudocode, which is intended to explain functionality. The pseudocode is not intended to constrain real-world implementations." [9 in [1]]. The following optimizations are done: - Replace multiple plain AES encryptions by a single AES-ECB encryption of a corresponding pre-initialized buffer, where possible. This allows platform-specific AES-ECB support to be used and reduces the overhead of multiple EVP calls. - Replace the generate operation loop (which is a counter increment followed by a plain AES encryption) by a loop which does a plain AES encryption followed by a counter increment. The latter loop is just a description of AES-CTR, so we replace it by a single AES-CTR encryption. This allows for platform-specific AES-CTR support to be used and reduces the overhead of multiple EVP calls. This change, that is, going from a pre- to a post- counter increment, requires the counter in the internal state to be kept at "+1" (compared to the pseudocode in [1]) such that it is in the correct state, when a generate operation is called. That in turn also requires all other operations to be changed from pre- to post-increment to keep functional equivalence. [1] NIST SP 800-90A Revision 1 Signed-off-by: Patrick Steuer Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/10457) ----------------------------------------------------------------------- Summary of changes: crypto/rand/drbg_ctr.c | 215 +++++++++++++++++++++++++++----------------- crypto/rand/rand_local.h | 6 +- test/build.info | 7 +- test/drbg_extra_test.c | 94 +++++++++++++++++++ test/drbg_extra_test.h | 188 ++++++++++++++++++++++++++++++++++++++ test/recipes/05-test_rand.t | 2 + 6 files changed, 428 insertions(+), 84 deletions(-) create mode 100644 test/drbg_extra_test.c create mode 100644 test/drbg_extra_test.h diff --git a/crypto/rand/drbg_ctr.c b/crypto/rand/drbg_ctr.c index 30420ae579..85b204d3be 100644 --- a/crypto/rand/drbg_ctr.c +++ b/crypto/rand/drbg_ctr.c @@ -12,6 +12,7 @@ #include #include #include +#include "crypto/modes.h" #include "internal/thread_once.h" #include "rand_local.h" @@ -65,15 +66,15 @@ static void ctr_XOR(RAND_DRBG_CTR *ctr, const unsigned char *in, size_t inlen) * Process a complete block using BCC algorithm of SP 800-90A 10.3.3 */ __owur static int ctr_BCC_block(RAND_DRBG_CTR *ctr, unsigned char *out, - const unsigned char *in) + const unsigned char *in, int len) { int i, outlen = AES_BLOCK_SIZE; - for (i = 0; i < 16; i++) + for (i = 0; i < len; i++) out[i] ^= in[i]; - if (!EVP_CipherUpdate(ctr->ctx_df, out, &outlen, out, AES_BLOCK_SIZE) - || outlen != AES_BLOCK_SIZE) + if (!EVP_CipherUpdate(ctr->ctx_df, out, &outlen, out, len) + || outlen != len) return 0; return 1; } @@ -84,12 +85,16 @@ __owur static int ctr_BCC_block(RAND_DRBG_CTR *ctr, unsigned char *out, */ __owur static int ctr_BCC_blocks(RAND_DRBG_CTR *ctr, const unsigned char *in) { - if (!ctr_BCC_block(ctr, ctr->KX, in) - || !ctr_BCC_block(ctr, ctr->KX + 16, in)) - return 0; - if (ctr->keylen != 16 && !ctr_BCC_block(ctr, ctr->KX + 32, in)) - return 0; - return 1; + unsigned char in_tmp[48]; + unsigned char num_of_blk = 2; + + memcpy(in_tmp, in, 16); + memcpy(in_tmp + 16, in, 16); + if (ctr->keylen != 16) { + memcpy(in_tmp + 32, in, 16); + num_of_blk = 3; + } + return ctr_BCC_block(ctr, ctr->KX, in_tmp, AES_BLOCK_SIZE * num_of_blk); } /* @@ -98,19 +103,14 @@ __owur static int ctr_BCC_blocks(RAND_DRBG_CTR *ctr, const unsigned char *in) */ __owur static int ctr_BCC_init(RAND_DRBG_CTR *ctr) { + unsigned char bltmp[48] = {0}; + unsigned char num_of_blk; + memset(ctr->KX, 0, 48); - memset(ctr->bltmp, 0, 16); - if (!ctr_BCC_block(ctr, ctr->KX, ctr->bltmp)) - return 0; - ctr->bltmp[3] = 1; - if (!ctr_BCC_block(ctr, ctr->KX + 16, ctr->bltmp)) - return 0; - if (ctr->keylen != 16) { - ctr->bltmp[3] = 2; - if (!ctr_BCC_block(ctr, ctr->KX + 32, ctr->bltmp)) - return 0; - } - return 1; + num_of_blk = ctr->keylen == 16 ? 2 : 3; + bltmp[(AES_BLOCK_SIZE * 1) + 3] = 1; + bltmp[(AES_BLOCK_SIZE * 2) + 3] = 2; + return ctr_BCC_block(ctr, ctr->KX, bltmp, num_of_blk * AES_BLOCK_SIZE); } /* @@ -199,20 +199,20 @@ __owur static int ctr_df(RAND_DRBG_CTR *ctr, || !ctr_BCC_final(ctr)) return 0; /* Set up key K */ - if (!EVP_CipherInit_ex(ctr->ctx, ctr->cipher, NULL, ctr->KX, NULL, 1)) + if (!EVP_CipherInit_ex(ctr->ctx_ecb, NULL, NULL, ctr->KX, NULL, -1)) return 0; /* X follows key K */ - if (!EVP_CipherUpdate(ctr->ctx, ctr->KX, &outlen, ctr->KX + ctr->keylen, + if (!EVP_CipherUpdate(ctr->ctx_ecb, ctr->KX, &outlen, ctr->KX + ctr->keylen, AES_BLOCK_SIZE) || outlen != AES_BLOCK_SIZE) return 0; - if (!EVP_CipherUpdate(ctr->ctx, ctr->KX + 16, &outlen, ctr->KX, + if (!EVP_CipherUpdate(ctr->ctx_ecb, ctr->KX + 16, &outlen, ctr->KX, AES_BLOCK_SIZE) || outlen != AES_BLOCK_SIZE) return 0; if (ctr->keylen != 16) - if (!EVP_CipherUpdate(ctr->ctx, ctr->KX + 32, &outlen, ctr->KX + 16, - AES_BLOCK_SIZE) + if (!EVP_CipherUpdate(ctr->ctx_ecb, ctr->KX + 32, &outlen, + ctr->KX + 16, AES_BLOCK_SIZE) || outlen != AES_BLOCK_SIZE) return 0; return 1; @@ -231,31 +231,25 @@ __owur static int ctr_update(RAND_DRBG *drbg, { RAND_DRBG_CTR *ctr = &drbg->data.ctr; int outlen = AES_BLOCK_SIZE; + unsigned char V_tmp[48], out[48]; + unsigned char len; /* correct key is already set up. */ + memcpy(V_tmp, ctr->V, 16); inc_128(ctr); - if (!EVP_CipherUpdate(ctr->ctx, ctr->K, &outlen, ctr->V, AES_BLOCK_SIZE) - || outlen != AES_BLOCK_SIZE) - return 0; - - /* If keylen longer than 128 bits need extra encrypt */ - if (ctr->keylen != 16) { + memcpy(V_tmp + 16, ctr->V, 16); + if (ctr->keylen == 16) { + len = 32; + } else { inc_128(ctr); - if (!EVP_CipherUpdate(ctr->ctx, ctr->K+16, &outlen, ctr->V, - AES_BLOCK_SIZE) - || outlen != AES_BLOCK_SIZE) - return 0; + memcpy(V_tmp + 32, ctr->V, 16); + len = 48; } - inc_128(ctr); - if (!EVP_CipherUpdate(ctr->ctx, ctr->V, &outlen, ctr->V, AES_BLOCK_SIZE) - || outlen != AES_BLOCK_SIZE) + if (!EVP_CipherUpdate(ctr->ctx_ecb, out, &outlen, V_tmp, len) + || outlen != len) return 0; - - /* If 192 bit key part of V is on end of K */ - if (ctr->keylen == 24) { - memcpy(ctr->V + 8, ctr->V, 8); - memcpy(ctr->V, ctr->K + 24, 8); - } + memcpy(ctr->K, out, ctr->keylen); + memcpy(ctr->V, out + ctr->keylen, 16); if ((drbg->flags & RAND_DRBG_FLAG_CTR_NO_DF) == 0) { /* If no input reuse existing derived value */ @@ -270,7 +264,8 @@ __owur static int ctr_update(RAND_DRBG *drbg, ctr_XOR(ctr, in2, in2len); } - if (!EVP_CipherInit_ex(ctr->ctx, ctr->cipher, NULL, ctr->K, NULL, 1)) + if (!EVP_CipherInit_ex(ctr->ctx_ecb, NULL, NULL, ctr->K, NULL, -1) + || !EVP_CipherInit_ex(ctr->ctx_ctr, NULL, NULL, ctr->K, NULL, -1)) return 0; return 1; } @@ -287,8 +282,10 @@ __owur static int drbg_ctr_instantiate(RAND_DRBG *drbg, memset(ctr->K, 0, sizeof(ctr->K)); memset(ctr->V, 0, sizeof(ctr->V)); - if (!EVP_CipherInit_ex(ctr->ctx, ctr->cipher, NULL, ctr->K, NULL, 1)) + if (!EVP_CipherInit_ex(ctr->ctx_ecb, NULL, NULL, ctr->K, NULL, -1)) return 0; + + inc_128(ctr); if (!ctr_update(drbg, entropy, entropylen, pers, perslen, nonce, noncelen)) return 0; return 1; @@ -298,20 +295,40 @@ __owur static int drbg_ctr_reseed(RAND_DRBG *drbg, const unsigned char *entropy, size_t entropylen, const unsigned char *adin, size_t adinlen) { + RAND_DRBG_CTR *ctr = &drbg->data.ctr; + if (entropy == NULL) return 0; + + inc_128(ctr); if (!ctr_update(drbg, entropy, entropylen, adin, adinlen, NULL, 0)) return 0; return 1; } +static void ctr96_inc(unsigned char *counter) +{ + u32 n = 12, c = 1; + + do { + --n; + c += counter[n]; + counter[n] = (u8)c; + c >>= 8; + } while (n); +} + __owur static int drbg_ctr_generate(RAND_DRBG *drbg, unsigned char *out, size_t outlen, const unsigned char *adin, size_t adinlen) { RAND_DRBG_CTR *ctr = &drbg->data.ctr; + unsigned int ctr32, blocks; + int outl, buflen; if (adin != NULL && adinlen != 0) { + inc_128(ctr); + if (!ctr_update(drbg, adin, adinlen, NULL, 0, NULL, 0)) return 0; /* This means we reuse derived value */ @@ -323,28 +340,51 @@ __owur static int drbg_ctr_generate(RAND_DRBG *drbg, adinlen = 0; } - for ( ; ; ) { - int outl = AES_BLOCK_SIZE; + inc_128(ctr); + if (outlen == 0) { inc_128(ctr); - if (outlen < 16) { - /* Use K as temp space as it will be updated */ - if (!EVP_CipherUpdate(ctr->ctx, ctr->K, &outl, ctr->V, - AES_BLOCK_SIZE) - || outl != AES_BLOCK_SIZE) - return 0; - memcpy(out, ctr->K, outlen); - break; - } - if (!EVP_CipherUpdate(ctr->ctx, out, &outl, ctr->V, AES_BLOCK_SIZE) - || outl != AES_BLOCK_SIZE) + + if (!ctr_update(drbg, adin, adinlen, NULL, 0, NULL, 0)) return 0; - out += 16; - outlen -= 16; - if (outlen == 0) - break; + return 1; } + memset(out, 0, outlen); + + do { + if (!EVP_CipherInit_ex(ctr->ctx_ctr, + NULL, NULL, NULL, ctr->V, -1)) + return 0; + + /*- + * outlen has type size_t while EVP_CipherUpdate takes an + * int argument and thus cannot be guaranteed to process more + * than 2^31-1 bytes at a time. We process such huge generate + * requests in 2^30 byte chunks, which is the greatest multiple + * of AES block size lower than or equal to 2^31-1. + */ + buflen = outlen > (1U << 30) ? (1U << 30) : outlen; + blocks = (buflen + 15) / 16; + + ctr32 = GETU32(ctr->V + 12) + blocks; + if (ctr32 < blocks) { + /* 32-bit counter overflow into V. */ + blocks -= ctr32; + buflen = blocks * 16; + ctr32 = 0; + ctr96_inc(ctr->V); + } + PUTU32(ctr->V + 12, ctr32); + + if (!EVP_CipherUpdate(ctr->ctx_ctr, out, &outl, out, buflen) + || outl != buflen) + return 0; + + out += buflen; + outlen -= buflen; + } while (outlen); + if (!ctr_update(drbg, adin, adinlen, NULL, 0, NULL, 0)) return 0; return 1; @@ -352,9 +392,11 @@ __owur static int drbg_ctr_generate(RAND_DRBG *drbg, static int drbg_ctr_uninstantiate(RAND_DRBG *drbg) { - EVP_CIPHER_CTX_free(drbg->data.ctr.ctx); + EVP_CIPHER_CTX_free(drbg->data.ctr.ctx_ecb); + EVP_CIPHER_CTX_free(drbg->data.ctr.ctx_ctr); EVP_CIPHER_CTX_free(drbg->data.ctr.ctx_df); - EVP_CIPHER_free(drbg->data.ctr.cipher); + EVP_CIPHER_free(drbg->data.ctr.cipher_ecb); + EVP_CIPHER_free(drbg->data.ctr.cipher_ctr); OPENSSL_cleanse(&drbg->data.ctr, sizeof(drbg->data.ctr)); return 1; } @@ -370,7 +412,8 @@ int drbg_ctr_init(RAND_DRBG *drbg) { RAND_DRBG_CTR *ctr = &drbg->data.ctr; size_t keylen; - EVP_CIPHER *cipher = NULL; + EVP_CIPHER *cipher_ecb = NULL; + EVP_CIPHER *cipher_ctr = NULL; switch (drbg->type) { default: @@ -378,30 +421,41 @@ int drbg_ctr_init(RAND_DRBG *drbg) return 0; case NID_aes_128_ctr: keylen = 16; - cipher = EVP_CIPHER_fetch(drbg->libctx, "AES-128-ECB", ""); + cipher_ecb = EVP_CIPHER_fetch(drbg->libctx, "AES-128-ECB", ""); + cipher_ctr = EVP_CIPHER_fetch(drbg->libctx, "AES-128-CTR", ""); break; case NID_aes_192_ctr: keylen = 24; - cipher = EVP_CIPHER_fetch(drbg->libctx, "AES-192-ECB", ""); + cipher_ecb = EVP_CIPHER_fetch(drbg->libctx, "AES-192-ECB", ""); + cipher_ctr = EVP_CIPHER_fetch(drbg->libctx, "AES-192-CTR", ""); break; case NID_aes_256_ctr: keylen = 32; - cipher = EVP_CIPHER_fetch(drbg->libctx, "AES-256-ECB", ""); + cipher_ecb = EVP_CIPHER_fetch(drbg->libctx, "AES-256-ECB", ""); + cipher_ctr = EVP_CIPHER_fetch(drbg->libctx, "AES-256-CTR", ""); break; } - if (cipher == NULL) + if (cipher_ecb == NULL || cipher_ctr == NULL) return 0; - EVP_CIPHER_free(ctr->cipher); - ctr->cipher = cipher; - - drbg->meth = &drbg_ctr_meth; + EVP_CIPHER_free(ctr->cipher_ecb); + ctr->cipher_ecb = cipher_ecb; + EVP_CIPHER_free(ctr->cipher_ctr); + ctr->cipher_ctr = cipher_ctr; ctr->keylen = keylen; - if (ctr->ctx == NULL) - ctr->ctx = EVP_CIPHER_CTX_new(); - if (ctr->ctx == NULL) + if (ctr->ctx_ecb == NULL) + ctr->ctx_ecb = EVP_CIPHER_CTX_new(); + if (ctr->ctx_ctr == NULL) + ctr->ctx_ctr = EVP_CIPHER_CTX_new(); + if (ctr->ctx_ecb == NULL || ctr->ctx_ctr == NULL + || !EVP_CipherInit_ex(ctr->ctx_ecb, + ctr->cipher_ecb, NULL, NULL, NULL, 1) + || !EVP_CipherInit_ex(ctr->ctx_ctr, + ctr->cipher_ctr, NULL, NULL, NULL, 1)) return 0; + + drbg->meth = &drbg_ctr_meth; drbg->strength = keylen * 8; drbg->seedlen = keylen + 16; @@ -419,7 +473,8 @@ int drbg_ctr_init(RAND_DRBG *drbg) if (ctr->ctx_df == NULL) return 0; /* Set key schedule for df_key */ - if (!EVP_CipherInit_ex(ctr->ctx_df, ctr->cipher, NULL, df_key, NULL, 1)) + if (!EVP_CipherInit_ex(ctr->ctx_df, + ctr->cipher_ecb, NULL, df_key, NULL, 1)) return 0; drbg->min_entropylen = ctr->keylen; diff --git a/crypto/rand/rand_local.h b/crypto/rand/rand_local.h index ce16892531..646c0c33fd 100644 --- a/crypto/rand/rand_local.h +++ b/crypto/rand/rand_local.h @@ -175,9 +175,11 @@ typedef struct rand_drbg_hmac_st { * The state of a DRBG AES-CTR. */ typedef struct rand_drbg_ctr_st { - EVP_CIPHER_CTX *ctx; + EVP_CIPHER_CTX *ctx_ecb; + EVP_CIPHER_CTX *ctx_ctr; EVP_CIPHER_CTX *ctx_df; - EVP_CIPHER *cipher; + EVP_CIPHER *cipher_ecb; + EVP_CIPHER *cipher_ctr; size_t keylen; unsigned char K[32]; unsigned char V[16]; diff --git a/test/build.info b/test/build.info index fcf2ac57ac..6f00d1a141 100644 --- a/test/build.info +++ b/test/build.info @@ -49,8 +49,7 @@ IF[{- !$disabled{tests} -}] cipherbytes_test \ asn1_encode_test asn1_decode_test asn1_string_table_test \ x509_time_test x509_dup_cert_test x509_check_cert_pkey_test \ - recordlentest drbgtest sslbuffertest \ - recordlentest drbgtest drbg_cavs_test sslbuffertest \ + recordlentest drbgtest drbg_cavs_test drbg_extra_test sslbuffertest \ time_offset_test pemtest ssl_cert_table_internal_test ciphername_test \ servername_test ocspapitest fatalerrtest tls13ccstest \ sysdefaulttest errtest ssl_ctx_test gosttest \ @@ -357,6 +356,10 @@ IF[{- !$disabled{tests} -}] INCLUDE[drbg_cavs_test]=../include ../apps/include . .. ../crypto/include DEPEND[drbg_cavs_test]=../libcrypto libtestutil.a + SOURCE[drbg_extra_test]=drbg_extra_test.c + INCLUDE[drbg_extra_test]=../include . .. ../apps/include + DEPEND[drbg_extra_test]=../libcrypto libtestutil.a + SOURCE[x509_dup_cert_test]=x509_dup_cert_test.c INCLUDE[x509_dup_cert_test]=../include ../apps/include DEPEND[x509_dup_cert_test]=../libcrypto libtestutil.a diff --git a/test/drbg_extra_test.c b/test/drbg_extra_test.c new file mode 100644 index 0000000000..642f744932 --- /dev/null +++ b/test/drbg_extra_test.c @@ -0,0 +1,94 @@ +/* + * Copyright 2020 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#include +#include "internal/nelem.h" +#include +#include +#include +#include +#include +#include +#include "../crypto/rand/rand_local.h" + +#include "testutil.h" +#include "drbg_extra_test.h" + +static unsigned char zerobuff[32]; + +static size_t kat_entropy(RAND_DRBG *drbg, unsigned char **pout, + int entropy, size_t min_len, size_t max_len, + int prediction_resistance) +{ + *pout = zerobuff; + return sizeof(zerobuff); +} + +static size_t kat_nonce(RAND_DRBG *drbg, unsigned char **pout, + int entropy, size_t min_len, size_t max_len) +{ + *pout = zerobuff; + return sizeof(zerobuff); +} + +static int run_extra_kat(const struct drbg_extra_kat *td) +{ + unsigned long long i; + RAND_DRBG *drbg = NULL; + unsigned char buff[BUFFSIZE]; + unsigned int flags = 0; + int failures = 0; + + if (!TEST_ptr(drbg = RAND_DRBG_new(td->nid, flags, NULL))) + return 0; + + /* Set deterministic entropy callback. */ + if (!TEST_true(RAND_DRBG_set_callbacks(drbg, kat_entropy, NULL, + kat_nonce, NULL))) { + failures++; + goto err; + } + + /* Set fixed reseed intervall. */ + if (!TEST_true(RAND_DRBG_set_reseed_interval(drbg, RESEEDINTERVAL))) { + failures++; + goto err; + } + + if (!TEST_true(RAND_DRBG_instantiate(drbg, NULL, 0))) + failures++; + + for (i = 0; i < td->ngen; i++) { + if(!TEST_true(RAND_DRBG_generate(drbg, buff, sizeof(buff), 0, NULL, + 0))) + failures++; + } + + if (!TEST_true(RAND_DRBG_uninstantiate(drbg)) + || !TEST_mem_eq(td->expected, sizeof(buff), buff, sizeof(buff))) + failures++; + +err: + if (drbg != NULL) { + RAND_DRBG_uninstantiate(drbg); + RAND_DRBG_free(drbg); + } + return failures == 0; +} + +static int test_extra_kats(int i) +{ + return run_extra_kat(drbg_extra_test[i]); +} + +int setup_tests(void) +{ + ADD_ALL_TESTS(test_extra_kats, OSSL_NELEM(drbg_extra_test)); + return 1; +} diff --git a/test/drbg_extra_test.h b/test/drbg_extra_test.h new file mode 100644 index 0000000000..4c771573d1 --- /dev/null +++ b/test/drbg_extra_test.h @@ -0,0 +1,188 @@ +/* + * Copyright 2020 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* + * Self generated known answer test (KATs) for NIST SP800-90A AES CTR_DRBG. + * Test overflow of V after |ngen| generate operation. + */ + +#include + +#ifndef DRBG_EXTRA_TEST_H +# define DRBG_EXTRA_TEST_H + +# define BUFFSIZE 512 +# define RESEEDINTERVAL ((1 << 24) - 1) + +struct drbg_extra_kat { + int nid; + const unsigned char *expected; + unsigned long long ngen; +}; + +static const unsigned char expected128[BUFFSIZE] = { + 0x39, 0x10, 0x06, 0x64, 0x68, 0x7d, 0x77, 0x64, 0xf9, 0xb8, 0xe8, 0x3c, + 0x55, 0xb0, 0xf1, 0x8c, 0xeb, 0x11, 0x23, 0x50, 0x15, 0x28, 0x44, 0x38, + 0x84, 0x47, 0x7b, 0xc2, 0x78, 0x16, 0x73, 0x57, 0x9f, 0x01, 0x57, 0xf0, + 0x17, 0x14, 0xa3, 0xa8, 0xdf, 0x3b, 0x87, 0x78, 0x37, 0xf8, 0x53, 0x23, + 0x18, 0xd2, 0xbc, 0x82, 0xc5, 0xed, 0x51, 0x84, 0x30, 0x14, 0xaa, 0x01, + 0xb8, 0xb5, 0xed, 0x33, 0x14, 0xe7, 0x6c, 0xa7, 0x38, 0x02, 0x60, 0x69, + 0x52, 0x0f, 0x5b, 0x7f, 0x4c, 0x82, 0x25, 0x05, 0x10, 0xaa, 0xd5, 0xc6, + 0xac, 0x44, 0x7c, 0xef, 0x0f, 0x69, 0xc7, 0x4d, 0x07, 0x54, 0x83, 0xb5, + 0xf2, 0x05, 0x0f, 0x69, 0xfd, 0x85, 0x8f, 0x63, 0x27, 0xe6, 0xff, 0xa5, + 0x26, 0xd9, 0xf0, 0x8b, 0x31, 0x89, 0xbc, 0x51, 0xb8, 0x62, 0x06, 0x88, + 0xe7, 0x95, 0xa7, 0x69, 0x7d, 0x43, 0x9c, 0x2b, 0x3c, 0x59, 0x9f, 0xa9, + 0x63, 0xa3, 0x80, 0x1b, 0xe9, 0x96, 0x6b, 0xde, 0xf2, 0xdb, 0x0c, 0x07, + 0x22, 0xb1, 0x30, 0xd0, 0x08, 0x66, 0x23, 0x31, 0x63, 0xd2, 0x86, 0xbf, + 0x6e, 0xcb, 0x44, 0xb7, 0x6a, 0x44, 0xac, 0xe6, 0x53, 0x0b, 0x32, 0x20, + 0xb6, 0xcb, 0x10, 0x22, 0x57, 0xa5, 0x7f, 0x7d, 0x9e, 0x83, 0xb9, 0xdb, + 0x27, 0x1b, 0x04, 0xf5, 0x67, 0x94, 0x6e, 0x44, 0xba, 0x77, 0xc2, 0xf6, + 0x6a, 0xcd, 0xfa, 0x71, 0x44, 0x07, 0x5e, 0x09, 0x6f, 0x42, 0x5c, 0x06, + 0x55, 0x4f, 0xae, 0xc7, 0x53, 0x73, 0x89, 0x80, 0x2d, 0x5a, 0x73, 0x3c, + 0x11, 0x8f, 0x76, 0xa1, 0x3b, 0xb6, 0xbe, 0x6b, 0xd2, 0x1f, 0xa7, 0x63, + 0x7c, 0x99, 0x46, 0x3d, 0x6b, 0x0d, 0x2a, 0xfe, 0x10, 0x00, 0x77, 0x43, + 0x5b, 0xd0, 0x52, 0x79, 0x8d, 0x1d, 0xfd, 0xe2, 0x9a, 0xac, 0x5c, 0x77, + 0x69, 0x68, 0xec, 0xf1, 0x92, 0xa8, 0xb7, 0x26, 0xcd, 0x64, 0xef, 0x8f, + 0x55, 0xa0, 0x83, 0x3f, 0x27, 0xf0, 0x34, 0xc3, 0x61, 0x74, 0xf9, 0x44, + 0x2d, 0xe1, 0xb3, 0xad, 0x02, 0xc2, 0x45, 0x40, 0x40, 0xc0, 0x0f, 0x05, + 0x72, 0xdb, 0x71, 0xae, 0x84, 0x4c, 0x3d, 0xd0, 0x61, 0x5d, 0x79, 0x52, + 0x16, 0xb1, 0x02, 0x07, 0xaf, 0xfa, 0x9a, 0xe0, 0x21, 0xbf, 0x1c, 0xc4, + 0x21, 0xf9, 0x76, 0x95, 0xc4, 0x92, 0x57, 0xb7, 0x1e, 0xce, 0xb8, 0xd5, + 0x1c, 0x68, 0x7c, 0xed, 0x8f, 0x45, 0x09, 0x0b, 0xef, 0x30, 0x68, 0xab, + 0x5f, 0x26, 0x4a, 0xf2, 0x8a, 0x55, 0x97, 0x3d, 0x1c, 0xa0, 0x33, 0x20, + 0x10, 0x9e, 0x10, 0x77, 0x93, 0xa2, 0xcb, 0x72, 0x33, 0xf3, 0x6f, 0xdc, + 0x41, 0x46, 0x83, 0xb1, 0x59, 0x22, 0xf0, 0x9b, 0x9f, 0x50, 0x9f, 0x14, + 0x2e, 0xe0, 0xb8, 0xa3, 0xf7, 0x40, 0x9d, 0xe0, 0x76, 0x78, 0xa6, 0xd4, + 0xf6, 0xd4, 0x29, 0x33, 0x97, 0x76, 0x54, 0xdf, 0x3e, 0xf0, 0x82, 0x9f, + 0x4f, 0xf1, 0x0b, 0x0a, 0x61, 0xa2, 0x3f, 0xde, 0xda, 0xfe, 0x93, 0xe1, + 0x51, 0x19, 0x93, 0x8c, 0xc0, 0x07, 0x76, 0xdb, 0x4a, 0x9c, 0xef, 0x42, + 0x5f, 0x7b, 0x5b, 0x2c, 0xff, 0xe7, 0x5f, 0x6d, 0xcb, 0x7e, 0x9b, 0xc9, + 0xf3, 0x94, 0xe9, 0x73, 0xd6, 0xa3, 0x00, 0x7d, 0x11, 0xf8, 0xd6, 0x58, + 0x97, 0x3e, 0xdf, 0xb9, 0xd5, 0x57, 0xde, 0x51, 0x9e, 0x39, 0x5d, 0x59, + 0xe5, 0x50, 0x29, 0x3e, 0x58, 0x90, 0x37, 0xa6, 0xcc, 0x06, 0x89, 0xb1, + 0xa6, 0xa7, 0xef, 0x96, 0x30, 0xf5, 0xc1, 0xea, 0x03, 0xde, 0x46, 0x9a, + 0x5f, 0xa2, 0x5d, 0xb6, 0x74, 0xfd, 0xbf, 0xde, 0x77, 0x8e, 0x3e, 0x90, + 0x55, 0x3b, 0x4d, 0x59, 0xde, 0x19, 0x43, 0xcd, 0x5d, 0x1b, 0xba, 0x29, + 0xa9, 0x59, 0xad, 0xef, 0x2d, 0x9c, 0x3b, 0xc0 +}; +static const struct drbg_extra_kat drbg_extra_test128 = { + NID_aes_128_ctr, + expected128, + 61335566ULL +}; + +static const unsigned char expected192[BUFFSIZE] = { + 0x19, 0x1b, 0xe3, 0xa9, 0x58, 0xb4, 0xcc, 0x3a, 0x3a, 0x06, 0x30, 0x6a, + 0xdc, 0x8c, 0x78, 0xb2, 0x1e, 0xb5, 0x83, 0xa0, 0x04, 0x72, 0xae, 0xed, + 0xae, 0x88, 0x7c, 0x63, 0x8b, 0xe6, 0x20, 0x9b, 0xb4, 0x04, 0x14, 0xa9, + 0x83, 0xce, 0xb4, 0xd1, 0x69, 0xc2, 0x00, 0xa5, 0xf4, 0x45, 0xdb, 0xa1, + 0xcb, 0xd7, 0xfe, 0xf7, 0x19, 0x5d, 0x4d, 0x26, 0x7d, 0x7a, 0x2f, 0xde, + 0xc1, 0xb3, 0x8e, 0x3e, 0x19, 0xd1, 0xff, 0x25, 0x9b, 0x81, 0x90, 0x11, + 0x71, 0xb6, 0x08, 0x46, 0x76, 0x58, 0xca, 0x78, 0xae, 0xc3, 0x90, 0x29, + 0x07, 0x07, 0x85, 0x9d, 0x90, 0xd9, 0xf5, 0x5a, 0x8d, 0x28, 0x87, 0xd3, + 0x88, 0xd1, 0x14, 0xc1, 0xa8, 0x96, 0xa3, 0x7e, 0x6b, 0xe4, 0x1d, 0xf6, + 0x0d, 0xfb, 0x3d, 0xee, 0xa9, 0x8c, 0x70, 0xc9, 0x3f, 0x87, 0xad, 0x57, + 0xd9, 0xe3, 0x4e, 0xfc, 0x03, 0xeb, 0x79, 0xb8, 0xb9, 0xe9, 0xe4, 0x55, + 0x78, 0x4b, 0xdb, 0xfa, 0xb6, 0x5e, 0x1e, 0x5b, 0xab, 0x11, 0x35, 0x3c, + 0x97, 0x10, 0x0d, 0x7e, 0x68, 0x47, 0x1a, 0xd0, 0x59, 0xac, 0x41, 0x61, + 0x8e, 0xfc, 0xd1, 0x12, 0xf6, 0x81, 0x44, 0x5c, 0x78, 0xe4, 0x32, 0x2f, + 0xa5, 0x4c, 0x6e, 0xf8, 0xbf, 0x35, 0xc2, 0x66, 0xc0, 0x04, 0x77, 0x2e, + 0x1d, 0xe9, 0xc9, 0x8f, 0xca, 0xd7, 0x2a, 0xf0, 0x35, 0x34, 0x3a, 0xf6, + 0x7e, 0x0d, 0xc6, 0xc2, 0x4a, 0xd0, 0x91, 0x5d, 0xf5, 0x47, 0xdb, 0x32, + 0x88, 0x52, 0x98, 0xf0, 0xca, 0xc9, 0x57, 0x34, 0x10, 0xca, 0xfa, 0x9d, + 0x23, 0x61, 0x41, 0x55, 0xc8, 0x65, 0xa4, 0x4e, 0xa5, 0x8b, 0x1a, 0xdc, + 0x14, 0x80, 0x26, 0xe7, 0x72, 0x98, 0x90, 0x14, 0x01, 0x52, 0xa4, 0x9f, + 0x55, 0xe4, 0xaa, 0x15, 0x20, 0xd4, 0x34, 0x3f, 0x36, 0xce, 0x93, 0x5d, + 0x7b, 0x49, 0x29, 0x3f, 0xef, 0x78, 0xe9, 0x2e, 0x4c, 0x87, 0xa1, 0xb6, + 0x28, 0xb7, 0xa3, 0xb4, 0x49, 0x84, 0xf5, 0x5d, 0x24, 0x7d, 0x57, 0x57, + 0x79, 0xf5, 0xa1, 0x67, 0x5b, 0x8c, 0x59, 0x43, 0x3a, 0x1f, 0x10, 0x51, + 0x57, 0xa0, 0xe5, 0x18, 0xba, 0xdd, 0xca, 0x2d, 0xa9, 0xc5, 0xef, 0xad, + 0x7e, 0xd5, 0x17, 0xa3, 0x66, 0xe0, 0x93, 0x00, 0xda, 0xfc, 0x90, 0x89, + 0x64, 0x01, 0x10, 0x6a, 0xe7, 0x51, 0x7e, 0x5c, 0x16, 0x87, 0x4a, 0xc2, + 0x04, 0x27, 0x5c, 0x71, 0xdb, 0xcb, 0xb4, 0x70, 0xfc, 0x5e, 0xfb, 0xce, + 0xba, 0xc8, 0x20, 0x80, 0x5d, 0x73, 0xdb, 0xb4, 0x30, 0x8b, 0xfc, 0xcf, + 0xd1, 0x09, 0xa1, 0x93, 0xa3, 0x3e, 0x86, 0x76, 0x86, 0x5a, 0xa4, 0xba, + 0xda, 0xb8, 0x03, 0x1d, 0x69, 0x99, 0x29, 0xef, 0xe1, 0x7b, 0x6a, 0xd3, + 0x95, 0x9e, 0x98, 0x5a, 0x39, 0xb0, 0xde, 0x53, 0x49, 0x09, 0x7d, 0xdd, + 0x89, 0xed, 0x90, 0xc6, 0xa3, 0x8c, 0xe6, 0x15, 0x2f, 0x5a, 0x47, 0x8a, + 0x66, 0xf7, 0x1f, 0x38, 0x9e, 0xae, 0x9b, 0x46, 0x71, 0x96, 0x21, 0xbf, + 0x9f, 0x8e, 0x60, 0x2c, 0xda, 0xd6, 0x38, 0xf0, 0xc5, 0xe6, 0x27, 0x4b, + 0xfa, 0xc2, 0x13, 0x1a, 0x6b, 0xf5, 0x47, 0x97, 0x2f, 0xd0, 0x34, 0xe7, + 0x71, 0x9f, 0x8b, 0xc7, 0x22, 0xec, 0x97, 0x38, 0xe2, 0x07, 0x2b, 0x02, + 0x76, 0xf7, 0xb5, 0xdc, 0x55, 0xaf, 0x8e, 0xe6, 0x92, 0x57, 0x82, 0x82, + 0xf2, 0x1e, 0x10, 0x37, 0x40, 0xc4, 0x91, 0x25, 0xa7, 0x5c, 0xed, 0x1b, + 0x61, 0xc7, 0xc4, 0x47, 0xac, 0xe5, 0xb8, 0x7b, 0xdc, 0xfc, 0xaa, 0xd4, + 0x0c, 0xcc, 0x93, 0xee, 0x69, 0xd7, 0x35, 0xcf, 0xd7, 0x47, 0x05, 0xfc, + 0x88, 0xeb, 0x29, 0x0b, 0x62, 0x8e, 0x51, 0xb0, 0xd6, 0x71, 0xa0, 0xf2, + 0x17, 0x74, 0x1a, 0x2d, 0x4f, 0xb0, 0xd9, 0x8b +}; +static const struct drbg_extra_kat drbg_extra_test192 = { + NID_aes_192_ctr, + expected192, + 10132467ULL +}; + +static const unsigned char expected256[BUFFSIZE] = { + 0x3f, 0x6d, 0x24, 0x4d, 0xe8, 0xdf, 0x93, 0xe5, 0xde, 0x4f, 0xba, 0x25, + 0x9c, 0x97, 0xfa, 0xbb, 0x78, 0x6f, 0xe7, 0xce, 0x74, 0x66, 0xa3, 0x81, + 0xf1, 0x0e, 0xf9, 0xea, 0xb6, 0xfc, 0xc2, 0xc5, 0xf0, 0x25, 0x0d, 0x45, + 0x45, 0x8a, 0x3e, 0xf2, 0x93, 0xf3, 0x2c, 0x41, 0x46, 0x2d, 0x58, 0x56, + 0x7e, 0x6a, 0x5c, 0x8a, 0x51, 0x3f, 0xd1, 0x76, 0x09, 0x6d, 0xf4, 0xf0, + 0x01, 0x8f, 0x60, 0x68, 0x9c, 0x52, 0xb2, 0xb1, 0xd2, 0x3e, 0x07, 0x10, + 0xab, 0x6c, 0xc9, 0x78, 0x22, 0xf4, 0xde, 0xbc, 0xee, 0x23, 0xa9, 0xb5, + 0x81, 0x2c, 0x4c, 0xf7, 0xd6, 0x35, 0x53, 0x1f, 0x66, 0x42, 0x1d, 0x7a, + 0x6d, 0x6e, 0x56, 0x8d, 0xbc, 0x03, 0xac, 0x76, 0x6c, 0x46, 0x4a, 0x80, + 0x87, 0x97, 0x62, 0xc6, 0xe8, 0x21, 0x35, 0xbd, 0x1d, 0x17, 0x28, 0x80, + 0x79, 0x6a, 0xe0, 0xc5, 0x33, 0x51, 0x38, 0xa6, 0xdf, 0x8d, 0xf6, 0xb3, + 0x69, 0x4f, 0x3b, 0xb2, 0xb1, 0x8e, 0x28, 0x8a, 0x3b, 0xba, 0x80, 0x43, + 0x7a, 0x92, 0x5e, 0x11, 0xd7, 0x4a, 0x8d, 0xa5, 0xee, 0x7c, 0x30, 0x69, + 0x7c, 0x27, 0x0f, 0xb8, 0x10, 0xd4, 0x32, 0x5f, 0xad, 0x27, 0xf4, 0xf1, + 0x31, 0xfe, 0x41, 0x08, 0x8c, 0x09, 0xe5, 0x9c, 0x55, 0x97, 0xa5, 0x38, + 0x7f, 0x72, 0x5b, 0x0a, 0xb3, 0x44, 0x2d, 0x4f, 0x65, 0xba, 0x74, 0x0c, + 0x35, 0x2f, 0x57, 0xfb, 0x21, 0x9c, 0x80, 0x2a, 0xd8, 0x0d, 0x56, 0xa7, + 0x99, 0x8b, 0xd9, 0xaf, 0x6f, 0x45, 0x06, 0x94, 0xf5, 0x6f, 0x56, 0x32, + 0x3d, 0x6c, 0xd6, 0x91, 0x30, 0x88, 0xdd, 0x61, 0x79, 0xa8, 0xac, 0x03, + 0xcf, 0x1c, 0x53, 0xd4, 0xdf, 0x6f, 0x39, 0x9c, 0x9f, 0xa9, 0xb5, 0x8c, + 0x8b, 0xc3, 0x20, 0x89, 0x5e, 0xf9, 0x74, 0x0c, 0xda, 0x7b, 0x2a, 0x22, + 0xa4, 0xcc, 0x00, 0x78, 0x66, 0x5e, 0xe5, 0x49, 0x5b, 0x3e, 0xfe, 0x85, + 0xcd, 0x9a, 0xa7, 0xcd, 0xb0, 0xf1, 0x2b, 0xe7, 0x3b, 0x23, 0x09, 0xb2, + 0x26, 0x66, 0x6c, 0x64, 0xd9, 0x35, 0x69, 0xd4, 0xfe, 0xc1, 0x3f, 0xbd, + 0xf3, 0x15, 0x15, 0x83, 0x1f, 0x92, 0x5f, 0x25, 0x0b, 0x1f, 0x54, 0xeb, + 0xfc, 0x40, 0x96, 0xb4, 0x71, 0x2a, 0x3b, 0xa3, 0x94, 0xfa, 0x41, 0xfa, + 0x43, 0x4e, 0xf1, 0x85, 0xc4, 0x2d, 0x40, 0xf0, 0x1a, 0x0d, 0x88, 0xf2, + 0xd4, 0x1f, 0x9d, 0x80, 0x69, 0x56, 0xb1, 0xa4, 0xcb, 0xa1, 0x35, 0x98, + 0xda, 0xa4, 0xa3, 0x6d, 0xd8, 0x01, 0x98, 0xe0, 0x2e, 0x13, 0xc2, 0x7d, + 0x74, 0x6a, 0x62, 0x7a, 0xef, 0x93, 0x65, 0x94, 0x37, 0xa6, 0x5b, 0xcb, + 0x23, 0xe6, 0x23, 0x3d, 0xa5, 0x7e, 0x30, 0x59, 0x36, 0x85, 0xee, 0xfb, + 0xe8, 0x33, 0x3c, 0xf5, 0xc3, 0x4e, 0xf2, 0xc4, 0x70, 0xc8, 0x4f, 0x00, + 0x39, 0x7d, 0x20, 0x7f, 0x72, 0x57, 0xd9, 0xb9, 0xf6, 0xfe, 0xf2, 0x50, + 0x44, 0xed, 0x53, 0xdc, 0xd6, 0xd5, 0x1f, 0x94, 0xea, 0x62, 0x9e, 0x64, + 0x23, 0xd6, 0x6d, 0x8a, 0x6e, 0xfb, 0xc2, 0xb3, 0x7e, 0x72, 0x26, 0xad, + 0x31, 0x30, 0x81, 0xb7, 0x62, 0x10, 0xaf, 0x8e, 0x45, 0x74, 0x6e, 0x8f, + 0x07, 0x5a, 0xfe, 0xe3, 0xa7, 0xe8, 0x47, 0x80, 0x7e, 0x1d, 0xb5, 0x8c, + 0xab, 0xcb, 0x0b, 0x95, 0xb2, 0x95, 0x64, 0x5e, 0xea, 0x42, 0x14, 0x6f, + 0x6b, 0xe4, 0x81, 0x51, 0x78, 0xb4, 0x0e, 0x0c, 0x6e, 0x22, 0x31, 0xb2, + 0x50, 0xd9, 0x78, 0xc6, 0xfa, 0xa4, 0xb6, 0xf4, 0x17, 0x20, 0xbe, 0xe3, + 0x69, 0xfa, 0x6c, 0xb9, 0x98, 0xad, 0xca, 0xba, 0x72, 0xa2, 0x22, 0x4c, + 0x0a, 0xb3, 0x6d, 0x9b, 0x11, 0x8a, 0x59, 0x06, 0xf1, 0xda, 0x43, 0xc2, + 0xae, 0xb0, 0x80, 0x35, 0x86, 0xbf, 0xf0, 0x8c +}; +static const struct drbg_extra_kat drbg_extra_test256 = { + NID_aes_256_ctr, + expected256, + 40870394ULL +}; + +static const struct drbg_extra_kat *drbg_extra_test[] = { + &drbg_extra_test128, + &drbg_extra_test192, + &drbg_extra_test256, +}; + +#endif diff --git a/test/recipes/05-test_rand.t b/test/recipes/05-test_rand.t index f376edd18a..70035e9b27 100644 --- a/test/recipes/05-test_rand.t +++ b/test/recipes/05-test_rand.t @@ -15,3 +15,5 @@ setup("test_rand"); ok(run(test(["drbgtest"]))); ok(run(test(["drbg_cavs_test"]))); +# commented out due to long running time +#ok(run(test(["drbg_extra_test"]))); From builds at travis-ci.org Wed Mar 11 12:13:44 2020 From: builds at travis-ci.org (Travis CI) Date: Wed, 11 Mar 2020 12:13:44 +0000 Subject: Errored: openssl/openssl#33028 (master - 4d6d787) In-Reply-To: Message-ID: <5e68d5f851ca0_43fe57410e82c743fb@aba56179-7837-4cea-ba2a-3d645298b401.mail> Build Update for openssl/openssl ------------------------------------- Build: #33028 Status: Errored Duration: 49 mins and 31 secs Commit: 4d6d787 (master) Author: Patrick Steuer Message: AES CTR-DRGB: add test for 32-bit counter overflow Signed-off-by: Patrick Steuer Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/10457) View the changeset: https://github.com/openssl/openssl/compare/4b5371913ed9...4d6d787c4937 View the full build log and details: https://travis-ci.org/github/openssl/openssl/builds/661033903?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the openssl/openssl repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=5849220&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Wed Mar 11 15:04:52 2020 From: no-reply at appveyor.com (AppVeyor) Date: Wed, 11 Mar 2020 15:04:52 +0000 Subject: Build failed: openssl master.32468 Message-ID: <20200311150452.1.C167CB4E88B081C4@appveyor.com> An HTML attachment was scrubbed... URL: From matt at openssl.org Wed Mar 11 15:05:21 2020 From: matt at openssl.org (Matt Caswell) Date: Wed, 11 Mar 2020 15:05:21 +0000 Subject: [openssl] OpenSSL_1_1_1-stable update Message-ID: <1583939121.435043.924.nullmailer@dev.openssl.org> The branch OpenSSL_1_1_1-stable has been updated via 2cb5e08c2cc5217e41b0b22432293b72dcb234b9 (commit) via 63fa6f2e4ba7641fd5f10c70eaa0c3a4b42e124c (commit) from 004f570821b1a92cbb733d8e03b54223231bfac3 (commit) - Log ----------------------------------------------------------------- commit 2cb5e08c2cc5217e41b0b22432293b72dcb234b9 Author: Matt Caswell Date: Mon Mar 9 09:07:11 2020 +0000 Revert "Create a new embeddedSCTs1 that's signed using SHA256" This reverts commit b98efebeb2d4265bd6638d5947fe365500121e03. Reviewed-by: Tim Hudson (Merged from https://github.com/openssl/openssl/pull/11282) commit 63fa6f2e4ba7641fd5f10c70eaa0c3a4b42e124c Author: Matt Caswell Date: Mon Mar 9 09:05:27 2020 +0000 Revert "Stop accepting certificates signed using SHA1 at security level 1" This reverts commit 68436f0a8964e911eb4f864bc8b31d7ca4d29585. The OMC did not vote in favour of backporting this to 1.1.1, so this change should be reverted. Reviewed-by: Tim Hudson (Merged from https://github.com/openssl/openssl/pull/11282) ----------------------------------------------------------------------- Summary of changes: CHANGES | 12 -------- NEWS | 5 +-- crypto/rsa/rsa_ameth.c | 20 +----------- crypto/x509/x509_set.c | 14 --------- test/certs/ct-server-key-public.pem | 4 --- test/certs/ct-server-key.pem | 5 --- test/certs/embeddedSCTs1-key.pem | 38 ++++++++--------------- test/certs/embeddedSCTs1.pem | 35 +++++++++++---------- test/certs/embeddedSCTs1.sct | 12 ++++---- test/certs/embeddedSCTs1.tlssct | Bin 118 -> 0 bytes test/certs/embeddedSCTs1_issuer-key.pem | 15 --------- test/certs/embeddedSCTs3.sct | 2 +- test/certs/mkcert.sh | 52 -------------------------------- test/certs/setup.sh | 3 -- test/ct_test.c | 6 +--- test/recipes/25-test_verify.t | 8 ++--- 16 files changed, 44 insertions(+), 187 deletions(-) delete mode 100644 test/certs/ct-server-key-public.pem delete mode 100644 test/certs/ct-server-key.pem delete mode 100644 test/certs/embeddedSCTs1.tlssct delete mode 100644 test/certs/embeddedSCTs1_issuer-key.pem diff --git a/CHANGES b/CHANGES index 7e348b078b..8c29dfae55 100644 --- a/CHANGES +++ b/CHANGES @@ -21,18 +21,6 @@ resolve symbols with longer names. [Richard Levitte] - *) X509 certificates signed using SHA1 are no longer allowed at security - level 1 and above. - In TLS/SSL the default security level is 1. It can be set either - using the cipher string with @SECLEVEL, or calling - SSL_CTX_set_security_level(). If the leaf certificate is signed with SHA-1, - a call to SSL_CTX_use_certificate() will fail if the security level is not - lowered first. - Outside TLS/SSL, the default security level is -1 (effectively 0). It can - be set using X509_VERIFY_PARAM_set_auth_level() or using the -auth_level - options of the apps. - [Kurt Roeckx] - *) Corrected the documentation of the return values from the EVP_DigestSign* set of functions. The documentation mentioned negative values for some errors, but this was never the case, so the mention of negative values diff --git a/NEWS b/NEWS index 11840cf05b..4af390505d 100644 --- a/NEWS +++ b/NEWS @@ -7,10 +7,7 @@ Major changes between OpenSSL 1.1.1d and OpenSSL 1.1.1e [under development] - o X509 certificates signed using SHA1 are no longer allowed at security - level 1 or higher. The default security level for TLS is 1, so - certificates signed using SHA1 are by default no longer trusted to - authenticate servers or clients. + o Major changes between OpenSSL 1.1.1c and OpenSSL 1.1.1d [10 Sep 2019] diff --git a/crypto/rsa/rsa_ameth.c b/crypto/rsa/rsa_ameth.c index d45d6b5ba3..6692a51ed8 100644 --- a/crypto/rsa/rsa_ameth.c +++ b/crypto/rsa/rsa_ameth.c @@ -855,7 +855,6 @@ static int rsa_sig_info_set(X509_SIG_INFO *siginf, const X509_ALGOR *sigalg, uint32_t flags; const EVP_MD *mgf1md = NULL, *md = NULL; RSA_PSS_PARAMS *pss; - int secbits; /* Sanity check: make sure it is PSS */ if (OBJ_obj2nid(sigalg->algorithm) != EVP_PKEY_RSA_PSS) @@ -875,24 +874,7 @@ static int rsa_sig_info_set(X509_SIG_INFO *siginf, const X509_ALGOR *sigalg, else flags = 0; /* Note: security bits half number of digest bits */ - secbits = EVP_MD_size(md) * 4; - /* - * SHA1 and MD5 are known to be broken. Reduce security bits so that - * they're no longer accepted at security level 1. The real values don't - * really matter as long as they're lower than 80, which is our security - * level 1. - * https://eprint.iacr.org/2020/014 puts a chosen-prefix attack for SHA1 at - * 2^63.4 - * https://documents.epfl.ch/users/l/le/lenstra/public/papers/lat.pdf - * puts a chosen-prefix attack for MD5 at 2^39. - */ - if (mdnid == NID_sha1) - secbits = 64; - else if (mdnid == NID_md5_sha1) - secbits = 68; - else if (mdnid == NID_md5) - secbits = 39; - X509_SIG_INFO_set(siginf, mdnid, EVP_PKEY_RSA_PSS, secbits, + X509_SIG_INFO_set(siginf, mdnid, EVP_PKEY_RSA_PSS, EVP_MD_size(md) * 4, flags); rv = 1; err: diff --git a/crypto/x509/x509_set.c b/crypto/x509/x509_set.c index deb7722c18..164b4e2be1 100644 --- a/crypto/x509/x509_set.c +++ b/crypto/x509/x509_set.c @@ -222,20 +222,6 @@ static void x509_sig_info_init(X509_SIG_INFO *siginf, const X509_ALGOR *alg, return; /* Security bits: half number of bits in digest */ siginf->secbits = EVP_MD_size(md) * 4; - /* - * SHA1 and MD5 are known to be broken. Reduce security bits so that - * they're no longer accepted at security level 1. The real values don't - * really matter as long as they're lower than 80, which is our security - * level 1. - * https://eprint.iacr.org/2020/014 puts a chosen-prefix attack for SHA1 at - * 2^63.4 - * https://documents.epfl.ch/users/l/le/lenstra/public/papers/lat.pdf - * puts a chosen-prefix attack for MD5 at 2^39. - */ - if (mdnid == NID_sha1) - siginf->secbits = 63; - else if (mdnid == NID_md5) - siginf->secbits = 39; switch (mdnid) { case NID_sha1: case NID_sha256: diff --git a/test/certs/ct-server-key-public.pem b/test/certs/ct-server-key-public.pem deleted file mode 100644 index c35ce3f483..0000000000 --- a/test/certs/ct-server-key-public.pem +++ /dev/null @@ -1,4 +0,0 @@ ------BEGIN PUBLIC KEY----- -MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEmXg8sUUzwBYaWrRb+V0IopzQ6o3U -yEJ04r5ZrRXGdpYM8K+hB0pXrGRLI0eeWz+3skXrS0IO83AhA3GpRL6s6w== ------END PUBLIC KEY----- diff --git a/test/certs/ct-server-key.pem b/test/certs/ct-server-key.pem deleted file mode 100644 index ab6a5575bb..0000000000 --- a/test/certs/ct-server-key.pem +++ /dev/null @@ -1,5 +0,0 @@ ------BEGIN EC PRIVATE KEY----- -MHcCAQEEIFLw4uhuCruGKjrS9MoNeXFbypqZe+Sgh+EL1gnRn1d4oAoGCCqGSM49 -AwEHoUQDQgAEmXg8sUUzwBYaWrRb+V0IopzQ6o3UyEJ04r5ZrRXGdpYM8K+hB0pX -rGRLI0eeWz+3skXrS0IO83AhA3GpRL6s6w== ------END EC PRIVATE KEY----- diff --git a/test/certs/embeddedSCTs1-key.pem b/test/certs/embeddedSCTs1-key.pem index 28dd206dbe..e3e66d55c5 100644 --- a/test/certs/embeddedSCTs1-key.pem +++ b/test/certs/embeddedSCTs1-key.pem @@ -1,27 +1,15 @@ -----BEGIN RSA PRIVATE KEY----- -MIIEpQIBAAKCAQEAuIjpA4/iCpDA2mjywI5zG6IBX6bNcRQYDsB7Cv0VonNXtJBw -XxMENP4jVpvEmWpJ5iMBknGHV+XWBkngYapczIsY4LGn6aMU6ySABBVQpNOQSRfT -48xGGPR9mzOBG/yplmpFOVq1j+b65lskvAXKYaLFpFn3oY/pBSdcCNBP8LypVXAJ -b3IqEXsBL/ErgHG9bgIRP8VxBAaryCz77kLzAXkfHL2LfSGIfNONyEKB3xI94S4L -eouOSoWL1VkEfJs87vG4G5xoXw3KOHyiueQUUlMnu8p+Bx0xPVKPEsLje3R9k0rG -a5ca7dXAn9UypKKp25x4NXpnjGX5txVEYfNvqQIDAQABAoIBAE0zqhh9Z5n3+Vbm -tTht4CZdXqm/xQ9b0rzJNjDgtN5j1vuJuhlsgUQSVoJzZIqydvw7BPtZV8AkPagf -3Cm/9lb0kpHegVsziRrfCFes+zIZ+LE7sMAKxADIuIvnvkoRKHnvN8rI8lCj16/r -zbCD06mJSZp6sSj8ZgZr8wsU63zRGt1TeGM67uVW4agphfzuKGlXstPLsSMwknpF -nxFS2TYbitxa9oH76oCpEk5fywYsYgUP4TdzOzfVAgMzNSu0FobvWl0CECB+G3RQ -XQ5VWbYkFoj5XbE5kYz6sYHMQWL1NQpglUp+tAQ1T8Nca0CvbSpD77doRGm7UqYw -ziVQKokCgYEA6BtHwzyD1PHdAYtOcy7djrpnIMaiisSxEtMhctoxg8Vr2ePEvMpZ -S1ka8A1Pa9GzjaUk+VWKWsTf+VkmMHGtpB1sv8S7HjujlEmeQe7p8EltjstvLDmi -BhAA7ixvZpXXjQV4GCVdUVu0na6gFGGueZb2FHEXB8j1amVwleJj2lcCgYEAy4f3 -2wXqJfz15+YdJPpG9BbH9d/plKJm5ID3p2ojAGo5qvVuIJMNJA4elcfHDwzCWVmn -MtR/WwtxYVVmy1BAnmk6HPSYc3CStvv1800vqN3fyJWtZ1P+8WBVZWZzIQdjdiaU -JSRevPnjQGc+SAZQQIk1yVclbz5790yuXsdIxf8CgYEApqlABC5lsvfga4Vt1UMn -j57FAkHe4KmPRCcZ83A88ZNGd/QWhkD9kR7wOsIz7wVqWiDkxavoZnjLIi4jP9HA -jwEZ3zER8wl70bRy0IEOtZzj8A6fSzAu6Q+Au4RokU6yse3lZ+EcepjQvhBvnXLu -ZxxAojj6AnsHzVf9WYJvlI0CgYEAoATIw/TEgRV/KNHs/BOiEWqP0Co5dVix2Nnk -3EVAO6VIrbbE3OuAm2ZWeaBWSujXLHSmVfpoHubCP6prZVI1W9aTkAxmh+xsDV3P -o3h+DiBTP1seuGx7tr7spQqFXeR3OH9gXktYCO/W0d3aQ7pjAjpehWv0zJ+ty2MI -fQ/lkXUCgYEAgbP+P5UmY7Fqm/mi6TprEJ/eYktji4Ne11GDKGFQCfjF5RdKhdw1 -5+elGhZes+cpzu5Ak6zBDu4bviT+tRTWJu5lVLEzlHHv4nAU7Ks5Aj67ApH21AnP -RtlATdhWOt5Dkdq1WSpDfz5bvWgvyBx9D66dSmQdbKKe2dH327eQll4= +MIICWwIBAAKBgQC+75jnwmh3rjhfdTJaDB0ym+3xj6r015a/BH634c4VyVui+A7k +WL19uG+KSyUhkaeb1wDDjpwDibRc1NyaEgqyHgy0HNDnKAWkEM2cW9tdSSdyba8X +EPYBhzd+olsaHjnu0LiBGdwVTcaPfajjDK8VijPmyVCfSgWwFAn/Xdh+tQIDAQAB +AoGAK/daG0vt6Fkqy/hdrtSJSKUVRoGRmS2nnba4Qzlwzh1+x2kdbMFuaOu2a37g +PvmeQclheKZ3EG1+Jb4yShwLcBCV6pkRJhOKuhvqGnjngr6uBH4gMCjpZVj7GDMf +flYHhdJCs3Cz/TY0wKN3o1Fldil2DHR/AEOc1nImeSp5/EUCQQDjKS3W957kYtTU +X5BeRjvg03Ug8tJq6IFuhTFvUJ+XQ5bAc0DmxAbQVKqRS7Wje59zTknVvS+MFdeQ +pz4dGuV7AkEA1y0X2yarIls+0A/S1uwkvwRTIkfS+QwFJ1zVya8sApRdKAcidIzA +b70hkKLilU9+LrXg5iZdFp8l752qJiw9jwJAXjItN/7mfH4fExGto+or2kbVQxxt +9LcFNPc2UJp2ExuL37HrL8YJrUnukOF8KJaSwBWuuFsC5GwKP4maUCdfEQJAUwBR +83c3DEmmMRvpeH4erpA8gTyzZN3+HvDwhpvLnjMcvBQEdnDUykVqbSBnxrCjO+Fs +n1qtDczWFVf8Cj2GgQJAQ14Awx32Cn9sF+3M+sEVtlAf6CqiEbkYeYdSCbsplMmZ +1UoaxiwXY3z+B7epsRnnPR3KaceAlAxw2/zQJMFNOQ== -----END RSA PRIVATE KEY----- diff --git a/test/certs/embeddedSCTs1.pem b/test/certs/embeddedSCTs1.pem index d2a111fb82..d1e85120a0 100644 --- a/test/certs/embeddedSCTs1.pem +++ b/test/certs/embeddedSCTs1.pem @@ -1,21 +1,20 @@ -----BEGIN CERTIFICATE----- -MIIDeDCCAuGgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBVMQswCQYDVQQGEwJHQjEk +MIIDWTCCAsKgAwIBAgIBBzANBgkqhkiG9w0BAQUFADBVMQswCQYDVQQGEwJHQjEk MCIGA1UEChMbQ2VydGlmaWNhdGUgVHJhbnNwYXJlbmN5IENBMQ4wDAYDVQQIEwVX -YWxlczEQMA4GA1UEBxMHRXJ3IFdlbjAgFw0yMDAxMjUxMTUwMTNaGA8yMTIwMDEy -NjExNTAxM1owGTEXMBUGA1UEAwwOc2VydmVyLmV4YW1wbGUwggEiMA0GCSqGSIb3 -DQEBAQUAA4IBDwAwggEKAoIBAQC4iOkDj+IKkMDaaPLAjnMbogFfps1xFBgOwHsK -/RWic1e0kHBfEwQ0/iNWm8SZaknmIwGScYdX5dYGSeBhqlzMixjgsafpoxTrJIAE -FVCk05BJF9PjzEYY9H2bM4Eb/KmWakU5WrWP5vrmWyS8BcphosWkWfehj+kFJ1wI -0E/wvKlVcAlvcioRewEv8SuAcb1uAhE/xXEEBqvILPvuQvMBeR8cvYt9IYh8043I -QoHfEj3hLgt6i45KhYvVWQR8mzzu8bgbnGhfDco4fKK55BRSUye7yn4HHTE9Uo8S -wuN7dH2TSsZrlxrt1cCf1TKkoqnbnHg1emeMZfm3FURh82+pAgMBAAGjggEMMIIB -CDAdBgNVHQ4EFgQUtMa8XD5ylrF9AqCdnPEhXa63H2owHwYDVR0jBBgwFoAUX52I -Dchz5lTU+A3Y5rDBJLRHw1UwCQYDVR0TBAIwADATBgNVHSUEDDAKBggrBgEFBQcD -ATCBigYKKwYBBAHWeQIEAgR8BHoAeAB2AN8cLsEVAJRSR6lhaDJd3Fx5Wej3xtOI -/AAuC70/dNdkAAABb15m6AAAAAQDAEcwRQIgfDPo8RArm/vcSEZ608Q1u+XQ55QB -u67SZEuZxLpbUM0CIQDRsgcTud4PDy8Cgg+lHeAS7UxgSKBbWAznYOuorwNewzAZ -BgNVHREEEjAQgg5zZXJ2ZXIuZXhhbXBsZTANBgkqhkiG9w0BAQsFAAOBgQCWFKKR -RNkDRzB25NK07OLkbzebhnpKtbP4i3blRx1HAvTSamf/3uuHI7kfiPJorJymJpT1 -IuJvSVKyMu1qONWBimiBfiyGL7+le1izHEJIP5lVTbddfzSIBIvrlHHcWIOL3H+W -YT6yTEIzJuO07Xp61qnB1CE2TrinUWlyC46Zkw== +YWxlczEQMA4GA1UEBxMHRXJ3IFdlbjAeFw0xMjA2MDEwMDAwMDBaFw0yMjA2MDEw +MDAwMDBaMFIxCzAJBgNVBAYTAkdCMSEwHwYDVQQKExhDZXJ0aWZpY2F0ZSBUcmFu +c3BhcmVuY3kxDjAMBgNVBAgTBVdhbGVzMRAwDgYDVQQHEwdFcncgV2VuMIGfMA0G +CSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+75jnwmh3rjhfdTJaDB0ym+3xj6r015a/ +BH634c4VyVui+A7kWL19uG+KSyUhkaeb1wDDjpwDibRc1NyaEgqyHgy0HNDnKAWk +EM2cW9tdSSdyba8XEPYBhzd+olsaHjnu0LiBGdwVTcaPfajjDK8VijPmyVCfSgWw +FAn/Xdh+tQIDAQABo4IBOjCCATYwHQYDVR0OBBYEFCAxVBryXAX/2GWLaEN5T16Q +Nve0MH0GA1UdIwR2MHSAFF+diA3Ic+ZU1PgN2OawwSS0R8NVoVmkVzBVMQswCQYD +VQQGEwJHQjEkMCIGA1UEChMbQ2VydGlmaWNhdGUgVHJhbnNwYXJlbmN5IENBMQ4w +DAYDVQQIEwVXYWxlczEQMA4GA1UEBxMHRXJ3IFdlboIBADAJBgNVHRMEAjAAMIGK +BgorBgEEAdZ5AgQCBHwEegB4AHYA3xwuwRUAlFJHqWFoMl3cXHlZ6PfG04j8AC4L +vT9012QAAAE92yffkwAABAMARzBFAiBIL2dRrzXbplQ2vh/WZA89v5pBQpSVkkUw +KI+j5eI+BgIhAOTtwNs6xXKx4vXoq2poBlOYfc9BAn3+/6EFUZ2J7b8IMA0GCSqG +SIb3DQEBBQUAA4GBAIoMS+8JnUeSea+goo5on5HhxEIb4tJpoupspOghXd7dyhUE +oR58h8S3foDw6XkDUmjyfKIOFmgErlVvMWmB+Wo5Srer/T4lWsAERRP+dlcMZ5Wr +5HAxM9MD+J86+mu8/FFzGd/ZW5NCQSEfY0A1w9B4MHpoxgdaLiDInza4kQyg -----END CERTIFICATE----- diff --git a/test/certs/embeddedSCTs1.sct b/test/certs/embeddedSCTs1.sct index 9e413e3dc7..59362dcee1 100644 --- a/test/certs/embeddedSCTs1.sct +++ b/test/certs/embeddedSCTs1.sct @@ -2,11 +2,11 @@ Signed Certificate Timestamp: Version : v1 (0x0) Log ID : DF:1C:2E:C1:15:00:94:52:47:A9:61:68:32:5D:DC:5C: 79:59:E8:F7:C6:D3:88:FC:00:2E:0B:BD:3F:74:D7:64 - Timestamp : Jan 1 00:00:00.000 2020 GMT + Timestamp : Apr 5 17:04:16.275 2013 GMT Extensions: none Signature : ecdsa-with-SHA256 - 30:45:02:20:7C:33:E8:F1:10:2B:9B:FB:DC:48:46:7A: - D3:C4:35:BB:E5:D0:E7:94:01:BB:AE:D2:64:4B:99:C4: - BA:5B:50:CD:02:21:00:D1:B2:07:13:B9:DE:0F:0F:2F: - 02:82:0F:A5:1D:E0:12:ED:4C:60:48:A0:5B:58:0C:E7: - 60:EB:A8:AF:03:5E:C3 + 30:45:02:20:48:2F:67:51:AF:35:DB:A6:54:36:BE:1F: + D6:64:0F:3D:BF:9A:41:42:94:95:92:45:30:28:8F:A3: + E5:E2:3E:06:02:21:00:E4:ED:C0:DB:3A:C5:72:B1:E2: + F5:E8:AB:6A:68:06:53:98:7D:CF:41:02:7D:FE:FF:A1: + 05:51:9D:89:ED:BF:08 \ No newline at end of file diff --git a/test/certs/embeddedSCTs1.tlssct b/test/certs/embeddedSCTs1.tlssct deleted file mode 100644 index 0586c94ab0..0000000000 Binary files a/test/certs/embeddedSCTs1.tlssct and /dev/null differ diff --git a/test/certs/embeddedSCTs1_issuer-key.pem b/test/certs/embeddedSCTs1_issuer-key.pem deleted file mode 100644 index 9326e38b1e..0000000000 --- a/test/certs/embeddedSCTs1_issuer-key.pem +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXAIBAAKBgQDVimhTYhCicRmTbneDIRgcKkATxtB7jHbrkVfT0PtLO1FuzsvR -yY2RxS90P6tjXVUJnNE6uvMa5UFEJFGnTHgW8iQ8+EjPKDHM5nugSlojgZ88ujfm -JNnDvbKZuDnd/iYx0ss6hPx7srXFL8/BT/9Ab1zURmnLsvfP34b7arnRsQIDAQAB -AoGAJLR6xEJp+5IXRFlLn7WTkFvO0ddtxJ7bXhiIkTctyruyfqp7LF9Jv1G2m3PK -QPUtBc73w/GYkfnwIwdfJbOmPHL7XyEGHZYmEXgIgEtw6LXvAv0G5JpUnNwsSBfL -GfSQqI5Z5ytyzlJXkMcTGA2kTgNAYc73h4EnU+pwUnDPdAECQQD2aj+4LtYk1XPq -r3gjgI6MoGvgYJfPmAtZhxxVbhXQKciFUCAcBiwlQdHIdLWE9j65ctmZRWidKifr -4O4nz+TBAkEA3djNW/rTQq5fKZy+mCF1WYnIU/3yhJaptzRqLm7AHqe7+hdrGXJw -+mCtU8T3L/Ms8bH1yFBZhmkp1PbR8gl48QJAQo70YyWThiN5yfxXcQ96cZWrTdIJ -b3NcLXSHPLQdhDqlBQ1dfvRT3ERpC8IqfZ2d162kBPhwh3MpkVcSPQK0gQJAC/dY -xGBYKt2a9nSk9zG+0bCT5Kvq++ngh6hFHfINXNnxUsEWns3EeEzkrIMQTj7QqszN -lBt5aL2dawZRNrv6EQJBAOo4STF9KEwQG0HLC/ryh1FeB0OBA5yIepXze+eJVKei -T0cCECOQJKfWHEzYJYDJhyEFF/sYp9TXwKSDjOifrsU= ------END RSA PRIVATE KEY----- diff --git a/test/certs/embeddedSCTs3.sct b/test/certs/embeddedSCTs3.sct index 579a890a9a..ad1ccf0ffc 100644 --- a/test/certs/embeddedSCTs3.sct +++ b/test/certs/embeddedSCTs3.sct @@ -33,4 +33,4 @@ Signed Certificate Timestamp: 55:83:D2:9D:E5:A1:8D:B6:3D:A6:73:89:42:32:9C:91: 0F:3B:6A:74:02:21:00:86:EE:10:F9:10:E6:7B:17:65: D9:2D:37:53:4A:3B:F0:AE:03:E4:21:76:37:EF:AF:B4: - 44:2E:2B:F5:5C:C6:91 + 44:2E:2B:F5:5C:C6:91 \ No newline at end of file diff --git a/test/certs/mkcert.sh b/test/certs/mkcert.sh index 790d20f8c1..ebb71c1778 100755 --- a/test/certs/mkcert.sh +++ b/test/certs/mkcert.sh @@ -288,56 +288,4 @@ gennocn() { cert "$cert" "" -signkey "${key}.pem" -set_serial 1 -days -1 "$@" } -genct() { - local OPTIND=1 - local purpose=serverAuth - - while getopts p: o - do - case $o in - p) purpose="$OPTARG";; - *) echo "Usage: $0 genct [-p EKU] cn keyname certname cakeyname cacertname ctlogkey" >&2 - return 1;; - esac - done - - shift $((OPTIND - 1)) - local cn=$1; shift - local key=$1; shift - local cert=$1; shift - local cakey=$1; shift - local ca=$1; shift - local logkey=$1; shift - - exts=$(printf "%s\n%s\n%s\n%s\n%s\n%s\n[alts]\n%s\n" \ - "subjectKeyIdentifier = hash" \ - "authorityKeyIdentifier = keyid, issuer" \ - "basicConstraints = CA:false" \ - "extendedKeyUsage = $purpose" \ - "1.3.6.1.4.1.11129.2.4.3 = critical,ASN1:NULL"\ - "subjectAltName = @alts" "DNS=${cn}") - csr=$(req "$key" "CN = $cn") || return 1 - echo "$csr" | - cert "$cert" "$exts" -CA "${ca}.pem" -CAkey "${cakey}.pem" \ - -set_serial 2 -days "${DAYS}" "$@" - cat ${cert}.pem ${ca}.pem > ${cert}-chain.pem - go run github.com/google/certificate-transparency-go/ctutil/sctgen \ - --log_private_key ${logkey}.pem \ - --timestamp="2020-01-01T00:00:00Z" \ - --cert_chain ${cert}-chain.pem \ - --tls_out ${cert}.tlssct - rm ${cert}-chain.pem - filesize=$(wc -c <${cert}.tlssct) - exts=$(printf "%s\n%s\n%s\n%s\n%s%04X%04X%s\n%s\n[alts]\n%s\n" \ - "subjectKeyIdentifier = hash" \ - "authorityKeyIdentifier = keyid, issuer" \ - "basicConstraints = CA:false" \ - "extendedKeyUsage = $purpose" \ - "1.3.6.1.4.1.11129.2.4.2 = ASN1:FORMAT:HEX,OCT:" $((filesize+2)) $filesize `xxd -p ${cert}.tlssct | tr -d '\n'` \ - "subjectAltName = @alts" "DNS=${cn}") - echo "$csr" | - cert "$cert" "$exts" -CA "${ca}.pem" -CAkey "${cakey}.pem" \ - -set_serial 2 -days "${DAYS}" "$@" -} - "$@" diff --git a/test/certs/setup.sh b/test/certs/setup.sh index d58d0d789b..2d53ea5b08 100755 --- a/test/certs/setup.sh +++ b/test/certs/setup.sh @@ -376,9 +376,6 @@ openssl req -new -nodes -subj "/CN=localhost" \ ./mkcert.sh geneenocsr "Server RSA-PSS restricted cert" \ server-pss-restrict-cert rootkey rootcert -# CT entry -./mkcert.sh genct server.example embeddedSCTs1-key embeddedSCTs1 embeddedSCTs1_issuer-key embeddedSCTs1_issuer ct-server-key - OPENSSL_SIGALG=ED448 OPENSSL_KEYALG=ed448 ./mkcert.sh genroot "Root Ed448" \ root-ed448-key root-ed448-cert OPENSSL_SIGALG=ED448 OPENSSL_KEYALG=ed448 ./mkcert.sh genee ed448 \ diff --git a/test/ct_test.c b/test/ct_test.c index 4dd6a67a7c..78d11ca98c 100644 --- a/test/ct_test.c +++ b/test/ct_test.c @@ -63,7 +63,7 @@ static CT_TEST_FIXTURE *set_up(const char *const test_case_name) if (!TEST_ptr(fixture = OPENSSL_zalloc(sizeof(*fixture)))) goto end; fixture->test_case_name = test_case_name; - fixture->epoch_time_in_ms = 1580335307000ULL; /* Wed 29 Jan 2020 10:01:47 PM UTC */ + fixture->epoch_time_in_ms = 1473269626000ULL; /* Sep 7 17:33:46 2016 GMT */ if (!TEST_ptr(fixture->ctlog_store = CTLOG_STORE_new()) || !TEST_int_eq( CTLOG_STORE_load_default_file(fixture->ctlog_store), 1)) @@ -160,10 +160,6 @@ static int compare_extension_printout(X509_EXTENSION *extension, X509V3_EXT_DEFAULT, 0))) goto end; - /* Append \n because it's easier to create files that end with one. */ - if (!TEST_true(BIO_write(text_buffer, "\n", 1))) - goto end; - /* Append \0 because we're about to use the buffer contents as a string. */ if (!TEST_true(BIO_write(text_buffer, "\0", 1))) goto end; diff --git a/test/recipes/25-test_verify.t b/test/recipes/25-test_verify.t index 5e5bc9ef1e..b80a1cde3e 100644 --- a/test/recipes/25-test_verify.t +++ b/test/recipes/25-test_verify.t @@ -336,14 +336,14 @@ ok(!verify("badalt9-cert", "sslserver", ["root-cert"], ["ncca1-cert", "ncca3-cer ok(!verify("badalt10-cert", "sslserver", ["root-cert"], ["ncca1-cert", "ncca3-cert"], ), "Name constraints nested DNS name excluded"); -ok(verify("ee-pss-sha1-cert", "sslserver", ["root-cert"], ["ca-cert"], "-auth_level", "0"), - "Accept PSS signature using SHA1 at auth level 0"); +ok(verify("ee-pss-sha1-cert", "sslserver", ["root-cert"], ["ca-cert"], ), + "Certificate PSS signature using SHA1"); ok(verify("ee-pss-sha256-cert", "sslserver", ["root-cert"], ["ca-cert"], ), "CA with PSS signature using SHA256"); -ok(!verify("ee-pss-sha1-cert", "sslserver", ["root-cert"], ["ca-cert"], "-auth_level", "1"), - "Reject PSS signature using SHA1 and auth level 1"); +ok(!verify("ee-pss-sha1-cert", "sslserver", ["root-cert"], ["ca-cert"], "-auth_level", "2"), + "Reject PSS signature using SHA1 and auth level 2"); ok(verify("ee-pss-sha256-cert", "sslserver", ["root-cert"], ["ca-cert"], "-auth_level", "2"), "PSS signature using SHA256 and auth level 2"); From matt at openssl.org Wed Mar 11 15:19:29 2020 From: matt at openssl.org (Matt Caswell) Date: Wed, 11 Mar 2020 15:19:29 +0000 Subject: [openssl] master update Message-ID: <1583939969.332171.4385.nullmailer@dev.openssl.org> The branch master has been updated via 0e6f62e3e1c4cdaa8e3bda7d459f978541dfb1fe (commit) via 55ecb812b1fd71aa829c3f5ac6030f2ed437eb30 (commit) from 4d6d787c4937706676355ce241c6e538475295d2 (commit) - Log ----------------------------------------------------------------- commit 0e6f62e3e1c4cdaa8e3bda7d459f978541dfb1fe Author: Matt Caswell Date: Fri Mar 6 18:05:37 2020 +0000 If the first serializer we find is the desired one that's ok Stop looking for a desired serializer if the first one is desired. Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/11271) commit 55ecb812b1fd71aa829c3f5ac6030f2ed437eb30 Author: Matt Caswell Date: Fri Mar 6 18:02:46 2020 +0000 Don't crash if we fail to find a serializer for the current provider The code was assuming that a serializer would always be found - but this may not be the case. Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/11271) ----------------------------------------------------------------------- Summary of changes: crypto/serializer/serializer_pkey.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/crypto/serializer/serializer_pkey.c b/crypto/serializer/serializer_pkey.c index 1b6df1da53..4b1bf5c3ee 100644 --- a/crypto/serializer/serializer_pkey.c +++ b/crypto/serializer/serializer_pkey.c @@ -121,13 +121,13 @@ static void select_serializer(const char *name, void *data) return; if ((s = OSSL_SERIALIZER_fetch(d->libctx, name, d->propquery)) != NULL) { - if (d->first == NULL && s->serialize_data != NULL) { - d->first = s; - } else if (OSSL_SERIALIZER_provider(s) == d->desired_provider - && s->serialize_object != NULL) { + if (OSSL_SERIALIZER_provider(s) == d->desired_provider + && s->serialize_object != NULL) { OSSL_SERIALIZER_free(d->first); d->first = NULL; d->desired = s; + } else if (d->first == NULL && s->serialize_data != NULL) { + d->first = s; } else { OSSL_SERIALIZER_free(s); } @@ -338,12 +338,14 @@ OSSL_SERIALIZER_CTX *OSSL_SERIALIZER_CTX_new_by_EVP_PKEY(const EVP_PKEY *pkey, OSSL_SERIALIZER_free(sel_data.first); OSSL_SERIALIZER_free(sel_data.desired); - current_props = - ossl_parse_property(libctx, OSSL_SERIALIZER_properties(ser)); - if (ossl_property_match_count(check, current_props) > 0) - selection = OSSL_KEYMGMT_SELECT_ALL_PARAMETERS; + if (ser != NULL) { + current_props = + ossl_parse_property(libctx, OSSL_SERIALIZER_properties(ser)); + if (ossl_property_match_count(check, current_props) > 0) + selection = OSSL_KEYMGMT_SELECT_ALL_PARAMETERS; + ossl_property_free(current_props); + } - ossl_property_free(current_props); ossl_property_free(check); } From builds at travis-ci.org Wed Mar 11 16:12:57 2020 From: builds at travis-ci.org (Travis CI) Date: Wed, 11 Mar 2020 16:12:57 +0000 Subject: Failed: openssl/openssl#33040 (master - 0e6f62e) In-Reply-To: Message-ID: <5e690e0962_43fbd3bf92cb083761@90bd167b-1ff6-47f4-87e8-fe63dce65c8d.mail> Build Update for openssl/openssl ------------------------------------- Build: #33040 Status: Failed Duration: 53 mins and 8 secs Commit: 0e6f62e (master) Author: Matt Caswell Message: If the first serializer we find is the desired one that's ok Stop looking for a desired serializer if the first one is desired. Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/11271) View the changeset: https://github.com/openssl/openssl/compare/4d6d787c4937...0e6f62e3e1c4 View the full build log and details: https://travis-ci.org/github/openssl/openssl/builds/661129507?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the openssl/openssl repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=5849220&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Wed Mar 11 16:26:05 2020 From: no-reply at appveyor.com (AppVeyor) Date: Wed, 11 Mar 2020 16:26:05 +0000 Subject: Build completed: openssl master.32469 Message-ID: <20200311162605.1.97FDC7B1E73F29BE@appveyor.com> An HTML attachment was scrubbed... URL: From shane.lontis at oracle.com Wed Mar 11 21:17:01 2020 From: shane.lontis at oracle.com (shane.lontis at oracle.com) Date: Wed, 11 Mar 2020 21:17:01 +0000 Subject: [openssl] master update Message-ID: <1583961421.350524.5066.nullmailer@dev.openssl.org> The branch master has been updated via a173cc9c388cbe8105f78ba5a8fdfbf20a35be1a (commit) from 0e6f62e3e1c4cdaa8e3bda7d459f978541dfb1fe (commit) - Log ----------------------------------------------------------------- commit a173cc9c388cbe8105f78ba5a8fdfbf20a35be1a Author: Shane Lontis Date: Thu Jan 16 17:18:26 2020 +1000 Add EC key validation to default provider Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/10861) ----------------------------------------------------------------------- Summary of changes: crypto/ec/ec_check.c | 19 ++-- crypto/ec/ec_key.c | 152 ++++++++++++++++++--------- crypto/ec/ec_lib.c | 5 + include/crypto/ec.h | 4 + providers/implementations/keymgmt/ec_kmgmt.c | 33 +++++- 5 files changed, 156 insertions(+), 57 deletions(-) diff --git a/crypto/ec/ec_check.c b/crypto/ec/ec_check.c index bb39177d64..1283d8404f 100644 --- a/crypto/ec/ec_check.c +++ b/crypto/ec/ec_check.c @@ -20,26 +20,27 @@ int EC_GROUP_check_named_curve(const EC_GROUP *group, int nist_only, BN_CTX *ctx) { int nid = NID_undef; -#ifndef FIPS_MODE BN_CTX *new_ctx = NULL; + if (group == NULL) { + ECerr(0, ERR_R_PASSED_NULL_PARAMETER); + goto err; + } + if (ctx == NULL) { - ctx = new_ctx = BN_CTX_new(); + ctx = new_ctx = BN_CTX_new_ex(NULL); if (ctx == NULL) { - ECerr(EC_F_EC_GROUP_CHECK_NAMED_CURVE, ERR_R_MALLOC_FAILURE); - goto err; + ECerr(0, ERR_R_MALLOC_FAILURE); + return NID_undef; } } -#endif nid = ec_curve_nid_from_params(group, ctx); if (nid > 0 && nist_only && EC_curve_nid2nist(nid) == NULL) nid = NID_undef; -#ifndef FIPS_MODE - err: - BN_CTX_free(ctx); -#endif +err: + BN_CTX_free(new_ctx); return nid; } diff --git a/crypto/ec/ec_key.c b/crypto/ec/ec_key.c index 18b544b9d3..ae3e974231 100644 --- a/crypto/ec/ec_key.c +++ b/crypto/ec/ec_key.c @@ -419,93 +419,151 @@ err: /* * ECC Key validation as specified in SP800-56A R3. - * Section 5.6.2.3.3 ECC Full Public-Key Validation - * Section 5.6.2.1.2 Owner Assurance of Private-Key Validity - * Section 5.6.2.1.4 Owner Assurance of Pair-wise Consistency - * NOTES: - * Before calling this method in fips mode, there should be an assurance that - * an approved elliptic-curve group is used. - * Returns 1 if the key is valid, otherwise it returns 0. + * Section 5.6.2.3.3 ECC Full Public-Key Validation. */ -int ec_key_simple_check_key(const EC_KEY *eckey) +int ec_key_public_check(const EC_KEY *eckey, BN_CTX *ctx) { - int ok = 0; - BN_CTX *ctx = NULL; - const BIGNUM *order = NULL; + int ret = 0; EC_POINT *point = NULL; + const BIGNUM *order = NULL; if (eckey == NULL || eckey->group == NULL || eckey->pub_key == NULL) { - ECerr(EC_F_EC_KEY_SIMPLE_CHECK_KEY, ERR_R_PASSED_NULL_PARAMETER); + ECerr(0, ERR_R_PASSED_NULL_PARAMETER); return 0; } /* 5.6.2.3.3 (Step 1): Q != infinity */ if (EC_POINT_is_at_infinity(eckey->group, eckey->pub_key)) { - ECerr(EC_F_EC_KEY_SIMPLE_CHECK_KEY, EC_R_POINT_AT_INFINITY); - goto err; + ECerr(0, EC_R_POINT_AT_INFINITY); + return 0; } - if ((ctx = BN_CTX_new_ex(eckey->libctx)) == NULL) - goto err; - - if ((point = EC_POINT_new(eckey->group)) == NULL) - goto err; + point = EC_POINT_new(eckey->group); + if (point == NULL) + return 0; /* 5.6.2.3.3 (Step 2) Test if the public key is in range */ if (!ec_key_public_range_check(ctx, eckey)) { - ECerr(EC_F_EC_KEY_SIMPLE_CHECK_KEY, EC_R_COORDINATES_OUT_OF_RANGE); + ECerr(0, EC_R_COORDINATES_OUT_OF_RANGE); goto err; } /* 5.6.2.3.3 (Step 3) is the pub_key on the elliptic curve */ if (EC_POINT_is_on_curve(eckey->group, eckey->pub_key, ctx) <= 0) { - ECerr(EC_F_EC_KEY_SIMPLE_CHECK_KEY, EC_R_POINT_IS_NOT_ON_CURVE); + ECerr(0, EC_R_POINT_IS_NOT_ON_CURVE); goto err; } order = eckey->group->order; if (BN_is_zero(order)) { - ECerr(EC_F_EC_KEY_SIMPLE_CHECK_KEY, EC_R_INVALID_GROUP_ORDER); + ECerr(0, EC_R_INVALID_GROUP_ORDER); goto err; } /* 5.6.2.3.3 (Step 4) : pub_key * order is the point at infinity. */ if (!EC_POINT_mul(eckey->group, point, NULL, eckey->pub_key, order, ctx)) { - ECerr(EC_F_EC_KEY_SIMPLE_CHECK_KEY, ERR_R_EC_LIB); + ECerr(0, ERR_R_EC_LIB); goto err; } if (!EC_POINT_is_at_infinity(eckey->group, point)) { - ECerr(EC_F_EC_KEY_SIMPLE_CHECK_KEY, EC_R_WRONG_ORDER); + ECerr(0, EC_R_WRONG_ORDER); + goto err; + } + ret = 1; +err: + EC_POINT_free(point); + return ret; +} + +/* + * ECC Key validation as specified in SP800-56A R3. + * Section 5.6.2.1.2 Owner Assurance of Private-Key Validity + * The private key is in the range [1, order-1] + */ +int ec_key_private_check(const EC_KEY *eckey) +{ + if (eckey == NULL || eckey->group == NULL || eckey->priv_key == NULL) { + ECerr(0, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + if (BN_cmp(eckey->priv_key, BN_value_one()) < 0 + || BN_cmp(eckey->priv_key, eckey->group->order) >= 0) { + ECerr(0, EC_R_INVALID_PRIVATE_KEY); + return 0; + } + return 1; +} + +/* + * ECC Key validation as specified in SP800-56A R3. + * Section 5.6.2.1.4 Owner Assurance of Pair-wise Consistency (b) + * Check if generator * priv_key = pub_key + */ +int ec_key_pairwise_check(const EC_KEY *eckey, BN_CTX *ctx) +{ + int ret = 0; + EC_POINT *point = NULL; + + if (eckey == NULL + || eckey->group == NULL + || eckey->pub_key == NULL + || eckey->priv_key == NULL) { + ECerr(0, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + + point = EC_POINT_new(eckey->group); + if (point == NULL) + goto err; + + + if (!EC_POINT_mul(eckey->group, point, eckey->priv_key, NULL, NULL, ctx)) { + ECerr(0, ERR_R_EC_LIB); + goto err; + } + if (EC_POINT_cmp(eckey->group, point, eckey->pub_key, ctx) != 0) { + ECerr(0, EC_R_INVALID_PRIVATE_KEY); goto err; } + ret = 1; +err: + EC_POINT_free(point); + return ret; +} + + +/* + * ECC Key validation as specified in SP800-56A R3. + * Section 5.6.2.3.3 ECC Full Public-Key Validation + * Section 5.6.2.1.2 Owner Assurance of Private-Key Validity + * Section 5.6.2.1.4 Owner Assurance of Pair-wise Consistency + * NOTES: + * Before calling this method in fips mode, there should be an assurance that + * an approved elliptic-curve group is used. + * Returns 1 if the key is valid, otherwise it returns 0. + */ +int ec_key_simple_check_key(const EC_KEY *eckey) +{ + int ok = 0; + BN_CTX *ctx = NULL; + + if (eckey == NULL) { + ECerr(0, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + if ((ctx = BN_CTX_new_ex(eckey->libctx)) == NULL) + return 0; + + if (!ec_key_public_check(eckey, ctx)) + goto err; if (eckey->priv_key != NULL) { - /* - * 5.6.2.1.2 Owner Assurance of Private-Key Validity - * The private key is in the range [1, order-1] - */ - if (BN_cmp(eckey->priv_key, BN_value_one()) < 0 - || BN_cmp(eckey->priv_key, order) >= 0) { - ECerr(EC_F_EC_KEY_SIMPLE_CHECK_KEY, EC_R_WRONG_ORDER); + if (!ec_key_private_check(eckey) + || !ec_key_pairwise_check(eckey, ctx)) goto err; - } - /* - * Section 5.6.2.1.4 Owner Assurance of Pair-wise Consistency (b) - * Check if generator * priv_key = pub_key - */ - if (!EC_POINT_mul(eckey->group, point, eckey->priv_key, - NULL, NULL, ctx)) { - ECerr(EC_F_EC_KEY_SIMPLE_CHECK_KEY, ERR_R_EC_LIB); - goto err; - } - if (EC_POINT_cmp(eckey->group, point, eckey->pub_key, ctx) != 0) { - ECerr(EC_F_EC_KEY_SIMPLE_CHECK_KEY, EC_R_INVALID_PRIVATE_KEY); - goto err; - } } ok = 1; - err: +err: BN_CTX_free(ctx); - EC_POINT_free(point); return ok; } diff --git a/crypto/ec/ec_lib.c b/crypto/ec/ec_lib.c index 078d8b35fa..e66a501a0e 100644 --- a/crypto/ec/ec_lib.c +++ b/crypto/ec/ec_lib.c @@ -1261,3 +1261,8 @@ int ec_point_blind_coordinates(const EC_GROUP *group, EC_POINT *p, BN_CTX *ctx) return group->meth->blind_coordinates(group, p, ctx); } + +OPENSSL_CTX *ec_key_get_libctx(const EC_KEY *eckey) +{ + return eckey->libctx; +} diff --git a/include/crypto/ec.h b/include/crypto/ec.h index c4f7d2e778..9ebf45d0f4 100644 --- a/include/crypto/ec.h +++ b/include/crypto/ec.h @@ -50,5 +50,9 @@ int ecdh_KDF_X9_63(unsigned char *out, size_t outlen, const EVP_MD *md); int ec_generate_key(OPENSSL_CTX *libctx, EC_KEY *eckey, int pairwise_test); +int ec_key_public_check(const EC_KEY *eckey, BN_CTX *ctx); +int ec_key_private_check(const EC_KEY *eckey); +int ec_key_pairwise_check(const EC_KEY *eckey, BN_CTX *ctx); +OPENSSL_CTX *ec_key_get_libctx(const EC_KEY *eckey); # endif /* OPENSSL_NO_EC */ #endif diff --git a/providers/implementations/keymgmt/ec_kmgmt.c b/providers/implementations/keymgmt/ec_kmgmt.c index 107ab1b594..2db23cd489 100644 --- a/providers/implementations/keymgmt/ec_kmgmt.c +++ b/providers/implementations/keymgmt/ec_kmgmt.c @@ -16,10 +16,10 @@ #include #include #include -#include #include #include #include "crypto/bn.h" +#include "crypto/ec.h" #include "internal/param_build.h" #include "prov/implementations.h" #include "prov/providercommon.h" @@ -32,6 +32,7 @@ static OSSL_OP_keymgmt_set_params_fn ec_set_params; static OSSL_OP_keymgmt_settable_params_fn ec_settable_params; static OSSL_OP_keymgmt_has_fn ec_has; static OSSL_OP_keymgmt_match_fn ec_match; +static OSSL_OP_keymgmt_validate_fn ec_validate; static OSSL_OP_keymgmt_import_fn ec_import; static OSSL_OP_keymgmt_import_types_fn ec_import_types; static OSSL_OP_keymgmt_export_fn ec_export; @@ -730,6 +731,35 @@ int ec_set_params(void *key, const OSSL_PARAM params[]) return 1; } +static +int ec_validate(void *keydata, int selection) +{ + EC_KEY *eck = keydata; + int ok = 0; + BN_CTX *ctx = BN_CTX_new_ex(ec_key_get_libctx(eck)); + + if (ctx == NULL) + return 0; + + if ((selection & EC_POSSIBLE_SELECTIONS) != 0) + ok = 1; + + if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0) + ok = ok && EC_GROUP_check(EC_KEY_get0_group(eck), ctx); + + if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0) + ok = ok && ec_key_public_check(eck, ctx); + + if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) + ok = ok && ec_key_private_check(eck); + + if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) == OSSL_KEYMGMT_SELECT_KEYPAIR) + ok = ok && ec_key_pairwise_check(eck, ctx); + + BN_CTX_free(ctx); + return ok; +} + const OSSL_DISPATCH ec_keymgmt_functions[] = { { OSSL_FUNC_KEYMGMT_NEW, (void (*)(void))ec_newdata }, { OSSL_FUNC_KEYMGMT_FREE, (void (*)(void))ec_freedata }, @@ -739,6 +769,7 @@ const OSSL_DISPATCH ec_keymgmt_functions[] = { { OSSL_FUNC_KEYMGMT_SETTABLE_PARAMS, (void (*) (void))ec_settable_params }, { OSSL_FUNC_KEYMGMT_HAS, (void (*)(void))ec_has }, { OSSL_FUNC_KEYMGMT_MATCH, (void (*)(void))ec_match }, + { OSSL_FUNC_KEYMGMT_VALIDATE, (void (*)(void))ec_validate }, { OSSL_FUNC_KEYMGMT_IMPORT, (void (*)(void))ec_import }, { OSSL_FUNC_KEYMGMT_IMPORT_TYPES, (void (*)(void))ec_import_types }, { OSSL_FUNC_KEYMGMT_EXPORT, (void (*)(void))ec_export }, From openssl at openssl.org Wed Mar 11 22:07:22 2020 From: openssl at openssl.org (OpenSSL run-checker) Date: Wed, 11 Mar 2020 22:07:22 +0000 Subject: Still FAILED build of OpenSSL branch master with options -d --strict-warnings Message-ID: <1583964442.205039.29868.nullmailer@run.openssl.org> Platform and configuration command: $ uname -a Linux run 4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux $ CC=clang ../openssl/config -d --strict-warnings Commit log since last time: a173cc9c38 Add EC key validation to default provider 0e6f62e3e1 If the first serializer we find is the desired one that's ok 55ecb812b1 Don't crash if we fail to find a serializer for the current provider 4d6d787c49 AES CTR-DRGB: add test for 32-bit counter overflow 28bdbe1aaa AES CTR-DRGB: performance improvement 4b5371913e DOCS: Use "command" not "tool" or "utility" Build log ended with (last 100 lines): test/cmsapitest-bin-cmsapitest.o \ test/libtestutil.a -lcrypto -ldl -pthread rm -f test/conf_include_test ${LDCMD:-clang} -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -L. \ -o test/conf_include_test \ test/conf_include_test-bin-conf_include_test.o \ test/libtestutil.a -lcrypto -ldl -pthread rm -f test/confdump ${LDCMD:-clang} -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -L. \ -o test/confdump \ test/confdump-bin-confdump.o \ -lcrypto -ldl -pthread rm -f test/constant_time_test ${LDCMD:-clang} -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -L. \ -o test/constant_time_test \ test/constant_time_test-bin-constant_time_test.o \ test/libtestutil.a -lcrypto -ldl -pthread rm -f test/context_internal_test ${LDCMD:-clang} -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations \ -o test/context_internal_test \ test/context_internal_test-bin-context_internal_test.o \ test/libtestutil.a libcrypto.a -ldl -pthread rm -f test/crltest ${LDCMD:-clang} -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -L. \ -o test/crltest \ test/crltest-bin-crltest.o \ test/libtestutil.a -lcrypto -ldl -pthread rm -f test/ct_test ${LDCMD:-clang} -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -L. \ -o test/ct_test \ test/ct_test-bin-ct_test.o \ test/libtestutil.a -lcrypto -ldl -pthread rm -f test/ctype_internal_test ${LDCMD:-clang} -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations \ -o test/ctype_internal_test \ test/ctype_internal_test-bin-ctype_internal_test.o \ test/libtestutil.a libcrypto.a -ldl -pthread rm -f test/curve448_internal_test ${LDCMD:-clang} -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations \ -o test/curve448_internal_test \ test/curve448_internal_test-bin-curve448_internal_test.o \ test/libtestutil.a libcrypto.a -ldl -pthread rm -f test/d2i_test ${LDCMD:-clang} -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -L. \ -o test/d2i_test \ test/d2i_test-bin-d2i_test.o \ test/libtestutil.a -lcrypto -ldl -pthread rm -f test/destest ${LDCMD:-clang} -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations \ -o test/destest \ test/destest-bin-destest.o \ test/libtestutil.a libcrypto.a -ldl -pthread rm -f test/dhtest ${LDCMD:-clang} -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations \ -o test/dhtest \ test/dhtest-bin-dhtest.o \ test/libtestutil.a libcrypto.a -ldl -pthread rm -f test/drbg_cavs_test ${LDCMD:-clang} -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -L. \ -o test/drbg_cavs_test \ test/drbg_cavs_test-bin-drbg_cavs_data_ctr.o \ test/drbg_cavs_test-bin-drbg_cavs_data_hash.o \ test/drbg_cavs_test-bin-drbg_cavs_data_hmac.o \ test/drbg_cavs_test-bin-drbg_cavs_test.o \ test/libtestutil.a -lcrypto -ldl -pthread rm -f test/drbg_extra_test ${LDCMD:-clang} -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations -L. \ -o test/drbg_extra_test \ test/drbg_extra_test-bin-drbg_extra_test.o \ test/libtestutil.a -lcrypto -ldl -pthread rm -f test/drbgtest ${LDCMD:-clang} -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations \ -o test/drbgtest \ test/drbgtest-bin-drbgtest.o \ test/libtestutil.a libcrypto.a -ldl -pthread rm -f test/dsa_no_digest_size_test /usr/bin/ld: final link failed: No space left on device clang: error: linker command failed with exit code 1 (use -v to see invocation) Makefile:24605: recipe for target 'test/dhtest' failed make[1]: *** [test/dhtest] Error 1 make[1]: *** Waiting for unfinished jobs.... ${LDCMD:-clang} -pthread -m64 -Wa,--noexecstack -Qunused-arguments -Wall -O0 -g -DDEBUG_UNUSED -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wswitch -Wsign-compare -Wshadow -Wformat -Wtype-limits -Wundef -Werror -Wmissing-prototypes -Wstrict-prototypes -Wno-unknown-warning-option -Wswitch-default -Wno-parentheses-equality -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations \ -o test/dsa_no_digest_size_test \ test/dsa_no_digest_size_test-bin-dsa_no_digest_size_test.o \ test/libtestutil.a libcrypto.a -ldl -pthread /usr/bin/ld: final link failed: No space left on device clang: error: linker command failed with exit code 1 (use -v to see invocation) Makefile:24591: recipe for target 'test/destest' failed make[1]: *** [test/destest] Error 1 /usr/bin/ld: final link failed: No space left on device /usr/bin/ld: final link failed: No space left on device clang: error: linker command failed with exit code 1 (use -v to see invocation) clang: error: linker command failed with exit code 1 (use -v to see invocation) Makefile:24694: recipe for target 'test/dsa_no_digest_size_test' failed make[1]: *** [test/dsa_no_digest_size_test] Error 1 Makefile:24679: recipe for target 'test/drbgtest' failed make[1]: *** [test/drbgtest] Error 1 make[1]: Leaving directory '/home/openssl/run-checker/default' Makefile:2941: recipe for target 'build_sw' failed make: *** [build_sw] Error 2 From builds at travis-ci.org Wed Mar 11 22:21:38 2020 From: builds at travis-ci.org (Travis CI) Date: Wed, 11 Mar 2020 22:21:38 +0000 Subject: Still Failing: openssl/openssl#33053 (master - a173cc9) In-Reply-To: Message-ID: <5e69647275ea_43fd4c2e93140198394@b78858bf-57e8-44c1-8f29-475f5a404435.mail> Build Update for openssl/openssl ------------------------------------- Build: #33053 Status: Still Failing Duration: 1 hr, 3 mins, and 51 secs Commit: a173cc9 (master) Author: Shane Lontis Message: Add EC key validation to default provider Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/10861) View the changeset: https://github.com/openssl/openssl/compare/0e6f62e3e1c4...a173cc9c388c View the full build log and details: https://travis-ci.org/github/openssl/openssl/builds/661270334?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the openssl/openssl repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=5849220&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Thu Mar 12 00:03:28 2020 From: no-reply at appveyor.com (AppVeyor) Date: Thu, 12 Mar 2020 00:03:28 +0000 Subject: Build failed: openssl master.32484 Message-ID: <20200312000328.1.F728B734D7C65DA7@appveyor.com> An HTML attachment was scrubbed... URL: From pauli at openssl.org Thu Mar 12 03:09:14 2020 From: pauli at openssl.org (Dr. Paul Dale) Date: Thu, 12 Mar 2020 03:09:14 +0000 Subject: [openssl] OpenSSL_1_1_1-stable update Message-ID: <1583982554.994977.10133.nullmailer@dev.openssl.org> The branch OpenSSL_1_1_1-stable has been updated via b69c7d352fad9f1b83eb6d86869f22885e1d6790 (commit) from 2cb5e08c2cc5217e41b0b22432293b72dcb234b9 (commit) - Log ----------------------------------------------------------------- commit b69c7d352fad9f1b83eb6d86869f22885e1d6790 Author: Dr. Matthias St. Pierre Date: Mon Mar 2 00:25:29 2020 +0100 doc: document that 'openssl rand' is cryptographically secure (cherry picked from commit 88398d2a358f) Additionally, remove an outdated paragraph mentioning the .rnd file, which is obsolete in 1.1.1 since the RANDFILE entry was removed from openssl.cnf in commit 1fd6afb571e8. Also borrow some text from 'openssl(1)/Random State Options' on master (commit a397aca43598) to emphasize that it is not necessary anymore to restore and save the RNG state using the '-rand' and '-writerand' options. Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/11251) ----------------------------------------------------------------------- Summary of changes: doc/man1/rand.pod | 35 +++++++++++++++++++++++++++-------- doc/man3/RAND_bytes.pod | 24 ++++++++++++++++++------ 2 files changed, 45 insertions(+), 14 deletions(-) diff --git a/doc/man1/rand.pod b/doc/man1/rand.pod index 5dd9e8e0a5..6b6c285248 100644 --- a/doc/man1/rand.pod +++ b/doc/man1/rand.pod @@ -18,12 +18,14 @@ I =head1 DESCRIPTION -The B command outputs I pseudo-random bytes after seeding -the random number generator once. As in other B command -line tools, PRNG seeding uses the file I<$HOME/>B<.rnd> or B<.rnd> -in addition to the files given in the B<-rand> option. A new -I<$HOME>/B<.rnd> or B<.rnd> file will be written back if enough -seeding was obtained from these sources. +This command generates I random bytes using a cryptographically +secure pseudo random number generator (CSPRNG). + +The random bytes are generated using the L function, +which provides a security level of 256 bits, provided it managed to +seed itself successfully from a trusted operating system entropy source. +Otherwise, the command will fail with a nonzero error code. +For more details, see L, L, and L. =head1 OPTIONS @@ -44,6 +46,8 @@ generator. Multiple files can be specified separated by an OS-dependent character. The separator is B<;> for MS-Windows, B<,> for OpenVMS, and B<:> for all others. +Explicitly specifying a seed file is in general not necessary, see the +L section for more information. =item [B<-writerand file>] @@ -60,13 +64,28 @@ Show the output as a hex string. =back +=head1 NOTES + +Prior to OpenSSL 1.1.1, it was common for applications to store information +about the state of the random-number generator in a file that was loaded +at startup and rewritten upon exit. On modern operating systems, this is +generally no longer necessary as OpenSSL will seed itself from a trusted +entropy source provided by the operating system. The B<-rand> and +B<-writerand> flags are still supported for special platforms or +circumstances that might require them. + +It is generally an error to use the same seed file more than once and +every use of B<-rand> should be paired with B<-writerand>. + =head1 SEE ALSO -L +L, +L, +L =head1 COPYRIGHT -Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/doc/man3/RAND_bytes.pod b/doc/man3/RAND_bytes.pod index e2265d170a..63a2845205 100644 --- a/doc/man3/RAND_bytes.pod +++ b/doc/man3/RAND_bytes.pod @@ -19,8 +19,8 @@ Deprecated: =head1 DESCRIPTION -RAND_bytes() puts B cryptographically strong pseudo-random bytes -into B. +RAND_bytes() generates B random bytes using a cryptographically +secure pseudo random generator (CSPRNG) and stores them in B. RAND_priv_bytes() has the same semantics as RAND_bytes(). It is intended to be used for generating values that should remain private. If using the @@ -31,10 +31,22 @@ and L. =head1 NOTES -Always check the error return value of RAND_bytes() and -RAND_priv_bytes() and do not take randomness for granted: an error occurs -if the CSPRNG has not been seeded with enough randomness to ensure an -unpredictable byte sequence. +By default, the OpenSSL CSPRNG supports a security level of 256 bits, provided it +was able to seed itself from a trusted entropy source. +On all major platforms supported by OpenSSL (including the Unix-like platforms +and Windows), OpenSSL is configured to automatically seed the CSPRNG on first use +using the operating systems's random generator. + +If the entropy source fails or is not available, the CSPRNG will enter an +error state and refuse to generate random bytes. For that reason, it is important +to always check the error return value of RAND_bytes() and RAND_priv_bytes() and +not take randomness for granted. + +On other platforms, there might not be a trusted entropy source available +or OpenSSL might have been explicitly configured to use different entropy sources. +If you are in doubt about the quality of the entropy source, don't hesitate to ask +your operating system vendor or post a question on GitHub or the openssl-users +mailing list. =head1 RETURN VALUES From shane.lontis at oracle.com Thu Mar 12 06:26:45 2020 From: shane.lontis at oracle.com (shane.lontis at oracle.com) Date: Thu, 12 Mar 2020 06:26:45 +0000 Subject: [openssl] master update Message-ID: <1583994405.355689.15799.nullmailer@dev.openssl.org> The branch master has been updated via 1c725f463edf0a5b33a2a93e9a43a9ab682af7db (commit) from a173cc9c388cbe8105f78ba5a8fdfbf20a35be1a (commit) - Log ----------------------------------------------------------------- commit 1c725f463edf0a5b33a2a93e9a43a9ab682af7db Author: Shane Lontis Date: Thu Feb 20 16:16:21 2020 +1000 Add ECDH to fips provider Note: This PR has not attempted to move the curves into the provider dispatch table. Mappings between the curve name / nid have been added to the inbuilt curve table. Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/11133) ----------------------------------------------------------------------- Summary of changes: crypto/ec/ec_curve.c | 228 ++++++++++++++----------- crypto/ec/ec_key.c | 5 + crypto/ec/ec_lib.c | 5 - include/crypto/ec.h | 2 + providers/fips/fipsprov.c | 6 + providers/implementations/exchange/build.info | 3 +- providers/implementations/exchange/ecdh_exch.c | 7 + providers/implementations/keymgmt/ec_kmgmt.c | 19 ++- test/recipes/30-test_evp.t | 4 +- 9 files changed, 163 insertions(+), 116 deletions(-) diff --git a/crypto/ec/ec_curve.c b/crypto/ec/ec_curve.c index 5951615ec2..c558ab983e 100644 --- a/crypto/ec/ec_curve.c +++ b/crypto/ec/ec_curve.c @@ -20,6 +20,7 @@ #include #include #include "internal/nelem.h" +#include "e_os.h" /* strcasecmp required by windows */ typedef struct { int field_type, /* either NID_X9_62_prime_field or @@ -2816,6 +2817,7 @@ static const struct { #endif /* OPENSSL_NO_SM2 */ typedef struct _ec_list_element_st { + const char *name; int nid; const EC_CURVE_DATA *data; const EC_METHOD *(*meth) (void); @@ -2826,15 +2828,15 @@ typedef struct _ec_list_element_st { static const ec_list_element curve_list[] = { /* prime field curves */ /* secg curves */ -# ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 - {NID_secp224r1, &_EC_NIST_PRIME_224.h, EC_GFp_nistp224_method, - "NIST/SECG curve over a 224 bit prime field"}, + {"secp224r1", NID_secp224r1, &_EC_NIST_PRIME_224.h, +# if !defined(OPENSSL_NO_EC_NISTP_64_GCC_128) + EC_GFp_nistp224_method, # else - {NID_secp224r1, &_EC_NIST_PRIME_224.h, 0, - "NIST/SECG curve over a 224 bit prime field"}, + 0, # endif + "NIST/SECG curve over a 224 bit prime field"}, /* SECG secp256r1 is the same as X9.62 prime256v1 and hence omitted */ - {NID_secp384r1, &_EC_NIST_PRIME_384.h, + {"secp384r1", NID_secp384r1, &_EC_NIST_PRIME_384.h, # if defined(S390X_EC_ASM) EC_GFp_s390x_nistp384_method, # else @@ -2842,7 +2844,7 @@ static const ec_list_element curve_list[] = { # endif "NIST/SECG curve over a 384 bit prime field"}, - {NID_secp521r1, &_EC_NIST_PRIME_521.h, + {"secp521r1", NID_secp521r1, &_EC_NIST_PRIME_521.h, # if defined(S390X_EC_ASM) EC_GFp_s390x_nistp521_method, # elif !defined(OPENSSL_NO_EC_NISTP_64_GCC_128) @@ -2853,9 +2855,9 @@ static const ec_list_element curve_list[] = { "NIST/SECG curve over a 521 bit prime field"}, /* X9.62 curves */ - {NID_X9_62_prime192v1, &_EC_NIST_PRIME_192.h, 0, + {"prime192v1", NID_X9_62_prime192v1, &_EC_NIST_PRIME_192.h, 0, "NIST/X9.62/SECG curve over a 192 bit prime field"}, - {NID_X9_62_prime256v1, &_EC_X9_62_PRIME_256V1.h, + {"prime256v1", NID_X9_62_prime256v1, &_EC_X9_62_PRIME_256V1.h, # if defined(ECP_NISTZ256_ASM) EC_GFp_nistz256_method, # elif defined(S390X_EC_ASM) @@ -2870,25 +2872,25 @@ static const ec_list_element curve_list[] = { # ifndef OPENSSL_NO_EC2M /* characteristic two field curves */ /* NIST/SECG curves */ - {NID_sect163k1, &_EC_NIST_CHAR2_163K.h, 0, + {"sect163k1", NID_sect163k1, &_EC_NIST_CHAR2_163K.h, 0, "NIST/SECG/WTLS curve over a 163 bit binary field"}, - {NID_sect163r2, &_EC_NIST_CHAR2_163B.h, 0, + {"sect163r2", NID_sect163r2, &_EC_NIST_CHAR2_163B.h, 0, "NIST/SECG curve over a 163 bit binary field"}, - {NID_sect233k1, &_EC_NIST_CHAR2_233K.h, 0, + {"sect233k1", NID_sect233k1, &_EC_NIST_CHAR2_233K.h, 0, "NIST/SECG/WTLS curve over a 233 bit binary field"}, - {NID_sect233r1, &_EC_NIST_CHAR2_233B.h, 0, + {"sect233r1", NID_sect233r1, &_EC_NIST_CHAR2_233B.h, 0, "NIST/SECG/WTLS curve over a 233 bit binary field"}, - {NID_sect283k1, &_EC_NIST_CHAR2_283K.h, 0, + {"sect283k1", NID_sect283k1, &_EC_NIST_CHAR2_283K.h, 0, "NIST/SECG curve over a 283 bit binary field"}, - {NID_sect283r1, &_EC_NIST_CHAR2_283B.h, 0, + {"sect283r1", NID_sect283r1, &_EC_NIST_CHAR2_283B.h, 0, "NIST/SECG curve over a 283 bit binary field"}, - {NID_sect409k1, &_EC_NIST_CHAR2_409K.h, 0, + {"sect409k1", NID_sect409k1, &_EC_NIST_CHAR2_409K.h, 0, "NIST/SECG curve over a 409 bit binary field"}, - {NID_sect409r1, &_EC_NIST_CHAR2_409B.h, 0, + {"sect409r1", NID_sect409r1, &_EC_NIST_CHAR2_409B.h, 0, "NIST/SECG curve over a 409 bit binary field"}, - {NID_sect571k1, &_EC_NIST_CHAR2_571K.h, 0, + {"sect571k1", NID_sect571k1, &_EC_NIST_CHAR2_571K.h, 0, "NIST/SECG curve over a 571 bit binary field"}, - {NID_sect571r1, &_EC_NIST_CHAR2_571B.h, 0, + {"sect571r1", NID_sect571r1, &_EC_NIST_CHAR2_571B.h, 0, "NIST/SECG curve over a 571 bit binary field"}, # endif }; @@ -2898,43 +2900,43 @@ static const ec_list_element curve_list[] = { static const ec_list_element curve_list[] = { /* prime field curves */ /* secg curves */ - {NID_secp112r1, &_EC_SECG_PRIME_112R1.h, 0, + {"secp112r1", NID_secp112r1, &_EC_SECG_PRIME_112R1.h, 0, "SECG/WTLS curve over a 112 bit prime field"}, - {NID_secp112r2, &_EC_SECG_PRIME_112R2.h, 0, + {"secp112r2", NID_secp112r2, &_EC_SECG_PRIME_112R2.h, 0, "SECG curve over a 112 bit prime field"}, - {NID_secp128r1, &_EC_SECG_PRIME_128R1.h, 0, + {"secp128r1", NID_secp128r1, &_EC_SECG_PRIME_128R1.h, 0, "SECG curve over a 128 bit prime field"}, - {NID_secp128r2, &_EC_SECG_PRIME_128R2.h, 0, + {"secp128r2", NID_secp128r2, &_EC_SECG_PRIME_128R2.h, 0, "SECG curve over a 128 bit prime field"}, - {NID_secp160k1, &_EC_SECG_PRIME_160K1.h, 0, + {"secp160k1", NID_secp160k1, &_EC_SECG_PRIME_160K1.h, 0, "SECG curve over a 160 bit prime field"}, - {NID_secp160r1, &_EC_SECG_PRIME_160R1.h, 0, + {"secp160r1", NID_secp160r1, &_EC_SECG_PRIME_160R1.h, 0, "SECG curve over a 160 bit prime field"}, - {NID_secp160r2, &_EC_SECG_PRIME_160R2.h, 0, + {"secp160r2", NID_secp160r2, &_EC_SECG_PRIME_160R2.h, 0, "SECG/WTLS curve over a 160 bit prime field"}, /* SECG secp192r1 is the same as X9.62 prime192v1 and hence omitted */ - {NID_secp192k1, &_EC_SECG_PRIME_192K1.h, 0, + {"secp192k1", NID_secp192k1, &_EC_SECG_PRIME_192K1.h, 0, "SECG curve over a 192 bit prime field"}, - {NID_secp224k1, &_EC_SECG_PRIME_224K1.h, 0, + {"secp224k1", NID_secp224k1, &_EC_SECG_PRIME_224K1.h, 0, "SECG curve over a 224 bit prime field"}, # ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 - {NID_secp224r1, &_EC_NIST_PRIME_224.h, EC_GFp_nistp224_method, + {"secp224r1", NID_secp224r1, &_EC_NIST_PRIME_224.h, EC_GFp_nistp224_method, "NIST/SECG curve over a 224 bit prime field"}, # else - {NID_secp224r1, &_EC_NIST_PRIME_224.h, 0, + {"secp224r1", NID_secp224r1, &_EC_NIST_PRIME_224.h, 0, "NIST/SECG curve over a 224 bit prime field"}, # endif - {NID_secp256k1, &_EC_SECG_PRIME_256K1.h, 0, + {"secp256k1", NID_secp256k1, &_EC_SECG_PRIME_256K1.h, 0, "SECG curve over a 256 bit prime field"}, /* SECG secp256r1 is the same as X9.62 prime256v1 and hence omitted */ - {NID_secp384r1, &_EC_NIST_PRIME_384.h, + {"secp384r1", NID_secp384r1, &_EC_NIST_PRIME_384.h, # if defined(S390X_EC_ASM) EC_GFp_s390x_nistp384_method, # else 0, # endif "NIST/SECG curve over a 384 bit prime field"}, - {NID_secp521r1, &_EC_NIST_PRIME_521.h, + {"secp521r1", NID_secp521r1, &_EC_NIST_PRIME_521.h, # if defined(S390X_EC_ASM) EC_GFp_s390x_nistp521_method, # elif !defined(OPENSSL_NO_EC_NISTP_64_GCC_128) @@ -2944,19 +2946,19 @@ static const ec_list_element curve_list[] = { # endif "NIST/SECG curve over a 521 bit prime field"}, /* X9.62 curves */ - {NID_X9_62_prime192v1, &_EC_NIST_PRIME_192.h, 0, + {"prime192v1", NID_X9_62_prime192v1, &_EC_NIST_PRIME_192.h, 0, "NIST/X9.62/SECG curve over a 192 bit prime field"}, - {NID_X9_62_prime192v2, &_EC_X9_62_PRIME_192V2.h, 0, + {"prime192v2", NID_X9_62_prime192v2, &_EC_X9_62_PRIME_192V2.h, 0, "X9.62 curve over a 192 bit prime field"}, - {NID_X9_62_prime192v3, &_EC_X9_62_PRIME_192V3.h, 0, + {"prime192v3", NID_X9_62_prime192v3, &_EC_X9_62_PRIME_192V3.h, 0, "X9.62 curve over a 192 bit prime field"}, - {NID_X9_62_prime239v1, &_EC_X9_62_PRIME_239V1.h, 0, + {"prime239v1", NID_X9_62_prime239v1, &_EC_X9_62_PRIME_239V1.h, 0, "X9.62 curve over a 239 bit prime field"}, - {NID_X9_62_prime239v2, &_EC_X9_62_PRIME_239V2.h, 0, + {"prime239v2", NID_X9_62_prime239v2, &_EC_X9_62_PRIME_239V2.h, 0, "X9.62 curve over a 239 bit prime field"}, - {NID_X9_62_prime239v3, &_EC_X9_62_PRIME_239V3.h, 0, + {"prime239v3", NID_X9_62_prime239v3, &_EC_X9_62_PRIME_239V3.h, 0, "X9.62 curve over a 239 bit prime field"}, - {NID_X9_62_prime256v1, &_EC_X9_62_PRIME_256V1.h, + {"prime256v1", NID_X9_62_prime256v1, &_EC_X9_62_PRIME_256V1.h, # if defined(ECP_NISTZ256_ASM) EC_GFp_nistz256_method, # elif defined(S390X_EC_ASM) @@ -2970,144 +2972,144 @@ static const ec_list_element curve_list[] = { # ifndef OPENSSL_NO_EC2M /* characteristic two field curves */ /* NIST/SECG curves */ - {NID_sect113r1, &_EC_SECG_CHAR2_113R1.h, 0, + {"sect113r1", NID_sect113r1, &_EC_SECG_CHAR2_113R1.h, 0, "SECG curve over a 113 bit binary field"}, - {NID_sect113r2, &_EC_SECG_CHAR2_113R2.h, 0, + {"sect113r2", NID_sect113r2, &_EC_SECG_CHAR2_113R2.h, 0, "SECG curve over a 113 bit binary field"}, - {NID_sect131r1, &_EC_SECG_CHAR2_131R1.h, 0, + { "sect131r1", NID_sect131r1, &_EC_SECG_CHAR2_131R1.h, 0, "SECG/WTLS curve over a 131 bit binary field"}, - {NID_sect131r2, &_EC_SECG_CHAR2_131R2.h, 0, + { "sect131r2", NID_sect131r2, &_EC_SECG_CHAR2_131R2.h, 0, "SECG curve over a 131 bit binary field"}, - {NID_sect163k1, &_EC_NIST_CHAR2_163K.h, 0, + {"sect163k1", NID_sect163k1, &_EC_NIST_CHAR2_163K.h, 0, "NIST/SECG/WTLS curve over a 163 bit binary field"}, - {NID_sect163r1, &_EC_SECG_CHAR2_163R1.h, 0, + {"sect163r1", NID_sect163r1, &_EC_SECG_CHAR2_163R1.h, 0, "SECG curve over a 163 bit binary field"}, - {NID_sect163r2, &_EC_NIST_CHAR2_163B.h, 0, + {"sect163r2", NID_sect163r2, &_EC_NIST_CHAR2_163B.h, 0, "NIST/SECG curve over a 163 bit binary field"}, - {NID_sect193r1, &_EC_SECG_CHAR2_193R1.h, 0, + {"sect193r1", NID_sect193r1, &_EC_SECG_CHAR2_193R1.h, 0, "SECG curve over a 193 bit binary field"}, - {NID_sect193r2, &_EC_SECG_CHAR2_193R2.h, 0, + {"sect193r2", NID_sect193r2, &_EC_SECG_CHAR2_193R2.h, 0, "SECG curve over a 193 bit binary field"}, - {NID_sect233k1, &_EC_NIST_CHAR2_233K.h, 0, + {"sect233k1", NID_sect233k1, &_EC_NIST_CHAR2_233K.h, 0, "NIST/SECG/WTLS curve over a 233 bit binary field"}, - {NID_sect233r1, &_EC_NIST_CHAR2_233B.h, 0, + {"sect233r1", NID_sect233r1, &_EC_NIST_CHAR2_233B.h, 0, "NIST/SECG/WTLS curve over a 233 bit binary field"}, - {NID_sect239k1, &_EC_SECG_CHAR2_239K1.h, 0, + {"sect239k1", NID_sect239k1, &_EC_SECG_CHAR2_239K1.h, 0, "SECG curve over a 239 bit binary field"}, - {NID_sect283k1, &_EC_NIST_CHAR2_283K.h, 0, + {"sect283k1", NID_sect283k1, &_EC_NIST_CHAR2_283K.h, 0, "NIST/SECG curve over a 283 bit binary field"}, - {NID_sect283r1, &_EC_NIST_CHAR2_283B.h, 0, + {"sect283r1", NID_sect283r1, &_EC_NIST_CHAR2_283B.h, 0, "NIST/SECG curve over a 283 bit binary field"}, - {NID_sect409k1, &_EC_NIST_CHAR2_409K.h, 0, + {"sect409k1", NID_sect409k1, &_EC_NIST_CHAR2_409K.h, 0, "NIST/SECG curve over a 409 bit binary field"}, - {NID_sect409r1, &_EC_NIST_CHAR2_409B.h, 0, + {"sect409r1", NID_sect409r1, &_EC_NIST_CHAR2_409B.h, 0, "NIST/SECG curve over a 409 bit binary field"}, - {NID_sect571k1, &_EC_NIST_CHAR2_571K.h, 0, + {"sect571k1", NID_sect571k1, &_EC_NIST_CHAR2_571K.h, 0, "NIST/SECG curve over a 571 bit binary field"}, - {NID_sect571r1, &_EC_NIST_CHAR2_571B.h, 0, + {"sect571r1", NID_sect571r1, &_EC_NIST_CHAR2_571B.h, 0, "NIST/SECG curve over a 571 bit binary field"}, /* X9.62 curves */ - {NID_X9_62_c2pnb163v1, &_EC_X9_62_CHAR2_163V1.h, 0, + {"c2pnb163v1", NID_X9_62_c2pnb163v1, &_EC_X9_62_CHAR2_163V1.h, 0, "X9.62 curve over a 163 bit binary field"}, - {NID_X9_62_c2pnb163v2, &_EC_X9_62_CHAR2_163V2.h, 0, + {"c2pnb163v2", NID_X9_62_c2pnb163v2, &_EC_X9_62_CHAR2_163V2.h, 0, "X9.62 curve over a 163 bit binary field"}, - {NID_X9_62_c2pnb163v3, &_EC_X9_62_CHAR2_163V3.h, 0, + {"c2pnb163v3", NID_X9_62_c2pnb163v3, &_EC_X9_62_CHAR2_163V3.h, 0, "X9.62 curve over a 163 bit binary field"}, - {NID_X9_62_c2pnb176v1, &_EC_X9_62_CHAR2_176V1.h, 0, + {"c2pnb176v1", NID_X9_62_c2pnb176v1, &_EC_X9_62_CHAR2_176V1.h, 0, "X9.62 curve over a 176 bit binary field"}, - {NID_X9_62_c2tnb191v1, &_EC_X9_62_CHAR2_191V1.h, 0, + {"c2tnb191v1", NID_X9_62_c2tnb191v1, &_EC_X9_62_CHAR2_191V1.h, 0, "X9.62 curve over a 191 bit binary field"}, - {NID_X9_62_c2tnb191v2, &_EC_X9_62_CHAR2_191V2.h, 0, + {"c2tnb191v2", NID_X9_62_c2tnb191v2, &_EC_X9_62_CHAR2_191V2.h, 0, "X9.62 curve over a 191 bit binary field"}, - {NID_X9_62_c2tnb191v3, &_EC_X9_62_CHAR2_191V3.h, 0, + {"c2tnb191v3", NID_X9_62_c2tnb191v3, &_EC_X9_62_CHAR2_191V3.h, 0, "X9.62 curve over a 191 bit binary field"}, - {NID_X9_62_c2pnb208w1, &_EC_X9_62_CHAR2_208W1.h, 0, + {"c2pnb208w1", NID_X9_62_c2pnb208w1, &_EC_X9_62_CHAR2_208W1.h, 0, "X9.62 curve over a 208 bit binary field"}, - {NID_X9_62_c2tnb239v1, &_EC_X9_62_CHAR2_239V1.h, 0, + {"c2tnb239v1", NID_X9_62_c2tnb239v1, &_EC_X9_62_CHAR2_239V1.h, 0, "X9.62 curve over a 239 bit binary field"}, - {NID_X9_62_c2tnb239v2, &_EC_X9_62_CHAR2_239V2.h, 0, + {"c2tnb239v2", NID_X9_62_c2tnb239v2, &_EC_X9_62_CHAR2_239V2.h, 0, "X9.62 curve over a 239 bit binary field"}, - {NID_X9_62_c2tnb239v3, &_EC_X9_62_CHAR2_239V3.h, 0, + {"c2tnb239v3", NID_X9_62_c2tnb239v3, &_EC_X9_62_CHAR2_239V3.h, 0, "X9.62 curve over a 239 bit binary field"}, - {NID_X9_62_c2pnb272w1, &_EC_X9_62_CHAR2_272W1.h, 0, + {"c2pnb272w1", NID_X9_62_c2pnb272w1, &_EC_X9_62_CHAR2_272W1.h, 0, "X9.62 curve over a 272 bit binary field"}, - {NID_X9_62_c2pnb304w1, &_EC_X9_62_CHAR2_304W1.h, 0, + {"c2pnb304w1", NID_X9_62_c2pnb304w1, &_EC_X9_62_CHAR2_304W1.h, 0, "X9.62 curve over a 304 bit binary field"}, - {NID_X9_62_c2tnb359v1, &_EC_X9_62_CHAR2_359V1.h, 0, + {"c2tnb359v1", NID_X9_62_c2tnb359v1, &_EC_X9_62_CHAR2_359V1.h, 0, "X9.62 curve over a 359 bit binary field"}, - {NID_X9_62_c2pnb368w1, &_EC_X9_62_CHAR2_368W1.h, 0, + {"c2pnb368w1", NID_X9_62_c2pnb368w1, &_EC_X9_62_CHAR2_368W1.h, 0, "X9.62 curve over a 368 bit binary field"}, - {NID_X9_62_c2tnb431r1, &_EC_X9_62_CHAR2_431R1.h, 0, + {"c2tnb431r1", NID_X9_62_c2tnb431r1, &_EC_X9_62_CHAR2_431R1.h, 0, "X9.62 curve over a 431 bit binary field"}, /* * the WAP/WTLS curves [unlike SECG, spec has its own OIDs for curves * from X9.62] */ - {NID_wap_wsg_idm_ecid_wtls1, &_EC_WTLS_1.h, 0, + {"wap-wsg-idm-ecid-wtls1", NID_wap_wsg_idm_ecid_wtls1, &_EC_WTLS_1.h, 0, "WTLS curve over a 113 bit binary field"}, - {NID_wap_wsg_idm_ecid_wtls3, &_EC_NIST_CHAR2_163K.h, 0, + {"wap-wsg-idm-ecid-wtls3", NID_wap_wsg_idm_ecid_wtls3, &_EC_NIST_CHAR2_163K.h, 0, "NIST/SECG/WTLS curve over a 163 bit binary field"}, - {NID_wap_wsg_idm_ecid_wtls4, &_EC_SECG_CHAR2_113R1.h, 0, + {"wap-wsg-idm-ecid-wtls4", NID_wap_wsg_idm_ecid_wtls4, &_EC_SECG_CHAR2_113R1.h, 0, "SECG curve over a 113 bit binary field"}, - {NID_wap_wsg_idm_ecid_wtls5, &_EC_X9_62_CHAR2_163V1.h, 0, + {"wap-wsg-idm-ecid-wtls5", NID_wap_wsg_idm_ecid_wtls5, &_EC_X9_62_CHAR2_163V1.h, 0, "X9.62 curve over a 163 bit binary field"}, # endif - {NID_wap_wsg_idm_ecid_wtls6, &_EC_SECG_PRIME_112R1.h, 0, + {"wap-wsg-idm-ecid-wtls6", NID_wap_wsg_idm_ecid_wtls6, &_EC_SECG_PRIME_112R1.h, 0, "SECG/WTLS curve over a 112 bit prime field"}, - {NID_wap_wsg_idm_ecid_wtls7, &_EC_SECG_PRIME_160R2.h, 0, + {"wap-wsg-idm-ecid-wtls7", NID_wap_wsg_idm_ecid_wtls7, &_EC_SECG_PRIME_160R2.h, 0, "SECG/WTLS curve over a 160 bit prime field"}, - {NID_wap_wsg_idm_ecid_wtls8, &_EC_WTLS_8.h, 0, + {"wap-wsg-idm-ecid-wtls8", NID_wap_wsg_idm_ecid_wtls8, &_EC_WTLS_8.h, 0, "WTLS curve over a 112 bit prime field"}, - {NID_wap_wsg_idm_ecid_wtls9, &_EC_WTLS_9.h, 0, + {"wap-wsg-idm-ecid-wtls9", NID_wap_wsg_idm_ecid_wtls9, &_EC_WTLS_9.h, 0, "WTLS curve over a 160 bit prime field"}, # ifndef OPENSSL_NO_EC2M - {NID_wap_wsg_idm_ecid_wtls10, &_EC_NIST_CHAR2_233K.h, 0, + {"wap-wsg-idm-ecid-wtls10", NID_wap_wsg_idm_ecid_wtls10, &_EC_NIST_CHAR2_233K.h, 0, "NIST/SECG/WTLS curve over a 233 bit binary field"}, - {NID_wap_wsg_idm_ecid_wtls11, &_EC_NIST_CHAR2_233B.h, 0, + {"wap-wsg-idm-ecid-wtls11", NID_wap_wsg_idm_ecid_wtls11, &_EC_NIST_CHAR2_233B.h, 0, "NIST/SECG/WTLS curve over a 233 bit binary field"}, # endif - {NID_wap_wsg_idm_ecid_wtls12, &_EC_WTLS_12.h, 0, + {"wap-wsg-idm-ecid-wtls12", NID_wap_wsg_idm_ecid_wtls12, &_EC_WTLS_12.h, 0, "WTLS curve over a 224 bit prime field"}, # ifndef OPENSSL_NO_EC2M /* IPSec curves */ - {NID_ipsec3, &_EC_IPSEC_155_ID3.h, 0, + {"Oakley-EC2N-3", NID_ipsec3, &_EC_IPSEC_155_ID3.h, 0, "\n\tIPSec/IKE/Oakley curve #3 over a 155 bit binary field.\n" "\tNot suitable for ECDSA.\n\tQuestionable extension field!"}, - {NID_ipsec4, &_EC_IPSEC_185_ID4.h, 0, + {"Oakley-EC2N-4", NID_ipsec4, &_EC_IPSEC_185_ID4.h, 0, "\n\tIPSec/IKE/Oakley curve #4 over a 185 bit binary field.\n" "\tNot suitable for ECDSA.\n\tQuestionable extension field!"}, # endif /* brainpool curves */ - {NID_brainpoolP160r1, &_EC_brainpoolP160r1.h, 0, + {"brainpoolP160r1", NID_brainpoolP160r1, &_EC_brainpoolP160r1.h, 0, "RFC 5639 curve over a 160 bit prime field"}, - {NID_brainpoolP160t1, &_EC_brainpoolP160t1.h, 0, + {"brainpoolP160t1", NID_brainpoolP160t1, &_EC_brainpoolP160t1.h, 0, "RFC 5639 curve over a 160 bit prime field"}, - {NID_brainpoolP192r1, &_EC_brainpoolP192r1.h, 0, + {"brainpoolP192r1", NID_brainpoolP192r1, &_EC_brainpoolP192r1.h, 0, "RFC 5639 curve over a 192 bit prime field"}, - {NID_brainpoolP192t1, &_EC_brainpoolP192t1.h, 0, + {"brainpoolP192t1", NID_brainpoolP192t1, &_EC_brainpoolP192t1.h, 0, "RFC 5639 curve over a 192 bit prime field"}, - {NID_brainpoolP224r1, &_EC_brainpoolP224r1.h, 0, + {"brainpoolP224r1", NID_brainpoolP224r1, &_EC_brainpoolP224r1.h, 0, "RFC 5639 curve over a 224 bit prime field"}, - {NID_brainpoolP224t1, &_EC_brainpoolP224t1.h, 0, + {"brainpoolP224t1", NID_brainpoolP224t1, &_EC_brainpoolP224t1.h, 0, "RFC 5639 curve over a 224 bit prime field"}, - {NID_brainpoolP256r1, &_EC_brainpoolP256r1.h, 0, + {"brainpoolP256r1", NID_brainpoolP256r1, &_EC_brainpoolP256r1.h, 0, "RFC 5639 curve over a 256 bit prime field"}, - {NID_brainpoolP256t1, &_EC_brainpoolP256t1.h, 0, + {"brainpoolP256t1", NID_brainpoolP256t1, &_EC_brainpoolP256t1.h, 0, "RFC 5639 curve over a 256 bit prime field"}, - {NID_brainpoolP320r1, &_EC_brainpoolP320r1.h, 0, + {"brainpoolP320r1", NID_brainpoolP320r1, &_EC_brainpoolP320r1.h, 0, "RFC 5639 curve over a 320 bit prime field"}, - {NID_brainpoolP320t1, &_EC_brainpoolP320t1.h, 0, + {"brainpoolP320t1", NID_brainpoolP320t1, &_EC_brainpoolP320t1.h, 0, "RFC 5639 curve over a 320 bit prime field"}, - {NID_brainpoolP384r1, &_EC_brainpoolP384r1.h, 0, + {"brainpoolP384r1", NID_brainpoolP384r1, &_EC_brainpoolP384r1.h, 0, "RFC 5639 curve over a 384 bit prime field"}, - {NID_brainpoolP384t1, &_EC_brainpoolP384t1.h, 0, + {"brainpoolP384t1", NID_brainpoolP384t1, &_EC_brainpoolP384t1.h, 0, "RFC 5639 curve over a 384 bit prime field"}, - {NID_brainpoolP512r1, &_EC_brainpoolP512r1.h, 0, + {"brainpoolP512r1", NID_brainpoolP512r1, &_EC_brainpoolP512r1.h, 0, "RFC 5639 curve over a 512 bit prime field"}, - {NID_brainpoolP512t1, &_EC_brainpoolP512t1.h, 0, + {"brainpoolP512t1", NID_brainpoolP512t1, &_EC_brainpoolP512t1.h, 0, "RFC 5639 curve over a 512 bit prime field"}, # ifndef OPENSSL_NO_SM2 - {NID_sm2, &_EC_sm2p256v1.h, 0, + {"SM2", NID_sm2, &_EC_sm2p256v1.h, 0, "SM2 curve over a 256 bit prime field"}, # endif }; @@ -3115,6 +3117,28 @@ static const ec_list_element curve_list[] = { #define curve_list_length OSSL_NELEM(curve_list) +const char *ec_curve_nid2name(int nid) +{ + int i; + + for (i = 0; i < (int)curve_list_length; i++) { + if (curve_list[i].nid == nid) + return curve_list[i].name; + } + return NULL; +} + +int ec_curve_name2nid(const char *name) +{ + int i; + + for (i = 0; i < (int)curve_list_length; i++) { + if (strcasecmp(curve_list[i].name, name) == 0) + return curve_list[i].nid; + } + return NID_undef; +} + static EC_GROUP *ec_group_new_from_data(OPENSSL_CTX *libctx, const ec_list_element curve) { diff --git a/crypto/ec/ec_key.c b/crypto/ec/ec_key.c index ae3e974231..3bbf8227c6 100644 --- a/crypto/ec/ec_key.c +++ b/crypto/ec/ec_key.c @@ -627,6 +627,11 @@ int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x, } +OPENSSL_CTX *ec_key_get_libctx(const EC_KEY *key) +{ + return key->libctx; +} + const EC_GROUP *EC_KEY_get0_group(const EC_KEY *key) { return key->group; diff --git a/crypto/ec/ec_lib.c b/crypto/ec/ec_lib.c index e66a501a0e..078d8b35fa 100644 --- a/crypto/ec/ec_lib.c +++ b/crypto/ec/ec_lib.c @@ -1261,8 +1261,3 @@ int ec_point_blind_coordinates(const EC_GROUP *group, EC_POINT *p, BN_CTX *ctx) return group->meth->blind_coordinates(group, p, ctx); } - -OPENSSL_CTX *ec_key_get_libctx(const EC_KEY *eckey) -{ - return eckey->libctx; -} diff --git a/include/crypto/ec.h b/include/crypto/ec.h index 9ebf45d0f4..91540fd856 100644 --- a/include/crypto/ec.h +++ b/include/crypto/ec.h @@ -54,5 +54,7 @@ int ec_key_public_check(const EC_KEY *eckey, BN_CTX *ctx); int ec_key_private_check(const EC_KEY *eckey); int ec_key_pairwise_check(const EC_KEY *eckey, BN_CTX *ctx); OPENSSL_CTX *ec_key_get_libctx(const EC_KEY *eckey); +const char *ec_curve_nid2name(int nid); +int ec_curve_name2nid(const char *name); # endif /* OPENSSL_NO_EC */ #endif diff --git a/providers/fips/fipsprov.c b/providers/fips/fipsprov.c index 7063bf5c3f..48394b27d5 100644 --- a/providers/fips/fipsprov.c +++ b/providers/fips/fipsprov.c @@ -794,6 +794,9 @@ static const OSSL_ALGORITHM fips_kdfs[] = { static const OSSL_ALGORITHM fips_keyexch[] = { #ifndef OPENSSL_NO_DH { "DH:dhKeyAgreement", "provider=fips,fips=yes", dh_keyexch_functions }, +#endif +#ifndef OPENSSL_NO_EC + { "ECDH:id-ecPublicKey", "provider=fips,fips=yes", ecdh_keyexch_functions }, #endif { NULL, NULL, NULL } }; @@ -818,6 +821,9 @@ static const OSSL_ALGORITHM fips_keymgmt[] = { { "DSA", "provider=fips,fips=yes", dsa_keymgmt_functions }, #endif { "RSA:rsaEncryption", "provider=fips,fips=yes", rsa_keymgmt_functions }, +#ifndef OPENSSL_NO_EC + { "EC:id-ecPublicKey", "provider=fips,fips=yes", ec_keymgmt_functions }, +#endif { NULL, NULL, NULL } }; diff --git a/providers/implementations/exchange/build.info b/providers/implementations/exchange/build.info index 82b688def3..3127f9a3e7 100644 --- a/providers/implementations/exchange/build.info +++ b/providers/implementations/exchange/build.info @@ -22,5 +22,6 @@ ENDIF IF[{- !$disabled{ec} -}] SOURCE[$ECX_GOAL]=ecx_exch.c DEFINE[$ECX_GOAL]=$ECDEF - SOURCE[$ECDH_GOAL]=ecdh_exch.c + SOURCE[../../libfips.a]=ecdh_exch.c + SOURCE[../../libnonfips.a]=ecdh_exch.c ENDIF diff --git a/providers/implementations/exchange/ecdh_exch.c b/providers/implementations/exchange/ecdh_exch.c index bf353fa175..7293e0b9fe 100644 --- a/providers/implementations/exchange/ecdh_exch.c +++ b/providers/implementations/exchange/ecdh_exch.c @@ -458,6 +458,7 @@ int ecdh_plain_derive(void *vpecdhctx, unsigned char *secret, return ret; } +#ifndef FIPS_MODE static ossl_inline int ecdh_X9_63_kdf_derive(void *vpecdhctx, unsigned char *secret, size_t *psecretlen, size_t outlen) @@ -497,6 +498,7 @@ int ecdh_X9_63_kdf_derive(void *vpecdhctx, unsigned char *secret, OPENSSL_secure_clear_free(stmp, stmplen); return ret; } +#endif /* FIPS_MODE */ static int ecdh_derive(void *vpecdhctx, unsigned char *secret, @@ -507,8 +509,13 @@ int ecdh_derive(void *vpecdhctx, unsigned char *secret, switch (pecdhctx->kdf_type) { case PROV_ECDH_KDF_NONE: return ecdh_plain_derive(vpecdhctx, secret, psecretlen, outlen); +#ifndef FIPS_MODE case PROV_ECDH_KDF_X9_63: return ecdh_X9_63_kdf_derive(vpecdhctx, secret, psecretlen, outlen); + +#endif /* FIPS_MODE */ + default: + break; } return 0; diff --git a/providers/implementations/keymgmt/ec_kmgmt.c b/providers/implementations/keymgmt/ec_kmgmt.c index 2db23cd489..43ccb5d0a9 100644 --- a/providers/implementations/keymgmt/ec_kmgmt.c +++ b/providers/implementations/keymgmt/ec_kmgmt.c @@ -23,6 +23,7 @@ #include "internal/param_build.h" #include "prov/implementations.h" #include "prov/providercommon.h" +#include "prov/provider_ctx.h" static OSSL_OP_keymgmt_new_fn ec_newdata; static OSSL_OP_keymgmt_free_fn ec_freedata; @@ -81,10 +82,11 @@ int params_to_domparams(EC_KEY *ec, const OSSL_PARAM params[]) if (!OSSL_PARAM_get_utf8_string(param_ec_name, &curve_name, 0) || curve_name == NULL - || (curve_nid = OBJ_sn2nid(curve_name)) == NID_undef) + || (curve_nid = ec_curve_name2nid(curve_name)) == NID_undef) goto err; - if ((ecg = EC_GROUP_new_by_curve_name(curve_nid)) == NULL) + if ((ecg = EC_GROUP_new_by_curve_name_ex(ec_key_get_libctx(ec), + curve_nid)) == NULL) goto err; } @@ -130,7 +132,7 @@ int domparams_to_params(const EC_KEY *ec, OSSL_PARAM_BLD *tmpl) /* named curve */ const char *curve_name = NULL; - if ((curve_name = OBJ_nid2sn(curve_nid)) == NULL) + if ((curve_name = ec_curve_nid2name(curve_nid)) == NULL) return 0; if (!ossl_param_bld_push_utf8_string(tmpl, OSSL_PKEY_PARAM_EC_NAME, curve_name, 0)) @@ -152,6 +154,7 @@ static ossl_inline int params_to_key(EC_KEY *ec, const OSSL_PARAM params[], int include_private) { const OSSL_PARAM *param_priv_key, *param_pub_key; + BN_CTX *ctx = NULL; BIGNUM *priv_key = NULL; unsigned char *pub_key = NULL; size_t pub_key_len; @@ -168,6 +171,9 @@ int params_to_key(EC_KEY *ec, const OSSL_PARAM params[], int include_private) param_pub_key = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PUB_KEY); + ctx = BN_CTX_new_ex(ec_key_get_libctx(ec)); + if (ctx == NULL) + goto err; /* * We want to have at least a public key either way, so we end up * requiring it unconditionally. @@ -177,7 +183,7 @@ int params_to_key(EC_KEY *ec, const OSSL_PARAM params[], int include_private) (void **)&pub_key, 0, &pub_key_len) || (pub_point = EC_POINT_new(ecg)) == NULL || !EC_POINT_oct2point(ecg, pub_point, - pub_key, pub_key_len, NULL)) + pub_key, pub_key_len, ctx)) goto err; if (param_priv_key != NULL && include_private) { @@ -223,7 +229,7 @@ int params_to_key(EC_KEY *ec, const OSSL_PARAM params[], int include_private) fixed_top = bn_get_top(order) + 2; - if ((priv_key = BN_new()) == NULL) + if ((priv_key = BN_secure_new()) == NULL) goto err; if (bn_wexpand(priv_key, fixed_top) == NULL) goto err; @@ -243,6 +249,7 @@ int params_to_key(EC_KEY *ec, const OSSL_PARAM params[], int include_private) ok = 1; err: + BN_CTX_free(ctx); BN_clear_free(priv_key); OPENSSL_free(pub_key); EC_POINT_free(pub_point); @@ -411,7 +418,7 @@ int otherparams_to_params(const EC_KEY *ec, OSSL_PARAM_BLD *tmpl) static void *ec_newdata(void *provctx) { - return EC_KEY_new(); + return EC_KEY_new_ex(PROV_LIBRARY_CONTEXT_OF(provctx)); } static diff --git a/test/recipes/30-test_evp.t b/test/recipes/30-test_evp.t index 9b940aa5ec..7263f29290 100644 --- a/test/recipes/30-test_evp.t +++ b/test/recipes/30-test_evp.t @@ -31,9 +31,9 @@ my @configs = ( $defaultcnf ); # Only add the FIPS config if the FIPS module has been built push @configs, 'fips.cnf' unless $no_fips; -my @files = qw( evpciph.txt evpdigest.txt evppkey.txt); +my @files = qw( evpciph.txt evpdigest.txt evppkey.txt evppkey_ecc.txt); my @defltfiles = qw( evpencod.txt evpkdf.txt evppkey_kdf.txt evpmac.txt - evppbe.txt evppkey_ecc.txt evpcase.txt evpccmcavs.txt ); + evppbe.txt evpcase.txt evpccmcavs.txt ); my @ideafiles = qw( evpciph_idea.txt ); push @defltfiles, @ideafiles unless disabled("idea"); From builds at travis-ci.org Thu Mar 12 07:16:51 2020 From: builds at travis-ci.org (Travis CI) Date: Thu, 12 Mar 2020 07:16:51 +0000 Subject: Still Failing: openssl/openssl#33065 (master - 1c725f4) In-Reply-To: Message-ID: <5e69e1e2f3946_43ff707d89620873d7@933cfb5b-5a08-43fc-9002-03bdb07b3a40.mail> Build Update for openssl/openssl ------------------------------------- Build: #33065 Status: Still Failing Duration: 49 mins and 37 secs Commit: 1c725f4 (master) Author: Shane Lontis Message: Add ECDH to fips provider Note: This PR has not attempted to move the curves into the provider dispatch table. Mappings between the curve name / nid have been added to the inbuilt curve table. Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/11133) View the changeset: https://github.com/openssl/openssl/compare/a173cc9c388c...1c725f463edf View the full build log and details: https://travis-ci.org/github/openssl/openssl/builds/661398423?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the openssl/openssl repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=5849220&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From levitte at openssl.org Thu Mar 12 09:46:09 2020 From: levitte at openssl.org (Richard Levitte) Date: Thu, 12 Mar 2020 09:46:09 +0000 Subject: [openssl] master update Message-ID: <1584006369.471716.20146.nullmailer@dev.openssl.org> The branch master has been updated via f11a74ef79d3944844593d8d76d43f048bdb709d (commit) via 88af1ebb04bf9db0da9bb3949b407dc46e5d6644 (commit) via 2972af109e10c5ce30e548190e3eee28327d6043 (commit) via 6292475573367434f91f7526301388d50c6d0d67 (commit) via 1a5632e0dcc5cdc2b3440694cb50e04994bb1391 (commit) from 1c725f463edf0a5b33a2a93e9a43a9ab682af7db (commit) - Log ----------------------------------------------------------------- commit f11a74ef79d3944844593d8d76d43f048bdb709d Author: Richard Levitte Date: Tue Feb 18 15:37:08 2020 +0100 test/recipes/30-test_evp_data/evppkey.txt: Change an expected KeyGen result Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/10289) commit 88af1ebb04bf9db0da9bb3949b407dc46e5d6644 Author: Richard Levitte Date: Tue Feb 18 15:35:24 2020 +0100 test/evp_test.c: fix keygen_test_run() There was a misunderstanding what it should return. It should return 0 on internal error, but 1 even if the thing it tests fails (the error is determined by |t->err|). Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/10289) commit 2972af109e10c5ce30e548190e3eee28327d6043 Author: Richard Levitte Date: Sun Oct 27 15:28:29 2019 +0100 PROV: Add RSA functionality for key generation This includes added support in legacy controls Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/10289) commit 6292475573367434f91f7526301388d50c6d0d67 Author: Richard Levitte Date: Sun Oct 27 15:09:26 2019 +0100 EVP: Add new domparams and key generation functionality The following functions are added: EVP_PKEY_gen_set_params(), replacing the older EVP_PKEY_CTX_ctrl() EVP_PKEY_gen(), replacing both EVP_PKEY_keygen() and EVP_PKEY_paramgen() These functions are made to work together with already existing domparams and key generation functionality: EVP_PKEY_CTX_new_provided(), EVP_PKEY_paramgen_init(), EVP_PKEY_keygen_init(), etc. Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/10289) commit 1a5632e0dcc5cdc2b3440694cb50e04994bb1391 Author: Richard Levitte Date: Sat Oct 26 13:00:56 2019 +0200 CORE: Add the key object generator libcrypto<->provider interface We introduce these dispatched functions: - OP_keymgmt_gen_init() to initialize the key object generation. - OP_keymgmt_gen_set_template() to set a template for key object generation. The template is another key object, for example one with domain parameters. - OP_keymgmt_gen_set_params() to set other key object generation parameters. - OP_keymgmt_gen_settable_params() to find out what settable parameters there are. - OP_keymgmt_gen() to perform the key object generation. - OP_keymgmt_gen_cleanup() to clean up the key object generation. Internal function for easy and consistent use of these ddispatched functions are added. Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/10289) ----------------------------------------------------------------------- Summary of changes: crypto/evp/evp_local.h | 8 + crypto/evp/keymgmt_lib.c | 20 ++ crypto/evp/keymgmt_meth.c | 90 +++++++- crypto/evp/p_lib.c | 2 +- crypto/evp/pmeth_gn.c | 254 ++++++++++++++++----- crypto/evp/pmeth_lib.c | 33 ++- crypto/rsa/rsa_lib.c | 91 ++++++++ doc/man3/{EVP_PKEY_keygen.pod => EVP_PKEY_gen.pod} | 79 +++++-- doc/man7/provider-keymgmt.pod | 53 ++++- include/crypto/evp.h | 38 ++- include/openssl/core_names.h | 7 + include/openssl/core_numbers.h | 25 +- include/openssl/evp.h | 1 + include/openssl/rsa.h | 16 +- providers/implementations/keymgmt/rsa_kmgmt.c | 124 ++++++++++ test/evp_test.c | 9 +- test/recipes/30-test_evp_data/evppkey.txt | 2 +- util/libcrypto.num | 4 + 18 files changed, 734 insertions(+), 122 deletions(-) rename doc/man3/{EVP_PKEY_keygen.pod => EVP_PKEY_gen.pod} (65%) diff --git a/crypto/evp/evp_local.h b/crypto/evp/evp_local.h index 858f1c49d6..836dc33e26 100644 --- a/crypto/evp/evp_local.h +++ b/crypto/evp/evp_local.h @@ -81,6 +81,14 @@ struct evp_keymgmt_st { OSSL_OP_keymgmt_set_params_fn *set_params; OSSL_OP_keymgmt_settable_params_fn *settable_params; + /* Generation, a complex constructor */ + OSSL_OP_keymgmt_gen_init_fn *gen_init; + OSSL_OP_keymgmt_gen_set_template_fn *gen_set_template; + OSSL_OP_keymgmt_gen_set_params_fn *gen_set_params; + OSSL_OP_keymgmt_gen_settable_params_fn *gen_settable_params; + OSSL_OP_keymgmt_gen_fn *gen; + OSSL_OP_keymgmt_gen_cleanup_fn *gen_cleanup; + /* Key object checking */ OSSL_OP_keymgmt_query_operation_name_fn *query_operation_name; OSSL_OP_keymgmt_has_fn *has; diff --git a/crypto/evp/keymgmt_lib.c b/crypto/evp/keymgmt_lib.c index 68ccdbb8ee..94be3c2a9c 100644 --- a/crypto/evp/keymgmt_lib.c +++ b/crypto/evp/keymgmt_lib.c @@ -350,3 +350,23 @@ int evp_keymgmt_util_copy(EVP_PKEY *to, EVP_PKEY *from, int selection) return 1; } + +void *evp_keymgmt_util_gen(EVP_PKEY *target, EVP_KEYMGMT *keymgmt, + void *genctx, OSSL_CALLBACK *cb, void *cbarg) +{ + void *keydata = evp_keymgmt_gen(keymgmt, genctx, cb, cbarg); + + if (keydata != NULL) { + if (!EVP_KEYMGMT_up_ref(keymgmt)) { + evp_keymgmt_freedata(keymgmt, keydata); + return NULL; + } + + evp_keymgmt_util_clear_operation_cache(target); + target->keymgmt = keymgmt; + target->keydata = keydata; + evp_keymgmt_util_cache_keyinfo(target); + } + + return keydata; +} diff --git a/crypto/evp/keymgmt_meth.c b/crypto/evp/keymgmt_meth.c index f80e6e29b5..07d52ebf68 100644 --- a/crypto/evp/keymgmt_meth.c +++ b/crypto/evp/keymgmt_meth.c @@ -38,7 +38,8 @@ static void *keymgmt_from_dispatch(int name_id, OSSL_PROVIDER *prov) { EVP_KEYMGMT *keymgmt = NULL; - int setparamfncnt = 0, getparamfncnt = 0, importfncnt = 0, exportfncnt = 0; + int setparamfncnt = 0, getparamfncnt = 0, setgenparamfncnt = 0; + int importfncnt = 0, exportfncnt = 0; if ((keymgmt = keymgmt_new()) == NULL) { EVP_KEYMGMT_free(keymgmt); @@ -52,6 +53,37 @@ static void *keymgmt_from_dispatch(int name_id, if (keymgmt->new == NULL) keymgmt->new = OSSL_get_OP_keymgmt_new(fns); break; + case OSSL_FUNC_KEYMGMT_GEN_INIT: + if (keymgmt->gen_init == NULL) + keymgmt->gen_init = OSSL_get_OP_keymgmt_gen_init(fns); + break; + case OSSL_FUNC_KEYMGMT_GEN_SET_TEMPLATE: + if (keymgmt->gen_set_template == NULL) + keymgmt->gen_set_template = + OSSL_get_OP_keymgmt_gen_set_template(fns); + break; + case OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS: + if (keymgmt->gen_set_params == NULL) { + setgenparamfncnt++; + keymgmt->gen_set_params = + OSSL_get_OP_keymgmt_gen_set_params(fns); + } + break; + case OSSL_FUNC_KEYMGMT_GEN_SETTABLE_PARAMS: + if (keymgmt->gen_settable_params == NULL) { + setgenparamfncnt++; + keymgmt->gen_settable_params = + OSSL_get_OP_keymgmt_gen_settable_params(fns); + } + break; + case OSSL_FUNC_KEYMGMT_GEN: + if (keymgmt->gen == NULL) + keymgmt->gen = OSSL_get_OP_keymgmt_gen(fns); + break; + case OSSL_FUNC_KEYMGMT_GEN_CLEANUP: + if (keymgmt->gen_cleanup == NULL) + keymgmt->gen_cleanup = OSSL_get_OP_keymgmt_gen_cleanup(fns); + break; case OSSL_FUNC_KEYMGMT_FREE: if (keymgmt->free == NULL) keymgmt->free = OSSL_get_OP_keymgmt_free(fns); @@ -134,12 +166,16 @@ static void *keymgmt_from_dispatch(int name_id, * export if you can't import or export. */ if (keymgmt->free == NULL - || keymgmt->new == NULL + || (keymgmt->new == NULL && keymgmt->gen == NULL) || keymgmt->has == NULL || (getparamfncnt != 0 && getparamfncnt != 2) || (setparamfncnt != 0 && setparamfncnt != 2) + || (setgenparamfncnt != 0 && setgenparamfncnt != 2) || (importfncnt != 0 && importfncnt != 2) - || (exportfncnt != 0 && exportfncnt != 2)) { + || (exportfncnt != 0 && exportfncnt != 2) + || (keymgmt->gen != NULL + && (keymgmt->gen_init == NULL + || keymgmt->gen_cleanup == NULL))) { EVP_KEYMGMT_free(keymgmt); EVPerr(0, EVP_R_INVALID_PROVIDER_FUNCTIONS); return NULL; @@ -249,6 +285,54 @@ void evp_keymgmt_freedata(const EVP_KEYMGMT *keymgmt, void *keydata) keymgmt->free(keydata); } +void *evp_keymgmt_gen_init(const EVP_KEYMGMT *keymgmt, int selection) +{ + void *provctx = ossl_provider_ctx(EVP_KEYMGMT_provider(keymgmt)); + + if (keymgmt->gen_init == NULL) + return NULL; + return keymgmt->gen_init(provctx, selection); +} + +int evp_keymgmt_gen_set_template(const EVP_KEYMGMT *keymgmt, void *genctx, + void *template) +{ + if (keymgmt->gen_set_template == NULL) + return 0; + return keymgmt->gen_set_template(genctx, template); +} + +int evp_keymgmt_gen_set_params(const EVP_KEYMGMT *keymgmt, void *genctx, + const OSSL_PARAM params[]) +{ + if (keymgmt->gen_set_params == NULL) + return 0; + return keymgmt->gen_set_params(genctx, params); +} + +const OSSL_PARAM *evp_keymgmt_gen_settable_params(const EVP_KEYMGMT *keymgmt) +{ + void *provctx = ossl_provider_ctx(EVP_KEYMGMT_provider(keymgmt)); + + if (keymgmt->gen_settable_params == NULL) + return NULL; + return keymgmt->gen_settable_params(provctx); +} + +void *evp_keymgmt_gen(const EVP_KEYMGMT *keymgmt, void *genctx, + OSSL_CALLBACK *cb, void *cbarg) +{ + if (keymgmt->gen == NULL) + return NULL; + return keymgmt->gen(genctx, cb, cbarg); +} + +void evp_keymgmt_gen_cleanup(const EVP_KEYMGMT *keymgmt, void *genctx) +{ + if (keymgmt->gen != NULL) + keymgmt->gen_cleanup(genctx); +} + int evp_keymgmt_get_params(const EVP_KEYMGMT *keymgmt, void *keydata, OSSL_PARAM params[]) { diff --git a/crypto/evp/p_lib.c b/crypto/evp/p_lib.c index 586ffaf041..3012790cee 100644 --- a/crypto/evp/p_lib.c +++ b/crypto/evp/p_lib.c @@ -1012,7 +1012,7 @@ int EVP_PKEY_up_ref(EVP_PKEY *pkey) } #ifndef FIPS_MODE -static void evp_pkey_free_legacy(EVP_PKEY *x) +void evp_pkey_free_legacy(EVP_PKEY *x) { if (x->ameth != NULL) { if (x->ameth->pkey_free != NULL) diff --git a/crypto/evp/pmeth_gn.c b/crypto/evp/pmeth_gn.c index 84149fabd7..03f1426d85 100644 --- a/crypto/evp/pmeth_gn.c +++ b/crypto/evp/pmeth_gn.c @@ -9,7 +9,10 @@ #include #include +#include +#include #include "internal/cryptlib.h" +#include "internal/core.h" #include #include #include "crypto/bn.h" @@ -17,102 +20,225 @@ #include "crypto/evp.h" #include "evp_local.h" -#ifndef FIPS_MODE -int EVP_PKEY_paramgen_init(EVP_PKEY_CTX *ctx) +static int gen_init(EVP_PKEY_CTX *ctx, int operation) { - int ret; - if (!ctx || !ctx->pmeth || !ctx->pmeth->paramgen) { - EVPerr(EVP_F_EVP_PKEY_PARAMGEN_INIT, - EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); - return -2; + int ret = 0; + + if (ctx == NULL) + goto not_supported; + + evp_pkey_ctx_free_old_ops(ctx); + ctx->operation = operation; + + if (ctx->engine != NULL || ctx->keytype == NULL) + goto legacy; + + if (ctx->keymgmt == NULL) { + ctx->keymgmt = + EVP_KEYMGMT_fetch(ctx->libctx, ctx->keytype, ctx->propquery); + if (ctx->keymgmt == NULL + || ctx->keymgmt->gen_init == NULL) { + EVP_KEYMGMT_free(ctx->keymgmt); + ctx->keymgmt = NULL; + goto legacy; + } + } + if (ctx->keymgmt->gen_init == NULL) + goto not_supported; + + switch (operation) { + case EVP_PKEY_OP_PARAMGEN: + ctx->op.keymgmt.genctx = + evp_keymgmt_gen_init(ctx->keymgmt, + OSSL_KEYMGMT_SELECT_ALL_PARAMETERS); + break; + case EVP_PKEY_OP_KEYGEN: + ctx->op.keymgmt.genctx = + evp_keymgmt_gen_init(ctx->keymgmt, OSSL_KEYMGMT_SELECT_KEYPAIR); + break; + } + + if (ctx->op.keymgmt.genctx == NULL) + ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR); + else + ret = 1; + goto end; + + legacy: +#ifdef FIPS_MODE + goto not_supported; +#else + if (ctx->pmeth == NULL + || (operation == EVP_PKEY_OP_PARAMGEN + && ctx->pmeth->paramgen == NULL) + || (operation == EVP_PKEY_OP_KEYGEN + && ctx->pmeth->keygen == NULL)) + goto not_supported; + + ret = 1; + switch (operation) { + case EVP_PKEY_OP_PARAMGEN: + if (ctx->pmeth->paramgen_init != NULL) + ret = ctx->pmeth->paramgen_init(ctx); + break; + case EVP_PKEY_OP_KEYGEN: + if (ctx->pmeth->keygen_init != NULL) + ret = ctx->pmeth->keygen_init(ctx); + break; } - ctx->operation = EVP_PKEY_OP_PARAMGEN; - if (!ctx->pmeth->paramgen_init) - return 1; - ret = ctx->pmeth->paramgen_init(ctx); +#endif + + end: if (ret <= 0) ctx->operation = EVP_PKEY_OP_UNDEFINED; return ret; + + not_supported: + ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + ret = -2; + goto end; } -int EVP_PKEY_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey) +int EVP_PKEY_paramgen_init(EVP_PKEY_CTX *ctx) { - int ret; - if (!ctx || !ctx->pmeth || !ctx->pmeth->paramgen) { - EVPerr(EVP_F_EVP_PKEY_PARAMGEN, - EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); - return -2; - } + return gen_init(ctx, EVP_PKEY_OP_PARAMGEN); +} - if (ctx->operation != EVP_PKEY_OP_PARAMGEN) { - EVPerr(EVP_F_EVP_PKEY_PARAMGEN, EVP_R_OPERATON_NOT_INITIALIZED); - return -1; - } +int EVP_PKEY_keygen_init(EVP_PKEY_CTX *ctx) +{ + return gen_init(ctx, EVP_PKEY_OP_KEYGEN); +} + +static int ossl_callback_to_pkey_gencb(const OSSL_PARAM params[], void *arg) +{ + EVP_PKEY_CTX *ctx = arg; + const OSSL_PARAM *param = NULL; + int p = -1, n = -1; + + if (ctx->pkey_gencb == NULL) + return 1; /* No callback? That's fine */ + + if ((param = OSSL_PARAM_locate_const(params, OSSL_GEN_PARAM_POTENTIAL)) + == NULL + || !OSSL_PARAM_get_int(param, &p)) + return 0; + if ((param = OSSL_PARAM_locate_const(params, OSSL_GEN_PARAM_ITERATION)) + == NULL + || !OSSL_PARAM_get_int(param, &n)) + return 0; + + ctx->keygen_info[0] = p; + ctx->keygen_info[1] = n; + + return ctx->pkey_gencb(ctx); +} + +int EVP_PKEY_gen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey) +{ + int ret = 0; + OSSL_CALLBACK cb; + EVP_PKEY *allocated_pkey = NULL; if (ppkey == NULL) return -1; + if (ctx == NULL) + goto not_supported; + + if ((ctx->operation & EVP_PKEY_OP_TYPE_GEN) == 0) + goto not_initialized; + if (*ppkey == NULL) - *ppkey = EVP_PKEY_new(); + *ppkey = allocated_pkey = EVP_PKEY_new(); if (*ppkey == NULL) { - EVPerr(EVP_F_EVP_PKEY_PARAMGEN, ERR_R_MALLOC_FAILURE); + ERR_raise(ERR_LIB_EVP, ERR_R_MALLOC_FAILURE); return -1; } - ret = ctx->pmeth->paramgen(ctx, *ppkey); + if (ctx->keymgmt == NULL) + goto legacy; + + ret = 1; + if (ctx->pkey != NULL) { + EVP_KEYMGMT *tmp_keymgmt = ctx->keymgmt; + void *keydata = + evp_pkey_export_to_provider(ctx->pkey, ctx->libctx, + &tmp_keymgmt, ctx->propquery); + + if (keydata == NULL) + goto not_supported; + ret = evp_keymgmt_gen_set_template(ctx->keymgmt, + ctx->op.keymgmt.genctx, keydata); + } + + /* + * the returned value from evp_keymgmt_util_gen() is cached in *ppkey, + * so we so not need to save it, just check it. + */ + ret = ret + && (evp_keymgmt_util_gen(*ppkey, ctx->keymgmt, ctx->op.keymgmt.genctx, + ossl_callback_to_pkey_gencb, ctx) + != NULL); + +#ifndef FIPS_MODE + /* In case |*ppkey| was originally a legacy key */ + if (ret) + evp_pkey_free_legacy(*ppkey); +#endif + + goto end; + + legacy: +#ifdef FIPS_MODE + goto not_supported; +#else + switch (ctx->operation) { + case EVP_PKEY_OP_PARAMGEN: + ret = ctx->pmeth->paramgen(ctx, *ppkey); + break; + case EVP_PKEY_OP_KEYGEN: + ret = ctx->pmeth->keygen(ctx, *ppkey); + break; + default: + goto not_supported; + } +#endif + + end: if (ret <= 0) { - EVP_PKEY_free(*ppkey); - *ppkey = NULL; + if (allocated_pkey != NULL) + *ppkey = NULL; + EVP_PKEY_free(allocated_pkey); } return ret; + + not_supported: + ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + ret = -2; + goto end; + not_initialized: + ERR_raise(ERR_LIB_EVP, EVP_R_OPERATON_NOT_INITIALIZED); + ret = -1; + goto end; } -int EVP_PKEY_keygen_init(EVP_PKEY_CTX *ctx) +int EVP_PKEY_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey) { - int ret; - if (!ctx || !ctx->pmeth || !ctx->pmeth->keygen) { - EVPerr(EVP_F_EVP_PKEY_KEYGEN_INIT, - EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); - return -2; + if (ctx->operation != EVP_PKEY_OP_PARAMGEN) { + ERR_raise(ERR_LIB_EVP, EVP_R_OPERATON_NOT_INITIALIZED); + return -1; } - ctx->operation = EVP_PKEY_OP_KEYGEN; - if (!ctx->pmeth->keygen_init) - return 1; - ret = ctx->pmeth->keygen_init(ctx); - if (ret <= 0) - ctx->operation = EVP_PKEY_OP_UNDEFINED; - return ret; + return EVP_PKEY_gen(ctx, ppkey); } int EVP_PKEY_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey) { - int ret; - - if (!ctx || !ctx->pmeth || !ctx->pmeth->keygen) { - EVPerr(EVP_F_EVP_PKEY_KEYGEN, - EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); - return -2; - } if (ctx->operation != EVP_PKEY_OP_KEYGEN) { - EVPerr(EVP_F_EVP_PKEY_KEYGEN, EVP_R_OPERATON_NOT_INITIALIZED); + ERR_raise(ERR_LIB_EVP, EVP_R_OPERATON_NOT_INITIALIZED); return -1; } - - if (ppkey == NULL) - return -1; - - if (*ppkey == NULL) - *ppkey = EVP_PKEY_new(); - if (*ppkey == NULL) - return -1; - - ret = ctx->pmeth->keygen(ctx, *ppkey); - if (ret <= 0) { - EVP_PKEY_free(*ppkey); - *ppkey = NULL; - } - return ret; + return EVP_PKEY_gen(ctx, ppkey); } void EVP_PKEY_CTX_set_cb(EVP_PKEY_CTX *ctx, EVP_PKEY_gen_cb *cb) @@ -152,6 +278,8 @@ int EVP_PKEY_CTX_get_keygen_info(EVP_PKEY_CTX *ctx, int idx) return ctx->keygen_info[idx]; } +#ifndef FIPS_MODE + EVP_PKEY *EVP_PKEY_new_mac_key(int type, ENGINE *e, const unsigned char *key, int keylen) { diff --git a/crypto/evp/pmeth_lib.c b/crypto/evp/pmeth_lib.c index 906b08156f..a81908a962 100644 --- a/crypto/evp/pmeth_lib.c +++ b/crypto/evp/pmeth_lib.c @@ -292,6 +292,9 @@ void evp_pkey_ctx_free_old_ops(EVP_PKEY_CTX *ctx) EVP_ASYM_CIPHER_free(ctx->op.ciph.cipher); ctx->op.ciph.ciphprovctx = NULL; ctx->op.ciph.cipher = NULL; + } else if (EVP_PKEY_CTX_IS_GEN_OP(ctx)) { + if (ctx->op.keymgmt.genctx != NULL && ctx->keymgmt != NULL) + evp_keymgmt_gen_cleanup(ctx->keymgmt, ctx->op.keymgmt.genctx); } #endif } @@ -569,6 +572,12 @@ int EVP_PKEY_CTX_set_params(EVP_PKEY_CTX *ctx, OSSL_PARAM *params) && ctx->op.ciph.cipher->set_ctx_params != NULL) return ctx->op.ciph.cipher->set_ctx_params(ctx->op.ciph.ciphprovctx, params); + if (EVP_PKEY_CTX_IS_GEN_OP(ctx) + && ctx->op.keymgmt.genctx != NULL + && ctx->keymgmt != NULL + && ctx->keymgmt->gen_set_params != NULL) + return evp_keymgmt_gen_set_params(ctx->keymgmt, ctx->op.keymgmt.genctx, + params); return 0; } @@ -629,6 +638,10 @@ const OSSL_PARAM *EVP_PKEY_CTX_settable_params(EVP_PKEY_CTX *ctx) && ctx->op.ciph.cipher != NULL && ctx->op.ciph.cipher->settable_ctx_params != NULL) return ctx->op.ciph.cipher->settable_ctx_params(); + if (EVP_PKEY_CTX_IS_GEN_OP(ctx) + && ctx->keymgmt != NULL + && ctx->keymgmt->gen_settable_params != NULL) + return evp_keymgmt_gen_settable_params(ctx->keymgmt); return NULL; } @@ -859,6 +872,12 @@ static int legacy_ctrl_to_param(EVP_PKEY_CTX *ctx, int keytype, int optype, ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); return -2; + case EVP_PKEY_CTRL_RSA_KEYGEN_BITS: + return EVP_PKEY_CTX_set_rsa_keygen_bits(ctx, p1); + case EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP: + return EVP_PKEY_CTX_set_rsa_keygen_pubexp(ctx, p2); + case EVP_PKEY_CTRL_RSA_KEYGEN_PRIMES: + return EVP_PKEY_CTX_set_rsa_keygen_primes(ctx, p1); } } return 0; @@ -878,7 +897,9 @@ int EVP_PKEY_CTX_ctrl(EVP_PKEY_CTX *ctx, int keytype, int optype, || (EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx) && ctx->op.sig.sigprovctx != NULL) || (EVP_PKEY_CTX_IS_ASYM_CIPHER_OP(ctx) - && ctx->op.ciph.ciphprovctx != NULL)) + && ctx->op.ciph.ciphprovctx != NULL) + || (EVP_PKEY_CTX_IS_GEN_OP(ctx) + && ctx->op.keymgmt.genctx != NULL)) return legacy_ctrl_to_param(ctx, keytype, optype, cmd, p1, p2); if (ctx->pmeth == NULL || ctx->pmeth->ctrl == NULL) { @@ -930,6 +951,12 @@ static int legacy_ctrl_str_to_param(EVP_PKEY_CTX *ctx, const char *name, name = OSSL_ASYM_CIPHER_PARAM_OAEP_LABEL; else if (strcmp(name, "rsa_pss_saltlen") == 0) name = OSSL_SIGNATURE_PARAM_PSS_SALTLEN; + else if (strcmp(name, "rsa_keygen_bits") == 0) + name = OSSL_PKEY_PARAM_RSA_BITS; + else if (strcmp(name, "rsa_keygen_pubexp") == 0) + name = OSSL_PKEY_PARAM_RSA_E; + else if (strcmp(name, "rsa_keygen_primes") == 0) + name = OSSL_PKEY_PARAM_RSA_PRIMES; # ifndef OPENSSL_NO_DH else if (strcmp(name, "dh_pad") == 0) name = OSSL_EXCHANGE_PARAM_PAD; @@ -979,7 +1006,9 @@ int EVP_PKEY_CTX_ctrl_str(EVP_PKEY_CTX *ctx, || (EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx) && ctx->op.sig.sigprovctx != NULL) || (EVP_PKEY_CTX_IS_ASYM_CIPHER_OP(ctx) - && ctx->op.ciph.ciphprovctx != NULL)) + && ctx->op.ciph.ciphprovctx != NULL) + || (EVP_PKEY_CTX_IS_GEN_OP(ctx) + && ctx->op.keymgmt.genctx != NULL)) return legacy_ctrl_str_to_param(ctx, name, value); if (!ctx || !ctx->pmeth || !ctx->pmeth->ctrl_str) { diff --git a/crypto/rsa/rsa_lib.c b/crypto/rsa/rsa_lib.c index ada5388bb2..0a0d3e84db 100644 --- a/crypto/rsa/rsa_lib.c +++ b/crypto/rsa/rsa_lib.c @@ -20,6 +20,7 @@ #include #include "internal/cryptlib.h" #include "internal/refcount.h" +#include "internal/param_build.h" #include "crypto/bn.h" #include "crypto/evp.h" #include "crypto/rsa.h" @@ -1266,4 +1267,94 @@ int EVP_PKEY_CTX_get_rsa_pss_saltlen(EVP_PKEY_CTX *ctx, int *saltlen) return 1; } + +int EVP_PKEY_CTX_set_rsa_keygen_bits(EVP_PKEY_CTX *ctx, int bits) +{ + OSSL_PARAM params[2], *p = params; + size_t bits2 = bits; + + if (ctx == NULL || !EVP_PKEY_CTX_IS_GEN_OP(ctx)) { + ERR_raise(ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED); + /* Uses the same return values as EVP_PKEY_CTX_ctrl */ + return -2; + } + + /* If key type not RSA return error */ + if (ctx->pmeth != NULL && ctx->pmeth->pkey_id != EVP_PKEY_RSA) + return -1; + + /* TODO(3.0): Remove this eventually when no more legacy */ + if (ctx->op.keymgmt.genctx == NULL) + return EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_KEYGEN, + EVP_PKEY_CTRL_RSA_KEYGEN_BITS, bits, NULL); + + *p++ = OSSL_PARAM_construct_size_t(OSSL_PKEY_PARAM_RSA_BITS, &bits2); + *p++ = OSSL_PARAM_construct_end(); + + if (!EVP_PKEY_CTX_set_params(ctx, params)) + return 0; + + return 1; +} + +int EVP_PKEY_CTX_set_rsa_keygen_pubexp(EVP_PKEY_CTX *ctx, BIGNUM *pubexp) +{ + OSSL_PARAM_BLD tmpl; + OSSL_PARAM *params; + int ret; + + if (ctx == NULL || !EVP_PKEY_CTX_IS_GEN_OP(ctx)) { + ERR_raise(ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED); + /* Uses the same return values as EVP_PKEY_CTX_ctrl */ + return -2; + } + + /* If key type not RSA return error */ + if (ctx->pmeth != NULL && ctx->pmeth->pkey_id != EVP_PKEY_RSA) + return -1; + + /* TODO(3.0): Remove this eventually when no more legacy */ + if (ctx->op.keymgmt.genctx == NULL) + return EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_KEYGEN, + EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP, 0, pubexp); + + ossl_param_bld_init(&tmpl); + if (!ossl_param_bld_push_BN(&tmpl, OSSL_PKEY_PARAM_RSA_E, pubexp) + || (params = ossl_param_bld_to_param(&tmpl)) == NULL) + return 0; + + ret = EVP_PKEY_CTX_set_params(ctx, params); + ossl_param_bld_free(params); + return ret; +} + +int EVP_PKEY_CTX_set_rsa_keygen_primes(EVP_PKEY_CTX *ctx, int primes) +{ + OSSL_PARAM params[2], *p = params; + size_t primes2 = primes; + + if (ctx == NULL || !EVP_PKEY_CTX_IS_GEN_OP(ctx)) { + ERR_raise(ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED); + /* Uses the same return values as EVP_PKEY_CTX_ctrl */ + return -2; + } + + /* If key type not RSA return error */ + if (ctx->pmeth != NULL && ctx->pmeth->pkey_id != EVP_PKEY_RSA) + return -1; + + /* TODO(3.0): Remove this eventually when no more legacy */ + if (ctx->op.keymgmt.genctx == NULL) + return EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_KEYGEN, + EVP_PKEY_CTRL_RSA_KEYGEN_PRIMES, primes, + NULL); + + *p++ = OSSL_PARAM_construct_size_t(OSSL_PKEY_PARAM_RSA_PRIMES, &primes2); + *p++ = OSSL_PARAM_construct_end(); + + if (!EVP_PKEY_CTX_set_params(ctx, params)) + return 0; + + return 1; +} #endif diff --git a/doc/man3/EVP_PKEY_keygen.pod b/doc/man3/EVP_PKEY_gen.pod similarity index 65% rename from doc/man3/EVP_PKEY_keygen.pod rename to doc/man3/EVP_PKEY_gen.pod index e326b82ffa..212ea2a742 100644 --- a/doc/man3/EVP_PKEY_keygen.pod +++ b/doc/man3/EVP_PKEY_gen.pod @@ -2,11 +2,12 @@ =head1 NAME -EVP_PKEY_keygen_init, EVP_PKEY_keygen, EVP_PKEY_paramgen_init, -EVP_PKEY_paramgen, EVP_PKEY_CTX_set_cb, EVP_PKEY_CTX_get_cb, +EVP_PKEY_keygen_init, EVP_PKEY_paramgen_init, EVP_PKEY_gen, +EVP_PKEY_CTX_set_cb, EVP_PKEY_CTX_get_cb, EVP_PKEY_CTX_get_keygen_info, EVP_PKEY_CTX_set_app_data, EVP_PKEY_CTX_get_app_data, -EVP_PKEY_gen_cb +EVP_PKEY_gen_cb, +EVP_PKEY_paramgen, EVP_PKEY_keygen - key and parameter generation and check functions =head1 SYNOPSIS @@ -14,9 +15,10 @@ EVP_PKEY_gen_cb #include int EVP_PKEY_keygen_init(EVP_PKEY_CTX *ctx); - int EVP_PKEY_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey); int EVP_PKEY_paramgen_init(EVP_PKEY_CTX *ctx); + int EVP_PKEY_gen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey); int EVP_PKEY_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey); + int EVP_PKEY_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey); typedef int EVP_PKEY_gen_cb(EVP_PKEY_CTX *ctx); @@ -30,24 +32,51 @@ EVP_PKEY_gen_cb =head1 DESCRIPTION -The EVP_PKEY_keygen_init() function initializes a public key algorithm -context using key B for a key generation operation. +Generating keys is sometimes straight forward, just generate the key's +numbers and be done with it. However, there are certain key types that need +key parameters, often called domain parameters but not necessarily limited +to that, that also need to be generated. In addition to this, the caller +may want to set user provided generation parameters that further affect key +parameter or key generation, such as the desired key size. + +To flexibly allow all that's just been described, key parameter and key +generation is divided into an initialization of a key algorithm context, +functions to set user provided parameters, and finally the key parameter or +key generation function itself. + +The key algorithm context must be created using L or +variants thereof, see that manual for details. + +EVP_PKEY_keygen_init() initializes a public key algorithm context using key +I for a key generation operation. + +EVP_PKEY_paramgen_init() is similar to EVP_PKEY_keygen_init() except key +parameters are generated. -The EVP_PKEY_keygen() function performs a key generation operation, the -generated key is written to B. +After initialization, generation parameters may be provided with +L or L, or any other +function described in those manuals. -The functions EVP_PKEY_paramgen_init() and EVP_PKEY_paramgen() are similar -except parameters are generated. +EVP_PKEY_gen() performs the generation operation, the resulting key +parameters or key are written to I<*ppkey>. If I<*ppkey> is NULL when this +function is called, it will be allocated, and should be freed by the caller +when no longer useful, using L. + +EVP_PKEY_paramgen() and EVP_PKEY_keygen() do exactly the same thing as +EVP_PKEY_gen(), after checking that the corresponding EVP_PKEY_paramgen_init() +or EVP_PKEY_keygen_init() was used to initialize I. +These are older functions that are kept for backward compatibility. +It is safe to use EVP_PKEY_gen() instead. The function EVP_PKEY_set_cb() sets the key or parameter generation callback -to B. The function EVP_PKEY_CTX_get_cb() returns the key or parameter +to I. The function EVP_PKEY_CTX_get_cb() returns the key or parameter generation callback. The function EVP_PKEY_CTX_get_keygen_info() returns parameters associated -with the generation operation. If B is -1 the total number of +with the generation operation. If I is -1 the total number of parameters available is returned. Any non negative value returns the value of that parameter. EVP_PKEY_CTX_gen_keygen_info() with a non-negative value for -B should only be called within the generation callback. +I should only be called within the generation callback. If the callback returns 0 then the key generation operation is aborted and an error occurs. This might occur during a time consuming operation where @@ -58,6 +87,13 @@ and retrieve an opaque pointer. This can be used to set some application defined value which can be retrieved in the callback: for example a handle which is used to update a "progress dialog". +=head1 RETURN VALUES + +EVP_PKEY_keygen_init(), EVP_PKEY_paramgen_init(), EVP_PKEY_keygen() and +EVP_PKEY_paramgen() return 1 for success and 0 or a negative value for failure. +In particular a return value of -2 indicates the operation is not supported by +the public key algorithm. + =head1 NOTES After the call to EVP_PKEY_keygen_init() or EVP_PKEY_paramgen_init() algorithm @@ -82,13 +118,6 @@ public key components and parameters (if any). An OpenSSL private key is equivalent to what some libraries call a "key pair". A private key can be used in functions which require the use of a public key or parameters. -=head1 RETURN VALUES - -EVP_PKEY_keygen_init(), EVP_PKEY_paramgen_init(), EVP_PKEY_keygen() and -EVP_PKEY_paramgen() return 1 for success and 0 or a negative value for failure. -In particular a return value of -2 indicates the operation is not supported by -the public key algorithm. - =head1 EXAMPLES Generate a 2048 bit RSA key: @@ -168,11 +197,17 @@ L =head1 HISTORY -These functions were added in OpenSSL 1.0.0. +EVP_PKEY_keygen_init(), int EVP_PKEY_paramgen_init(), EVP_PKEY_keygen(), +EVP_PKEY_paramgen(), EVP_PKEY_gen_cb(), EVP_PKEY_CTX_set_cb(), +EVP_PKEY_CTX_get_cb(), EVP_PKEY_CTX_get_keygen_info(), +EVP_PKEY_CTX_set_app_data() and EVP_PKEY_CTX_get_app_data() were added in +OpenSSL 1.0.0. + +EVP_PKEY_gen() was added in OpenSSL 3.0. =head1 COPYRIGHT -Copyright 2006-2018 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved. Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/doc/man7/provider-keymgmt.pod b/doc/man7/provider-keymgmt.pod index 0a2768b5db..59e538dbac 100644 --- a/doc/man7/provider-keymgmt.pod +++ b/doc/man7/provider-keymgmt.pod @@ -18,6 +18,13 @@ provider-keymgmt - The KEYMGMT library E-E provider functions void *OP_keymgmt_new(void *provctx); void OP_keymgmt_free(void *keydata); + void *OP_keymgmt_gen_init(void *provctx, int selection); + int OP_keymgmt_gen_set_template(void *genctx, void *template); + int OP_keymgmt_gen_set_params(void *genctx, const OSSL_PARAM params[]); + const OSSL_PARAM *OP_keymgmt_gen_settable_params(void *provctx); + void *OP_keymgmt_gen(void *genctx, OSSL_CALLBACK *cb, void *cbarg); + void OP_keymgmt_gen_cleanup(void *genctx); + /* Key object information */ int OP_keymgmt_get_params(void *keydata, OSSL_PARAM params[]); const OSSL_PARAM *OP_keymgmt_gettable_params(void); @@ -80,6 +87,13 @@ macros in L, as follows: OP_keymgmt_new OSSL_FUNC_KEYMGMT_NEW OP_keymgmt_free OSSL_FUNC_KEYMGMT_FREE + OP_keymgmt_gen_init OSSL_FUNC_KEYMGMT_GEN_INIT + OP_keymgmt_gen_set_template OSSL_FUNC_KEYMGMT_GEN_SET_TEMPLATE + OP_keymgmt_gen_set_params OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS + OP_keymgmt_gen_settable_params OSSL_FUNC_KEYMGMT_GEN_SETTABLE_PARAMS + OP_keymgmt_gen OSSL_FUNC_KEYMGMT_GEN + OP_keymgmt_gen_cleanup OSSL_FUNC_KEYMGMT_GEN_CLEANUP + OP_keymgmt_get_params OSSL_FUNC_KEYMGMT_GET_PARAMS OP_keymgmt_gettable_params OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS OP_keymgmt_set_params OSSL_FUNC_KEYMGMT_SET_PARAMS @@ -193,12 +207,41 @@ key object, but that is not mandatory. OP_keymgmt_free() should free the passed I. -The constructor and destructor are mandatory, a KEYMGMT implementation -without them will not be accepted. +OP_keymgmt_gen_init(), OP_keymgmt_gen_set_template(), +OP_keymgmt_gen_set_params(), OP_keymgmt_gen_settable_params(), +OP_keymgmt_gen() and OP_keymgmt_gen_cleanup() work together as a more +elaborate context based key object constructor. + +OP_keymgmt_gen_init() should create the key object generation context +and initialize it with I, which will determine what kind +of contents the key object to be generated should get. + +OP_keymgmt_gen_set_template() should add I