From 4534a35b2eb4fdfd71c13a923f6e2f3f729ea410 Mon Sep 17 00:00:00 2001 From: espie Date: Thu, 15 May 2014 13:14:15 +0000 Subject: [PATCH] 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@ --- usr.bin/signify/signify.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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"); -- 2.20.1