mirror of
https://github.com/jedisct1/libsodium.git
synced 2026-08-25 08:37:13 +09:00
crypto_sign(): read the copy, not the message, to properly handle overlaps
This commit is contained in:
@@ -63,7 +63,8 @@ crypto_sign(unsigned char *sm, unsigned long long *smlen,
|
||||
|
||||
memmove(sm + crypto_sign_ed25519_BYTES, m, mlen);
|
||||
/* LCOV_EXCL_START */
|
||||
if (crypto_sign_detached(sm, &siglen, m, mlen, sk) != 0 ||
|
||||
if (crypto_sign_detached(sm, &siglen, sm + crypto_sign_ed25519_BYTES,
|
||||
mlen, sk) != 0 ||
|
||||
siglen != crypto_sign_ed25519_BYTES) {
|
||||
if (smlen != NULL) {
|
||||
*smlen = 0;
|
||||
|
||||
Reference in New Issue
Block a user