allow more crypted password types
This commit is contained in:
3
auth.c
3
auth.c
@@ -12,6 +12,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <alloca.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include "ldap.h"
|
||||
#include "auth.h"
|
||||
#include <libowfat/str.h>
|
||||
@@ -31,7 +32,7 @@ int check_password(const char* fromdb,struct string* plaintext) {
|
||||
if (str_equal(md5,fromdb+5))
|
||||
return 1;
|
||||
}
|
||||
if (plaintext->l<100 && (str_start(fromdb,"$1$") || strlen(fromdb)==13)) {
|
||||
if (plaintext->l<100 && ((fromdb[0]=='$' && fromdb[2]=='$' && isdigit(fromdb[1])) || strlen(fromdb)==13)) {
|
||||
char* c=alloca(plaintext->l+1);
|
||||
byte_copy(c,plaintext->l,plaintext->s);
|
||||
c[plaintext->l]=0;
|
||||
|
||||
Reference in New Issue
Block a user