Browse Source

Check outlen in blake2b_final

Not required in Sodium since the check is already performed in
higher-level functions, but it doesn't hurt either.
next
Frank Denis 10 years ago
parent
commit
a7d38ef15d
  1. 3
      src/libsodium/crypto_generichash/blake2/ref/blake2b-ref.c

3
src/libsodium/crypto_generichash/blake2/ref/blake2b-ref.c

@ -387,6 +387,9 @@ int blake2b_final( blake2b_state *S, uint8_t *out, uint8_t outlen )
uint8_t buffer[BLAKE2B_OUTBYTES];
int i;
if( outlen > BLAKE2B_OUTBYTES ) {
return -1;
}
if( S->buflen > BLAKE2B_BLOCKBYTES )
{
blake2b_increment_counter( S, BLAKE2B_BLOCKBYTES );

Loading…
Cancel
Save