diff options
| author | Matthew Garrett <mjg@redhat.com> | 2012-10-18 17:43:53 -0400 |
|---|---|---|
| committer | Matthew Garrett <mjg@redhat.com> | 2012-10-18 17:43:53 -0400 |
| commit | 16c512f9b5930da742e4014dbe26d3c895d689c3 (patch) | |
| tree | 8f500f60fc2d3a6b6f1f1be4382c58a00ba54d60 | |
| parent | 37635f541465578e29c2c6e908a24e74f240d728 (diff) | |
| download | efi-boot-shim-16c512f9b5930da742e4014dbe26d3c895d689c3.tar.gz efi-boot-shim-16c512f9b5930da742e4014dbe26d3c895d689c3.zip | |
Don't print SHA1 sum when calculating file fingerprints
There's no point in printing the SHA1 of a SHA256...
| -rw-r--r-- | MokManager.c | 30 |
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"); } |
