summaryrefslogtreecommitdiff
path: root/include/PasswordCrypt.h
diff options
context:
space:
mode:
authorMathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>2018-07-24 16:24:23 -0400
committerMathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>2018-07-24 16:24:23 -0400
commitf892ac66084ab0315adb0c52e4a39b518730d023 (patch)
tree0b41430bab3e1cf51e37476a5e6548f639cb7ec6 /include/PasswordCrypt.h
parent6215e920e71f5c6c43189f27b755e7a3238ad396 (diff)
downloadefi-boot-shim-upstream/15+1531942534.dd3230d.tar.gz
efi-boot-shim-upstream/15+1531942534.dd3230d.zip
New upstream version 15+1531942534.dd3230dupstream/15+1531942534.dd3230d
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..cadad727
--- /dev/null
+++ b/include/PasswordCrypt.h
@@ -0,0 +1,27 @@
+#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 */