site.c, dh.c, secnet.h: Allow the dh `makeshared' method to fail.
[secnet] / secnet.h
index e253a14..b23ffa8 100644 (file)
--- a/secnet.h
+++ b/secnet.h
@@ -354,6 +354,7 @@ extern init_module md5_module;
 extern init_module slip_module;
 extern init_module tun_module;
 extern init_module sha1_module;
+extern init_module sha512_module;
 extern init_module log_module;
 
 /***** END of module support *****/
@@ -402,8 +403,8 @@ struct resolver_if {
 
 /* RANDOMSRC interface */
 
-/* Return some random data. Returns TRUE for success. */
-typedef bool_t random_fn(void *st, int32_t bytes, uint8_t *buff);
+/* Return some random data. Cannot fail. */
+typedef void random_fn(void *st, int32_t bytes, uint8_t *buff);
 
 struct random_if {
     void *st;
@@ -574,7 +575,7 @@ struct transform_inst_if {
 
 struct transform_if {
     void *st;
-    int capab_transformnum;
+    int capab_bit;
     int32_t keylen; /* <<< INT_MAX */
     transform_createinstance_fn *create;
 };
@@ -615,9 +616,9 @@ struct netlink_if {
 typedef string_t dh_makepublic_fn(void *st, uint8_t *secret,
                                  int32_t secretlen);
 /* Fills buffer (up to buflen) with shared secret */
-typedef void dh_makeshared_fn(void *st, uint8_t *secret,
-                             int32_t secretlen, cstring_t rempublic,
-                             uint8_t *sharedsecret, int32_t buflen);
+typedef bool_t dh_makeshared_fn(void *st, uint8_t *secret,
+                               int32_t secretlen, cstring_t rempublic,
+                               uint8_t *sharedsecret, int32_t buflen);
 struct dh_if {
     void *st;
     int32_t len; /* Approximate size of modulus in bytes */