mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 06:13:31 +01:00
crypt_ops: Stop using a separate buffer in ed25519_signature_from_base64()
Part of 29960.
This commit is contained in:
parent
ac269d5c30
commit
ebbc2c3d8f
@ -248,11 +248,9 @@ ed25519_signature_from_base64(ed25519_signature_t *sig,
|
||||
{
|
||||
if (strlen(input) != ED25519_SIG_BASE64_LEN)
|
||||
return -1;
|
||||
char buf[ED25519_SIG_BASE64_LEN+1];
|
||||
memcpy(buf, input, ED25519_SIG_BASE64_LEN);
|
||||
buf[ED25519_SIG_BASE64_LEN] = 0;
|
||||
char decoded[128];
|
||||
int n = base64_decode(decoded, sizeof(decoded), buf, strlen(buf));
|
||||
int n = base64_decode(decoded, sizeof(decoded), input,
|
||||
ED25519_SIG_BASE64_LEN);
|
||||
if (n < 0 || n != ED25519_SIG_LEN)
|
||||
return -1;
|
||||
memcpy(sig->sig, decoded, ED25519_SIG_LEN);
|
||||
|
Loading…
Reference in New Issue
Block a user