[SECNET RFC PATCH 5/5] sigscheme: Interface for signature schemes
Ian Jackson
ijackson at chiark.greenend.org.uk
Sun Sep 29 14:47:21 BST 2019
There is no implementation here. This is split out like this for
early review.
Signed-off-by: Ian Jackson <ijackson at chiark.greenend.org.uk>
---
secnet.h | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/secnet.h b/secnet.h
index 53a2b6d4..6a1f644e 100644
--- a/secnet.h
+++ b/secnet.h
@@ -359,6 +359,36 @@ extern init_module log_module;
/***** END of module support *****/
+/***** SIGNATURE SCHEMES *****/
+
+struct sigscheme_info;
+
+typedef bool_t sigscheme_loadpub(const struct sigscheme_info *algo,
+ void *pubkeydata, size_t pubkeydata_len,
+ sigpubkey_if **sigpub_r, log_if *log);
+ /* pubkeydata is (supposedly) for this algorithm.
+ * loadpub should log an error if it fails. */
+
+typedef bool_t sigscheme_loadpriv(FILE *privkeyfile,
+ sigprivkey_if **sigpriv_r, log_if *log);
+ /* privkeyfile may contain data for any algorithm, not necessarily
+ * this one! If it is not for this algorithm, return False and do
+ * not log anything. If it *is* for this algorithm but is wrong,
+ * log an error. privkeyfile was opened with rb and starts at the
+ * beginning of the file; it may be left anywhere in the file (or
+ * even with the error flag set) */
+
+struct sigscheme_info {
+ const char *name;
+ sigscheme_loadpub *loadpub;
+ sigscheme_loadpriv *loadpriv;
+};
+
+extern const struct sigscheme_info rsa1_sigscheme;
+extern const struct sigscheme_info sigschemes[]; /* sentinel has name==0 */
+
+/***** END of signature schemes *****/
+
/***** CLOSURE TYPES and interface definitions *****/
#define CL_PURE 0
--
2.11.0
More information about the sgo-software-discuss
mailing list