chiark / gitweb /
privcache: New closure for signature key handling
[secnet.git] / secnet.h
index ba3e45ddf3989eb97c99b71cc0b448e5dc3e6c71..84e732d88fd2c952d5cbf5ddd9069b79246f67a1 100644 (file)
--- a/secnet.h
+++ b/secnet.h
@@ -391,6 +391,7 @@ extern init_module slip_module;
 extern init_module tun_module;
 extern init_module sha1_module;
 extern init_module log_module;
+extern init_module privcache_module;
 
 /***** END of module support *****/
 
@@ -446,6 +447,7 @@ extern const struct sigscheme_info sigschemes[]; /* sentinel has name==0 */
 #define CL_HASH        12
 #define CL_BUFFER      13
 #define CL_NETLINK     14
+#define CL_PRIVCACHE   15
 
 struct buffer_if;
 
@@ -520,6 +522,19 @@ struct sigprivkey_if {
     sig_dispose_fn *dispose;
 };
 
+/* PRIVCACHE interface */
+
+typedef struct sigprivkey_if *privcache_lookup_fn(void *st,
+                                          const struct sigkeyid *id,
+                                          struct log_if*);
+  /* Return is valid only until you return from the current event!
+   * You do not need to call ->sethash. */
+
+struct privcache_if {
+    void *st;
+    privcache_lookup_fn *lookup;
+};
+
 /* COMM interface */
 
 struct comm_addr {