argon2 - copy raw hash after possible encoding, not before
(irrelevant in libsodium)
This commit is contained in:
parent
4a75300b45
commit
3b9cbcf60d
@ -134,11 +134,6 @@ argon2_hash(const uint32_t t_cost, const uint32_t m_cost,
|
||||
return result;
|
||||
}
|
||||
|
||||
/* if raw hash requested, write it */
|
||||
if (hash) {
|
||||
memcpy(hash, out, hashlen);
|
||||
}
|
||||
|
||||
/* if encoding requested, write it */
|
||||
if (encoded && encodedlen) {
|
||||
if (argon2_encode_string(encoded, encodedlen,
|
||||
@ -150,6 +145,11 @@ argon2_hash(const uint32_t t_cost, const uint32_t m_cost,
|
||||
}
|
||||
}
|
||||
|
||||
/* if raw hash requested, write it */
|
||||
if (hash) {
|
||||
memcpy(hash, out, hashlen);
|
||||
}
|
||||
|
||||
sodium_memzero(out, hashlen);
|
||||
free(out);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user