These algorithms do not have OIDS (Note that RSA does have OIDS),
and are not valid values for FIPS.
Note that this was only possible if the "ECDSA" algorithm is fetched.
Note that "ECDSA-SHA512-256" and "ECDSA-SHA512-224" are not currently
fetchable.
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28377)
(cherry picked from commit
5ce54ae14bd1ad1934dfe493fe39d89eb1d5b72d)
int ossl_fips_ind_digest_sign_check(OSSL_FIPS_IND *ind, int id,
OSSL_LIB_CTX *libctx,
int nid, int sha1_allowed,
+ int sha512_trunc_allowed,
const char *desc,
OSSL_FIPS_IND_CHECK_CB *config_check_f)
{
int approved;
+ const char *op = "none";
- if (nid == NID_undef)
+ switch (nid) {
+ case NID_undef:
approved = 0;
- else
- approved = sha1_allowed || nid != NID_sha1;
+ break;
+ case NID_sha512_224:
+ case NID_sha512_256:
+ approved = sha512_trunc_allowed;
+ op = "Digest Truncated SHA512";
+ break;
+ case NID_sha1:
+ approved = sha1_allowed;
+ op = "Digest SHA1";
+ break;
+ default:
+ approved = 1;
+ break;
+ }
if (!approved) {
- if (!ossl_FIPS_IND_on_unapproved(ind, id, libctx, desc, "Digest SHA1",
+ if (!ossl_FIPS_IND_on_unapproved(ind, id, libctx, desc, op,
config_check_f)) {
ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_DIGEST);
return 0;
int ossl_fips_ind_digest_sign_check(OSSL_FIPS_IND *ind, int id,
OSSL_LIB_CTX *libctx,
int nid, int sha1_allowed,
+ int sha512_trunc_allowed,
const char *desc,
OSSL_FIPS_IND_CHECK_CB *config_check_f);
if (!ossl_fips_ind_digest_sign_check(OSSL_FIPS_IND_GET(ctx),
OSSL_FIPS_IND_SETTABLE1,
ctx->libctx,
- md_nid, sha1_allowed, desc,
+ md_nid, sha1_allowed, 0, desc,
ossl_fips_config_signature_digest_check))
goto err;
}
if (!ossl_fips_ind_digest_sign_check(OSSL_FIPS_IND_GET(ctx),
OSSL_FIPS_IND_SETTABLE1,
ctx->libctx,
- md_nid, sha1_allowed, desc,
+ md_nid, sha1_allowed, 0, desc,
ossl_fips_config_signature_digest_check))
goto err;
}
if (!ossl_fips_ind_digest_sign_check(OSSL_FIPS_IND_GET(ctx),
OSSL_FIPS_IND_SETTABLE1,
ctx->libctx,
- md_nid, sha1_allowed, desc,
+ md_nid, sha1_allowed, 1, desc,
ossl_fips_config_signature_digest_check))
goto err;
}
Input = "0123456789ABCDEF1234"
Result = KEYOP_MISMATCH
+FIPSversion = >=3.6.0
+Sign = P-256
+Securitycheck = 1
+Unapproved = 1
+CtrlInit = digest-check:0
+Ctrl = digest:SHA512-224
+Input = "0123456789ABCDEF1234"
+Result = KEYOP_ERROR
+
Title = XOF disallowed
DigestVerify = SHAKE256