From 76f1d0775b52e7a8a1c322214836cde530117512 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Thu, 27 Aug 2020 18:23:58 -0400 Subject: Add support for OpenBSD --- client.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'client.c') diff --git a/client.c b/client.c index 06efeb8..dcfc835 100644 --- a/client.c +++ b/client.c @@ -166,11 +166,16 @@ static void handlePass(struct Client *client, struct Message *msg) { client->error = true; return; } - if (!strcmp(crypt(msg->params[0], clientPass), clientPass)) { +#ifdef __OpenBSD__ + int error = crypt_checkpass(msg->params[0], clientPass); +#else + int error = strcmp(crypt(msg->params[0], clientPass), clientPass); +#endif + if (error) { + passRequired(client); + } else { client->need &= ~NeedPass; maybeSync(client); - } else { - passRequired(client); } explicit_bzero(msg->params[0], strlen(msg->params[0])); } -- cgit 1.4.1