From c9b87029c1f0eba01ea7d0ef7be10f8cfcfa8432 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Thu, 10 Apr 2014 23:20:15 -0700 Subject: [PATCH] crypto_hash_sha256_update() cannot fail --- src/libsodium/crypto_hash/sha256/cp/hash_sha256.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/libsodium/crypto_hash/sha256/cp/hash_sha256.c b/src/libsodium/crypto_hash/sha256/cp/hash_sha256.c index 95e91d37..9446f8dc 100644 --- a/src/libsodium/crypto_hash/sha256/cp/hash_sha256.c +++ b/src/libsodium/crypto_hash/sha256/cp/hash_sha256.c @@ -286,10 +286,7 @@ crypto_hash(unsigned char *out, const unsigned char *in, crypto_hash_sha256_state state; crypto_hash_sha256_init(&state); - if (crypto_hash_sha256_update(&state, in, inlen) != 0) { - sodium_memzero(out, crypto_hash_BYTES); - return -1; - } + crypto_hash_sha256_update(&state, in, inlen); crypto_hash_sha256_final(&state, out); return 0;