17c478bd9Sstevel@tonic-gate /* md5.h - an implementation of the MD5 algorithm and MD5 crypt */ 27c478bd9Sstevel@tonic-gate /* 37c478bd9Sstevel@tonic-gate * GRUB -- GRand Unified Bootloader 47c478bd9Sstevel@tonic-gate * Copyright (C) 2000 Free Software Foundation, Inc. 57c478bd9Sstevel@tonic-gate * 67c478bd9Sstevel@tonic-gate * This program is free software; you can redistribute it and/or modify 77c478bd9Sstevel@tonic-gate * it under the terms of the GNU General Public License as published by 87c478bd9Sstevel@tonic-gate * the Free Software Foundation; either version 2 of the License, or 97c478bd9Sstevel@tonic-gate * (at your option) any later version. 107c478bd9Sstevel@tonic-gate * 117c478bd9Sstevel@tonic-gate * This program is distributed in the hope that it will be useful, 127c478bd9Sstevel@tonic-gate * but WITHOUT ANY WARRANTY; without even the implied warranty of 137c478bd9Sstevel@tonic-gate * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 147c478bd9Sstevel@tonic-gate * GNU General Public License for more details. 157c478bd9Sstevel@tonic-gate * 167c478bd9Sstevel@tonic-gate * You should have received a copy of the GNU General Public License 177c478bd9Sstevel@tonic-gate * along with this program; if not, write to the Free Software 187c478bd9Sstevel@tonic-gate * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 197c478bd9Sstevel@tonic-gate */ 207c478bd9Sstevel@tonic-gate 217c478bd9Sstevel@tonic-gate /* If CHECK is true, check a password for correctness. Returns 0 227c478bd9Sstevel@tonic-gate if password was correct, and a value != 0 for error, similarly 237c478bd9Sstevel@tonic-gate to strcmp. 247c478bd9Sstevel@tonic-gate If CHECK is false, crypt KEY and save the result in CRYPTED. 257c478bd9Sstevel@tonic-gate CRYPTED must have a salt. */ 267c478bd9Sstevel@tonic-gate extern int md5_password (const char *key, char *crypted, int check); 277c478bd9Sstevel@tonic-gate 287c478bd9Sstevel@tonic-gate /* For convenience. */ 297c478bd9Sstevel@tonic-gate #define check_md5_password(key,crypted) md5_password((key), (crypted), 1) 307c478bd9Sstevel@tonic-gate #define make_md5_password(key,crypted) md5_password((key), (crypted), 0) 31