From: espie Date: Thu, 15 May 2014 13:14:15 +0000 (+0000) Subject: fix the band-aid error. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=4534a35b2eb4fdfd71c13a923f6e2f3f729ea410;p=openbsd fix the band-aid error. tedu was bitten by the RETARDED interface in sha2.h (who names string LENGTH things that are actually buffer SIZES) ? make -C mode work again. okay beck@ --- diff --git a/usr.bin/signify/signify.c b/usr.bin/signify/signify.c index 0d9e01ef733..e5cdfb4abd1 100644 --- a/usr.bin/signify/signify.c +++ b/usr.bin/signify/signify.c @@ -1,4 +1,4 @@ -/* $OpenBSD: signify.c,v 1.83 2014/05/14 16:02:34 tedu Exp $ */ +/* $OpenBSD: signify.c,v 1.84 2014/05/15 13:14:15 espie Exp $ */ /* * Copyright (c) 2013 Ted Unangst * @@ -544,8 +544,8 @@ recodehash(char *hash) uint8_t data[HASHBUFSIZE / 2]; int i, rv; - if (strlen(hash) == SHA256_DIGEST_STRING_LENGTH || - strlen(hash) == SHA512_DIGEST_STRING_LENGTH) + if (strlen(hash)+1 == SHA256_DIGEST_STRING_LENGTH || + strlen(hash)+1 == SHA512_DIGEST_STRING_LENGTH) return; if ((rv = b64_pton(hash, data, sizeof(data))) == -1) errx(1, "invalid base64 encoding");