From ece73ab6e11d65dfc16995f9324e2ff1f759f4c2 Mon Sep 17 00:00:00 2001 From: tedu <> Date: Sat, 18 Jul 2015 00:56:37 +0000 Subject: [PATCH] standards compliant error return (null). will make ruby happier, at least. ok deraadt jeremy --- src/lib/libc/crypt/bcrypt.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/lib/libc/crypt/bcrypt.c b/src/lib/libc/crypt/bcrypt.c index bc9441cc..04c04e89 100644 --- a/src/lib/libc/crypt/bcrypt.c +++ b/src/lib/libc/crypt/bcrypt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bcrypt.c,v 1.52 2015/01/28 23:33:52 tedu Exp $ */ +/* $OpenBSD: bcrypt.c,v 1.53 2015/07/18 00:56:37 tedu Exp $ */ /* * Copyright (c) 2014 Ted Unangst @@ -385,12 +385,9 @@ char * bcrypt(const char *pass, const char *salt) { static char gencrypted[BCRYPT_HASHSPACE]; - static char gerror[2]; - /* How do I handle errors ? Return ':' */ - strlcpy(gerror, ":", sizeof(gerror)); if (bcrypt_hashpass(pass, salt, gencrypted, sizeof(gencrypted)) != 0) - return gerror; + return NULL; return gencrypted; }