chiark / gitweb /
Mobile sites: Maintain multiple addresses for some peers (new feature)
[secnet.git] / transform.c
index dc6ac3ea097ab2e6815d3ccdf10dd9e2ce1e37d6..8fdf9fd80a350b254bb4e2d7380a31a9babc77f9 100644 (file)
@@ -19,7 +19,6 @@
 
 struct transform {
     closure_t cl;
-    uint32_t line;
     struct transform_if ops;
     uint32_t max_seq_skew;
 };
@@ -38,7 +37,7 @@ struct transform_inst {
 
 #define PKCS5_MASK 15
 
-static bool_t transform_setkey(void *sst, uint8_t *key, uint32_t keylen)
+static bool_t transform_setkey(void *sst, uint8_t *key, int32_t keylen)
 {
     struct transform_inst *ti=sst;
 
@@ -73,8 +72,8 @@ static void transform_delkey(void *sst)
 {
     struct transform_inst *ti=sst;
 
-    memset(&ti->cryptkey,0,sizeof(ti->cryptkey));
-    memset(&ti->mackey,0,sizeof(ti->mackey));
+    FILLZERO(ti->cryptkey);
+    FILLZERO(ti->mackey);
     ti->keyed=False;
 }
 
@@ -157,7 +156,7 @@ static uint32_t transform_reverse(void *sst, struct buffer_if *buf,
 {
     struct transform_inst *ti=sst;
     uint8_t *padp;
-    unsigned padlen;
+    int padlen;
     int i;
     uint32_t seqnum, skew;
     uint8_t iv[16];
@@ -253,7 +252,7 @@ static void transform_destroy(void *sst)
 {
     struct transform_inst *st=sst;
 
-    memset(st,0,sizeof(*st)); /* Destroy key material */
+    FILLZERO(*st); /* Destroy key material */
     free(st);
 }
 
@@ -311,7 +310,6 @@ static list_t *transform_apply(closure_t *self, struct cloc loc,
     return new_closure(&st->cl);
 }
 
-init_module transform_module;
 void transform_module(dict_t *dict)
 {
     struct keyInstance k;