SecureBoot: Publickey and Signature data structure updates

This patch implements pubKey and signature updates done
in storage. Added info as sigining types, signing algo,
key sizes which could be used in secureboot and crypto
libraries.

Information from IASImage is transformed to updated
crypto and secure boot implementation. Only RSA2048 and sha256
support is updated as IAS image supports only this combination.

Signed-off-by: Subash Lakkimsetti <subashx.lakkimsetti@intel.com>
This commit is contained in:
Subash Lakkimsetti
2019-12-08 16:13:53 -07:00
committed by Maurice Ma
parent b6724f6b10
commit 929bca6807
11 changed files with 155 additions and 85 deletions
@@ -103,16 +103,16 @@ int VerifyRsaSignature (const void *hash, const void *rsa_n, const void *rsa_e,
* Returns RETURN_SUCCESS on success, others on failure.
*/
RETURN_STATUS
RsaVerify(const RSA_PUB_KEY *key, const Ipp8u *sig, const Ipp32u sig_len, const Ipp8u sig_type, const Ipp8u *hash)
RsaVerify_Pkcs_1_5 (CONST PUB_KEY_HDR *PubKeyHdr, CONST SIGNATURE_HDR *SignatureHdr, CONST UINT8 *Hash)
{
Ipp8u *rsa_n;
Ipp8u *rsa_e;
if ((key->Signature != RSA_KEY_IPP_SIGNATURE) || (sig_type != SIG_TYPE_RSA2048SHA256) || (sig_len != RSA_MOD_SIZE)) {
if ((SignatureHdr->SigType != SIGNING_TYPE_RSA_PKCS_1_5) || (SignatureHdr->SigSize != RSA_MOD_SIZE)) {
return RETURN_INVALID_PARAMETER;
} else {
rsa_n = (Ipp8u *)key->PubKeyData;
rsa_e = rsa_n + RSA_MOD_SIZE;
return VerifyRsaSignature (hash, rsa_n, rsa_e, sig) ? RETURN_SECURITY_VIOLATION : RETURN_SUCCESS ;
rsa_n = (Ipp8u *) PubKeyHdr->KeyData;
rsa_e = (Ipp8u *) PubKeyHdr->KeyData + PubKeyHdr->KeySize - RSA_E_SIZE;
return VerifyRsaSignature (Hash, rsa_n, rsa_e, SignatureHdr->Signature) ? RETURN_SECURITY_VIOLATION : RETURN_SUCCESS ;
}
}