mirror of
https://git.proxmox.com/git/efi-boot-shim
synced 2025-08-04 19:06:45 +00:00
Don't print SHA1 sum when calculating file fingerprints
There's no point in printing the SHA1 of a SHA256...
This commit is contained in:
parent
37635f5414
commit
16c512f9b5
30
MokManager.c
30
MokManager.c
@ -317,8 +317,8 @@ static void show_mok_info (void *Mok, UINTN MokSize)
|
||||
return;
|
||||
|
||||
if (MokSize != 48) {
|
||||
if (X509ConstructCertificate(Mok, MokSize, (UINT8 **) &X509Cert) &&
|
||||
X509Cert != NULL) {
|
||||
if (X509ConstructCertificate(Mok, MokSize,
|
||||
(UINT8 **) &X509Cert) && X509Cert != NULL) {
|
||||
show_x509_info(X509Cert);
|
||||
X509_free(X509Cert);
|
||||
} else {
|
||||
@ -326,6 +326,20 @@ static void show_mok_info (void *Mok, UINTN MokSize)
|
||||
((UINT32 *)Mok)[0]);
|
||||
return;
|
||||
}
|
||||
|
||||
efi_status = get_sha1sum(Mok, MokSize, hash);
|
||||
|
||||
if (efi_status != EFI_SUCCESS) {
|
||||
Print(L"Failed to compute MOK fingerprint\n");
|
||||
return;
|
||||
}
|
||||
|
||||
Print(L" Fingerprint (SHA1):\n ");
|
||||
for (i = 0; i < SHA1_DIGEST_SIZE; i++) {
|
||||
Print(L" %02x", hash[i]);
|
||||
if (i % 10 == 9)
|
||||
Print(L"\n ");
|
||||
}
|
||||
} else {
|
||||
Print(L"SHA256 hash:\n ");
|
||||
for (i = 0; i < SHA256_DIGEST_SIZE; i++) {
|
||||
@ -335,19 +349,7 @@ static void show_mok_info (void *Mok, UINTN MokSize)
|
||||
}
|
||||
Print(L"\n");
|
||||
}
|
||||
efi_status = get_sha1sum(Mok, MokSize, hash);
|
||||
|
||||
if (efi_status != EFI_SUCCESS) {
|
||||
Print(L"Failed to compute MOK fingerprint\n");
|
||||
return;
|
||||
}
|
||||
|
||||
Print(L" Fingerprint (SHA1):\n ");
|
||||
for (i = 0; i < SHA1_DIGEST_SIZE; i++) {
|
||||
Print(L" %02x", hash[i]);
|
||||
if (i % 10 == 9)
|
||||
Print(L"\n ");
|
||||
}
|
||||
Print(L"\n");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user