diff options
author | djm@openbsd.org <djm@openbsd.org> | 2022-10-28 02:41:17 +0200 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2022-10-28 03:46:59 +0200 |
commit | 7d00799c935271ce89300494c5677190779f6453 (patch) | |
tree | 14b674e5ef56ed3f05af8b38c446b8f1cf5c2f39 /ssh-ecdsa-sk.c | |
parent | upstream: factor out key generation (diff) | |
download | openssh-7d00799c935271ce89300494c5677190779f6453.tar.xz openssh-7d00799c935271ce89300494c5677190779f6453.zip |
upstream: refactor sshkey_from_private()
feedback/ok markus@
OpenBSD-Commit-ID: e5dbe7a3545930c50f70ee75c867a1e08b382b53
Diffstat (limited to 'ssh-ecdsa-sk.c')
-rw-r--r-- | ssh-ecdsa-sk.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/ssh-ecdsa-sk.c b/ssh-ecdsa-sk.c index cbc9b0e1c..2a67df8a4 100644 --- a/ssh-ecdsa-sk.c +++ b/ssh-ecdsa-sk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh-ecdsa-sk.c,v 1.12 2022/10/28 00:39:29 djm Exp $ */ +/* $OpenBSD: ssh-ecdsa-sk.c,v 1.13 2022/10/28 00:41:17 djm Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * Copyright (c) 2010 Damien Miller. All rights reserved. @@ -96,6 +96,18 @@ ssh_ecdsa_sk_serialize_public(const struct sshkey *key, struct sshbuf *b, return 0; } +static int +ssh_ecdsa_sk_copy_public(const struct sshkey *from, struct sshkey *to) +{ + int r; + + if ((r = sshkey_ecdsa_funcs.copy_public(from, to)) != 0) + return r; + if ((r = sshkey_copy_public_sk(from, to)) != 0) + return r; + return 0; +} + /* * Check FIDO/W3C webauthn signatures clientData field against the expected * format and prepare a hash of it for use in signature verification. @@ -363,6 +375,7 @@ static const struct sshkey_impl_funcs sshkey_ecdsa_sk_funcs = { /* .equal = */ ssh_ecdsa_sk_equal, /* .ssh_serialize_public = */ ssh_ecdsa_sk_serialize_public, /* .generate = */ NULL, + /* .copy_public = */ ssh_ecdsa_sk_copy_public, }; const struct sshkey_impl sshkey_ecdsa_sk_impl = { |