1 |
/* md5.c - an implementation of the MD5 algorithm and MD5 crypt */ |
/* md5.c - an implementation of the MD5 algorithm and MD5 crypt */ |
2 |
/* |
/* |
3 |
* GRUB -- GRand Unified Bootloader |
* GRUB -- GRand Unified Bootloader |
4 |
* Copyright (C) 2000 Free Software Foundation, Inc. |
* Copyright (C) 2000, 2001 Free Software Foundation, Inc. |
5 |
* |
* |
6 |
* This program is free software; you can redistribute it and/or modify |
* This program is free software; you can redistribute it and/or modify |
7 |
* it under the terms of the GNU General Public License as published by |
* it under the terms of the GNU General Public License as published by |
215 |
unsigned char *digest; |
unsigned char *digest; |
216 |
|
|
217 |
if (check) |
if (check) |
218 |
saltlen = strstr (salt, "$") - salt; |
{ |
219 |
|
/* If our crypted password isn't 3 chars, then it can't be md5 |
220 |
|
crypted. So, they don't match. */ |
221 |
|
if (strlen(crypted) <= 3) |
222 |
|
return 1; |
223 |
|
|
224 |
|
saltlen = strstr (salt, "$") - salt; |
225 |
|
} |
226 |
else |
else |
227 |
{ |
{ |
228 |
char *end = strstr (salt, "$"); |
char *end = strstr (salt, "$"); |