diff options
author | Simon Tatham <anakin@pobox.com> | 2022-04-19 19:05:36 +0300 |
---|---|---|
committer | Simon Tatham <anakin@pobox.com> | 2022-04-24 10:39:04 +0300 |
commit | f9775a7b676c8878239eafe8c88cc6b9240eda86 (patch) | |
tree | d05fe334a55a404202870aa06f16c67cf1b23229 /utils | |
parent | 6143a50ed228fdf5a72c2970629b4ff643d001fc (diff) |
Make ssh_keyalg's supported_flags a method.
It's a class method rather than an object method, so it doesn't allow
keys with the same algorithm to make different choices about what
flags they support. But that's not what I wanted it for: the real
purpose is to allow one key algorithm to delegate supported_flags to
another, by having its method implementation call the one from the
delegate class.
(If only C's compile/link model permitted me to initialise a field of
one global const struct variable to be a copy of that of another, I
wouldn't need the runtime overhead of this method! But object file
formats don't let you even specify that.)
Most key algorithms support no flags at all, so they all want to use
the same implementation of this method. So I've started a file of
stubs utils/nullkey.c to contain the common stub version.
Diffstat (limited to 'utils')
-rw-r--r-- | utils/CMakeLists.txt | 1 | ||||
-rw-r--r-- | utils/nullkey.c | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt index 787bcefc..94192f98 100644 --- a/utils/CMakeLists.txt +++ b/utils/CMakeLists.txt @@ -35,6 +35,7 @@ add_sources_from_current_dir(utils memory.c memxor.c null_lp.c + nullkey.c nullseat.c nullstrcmp.c out_of_memory.c diff --git a/utils/nullkey.c b/utils/nullkey.c new file mode 100644 index 00000000..e8e77d50 --- /dev/null +++ b/utils/nullkey.c @@ -0,0 +1,6 @@ +#include "ssh.h" + +unsigned nullkey_supported_flags(const ssh_keyalg *self) +{ + return 0; +} |