summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2020-03-30Describe the "want" parameter in int create_bare_ssl_connection()Matt Caswell
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Ben Kaduk <kaduk@mit.edu> (Merged from https://github.com/openssl/openssl/pull/11406)
2020-03-30Display errors if a test TLS connection failsMatt Caswell
If a connection fails it is useful during debugging to have any errors that are on the OpenSSL error stack at the time of the failure. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Ben Kaduk <kaduk@mit.edu> (Merged from https://github.com/openssl/openssl/pull/11406)
2020-03-28Param builder: Remove the static size limit.Pauli
Prior to this, the param builder had a statically sized array internally. This changes it so that it uses a stack instead. Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> (Merged from https://github.com/openssl/openssl/pull/11390)
2020-03-28Param build: make structures opaque.Pauli
Since this is public, it is best to make the underlying structure opaque. This means converting from stack allocation to dynamic allocation for all usages. Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> (Merged from https://github.com/openssl/openssl/pull/11390)
2020-03-28NEWS: note OSSL_PARAM_BLD API as public.Pauli
Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> (Merged from https://github.com/openssl/openssl/pull/11390)
2020-03-28Param builder: make the OSSL_PARAM_BLD APIs public.Pauli
The catalyst for this is the difficult of passing BNs through the other OSSL_PARAM APIs. Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> (Merged from https://github.com/openssl/openssl/pull/11390)
2020-03-27s_server: Properly indicate ALPN protocol mismatchTomas Mraz
Return SSL_TLSEXT_ERR_ALERT_FATAL from alpn_select_cb so that an alert is sent to the client on ALPN protocol mismatch. Fixes: #2708 Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11415)
2020-03-27PROV: Fix EC_KEY exporters to allow domain parameter keysRichard Levitte
The provider key export functions for EC_KEY assumed that a public key is always present, and would fail if not. This blocks any attempt to export a key structure with only domain parameters. This is similar to earlier work done in EVP_PKEY_ASN1_METHODs. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11394)
2020-03-27Document various SRP related APIsMatt Caswell
This includes the newly added *_ex() variants that take a libctx/property query string. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11410)
2020-03-27Use the new library context aware SRP functions in sslapitestMatt Caswell
For the moment this still just uses the default library context, but a future version of sslapitest will specify a non-default library context. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11410)
2020-03-27Update libssl to use the new library context aware SRP functionsMatt Caswell
Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11410)
2020-03-27Make SRP library context awareMatt Caswell
In order for the TLS SRP tests to pass when using a non-default library context the underlying SRP calls need to be library context aware. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11410)
2020-03-27Use the new OCSP functions in sslapitest.cMatt Caswell
At the moment we just use the default libctx - but a future PR will add support for running sslapitest with a non-default libctx. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11407)
2020-03-27Add OCSP_RESPID_set_by_key_ex() and OCSP_RESPID_match_ex()Matt Caswell
OCSP_RESPID_set_by_key() calculates a SHA1 hash of the supplied certificate. We need to be able to specify which libctx and property query string is used to fetch that algorithm so we introduce OCSP_RESPID_set_by_key_ex() which does the same thing but enables you to speicfy the library context and propery query string explicitly. OCSP_RESPID_match() matches with certificates based on the SHA1 hash. Therefore for the same reason we introduce OCSP_RESPID_match_ex(). Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11407)
2020-03-27Ignore some fetch failuresMatt Caswell
Some fetch failurs are ok and should be ignored. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11405)
2020-03-27Put an error on the stack in the event of a fetch failureMatt Caswell
Fetch failures are a common problem and it is useful to have detailed information about what was requested in the event of a failure. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11405)
2020-03-26Use a fetched cipher for the TLSv1.3 early secretMatt Caswell
We should use an explicitly fetched cipher to ensure that we are using the correct libctx and property query. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/11402)
2020-03-26Use a fetched cipher when decrypting a ticket in libsslMatt Caswell
We need to make sure we are using the correct libctx and property query. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/11402)
2020-03-25EVP: Limit the diverse key parameter functions to domain params onlyRichard Levitte
Provider KEYMGMT functions can handle domain parameters as well as "other" parameters (the cofactor mode flag in ECC keys is one of those). The public EVP functions EVP_PKEY_copy_parameters(), EVP_PKEY_missing_parameters(), EVP_PKEY_cmp_parameters() and EVP_PKEY_cmp() tried to handle all parameters, but looking back at EVP_PKEY_ASN1_METHOD code (especially crypto/ec/ec_ameth.c), it turns out that they only need to concern themselves with domain parameters. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11375)
2020-03-25EVP: Implement support for key downgrading in backendsRichard Levitte
Downgrading EVP_PKEYs from containing provider side internal keys to containing legacy keys demands support in the EVP_PKEY_ASN1_METHOD. This became a bit elaborate because the code would be almost exactly the same as the import functions int EVP_KEYMGMT. Therefore, we end up moving most of the code to common backend support files that can be used both by legacy backend code and by our providers. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11375)
2020-03-25test/evp_pkey_provided_test.c: Add test of EVP_PKEY_copy_parameters()Richard Levitte
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11375)
2020-03-25EVP: Downgrade keys rather than upgradeRichard Levitte
Upgrading EVP_PKEYs from containing legacy keys to containing provider side keys proved to be risky, with a number of unpleasant corner cases, and with functions like EVP_PKEY_get0_DSA() failing unexpectedly. We therefore change course, and instead of upgrading legacy internal keys to provider side internal keys, we downgrade provider side internal keys to legacy ones. To be able to do this, we add |import_from| and make it a callback function designed for evp_keymgmt_export(). This means that evp_pkey_upgrade_to_provider() is replaced with evp_pkey_downgrade(). EVP_PKEY_copy_parameters() is the most deeply affected function of this change. Fixes #11366 Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11375)
2020-03-25EVP: Add EVP_PKEY_set_type_by_keymgmt() and use itRichard Levitte
This function intialises an EVP_PKEY to contain a provider side internal key. We take the opportunity to also document the older EVP_PKEY_set_type() and EVP_PKEY_set_type_str(). Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11375)
2020-03-25EVP: Clarify the states of an EVP_PKEYRichard Levitte
EVP_PKEY is rather complex, even before provider side keys entered the stage. You could have untyped / unassigned keys (pk->type == EVP_PKEY_NONE), keys that had been assigned a type but no data (pk->pkey.ptr == NULL), and fully assigned keys (pk->type != EVP_PKEY_NONE && pk->pkey.ptr != NULL). For provider side keys, the corresponding states weren't well defined, and the code didn't quite account for all the possibilities. We also guard most of the legacy fields in EVP_PKEY with FIPS_MODE, so they don't exist at all in the FIPS module. Most of all, code needs to adapt to the case where an EVP_PKEY's |keymgmt| is non-NULL, but its |keydata| is NULL. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11375)
2020-03-25EC: Refactor ec_curve_name2nid() to accept NIST curve namesRichard Levitte
We can find no reason why everyone should have to call both EC_curve_nist2nid() and ec_curve_name2nid() to find the NID for a name, and it's too easy to forget EC_curve_nist2nid(), so we make life simpler. One could argue that FIPS only allows a limited set of names, but that now gets handled internally, and those who really want to be really sure to only get the NIST names can still do so with EC_curve_nist2nid() Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11391)
2020-03-25Chunk 9 of CMP contribution to OpenSSL: CMP client and related testsDr. David von Oheimb
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 <matt@openssl.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/11300)
2020-03-25Fix bug in strncpy() use of sk_ASN1_UTF8STRING2text() in asn1_lib.cDr. David von Oheimb
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/11300)
2020-03-25Fix whitespace nit in OSSL_SELF_TEST_new.pod which caused doc-nits warningDr. David von Oheimb
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/11300)
2020-03-25Issuer Sign Tool extention supportNikolay Morozov
Issuer Sign Tool (1.2.643.100.112) The name of the tool used to signs the subject (ASN1_SEQUENCE) This extention is required to obtain the status of a qualified certificate at Russian Federation. RFC-style description is available here: https://tools.ietf.org/html/draft-deremin-rfc4491-bis-04#section-5 Russian Federal Law 63 "Digital Sign" is available here: http://www.consultant.ru/document/cons_doc_LAW_112701/ Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/11216)
2020-03-25Fix EVP_PKEY_new_mac_key()Matt Caswell
EVP_PKEY_new_mac_key() was failing if the specified MAC was not available in the default provider - even though that MAC is never actually needed to successfully complete the function. The resulting EVP_PKEY can then be used in some non-default libctx which *does* have the MAC loaded. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11360)
2020-03-25util/wrap.pl: Correct exit code when signalledRichard Levitte
On Unix, a caught signal that exits the process does so with an exit code that is 'signal | 128'. This modifies util/wrap.pl to mimic that. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/11379)
2020-03-24Use ctx2 instead ctx.Richard Könning
CLA: trivial Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Ben Kaduk <kaduk@mit.edu> (Merged from https://github.com/openssl/openssl/pull/11372)
2020-03-24Make sure we use a fetched cipher when encrypting stateless ticketsMatt Caswell
We use AES-256-CBC to encrypt stateless session tickets. We should ensure that the implementation is fetched from the appropriate provider. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/11356)
2020-03-24Use a fetched version of SHA256 in tls_process_new_session_ticket()Matt Caswell
We use the SHA256 digest of the ticket as a "fake" session id. We should ensure that the SHA256 implementation is fetched from the appropriate provider. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/11356)
2020-03-23Use correct libctx when fetching the TLS1 PRF in libsslMatt Caswell
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11357)
2020-03-23Use the libctx and properties when constructing an EVP_PKEY_CTXMatt Caswell
When constructing an RSA ClientKeyExchange make sure we construct our EVP_PKEY_CTX using the correct libctx and properties Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11357)
2020-03-23Update CA.pl podpage, and scriptRich Salz
Merge the NOTES section into the relevant parts of the manpage. Add the $EXTRA parameter in consistent places (the end) to call commands. Document that multiple -extra-XXX might be needed. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/11338)
2020-03-23Handle mdname in legacy EVP_DigestSignInit_ex codepathsMatt Caswell
Even though an application callS the new EVP_DigestSignInit_ex() function to pass an mdname by string rather than EVP_MD, we may still end up in legacy codepaths, and therefore we need to handle either mdname or EVP_MD, in both legacy and non-legacy codepaths. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/11353)
2020-03-23Make it possible to easily specify a libctx for EVP_DigestSign*Matt Caswell
EVP_DigestSignInit_ex and EVP_DigestVerifyInit_ex did not provide the capability to specify an explicit OPENSSL_CTX parameter. It is still possible by explicitly setting an EVP_PKEY_CTX - but in most cases it would be much simpler to just specify it in the Init call. We add the capability to do that. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/11353)
2020-03-23DH, DSA, EC_KEY: Fix exporters to allow domain parameter keysRichard Levitte
The export-to-provider functions for DH, DSA and EC_KEY assumed that a public key is always present, and would fail if not. This blocks any attempt to export a key structure with only domain parameters. While fixing this, we also modify the selection declaration to evp_keymgmt_import() to be more adaptive, the diverse selection bits are now added when the corresponding data is added to the OSSL_PARAM array. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11374)
2020-03-23Constify various mostly X509-related parameter types in crypto/ and apps/Dr. David von Oheimb
in particular X509_NAME*, X509_STORE{,_CTX}*, and ASN1_INTEGER *, also some result types of new functions, which does not break compatibility Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/10504)
2020-03-21Fix error handling in x509v3_cache_extensions and related functionsBernd Edlinger
Basically we use EXFLAG_INVALID for all kinds of out of memory and all kinds of parse errors in x509v3_cache_extensions. [extended tests] Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/10755)
2020-03-21evp_test: the tests using MDC2 need the legacy providerRichard Levitte
This was always a potential, we just haven't seen this need before now. Reviewed-by: Paul Yang <kaishen.yy@antfin.com> (Merged from https://github.com/openssl/openssl/pull/11343)
2020-03-21EVP: fetch the EVP_KEYMGMT earlierRichard Levitte
Instead of fetching the EVP_KEYMGMT in the init for every different operation, do it when creating the EVP_PKEY_CTX. This allows certain control functions to be called between the creation of the EVP_PKEY_CTX and the call of the operation's init function. Use case: EVP_PKEY_CTX_set1_id(), which is allowed to be called very early with the legacy implementation, this should still be allowed with provider implementations. Reviewed-by: Paul Yang <kaishen.yy@antfin.com> (Merged from https://github.com/openssl/openssl/pull/11343)
2020-03-20s_server: warn about NO PSK identity hint in TLSv1.3EasySec
There is NO PSK identity hint in TLSv1.3 so output a warning message when inconsistent PSK / TLS options are mixed. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/11322)
2020-03-20Add support for passing the libctx to the config loaderShane Lontis
The self tests for the fips module are triggered on startup and they need to know the core's libctx in order to function correctly. As the provider can be autoloaded via configuration it then needs to propagate the callers libctx down to the provider via the config load. Note that OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, ..) is still called, but will only load the default configuration if the OPENSSL_CONF environment variable is set. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11240)
2020-03-19Use RAND_bytes_ex in crypto/rsaMatt Caswell
At various points in crypto/rsa we need to get random numbers. We should ensure that we use the correct libctx when doing so. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/11355)
2020-03-19Make sure we use the libctx when fetching a MACMatt Caswell
We were doing an EVP_MAC_fetch without using the correct libctx. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11354)
2020-03-19Handle the case where there is no digest in an EVP_MD_CTXMatt Caswell
EVP_MD_CTX_ctrl assumes that a digest has always been set. However in a non-legacy EVP_DigestSign* operation this is not the case because the digest is handled entirely by the underlying signature implementation. This fixes one of the travis failures on the master branch. [extended tests] Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/11317)
2020-03-19Update CHANGES and NEWS for 1.1.1e releaseDr. Matthias St. Pierre
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11346)