efi-boot-shim/PasswordCrypt.h
Gary Ching-Pang Lin 3a838b14f0 MokManager: support crypt() password hash
The password format is introduced for the password hash generated by crypt(),
so that the user can import the password hash from /etc/shadow. The packager,
especially those who packages 3rd party drivers, can utilize this feature to
import a 3rd party certificate without interfering the package installation.

This commit implements the sha256-based crypt() hash function.

Conflicts:
	Makefile
	MokManager.c
2013-09-26 11:58:01 -04:00

27 lines
538 B
C

#ifndef __PASSWORD_CRYPT_H__
#define __PASSWORD_CRYPT_H__
enum HashMethod {
TRANDITIONAL_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);
#endif /* __PASSWORD_CRYPT_H__ */