mirror of https://github.com/thesofproject/sof.git
rimage: add SHA384 hashing
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
This commit is contained in:
parent
72b6521c87
commit
e2743bc397
|
@ -87,3 +87,19 @@ void ri_sha256(struct image *image, unsigned int offset, unsigned int size,
|
|||
module_sha_update(image, image->fw_image + offset, size);
|
||||
module_sha_complete(image, hash);
|
||||
}
|
||||
|
||||
static void module_sha384_create(struct image *image)
|
||||
{
|
||||
image->md = EVP_sha384();
|
||||
image->mdctx = EVP_MD_CTX_new();
|
||||
|
||||
EVP_DigestInit_ex(image->mdctx, image->md, NULL);
|
||||
}
|
||||
|
||||
void ri_sha384(struct image *image, unsigned int offset, unsigned int size,
|
||||
uint8_t *hash)
|
||||
{
|
||||
module_sha384_create(image);
|
||||
module_sha_update(image, image->fw_image + offset, size);
|
||||
module_sha_complete(image, hash);
|
||||
}
|
||||
|
|
|
@ -107,7 +107,7 @@ struct image {
|
|||
int meu_offset;
|
||||
int xcc_mod_offset;
|
||||
|
||||
/* SHA 256 */
|
||||
/* SHA 256 & 384 */
|
||||
const char *key_name;
|
||||
EVP_MD_CTX *mdctx;
|
||||
const EVP_MD *md;
|
||||
|
@ -157,6 +157,8 @@ int ri_manifest_sign_v1_5(struct image *image);
|
|||
int ri_manifest_sign_v1_8(struct image *image);
|
||||
void ri_sha256(struct image *image, unsigned int offset, unsigned int size,
|
||||
uint8_t *hash);
|
||||
void ri_sha384(struct image *image, unsigned int offset, unsigned int size,
|
||||
uint8_t *hash);
|
||||
|
||||
int pkcs_v1_5_sign_man_v1_5(struct image *image,
|
||||
struct fw_image_manifest_v1_5 *man,
|
||||
|
|
Loading…
Reference in New Issue