diff options
| author | Peter Jones <pjones@redhat.com> | 2017-09-28 12:23:17 -0400 |
|---|---|---|
| committer | Peter Jones <pmjones@gmail.com> | 2018-03-12 16:21:43 -0400 |
| commit | 1c2376338d57c900fbc1c2fe6d9c30cfe20e44be (patch) | |
| tree | 293bb98f7e683d2af3b1490bb2b8554c9ac52aa5 /PasswordCrypt.c | |
| parent | ee07a19d7ef3dc2e3fc0204aba4def95eeeadf95 (diff) | |
| download | efi-boot-shim-1c2376338d57c900fbc1c2fe6d9c30cfe20e44be.tar.gz efi-boot-shim-1c2376338d57c900fbc1c2fe6d9c30cfe20e44be.zip | |
shim: Use EFI_ERROR() instead of comparing to EFI_SUCCESS everywhere.
Also consistently name our status variable "efi_status" unless there's a
good reason not to, such as already having another one of those.
Signed-off-by: Peter Jones <pjones@redhat.com>
Diffstat (limited to 'PasswordCrypt.c')
| -rw-r--r-- | PasswordCrypt.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/PasswordCrypt.c b/PasswordCrypt.c index 793cb72c..2eb971dd 100644 --- a/PasswordCrypt.c +++ b/PasswordCrypt.c @@ -286,7 +286,7 @@ static EFI_STATUS blowfish_crypt (const char *key, const char *salt, UINT8 *hash EFI_STATUS password_crypt (const char *password, UINT32 pw_length, const PASSWORD_CRYPT *pw_crypt, UINT8 *hash) { - EFI_STATUS status; + EFI_STATUS efi_status; if (!pw_crypt) return EFI_INVALID_PARAMETER; @@ -294,32 +294,36 @@ EFI_STATUS password_crypt (const char *password, UINT32 pw_length, switch (pw_crypt->method) { case TRADITIONAL_DES: case EXTEND_BSDI_DES: - status = EFI_UNSUPPORTED; + efi_status = EFI_UNSUPPORTED; break; case MD5_BASED: - status = md5_crypt (password, pw_length, (char *)pw_crypt->salt, - pw_crypt->salt_size, hash); + efi_status = md5_crypt (password, pw_length, + (char *)pw_crypt->salt, + pw_crypt->salt_size, hash); break; case SHA256_BASED: - status = sha256_crypt(password, pw_length, (char *)pw_crypt->salt, - pw_crypt->salt_size, pw_crypt->iter_count, - hash); + efi_status = sha256_crypt(password, pw_length, + (char *)pw_crypt->salt, + pw_crypt->salt_size, + pw_crypt->iter_count, hash); break; case SHA512_BASED: - status = sha512_crypt(password, pw_length, (char *)pw_crypt->salt, - pw_crypt->salt_size, pw_crypt->iter_count, - hash); + efi_status = sha512_crypt(password, pw_length, + (char *)pw_crypt->salt, + pw_crypt->salt_size, + pw_crypt->iter_count, hash); break; case BLOWFISH_BASED: if (pw_crypt->salt_size != (7 + 22 + 1)) { - status = EFI_INVALID_PARAMETER; + efi_status = EFI_INVALID_PARAMETER; break; } - status = blowfish_crypt(password, (char *)pw_crypt->salt, hash); + efi_status = blowfish_crypt(password, (char *)pw_crypt->salt, + hash); break; default: return EFI_INVALID_PARAMETER; } - return status; + return efi_status; } |
