summaryrefslogtreecommitdiff
path: root/MokManager.c
diff options
context:
space:
mode:
Diffstat (limited to 'MokManager.c')
-rw-r--r--MokManager.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/MokManager.c b/MokManager.c
index 23ed80eb..bc62cd08 100644
--- a/MokManager.c
+++ b/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");
}