summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2023-06-09apps/asn1parse: improve RFC7462 complianceDr. Matthias St. Pierre
The asn1parse command now supports three different input formats: openssl asn1parse -inform PEM|DER|B64 PEM: base64 encoded data enclosed by PEM markers (RFC7462) DER: der encoded binary data B64: raw base64 encoded data The PEM input format is the default format. It is equivalent to the former `-strictpem` option which is now marked obsolete and kept for backward compatibility only. The B64 is equivalent to the former default input format of the asn1parse command (without `-strictpem`) Fixes #7317 Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7320)
2023-06-09apps/opt: refactor input format parsingDr. Matthias St. Pierre
- split OPT_FMT_PEMDER flag into OPT_FMT_PEM and OPT_FMT_DER - add OPT_FMT_B64 option (`-inform b64`) Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7320)
2023-06-09Optimize CMAC_Update for better performance.fisher.yu
Reduce the number of EVP_Cipher function calls in CMAC_Update, to improve performance of CMAC. Below are command and result of performance improvement. COMMAND: openssl speed -cmac ALGORITHM IMPROVEMENT(%): A72 stands for Cortex A72 N1 stands for Neoverse N1 N2 stands for Neoverse N2 A72 N1 N2 x86 aes-128-cbc@256 65.4 54.6 37.9 86.6 aes-128-cbc@1024 156.0 105.6 65.8 197.1 aes-128-cbc@8192 237.7 139.2 80.5 285.8 aes-128-cbc@16384 249.1 143.5 82.2 294.1 aes-192-cbc@256 65.6 46.5 30.9 77.8 aes-192-cbc@1024 154.2 87.5 50.8 167.4 aes-192-cbc@8192 226.5 117.0 60.5 231.7 aes-192-cbc@16384 236.3 120.1 61.7 238.4 aes-256-cbc@256 66.0 40.3 22.2 69.5 aes-256-cbc@1024 136.8 74.6 35.7 142.2 aes-256-cbc@8192 189.7 93.5 41.5 191.7 aes-256-cbc@16384 196.6 95.8 42.2 195.9 des-ede3-cbc@64 6.9 4.4 2.9 7.2 des-ede3-cbc@256 9.3 6.1 4.3 13.1 des-ede3-cbc@1024 10.0 6.4 4.8 14.9 des-ede3-cbc@8192 10.3 6.5 5.1 15.5 des-ede3-cbc@16384 10.3 6.4 5.1 15.5 sm4-cbc@256 9.5 3.0 - 18.0 sm4-cbc@1024 12.3 3.6 - 24.6 sm4-cbc@8192 13.2 3.8 - 27.0 sm4-cbc@16384 13.5 3.8 - 27.2 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21102)
2023-06-09Update CMAC cipher algorithm list and test cases.fisher.yu
1. Update manual, add SM4-CBC to CMAC cipher algorithm list. 2. Add test case for SM4-CBC CMAC, add "data length is greater than 4 block-length" cases for aes-128-cbc, aes-192-cbc, aes-256-cbc and des-ede3-cbc. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21102)
2023-06-08Add 3.0.9 to list of FIPS releasesPauli
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21140)
2023-06-08Update versions tested to include 3.1.1Pauli
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21140)
2023-06-08kdf test: restrict the version of the FIPS providerPauli
Concatenation tests are provider version specific, limit them to supporting versions. Fixes #21134 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21140)
2023-06-08Workaround false positive warning of MSAN in eng_rdrand.cAntony Polukhin
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21136)
2023-06-08Bump coverallsapp/github-action from 2.1.2 to 2.2.0dependabot[bot]
Bumps [coverallsapp/github-action](https://github.com/coverallsapp/github-action) from 2.1.2 to 2.2.0. - [Release notes](https://github.com/coverallsapp/github-action/releases) - [Commits](https://github.com/coverallsapp/github-action/compare/v2.1.2...v2.2.0) --- updated-dependencies: - dependency-name: coverallsapp/github-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> CLA: trivial Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21147)
2023-06-08build.info: Introduce special syntax for dependencies on script modulesRichard Levitte
The DEPEND statement, when applied on files generated with GENERATE, may be used to specify script modules that the template to be generated from depends on. In short, this sort of depend: DEPEND[generated]=util/perl/OpenSSL/something.pm ... would generate a perl run that has the inclusion directory 'util/perl/OpenSSL' and 'something' as the module to be loaded. However, the package name for this module is 'OpenSSL::something', so to load it the way it's expected, the inclusion directory should be 'util/perl', and the module to be loaded should be specified as 'OpenSSL/something' (to be massaged into a proper module name by the build file template). To allow this, we introduce a file syntax, where a single '|' is used as a directory separator, to delineate what part should be used as the inclustion directory, and which part the module name to be loaded should be derived from: DEPEND[generated]=util/perl|OpenSSL/something.pm Fixes #21112 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21117)
2023-06-06Modify ENGINE_pkey_asn1_find_str() to use a read lock instead of a writeMatt Caswell
ENGINE_pkey_asn1_find_str() does not make any modifications to fields controlled by the global_engine_lock. The only change made is the struct_ref field which is controlled separately. Therefore we can afford to only take a read lock. This also impacts EVP_PKEY_asn1_find_str(). This lock ends up being obtained indirectly from numerous public API functions including EVP_PKEY_key_gen(), EVP_PKEY_new_raw_public_key_ex(), EVP_PKEY_copy_parameters() etc. This occurs even if no engines are actually in use. Some tests showed this lock being obtained 6 times after a "warmed up" s_server instance with default configuration processed a handshake from a default s_client. When processing a resumption handshake from s_client it was obtained 8 times. Partially fixes #20286 Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20950)
2023-06-06Convert the ENGINE struct_ref field to be an atomicMatt Caswell
We use atomic primitives to up ref and down the struct_ref field rather than relying on the global lock for this. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20950)
2023-06-06Add SSL_get0_group_name() to get name of the group used for KEXAlex Bozarth
Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20866)
2023-06-06Cast the argument to unsigned char when calling isdigit()Michael Baentsch
Fixes #21123 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21127)
2023-06-06Make link to RFC 1578 in CHANGES.md be a proper linkTomas Mraz
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21130)
2023-06-06Restrict the size of OBJECT IDENTIFIERs that OBJ_obj2txt will translateRichard Levitte
OBJ_obj2txt() would translate any size OBJECT IDENTIFIER to canonical numeric text form. For gigantic sub-identifiers, this would take a very long time, the time complexity being O(n^2) where n is the size of that sub-identifier. To mitigate this, a restriction on the size that OBJ_obj2txt() will translate to canonical numeric text form is added, based on RFC 2578 (STD 58), which says this: > 3.5. OBJECT IDENTIFIER values > > An OBJECT IDENTIFIER value is an ordered list of non-negative numbers. > For the SMIv2, each number in the list is referred to as a sub-identifier, > there are at most 128 sub-identifiers in a value, and each sub-identifier > has a maximum value of 2^32-1 (4294967295 decimal). Fixes otc/security#96 Fixes CVE-2023-2650 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org>
2023-06-06allow to disable httpVladimír Kotal
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21108)
2023-06-06doc: note that out ChaCha20 isn't standard compliant.Pauli
Fixes #21095 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/21098)
2023-06-05Don't take a write lock to retrieve a value from a stackMatt Caswell
ossl_x509_store_ctx_get_by_subject() was taking a write lock for the store, but was only (usually) retrieving a value from the stack of objects. We take a read lock instead. Partially fixes #20286 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20952)
2023-06-05Avoid an unneccessary lock if we didn't add anything to the storeMatt Caswell
Partially fixes #20286 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20952)
2023-06-03Remove pointless warning on pkcs12 importDmitry Belyavskiy
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21107)
2023-06-02Update fuzz/corpora submodule to latest dataTomas Mraz
Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21118)
2023-06-02Fix documentation where openssl-genrsa is listed asDarana
deprecated since OpenSSL 3.0 openssl-genrsa is not deprecated however the OpenSSL documentation states that it is the case from OpenSSL 3.0. This has been fixed in the documentation, specifically in manpage 1. Fixes #21055 CLA: trivial Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21059)
2023-06-02possible workaroundPauli
Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20935)
2023-06-02Update .gitignorePauli
Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20935)
2023-06-02gcm: use the new faster param location mechanism.Pauli
Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20935)
2023-06-02params: provide a faster TRIE based param lookup.Pauli
The separate file is a Perl script that generates the appropriate define directives for inclusion in core_names.h. By having this separation it will be possible to prebuild data structures to give faster access when looking up parameters by name. Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20935)
2023-06-02[feat] SSL RTT in both client and server statem. SSL_get_handshake_rtt makes ↵Jairus Christensen
it available Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/20248)
2023-06-02Avoid taking a write lock in ossl_provider_doall_activated()Matt Caswell
We refactor ossl_provider_doall_activated() so that we only need to take a read lock instead of a write lock for the flag_lock. This should improve performance by avoiding the lock contention. We achieve this by protecting the activatecnt via atomics rather than via a lock and by avoiding the full provider activation/deactivation procedure where it is not needed. Partial fix for #20286 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20927)
2023-06-02Enable obtaining certain DRBG params without a lockMatt Caswell
Even if a DRBG has locking enabled on it, there are certain parameters which are still safe to obtain even without a lock. The max_request value is constant for all our DRBGs. The reseed_counter does not matter if we get it wrong - so it is safe to avoid the lock. So if all we are reading are those parameters then we take no lock at all. Partially fixes #20286 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Todd Short <todd.short@me.com> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20970)
2023-06-02Refactor the DRBG implementations to manage locking themselvesMatt Caswell
Previously the EVP layer would call lock and unlock functions on the underlying DRBG implementation to say when a lock should be acquired and released. This gives the DRBG implementation no say as to what kind of lock should obtained (e.g. read/write) or even whether a lock is actually needed or not. In reality we know whether a DRBG is supposed to be in locking mode or not because the "enable_locking()" function will have been called if locks should be used. Therefore we re-interpret the lock and unlock functions as "hints" from the EVP layer which we ignore. Instead we acquire locks only when we need them. By knowing the context we can obtain either a read or a write lock as appropriate. This may mean that in some rare cases we acquire the locks more than once for a single EVP call, if the EVP call makes several calls to the underlying DRBG. But in practice almost all EVP calls only make one such call. EVP_RAND_generate() is an example of a call where multiple DRBG calls may be made. One of these gets the "max_request" parameter (which is constant for all of our own DRBGs) and it may make several calls to the DRBG generate call - but only if the requested size is very large which will rarely be the case. Partially fixes #20286 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Todd Short <todd.short@me.com> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20970)
2023-06-01openssl-cmp.pod.in: tweak doc of -subject, -issuer, -keep_alive, and -untrustedDr. David von Oheimb
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/21086)
2023-06-01cmp_mock_srv.c: improve comment on cert to be produced from request templateDr. David von Oheimb
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/21086)
2023-06-01cmp_client.c: add comment on certConf and add 'ossl_unused' to two functionsDr. David von Oheimb
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/21086)
2023-06-01apps.c: add comment to do_X509_sign() referring to question #19805Dr. David von Oheimb
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/21086)
2023-06-01apps/cmp.c: make management of http_cb_arg pointer more robustDr. David von Oheimb
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/21086)
2023-06-01apps/cmp.c: improve warnings on option useDr. David von Oheimb
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/21086)
2023-06-01CMS_ContentInfo_free(): fix mem leak on encrypted content keyDr. David von Oheimb
Fixes #21026 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/21058)
2023-06-01SMIME_crlf_copy(): check for NULL pointer argumentsDr. David von Oheimb
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/21058)
2023-06-01Ignore the fetch error when a legacy algorithm is foundYuri Penkin
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/21035) (cherry picked from commit cb1f87f59d0b290eca9207ec4ef36d8073e6feec)
2023-06-01CMP: add support for genm/genp messages with id-it-caCertsDr. David von Oheimb
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/19231)
2023-06-01QUIC: CID conformancePauli
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21078)
2023-06-01doc: update FIPS provider version informationPauli
With 3.0.8 validated, we need to note this in the documentation. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/21049)
2023-06-01tags: fix `make tags` target for out of tree buildsPauli
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Todd Short <todd.short@me.com> (Merged from https://github.com/openssl/openssl/pull/21079)
2023-06-01Add PEM fuzzerKurt Roeckx
This fuzzer can find CVE-2022-4450 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20242)
2023-06-01Compute RSA-PSS algorithm params in libcrypto for legacyTomas Mraz
Fixes regression of RSA signatures for legacy keys caused by quering the provider for the algorithm id with parameters. Legacy keys do not have a method that would create the algorithm id. So we revert to what was done in 3.0.7 and earlier versions for these keys. Fixes #21008 Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21019)
2023-05-31Fix arm64 asm code back compatible issue with gcc 4.9.4Xiaokang Qian
Fix: #20963 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20967)
2023-05-30Bump actions/setup-python from 4.6.0 to 4.6.1dependabot[bot]
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.6.0 to 4.6.1. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v4.6.0...v4.6.1) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> CLA: trivial Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21047)
2023-05-30CMS, PKCS7, and CRMF: simplify use of EVP_PKEY_decrypt() by helper functionDr. David von Oheimb
Also remove needless constant_time_* and ERR_clear_error() calls from OSSL_CRMF_ENCRYPTEDVALUE_get1_encCert(). Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/17354)
2023-05-30ssl/statem_srvr.c: clean up handling of EVP_PKEY_decrypt() outlenDr. David von Oheimb
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/17354)