~jonathank89/burg/burg-percise

« back to all changes in this revision

Viewing changes to include/grub/auth.h

merge mainline into mips

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 *  You should have received a copy of the GNU General Public License
16
16
 *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
17
17
 */
18
 
#ifndef GRUB_AURH_HEADER
 
18
#ifndef GRUB_AUTH_HEADER
19
19
#define GRUB_AUTH_HEADER        1
20
20
 
21
21
#include <grub/err.h>
22
 
#include <grub/i18n.h>
23
 
 
24
 
/* Macros for indistinguishibility.  */
25
 
#define GRUB_ACCESS_DENIED grub_error (GRUB_ERR_ACCESS_DENIED, "access denied")
26
 
#define GRUB_GET_PASSWORD(string, len) grub_cmdline_get (N_("Enter password:"), \
27
 
                                                         string, len,   \
28
 
                                                         '*', 0, 0)
29
 
 
30
 
/* Like strcmp but untimeable. Accepts NULL as second argument.  */
31
 
int grub_auth_strcmp (const char *user_input, const char *template);
32
 
/* Like strcmp but untimeable and ignores commas in needle.  */
33
 
int grub_auth_strword (const char *haystack, const char *needle);
34
 
 
35
 
typedef grub_err_t (*grub_auth_callback_t) (const char*, void *);
 
22
#include <grub/crypto.h>
 
23
 
 
24
#define GRUB_AUTH_MAX_PASSLEN 1024
 
25
 
 
26
typedef grub_err_t (*grub_auth_callback_t) (const char *, const char *, void *);
36
27
 
37
28
grub_err_t grub_auth_register_authentication (const char *user,
38
29
                                              grub_auth_callback_t callback,