Commit Graph

15 Commits (a6f8e131f40bbca55867af7d1504a58acd4c3b3d)

Author SHA1 Message Date
Shane Lontis 3fed27181a Add FIPS Self test for AES_ECB decrypt
Fixes #14807

Compliance with IG 9.4 requires that an inverse cipher function be
tested if one is implemented. Just running AES_GCM encrypt/decrypt does not meet this
requirement (Since only ECB, CBC, XTS, KW, KWP support the inverse
function during decryption mode).

Added a mode to the cipher test so that the AES_GCM only does an encrypt
and AES_ECB only does a decrypt. TDES still does both.

Reviewed-by: Paul Dale <>
(Merged from
2021-04-13 13:06:37 +10:00
Richard Levitte a8eb71ad57 Allow the sshkdf type to be passed as a single character
This partially reverts commit 270a5ce1d9.

This also slightly modifies the way diverse parameters in are
specified in providers/fips/ for better consistency.

Fixes #14027

Reviewed-by: Tomas Mraz <>
(Merged from
2021-02-24 19:50:10 +01:00
Matt Caswell a28d06f3e9 Update copyright year
Reviewed-by: Tomas Mraz <>
(Merged from
2021-02-18 15:05:17 +00:00
Juergen Christ 270a5ce1d9 Fix parameter types in sshkdf
Handling of parameter OSSL_KDF_PARAM_SSHKDF_TYPE mixed integer and string
parameters.  This caused endianness problems on big-endian machines.  As a
result, it is not possible to pass FIPS tests since the parameter was stored
with an integer value but read via a cast to char pointer.  While this works
on little endian machines, big endian s390 read the most significant bits
instead of the least significant (as done by, e.g., x86).  Change the
parameter to char array and fix the usages.

Signed-off-by: Juergen Christ <>

Reviewed-by: Richard Levitte <>
Reviewed-by: Tomas Mraz <>
Reviewed-by: Patrick Steuer <>
(Merged from
2021-01-28 16:05:50 +01:00
Richard Levitte 3a1ee3c199 Drop OPENSSL_NO_RSA everywhere
The configuration option 'no-rsa' was dropped with OpenSSL 1.1.0, so
this is simply a cleanup of the remains.

Reviewed-by: Tomas Mraz <>
(Merged from
2020-12-20 12:19:42 +01:00
Shane Lontis acd3e548bc Add fips self tests for all included kdf
Reviewed-by: Tomas Mraz <>
(Merged from
2020-12-11 10:59:32 +10:00
Matt Caswell cbb85bda0c Fix builds that specify both no-dh and no-ec
Various sections of code assumed that at least one of dh or ec would be
available. We also now also need to handle cases where a provider has
a key exchange algorithm and TLS-GROUP that we don't know about.

Fixes #13536

Reviewed-by: Richard Levitte <>
Reviewed-by: Paul Dale <>
(Merged from
2020-11-30 10:50:13 +00:00
Shane Lontis 4343a4187d Add self tests for rsa encryption
SP800-56br2 requires seperate KAT's (fips self tests) to be tested for both encryption and decryption
using the RSA primitive (i.e. no padding). This is specified in FIPS140-2 IG D.9

A copy of the methods EVP_PKEY_encrypt_init(), EVP_PKEY_encrypt(), EVP_PKEY_decrypt_init(), EVP_PKEY_decrypt()
are now in the fips module.

Removed the #ifdef FIPS_MODULE in evp_pkey_ctx_free_old_ops().

Added corruption test

Reviewed-by: Tomas Mraz <>
(Merged from
2020-09-16 14:10:23 +10:00
Pauli 6154f9a7ca fips rand: DRBG KAT self test updates to provider model.
Reviewed-by: Matthias St. Pierre <>
(Merged from
2020-06-24 20:05:42 +10:00
Matt Caswell 11a1b341f3 Make EVP_PKEY_CTX_[get|set]_ec_paramgen_curve_name more generic
We rename these function to EVP_PKEY_CTX_get_group_name and
EVP_PKEY_CTX_set_group_name so that they can be used for other algorithms
other than EC.

Reviewed-by: Shane Lontis <>
(Merged from
2020-06-19 10:19:31 +01:00
Shourya Shukla a6ed19dc9a Amend references to "OpenSSL license"
A small number of files contain references to the "OpenSSL license"
which has been deprecated and replaced by the "Apache License 2.0".
Amend the occurences.

Fixes #11649

Reviewed-by: Matt Caswell <>
Reviewed-by: Richard Levitte <>
(Merged from
2020-04-29 15:27:22 +02:00
Shane Lontis ec4d1b8f8c Add data driven SELF TEST code for signatures and key agreement
Reviewed-by: Tomas Mraz <>
(Merged from
2020-04-03 16:50:36 +10:00
Shane Lontis 980a880ee5 Add DRBG self tests
Reviewed-by: Matthias St. Pierre <>
(Merged from
2020-02-21 17:23:18 +01:00
Matt Caswell e89ffd23c3 Fix no-des
Don't attempt to self-test DES in the FIPS provider if we have been built
without FIPS support.

Reviewed-by: Richard Levitte <>
(Merged from
2020-02-07 23:33:59 +00:00
Shane Lontis 36fc5fc6bd Add FIPS Self test kats for digests
Added an API to optionally set a self test callback.
The callback has the following 2 purposes
(1) Output information about the KAT tests.
(2) Allow the ability to corrupt one of the KAT's
The fipsinstall program uses the API.

Some KATS are not included in this PR since the required functionality did not yet exist in the provider.

Reviewed-by: Matt Caswell <>
(Merged from
2020-01-15 10:48:01 +10:00