summaryrefslogtreecommitdiff
path: root/sshkey.h
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2022-10-28 00:35:40 +0000
committerDamien Miller <djm@mindrot.org>2022-10-28 12:46:56 +1100
commit25de1c01a8b9a2c8ab9b1da22444a03e89c982de (patch)
tree286c31a5342ca485bdb117315b7ce908e4bf4432 /sshkey.h
parent445363433ba20b8a3e655b113858c836da46a1cb (diff)
downloadopenssh-git-25de1c01a8b9a2c8ab9b1da22444a03e89c982de.tar.gz
upstream: begin big refactor of sshkey
Move keytype data and some of the type-specific code (allocation, cleanup, etc) out into each key type's implementation. Subsequent commits will move more, with the goal of having each key-*.c file owning as much of its keytype's implementation as possible. lots of feedback + ok markus@ OpenBSD-Commit-ID: 0f2b4334f73914344e9e5b3d33522d41762a57ec
Diffstat (limited to 'sshkey.h')
-rw-r--r--sshkey.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/sshkey.h b/sshkey.h
index be254e6b..3ec0e87b 100644
--- a/sshkey.h
+++ b/sshkey.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshkey.h,v 1.52 2022/09/17 10:30:45 djm Exp $ */
+/* $OpenBSD: sshkey.h,v 1.53 2022/10/28 00:35:40 djm Exp $ */
/*
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
@@ -164,6 +164,24 @@ struct sshkey_sig_details {
uint8_t sk_flags; /* U2F signature flags; see ssh-sk.h */
};
+struct sshkey_impl_funcs {
+ u_int (*size)(const struct sshkey *); /* optional */
+ int (*alloc)(struct sshkey *); /* optional */
+ void (*cleanup)(struct sshkey *); /* optional */
+};
+
+struct sshkey_impl {
+ const char *name;
+ const char *shortname;
+ const char *sigalg;
+ int type;
+ int nid;
+ int cert;
+ int sigonly;
+ int keybits;
+ const struct sshkey_impl_funcs *funcs;
+};
+
struct sshkey *sshkey_new(int);
void sshkey_free(struct sshkey *);
int sshkey_equal_public(const struct sshkey *,