summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2021-04-14APPS: make apps strict on app_RAND_load() and app_RAND_write() failureDr. David von Oheimb
Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14840)
2021-04-14Document the invariants for the empty X509_NAME encodingTomas Mraz
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/14832)
2021-04-14X509_NAME_cmp: if canon_enclen is 0 for both names return 0Tomas Mraz
We do not care whether canon_enc is NULL in this case. Fixes #14813 Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/14832)
2021-04-14bio_printf: add \0 terminators for error returns in floating point conversions.Pauli
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14829)
2021-04-14bio: note that BIO_sprintf null terminates on insufficient space.Pauli
Fixes: #14772 Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14829)
2021-04-14bio: add a malloc failed error to BIO_printPauli
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14829)
2021-04-14Add some additional NULL checks to prevent segfaults.Shane Lontis
Fixes #14809 PR #14752 attempted to pass the libctx, propq in a few places related to X509 signing. There were a few places that needed additional NULL checks so that they behavethe same as they did before. OCSP_basic_sign() was changed to call EVP_DigestSignInit_ex() which passed the parameter EVP_MD_name(dgst). Since dgst can be NULL EVP_MD_name() was segfaulting. Adding an additional NULL check EVP_MD_name() resolves this issue. The other NULL checks are required to produce errors rather than segfaults if the certificate is NULL. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14826)
2021-04-14Add domain parameter match check for DH and ECDH key exchange.Shane Lontis
Fixes #14808 Validation checks were moved into EVP_PKEY_derive_set_peer() which broke an external negative test. Originally the old code was semi working by checking the peers public key was in the range of other parties p. It was not actually ever checking that the domain parameters were consistent between the 2 parties. It now checks the parameters match as well as validating the peers public key. Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14823)
2021-04-14Remove a TODO(3.0) from X509_PUBKEY_setMatt Caswell
The comment talks about the EVP_PKEY that is contained within an X509_PUBKEY object and whether it has to be exactly the same as the one passed by the caller in X509_PUBKEY_set(). IMO it does, so the TODO should be dropped. Fixes #14378 Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14845)
2021-04-14crypto: raise error on malloc failureFdaSilvaYY
clean a few style nits. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14806)
2021-04-14nits: fix a few typo in template codeFdaSilvaYY
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14806)
2021-04-14doc: Fix formattingJakub Wilk
CLA: trivial Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14835)
2021-04-13Handle set_alpn_protos inputs better.Todd Short
It's possible to set an invalid protocol list that will be sent in a ClientHello. This validates the inputs to make sure this does not happen. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14815)
2021-04-13util/wrap.pl: use the apps/openssl.cnf from the source treeDr. Matthias St. Pierre
The `make install_fips` target failed msp@debian:~/src/openssl$ make install_fips *** Installing FIPS module install providers/fips.so -> /opt/openssl-dev/lib/ossl-modules/fips.so *** Installing FIPS module configuration fipsinstall /opt/openssl-dev/ssl/fipsmodule.cnf FATAL: Startup failure (dev note: apps_startup()) for ./apps/openssl ... No such file or directory:crypto/conf/conf_def.c:771:calling stat(fipsmodule.cnf) ... make: *** [Makefile:3341: install_fips] Error 1 because the `openssl fipsinstall` command was loading a previously installed configuration file instead of the copy shipped with the source tree. msp@debian:~/src/openssl$ strace -f make install_fips |& grep openssl.cnf [pid 128683] openat(AT_FDCWD, "/opt/openssl-dev/ssl/openssl.cnf", O_RDONLY) = 3 This issue reveiled a more general problem, which applies to the tests as well: unless openssl is installed, the openssl app must not use any preinstalled configuration file. This holds in particular when the preinstalled configuration file load providers, which caused the above failure. The most consistent way to achieve this behaviour is to set the OPENSSL_CONF environment variable to the correct location in the util/wrap.pl perl wrapper. Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14136)
2021-04-13apps: call ERR_print_errors when OSSL_PROVIDER_load failsPetr Gotthard
The ERR_print_errors often displays the reason why the provider couldn't be loaded. Hence it is quite important for debugging. Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14818)
2021-04-13Note deprecated function/macros with no replacement.Pauli
These functions are deprecated with no replacement specified: DH_clear_flags, DH_get_1024_160, DH_get_2048_224, DH_get_2048_256, DH_set_flags, DH_test_flags, DSA_clear_flags, DSA_dup_DH, DSAparams_dup, DSA_set_flags, DSA_test_flags, RSA_blinding_off, RSA_blinding_on, RSA_clear_flags, RSA_get_version, RSAPrivateKey_dup, RSAPublicKey_dup, RSA_set_flags, RSA_setup_blinding and RSA_test_flags. The flags that are going are: DH_FLAG_CACHE_MONT_P, DSA_FLAG_CACHE_MONT_P, RSA_FLAG_BLINDING, RSA_FLAG_CACHE_PRIVATE, RSA_FLAG_CACHE_PUBLIC, RSA_FLAG_EXT_PKEY, RSA_FLAG_NO_BLINDING, RSA_FLAG_THREAD_SAFE and RSA_METHOD_FLAG_NO_CHECK. These two flags are "readable" via EVP_is_a(). They are not writable: DH_FLAG_TYPE_DHX and DH_FLAG_TYPE_DH. Fixes #14616 Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/14824)
2021-04-13Fix windows compiler error in kmac_prov.cShane Lontis
Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14851)
2021-04-13Add FIPS Self test for AES_ECB decryptShane Lontis
Fixes #14807 Compliance with IG 9.4 requires that an inverse cipher function be tested if one is implemented. Just running AES_GCM encrypt/decrypt does not meet this requirement (Since only ECB, CBC, XTS, KW, KWP support the inverse function during decryption mode). Added a mode to the cipher test so that the AES_GCM only does an encrypt and AES_ECB only does a decrypt. TDES still does both. Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14825)
2021-04-12Remove the function EVP_PKEY_set_alias_typeMatt Caswell
OTC recently voted that EVP_PKEY types will be immutable in 3.0. This means that EVP_PKEY_set_alias_type can no longer work and should be removed entirely (applications will need to be rewritten not to use it). It was primarily used for SM2 which no longer needs this call. Applications should generate SM2 keys directly (without going via an EC key first), or otherwise when loading keys they should automatically be detected as SM2 keys. Fixes #14379 Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14803)
2021-04-12Update KTLS documentationMatt Caswell
KTLS support has been changed to be off by default, and configuration is via a single "option" rather two "modes". Documentation is updated accordingly. Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14799)
2021-04-12Only enable KTLS if it is explicitly configuredMatt Caswell
It has always been the case that KTLS is not compiled by default. However if it is compiled then it was automatically used unless specifically configured not to. This is problematic because it avoids any crypto implementations from providers. A user who configures all crypto to use the FIPS provider may unexpectedly find that TLS related crypto is actually being performed outside of the FIPS boundary. Instead we change KTLS so that it is disabled by default. We also swap to using a single "option" (i.e. SSL_OP_ENABLE_KTLS) rather than two separate "modes", (i.e. SSL_MODE_NO_KTLS_RX and SSL_MODE_NO_KTLS_TX). Fixes #13794 Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14799)
2021-04-12Always reset IV for CBC, OFB, and CFB mode on cipher context reinitTomas Mraz
This is necessary to keep compatibility with 1.1.1 implementation of the CBC, OFB, and CFB mode ciphers. Fixes #14704 Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14811)
2021-04-12Replace OSSL_PARAM_BLD_free_params() with OSSL_PARAM_free().Shane Lontis
Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14785)
2021-04-12Add OSSL_PARAM_dup() and OSSL_PARAM_merge().Shane Lontis
These functions are prerequisites for implementing EVP_PKEY_todata(). OSSL_PARAM_dup() is required to make a deep copy of the exported params (since the provider export() uses a OSSL_PARAM_BLD which throws away the data after the call), and then use OSSL_PARAM_merge() to add some additional params that can be passed to the EVP_PKEY_todata(). Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14785)
2021-04-12kmac: update the documention for the customisation string maximum lengthPauli
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/14810)
2021-04-12kmac: fix customistation string overflow bugPauli
Previously there was an off by two error allowing a stack buffer overrun. Avoided this by allocating a correct sized buffer on the stack. A side effect is that the maximum size of the customisation string can be increased. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/14810)
2021-04-12kmac: add long customisation string examplePauli
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/14810)
2021-04-12Add additional KMAC errorPauli
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/14810)
2021-04-09apps: fix warning about size_t / int conversionArmin Fuerst
Windows builds show the following warning: (..\apps\ca.c(2643): warning C4267: 'function': conversion from 'size_t' to 'int', possible loss of data) Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14453)
2021-04-09crl2pkcs7 shouldn't include empty optional setsDave Coombs
If using crl2pkcs7 -nocrl and with no -certfiles, we shouldn't include the implicitly tagged [0] certs and [1] crls sets as they are marked optional and would be empty. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14781)
2021-04-09Fix typos in x509.podNan Xiao
CLA: trivial Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14783)
2021-04-09Small fixes and cleanups of provider API documentationTomas Mraz
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14756)
2021-04-09provider-decoder.pod: Documentation of provider side decoder APITomas Mraz
Fixes #13949 Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14756)
2021-04-09Fix typo in statem_clnt.cNan Xiao
CLA: trivial Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14791)
2021-04-09Inherit hostflags verify params even without hostsChristian Heimes
X509_VERIFY_PARAM_inherit() now copies hostflags independently of hosts. Previously hostflags were only copied when at least one host was set. Typically applications don't configure hosts on SSL_CTX. The change enables applications to configure hostflags on SSL_CTX and have OpenSSL copy the flags from SSL_CTX to SSL. Fixes: https://github.com/openssl/openssl/issues/14579 Signed-off-by: Christian Heimes <christian@python.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14743)
2021-04-08d2i_PrivateKey_decoder(): Fix premature exit on unsuccessful ↵Dr. David von Oheimb
OSSL_DECODER_CTX_new_for_pkey() Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14647)
2021-04-08PEM_X509_INFO_read_bio_ex(): Generalize to allow parsing any type of private keyDr. David von Oheimb
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14647)
2021-04-08d2i_PrivateKey{,_ex}() and PEM_X509_INFO_read_bio_ex(): Fix handling of ↵Dr. David von Oheimb
RSA/DSA/EC private key This is needed to correct d2i_PrivateKey() after it was changed by commit 576892d78f80cf9a. Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14647)
2021-04-08PEM_X509_INFO_read,{_bio}_ex(): Complete documentation in ↵Dr. David von Oheimb
PEM_X509_INFO_read_bio_ex.pod Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14647)
2021-04-08apps: fix Camellia CBC performance loopPauli
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14786)
2021-04-08Prepare for 3.0 alpha 15Matt Caswell
Reviewed-by: Tomas Mraz <tomas@openssl.org>
2021-04-08Prepare for release of 3.0 alpha 14openssl-3.0.0-alpha14Matt Caswell
Reviewed-by: Tomas Mraz <tomas@openssl.org>
2021-04-08Update copyright yearMatt Caswell
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14801)
2021-04-08Remove a TODO in EVP_set_default_propertiesMatt Caswell
Fixes #14371 Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1487)
2021-04-08Update the algorithm fetching documentation linksMatt Caswell
The documentation on algorithm fetching has moved. There were a lot of references to the old location so we update all of those locations. Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1487)
2021-04-08Update provider.podMatt Caswell
The previous commits moved some content out of provider.pod into other pages, so that content is now removed. provider.pod is now exclusively focussed on provider authors. Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1487)
2021-04-08Add additional glossary entriesMatt Caswell
Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1487)
2021-04-08Expand the libcrypto documentationMatt Caswell
Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1487)
2021-04-08curve448: Integrate 64-bit reference implementationAmitay Isaacs
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14784)
2021-04-08Configure: Check if 128-bit integers are supported by compilerAmitay Isaacs
Add a config variable "use_int128" to indicate if 128-bit integers are supported or not at the configure time. This makes it easier to automatically select 64-bit versus 32-bit implementation for curve448. Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14784)