Use dedicated simple password retriever for size of future crypto disks modules and simplify entering passwords routines
This commit is contained in:
parent
c0a6bd447e
commit
b391bdb2f2
7 changed files with 71 additions and 46 deletions
|
@ -19,14 +19,11 @@
|
|||
#define GRUB_AUTH_HEADER 1
|
||||
|
||||
#include <grub/err.h>
|
||||
#include <grub/crypto.h>
|
||||
|
||||
/* Macros for indistinguishibility. */
|
||||
#define GRUB_ACCESS_DENIED grub_error (GRUB_ERR_ACCESS_DENIED, "Access denied.")
|
||||
#define GRUB_GET_PASSWORD(string, len) grub_cmdline_get ("Enter password: ", \
|
||||
string, len, \
|
||||
'*', 0, 0)
|
||||
#define GRUB_AUTH_MAX_PASSLEN 1024
|
||||
|
||||
typedef grub_err_t (*grub_auth_callback_t) (const char*, void *);
|
||||
typedef grub_err_t (*grub_auth_callback_t) (const char *, const char *, void *);
|
||||
|
||||
grub_err_t grub_auth_register_authentication (const char *user,
|
||||
grub_auth_callback_t callback,
|
||||
|
|
|
@ -26,8 +26,6 @@
|
|||
#include <grub/symbol.h>
|
||||
#include <grub/types.h>
|
||||
#include <grub/err.h>
|
||||
/* For GRUB_ACCESS_DENIED. */
|
||||
#include <grub/auth.h>
|
||||
|
||||
typedef enum
|
||||
{
|
||||
|
@ -264,6 +262,12 @@ grub_crypto_pbkdf2 (const struct gcry_md_spec *md,
|
|||
grub_uint8_t *DK, grub_size_t dkLen);
|
||||
|
||||
int
|
||||
grub_crypto_memcmp (void *a, void *b, grub_size_t n);
|
||||
grub_crypto_memcmp (const void *a, const void *b, grub_size_t n);
|
||||
|
||||
int
|
||||
grub_password_get (char buf[], unsigned buf_size);
|
||||
|
||||
/* For indistinguishibility. */
|
||||
#define GRUB_ACCESS_DENIED grub_error (GRUB_ERR_ACCESS_DENIED, "Access denied.")
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue