server/src/util/password.c

19 lines
406 B
C
Raw Normal View History

#include <platform.h>
#include "password.h"
#include <assert.h>
#include <string.h>
#include <stdio.h>
2016-02-25 10:46:46 +01:00
bool password_is_implemented(int algo) {
2016-07-13 19:10:22 +02:00
return algo == PASSWORD_PLAINTEXT;
}
const char * password_encode(const char * passwd, int algo) {
2016-07-13 19:10:22 +02:00
return passwd;
}
int password_verify(const char * pwhash, const char * passwd) {
2016-07-13 19:10:22 +02:00
return (strcmp(passwd, pwhash) == 0) ? VERIFY_OK : VERIFY_FAIL;
}