-/* $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 <tedu@openbsd.org>
*
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");