diff options
author | Steve McIntyre <steve@einval.com> | 2021-03-23 23:49:46 +0000 |
---|---|---|
committer | Steve McIntyre <steve@einval.com> | 2021-03-23 23:49:46 +0000 |
commit | 031e5cce385d3f96b1caa1d53495332a7eb03749 (patch) | |
tree | b4988dfbd191b2242b9294e24075b39a608b1155 /include/passwordcrypt.h | |
parent | 7bf7a6d0852382bb645119b18df3ff461aaba247 (diff) | |
download | efi-boot-shim-upstream/15.3.tar.gz efi-boot-shim-upstream/15.3.zip |
New upstream version 15.3upstream/15.3
Diffstat (limited to 'include/passwordcrypt.h')
-rw-r--r-- | include/passwordcrypt.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/include/passwordcrypt.h b/include/passwordcrypt.h new file mode 100644 index 00000000..4c0e3607 --- /dev/null +++ b/include/passwordcrypt.h @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: BSD-2-Clause-Patent + +#ifndef SHIM_PASSWORDCRYPT_H +#define SHIM_PASSWORDCRYPT_H + +enum HashMethod { + TRADITIONAL_DES = 0, + EXTEND_BSDI_DES, + MD5_BASED, + SHA256_BASED, + SHA512_BASED, + BLOWFISH_BASED +}; + +typedef struct { + UINT16 method; + UINT64 iter_count; + UINT16 salt_size; + UINT8 salt[32]; + UINT8 hash[128]; +} __attribute__ ((packed)) PASSWORD_CRYPT; + +#define PASSWORD_CRYPT_SIZE sizeof(PASSWORD_CRYPT) + +EFI_STATUS password_crypt (const char *password, UINT32 pw_length, + const PASSWORD_CRYPT *pw_hash, UINT8 *hash); +UINT16 get_hash_size (const UINT16 method); + +#endif /* SHIM_PASSWORDCRYPT_H */ |