summaryrefslogtreecommitdiff
path: root/include/PasswordCrypt.h
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2017-10-19 15:44:12 -0400
committerPeter Jones <pmjones@gmail.com>2018-03-12 16:21:43 -0400
commitdc62a3c4dc3dd590fbba32c46b717088a132eb5e (patch)
tree71993be00c4695abd13d139346346bfb4c791d8d /include/PasswordCrypt.h
parent1a44dbb8be12ef2a06d73b8eec07ac0acff27e68 (diff)
downloadefi-boot-shim-dc62a3c4dc3dd590fbba32c46b717088a132eb5e.tar.gz
efi-boot-shim-dc62a3c4dc3dd590fbba32c46b717088a132eb5e.zip
Move includes around to clean the source tree up a bit.
Signed-off-by: Peter Jones <pjones@redhat.com>
Diffstat (limited to 'include/PasswordCrypt.h')
-rw-r--r--include/PasswordCrypt.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/PasswordCrypt.h b/include/PasswordCrypt.h
new file mode 100644
index 00000000..b726f320
--- /dev/null
+++ b/include/PasswordCrypt.h
@@ -0,0 +1,27 @@
+#ifndef __PASSWORD_CRYPT_H__
+#define __PASSWORD_CRYPT_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 /* __PASSWORD_CRYPT_H__ */