X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/secnet/blobdiff_plain/3b83c93292fbf6c4e859ce513bdf54ad90733f96..076bb54e68477f883033bee696c9c5f801ece2f2:/transform.c diff --git a/transform.c b/transform.c index dc6ac3e..8fdf9fd 100644 --- a/transform.c +++ b/transform.c @@ -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;