summaryrefslogtreecommitdiff
path: root/ssh-ed25519-sk.c
diff options
context:
space:
mode:
authormarkus@openbsd.org <markus@openbsd.org>2019-11-12 19:34:40 +0000
committerDamien Miller <djm@mindrot.org>2019-11-13 08:54:09 +1100
commitb556cc3cbf0c43f073bb41bba4e92ca709a1ec13 (patch)
treeefe6046187a7bc035e427b99e269e7a88cbac59f /ssh-ed25519-sk.c
parent3fcf69ace19e75cf9dcd7206f396adfcb29611a8 (diff)
downloadopenssh-git-b556cc3cbf0c43f073bb41bba4e92ca709a1ec13.tar.gz
upstream: remove extra layer for ed25519 signature; ok djm@
OpenBSD-Commit-ID: 7672d9d0278b4bf656a12d3aab0c0bfe92a8ae47
Diffstat (limited to 'ssh-ed25519-sk.c')
-rw-r--r--ssh-ed25519-sk.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/ssh-ed25519-sk.c b/ssh-ed25519-sk.c
index f42c8830..622cb45c 100644
--- a/ssh-ed25519-sk.c
+++ b/ssh-ed25519-sk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-ed25519-sk.c,v 1.1 2019/11/12 19:29:24 markus Exp $ */
+/* $OpenBSD: ssh-ed25519-sk.c,v 1.2 2019/11/12 19:34:40 markus Exp $ */
/*
* Copyright (c) 2019 Markus Friedl. All rights reserved.
*
@@ -36,7 +36,6 @@ ssh_ed25519_sk_verify(const struct sshkey *key,
const u_char *data, size_t datalen, u_int compat)
{
struct sshbuf *b = NULL;
- struct sshbuf *sigbuf = NULL;
struct sshbuf *encoded = NULL;
char *ktype = NULL;
const u_char *sigblob;
@@ -60,10 +59,9 @@ ssh_ed25519_sk_verify(const struct sshkey *key,
if ((b = sshbuf_from(signature, signaturelen)) == NULL)
return SSH_ERR_ALLOC_FAIL;
if (sshbuf_get_cstring(b, &ktype, NULL) != 0 ||
- sshbuf_froms(b, &sigbuf) != 0 ||
- sshbuf_get_string_direct(sigbuf, &sigblob, &len) != 0 ||
- sshbuf_get_u8(sigbuf, &sig_flags) != 0 ||
- sshbuf_get_u32(sigbuf, &sig_counter) != 0) {
+ sshbuf_get_string_direct(b, &sigblob, &len) != 0 ||
+ sshbuf_get_u8(b, &sig_flags) != 0 ||
+ sshbuf_get_u32(b, &sig_counter) != 0) {
r = SSH_ERR_INVALID_FORMAT;
goto out;
}
@@ -123,7 +121,6 @@ ssh_ed25519_sk_verify(const struct sshkey *key,
free(m);
}
sshbuf_free(b);
- sshbuf_free(sigbuf);
sshbuf_free(encoded);
free(ktype);
return r;