diff options
| author | Gary Ching-Pang Lin <glin@suse.com> | 2013-01-24 18:24:49 +0800 |
|---|---|---|
| committer | Peter Jones <pjones@redhat.com> | 2013-09-26 11:58:01 -0400 |
| commit | 9b41d26597e03af91de22b84c13d82a350d877ec (patch) | |
| tree | 310d10e590a7c40121455b165708dd5dc820ff0b /MokManager.c | |
| parent | afb61e79027d2a5de9edfcab8de163609894f930 (diff) | |
| download | efi-boot-shim-9b41d26597e03af91de22b84c13d82a350d877ec.tar.gz efi-boot-shim-9b41d26597e03af91de22b84c13d82a350d877ec.zip | |
MokManager: support SHA512-based crypt() hash
Diffstat (limited to 'MokManager.c')
| -rw-r--r-- | MokManager.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/MokManager.c b/MokManager.c index 66e33ce9..4cf836fd 100644 --- a/MokManager.c +++ b/MokManager.c @@ -638,7 +638,7 @@ static EFI_STATUS match_password (PASSWORD_CRYPT *pw_crypt, UINT8 *auth, CHAR16 *prompt) { EFI_STATUS status; - UINT8 hash[SHA256_DIGEST_SIZE]; + UINT8 hash[128]; UINT8 *auth_hash; UINT32 auth_size; CHAR16 password[PASSWORD_MAX]; @@ -647,14 +647,10 @@ static EFI_STATUS match_password (PASSWORD_CRYPT *pw_crypt, int i; if (pw_crypt) { - /* - * Only support sha256 now - */ - if(pw_crypt->method != SHA256_BASED) - return EFI_INVALID_PARAMETER; auth_hash = pw_crypt->hash; - /* FIXME assign auth_size according to pw_crypt->method */ - auth_size = SHA256_DIGEST_SIZE; + auth_size = get_hash_size (pw_crypt->method); + if (auth_size == 0) + return EFI_INVALID_PARAMETER; } else if (auth) { auth_hash = auth; auth_size = SHA256_DIGEST_SIZE; |
