#include <string.h>
#include <ctype.h>
-#if HAVE_CRYPT_H
-# include <crypt.h>
-#endif
-
#if HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
VALUE_PAIR *password_pair;
VALUE_PAIR *auth_item;
char string[MAX_STRING_LEN];
- const char *crypted_password;
int auth_type = -1;
int result;
int auth_type_count = 0;
return -1;
}
- crypted_password = crypt((char *)auth_item->strvalue,
- (char *)password_pair->strvalue);
- if (!crypted_password) {
- rad_authlog("Login incorrect "
- "(system failed to supply an encrypted password for comparison)", request, 0);
- return -1;
- }
- if (strcmp((char *)password_pair->strvalue,
- crypted_password) != 0) {
- return -1;
+ switch (lrad_crypt_check((char *)auth_item->strvalue,
+ (char *)password_pair->strvalue)) {
+ case -1:
+ rad_authlog("Login incorrect "
+ "(system failed to supply an encrypted password for comparison)", request, 0);
+ case 1:
+ return -1;
}
break;
case PW_AUTHTYPE_LOCAL: