summaryrefslogtreecommitdiff
path: root/ssh-ed25519-sk.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2022-10-28 00:41:17 +0000
committerDamien Miller <djm@mindrot.org>2022-10-28 12:46:59 +1100
commit7d00799c935271ce89300494c5677190779f6453 (patch)
tree14b674e5ef56ed3f05af8b38c446b8f1cf5c2f39 /ssh-ed25519-sk.c
parent262647c2e920492ca57f1b9320d74f4a0f6e482b (diff)
downloadopenssh-git-7d00799c935271ce89300494c5677190779f6453.tar.gz
upstream: refactor sshkey_from_private()
feedback/ok markus@ OpenBSD-Commit-ID: e5dbe7a3545930c50f70ee75c867a1e08b382b53
Diffstat (limited to 'ssh-ed25519-sk.c')
-rw-r--r--ssh-ed25519-sk.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/ssh-ed25519-sk.c b/ssh-ed25519-sk.c
index 6236ee12..b04d0690 100644
--- a/ssh-ed25519-sk.c
+++ b/ssh-ed25519-sk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-ed25519-sk.c,v 1.10 2022/10/28 00:39:29 djm Exp $ */
+/* $OpenBSD: ssh-ed25519-sk.c,v 1.11 2022/10/28 00:41:17 djm Exp $ */
/*
* Copyright (c) 2019 Markus Friedl. All rights reserved.
*
@@ -70,6 +70,18 @@ ssh_ed25519_sk_serialize_public(const struct sshkey *key, struct sshbuf *b,
return 0;
}
+static int
+ssh_ed25519_sk_copy_public(const struct sshkey *from, struct sshkey *to)
+{
+ int r;
+
+ if ((r = sshkey_ed25519_funcs.copy_public(from, to)) != 0)
+ return r;
+ if ((r = sshkey_copy_public_sk(from, to)) != 0)
+ return r;
+ return 0;
+}
+
int
ssh_ed25519_sk_verify(const struct sshkey *key,
const u_char *signature, size_t signaturelen,
@@ -204,6 +216,7 @@ static const struct sshkey_impl_funcs sshkey_ed25519_sk_funcs = {
/* .equal = */ ssh_ed25519_sk_equal,
/* .ssh_serialize_public = */ ssh_ed25519_sk_serialize_public,
/* .generate = */ NULL,
+ /* .copy_public = */ ssh_ed25519_sk_copy_public,
};
const struct sshkey_impl sshkey_ed25519_sk_impl = {