aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pki_ed25519.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/pki_ed25519.c b/src/pki_ed25519.c
index a51f6c6b..393948ac 100644
--- a/src/pki_ed25519.c
+++ b/src/pki_ed25519.c
@@ -76,16 +76,18 @@ int pki_ed25519_sign(const ssh_key privkey,
if (rc != 0) {
goto error;
}
- sig->ed25519_sig = malloc(ED25519_SIG_LEN);
- if (sig->ed25519_sig == NULL) {
- goto error;
- }
/* This shouldn't happen */
if (dlen - hlen != ED25519_SIG_LEN) {
goto error;
}
- memcpy(sig->ed25519_sig, buffer, dlen - hlen);
+
+ sig->ed25519_sig = malloc(ED25519_SIG_LEN);
+ if (sig->ed25519_sig == NULL) {
+ goto error;
+ }
+
+ memcpy(sig->ed25519_sig, buffer, ED25519_SIG_LEN);
SAFE_FREE(buffer);
return SSH_OK;