1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-15 01:57:40 -05:00

Expose the structure tag 'crcda_ctx'.

This one isn't used in many places, but it's another 'void *' pointer
that ought to come with an identifying structure tag.
This commit is contained in:
Simon Tatham
2018-09-13 13:00:56 +01:00
parent 3aae1f9d76
commit 65b65bb8ef
3 changed files with 8 additions and 9 deletions

View File

@ -55,7 +55,7 @@ struct crcda_ctx {
uint32 n;
};
void *crcda_make_context(void)
struct crcda_ctx *crcda_make_context(void)
{
struct crcda_ctx *ret = snew(struct crcda_ctx);
ret->h = NULL;
@ -63,9 +63,8 @@ void *crcda_make_context(void)
return ret;
}
void crcda_free_context(void *handle)
void crcda_free_context(struct crcda_ctx *ctx)
{
struct crcda_ctx *ctx = (struct crcda_ctx *)handle;
if (ctx) {
sfree(ctx->h);
ctx->h = NULL;
@ -102,9 +101,8 @@ static int check_crc(uchar *S, uchar *buf, uint32 len, uchar *IV)
}
/* Detect a crc32 compensation attack on a packet */
int detect_attack(void *handle, uchar *buf, uint32 len, uchar *IV)
int detect_attack(struct crcda_ctx *ctx, uchar *buf, uint32 len, uchar *IV)
{
struct crcda_ctx *ctx = (struct crcda_ctx *)handle;
register uint32 i, j;
uint32 l;
register uchar *c;