X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=include%2Fmd5.h;fp=include%2Fmd5.h;h=c1dbd060740b444f8d203dc9d2648dee37b278e8;hb=f4ebbd9f7ea23e3f0fcbe098754580c220894628;hp=0000000000000000000000000000000000000000;hpb=f42aaadb5c8c5f7f15e5159cbc251e64e1a4ac8f;p=yaboot.git diff --git a/include/md5.h b/include/md5.h new file mode 100644 index 0000000..c1dbd06 --- /dev/null +++ b/include/md5.h @@ -0,0 +1,30 @@ +/* md5.h - an implementation of the MD5 algorithm and MD5 crypt */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2000 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* If CHECK is true, check a password for correctness. Returns 0 + if password was correct, and a value != 0 for error, similarly + to strcmp. + If CHECK is false, crypt KEY and save the result in CRYPTED. + CRYPTED must have a salt. */ +extern int md5_password (const char *key, char *crypted, int check); + +/* For convenience. */ +#define check_md5_password(key,crypted) md5_password((key), (crypted), 1) +#define make_md5_password(key,crypted) md5_password((key), (crypted), 0)