mirror of
https://github.com/jedisct1/libsodium.git
synced 2026-08-26 11:47:13 +09:00
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.
This commit is contained in:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user