(cherry picked from commit
16c46ecdaf71e4c9dddcd933778f02d78425f6a5)
Conflicts:
sshsh512.c
Cherry-picker's notes: the conflict was because the original commit
also added smemclrs to SHA384_Simple and the ssh_hash structures for
SHA-384 and SHA-512, none of which exists on this branch so those
changes are irrelevant.
MD5Init(&s);
MD5Update(&s, (unsigned char const *)p, len);
MD5Final(output, &s);
+ smemclr(&s, sizeof(s));
}
/* ----------------------------------------------------------------------
void hmacmd5_free_context(void *handle)
{
+ smemclr(handle, 3*sizeof(struct MD5Context));
sfree(handle);
}
SHA256_Init(&s);
SHA256_Bytes(&s, p, len);
SHA256_Final(&s, output);
+ smemclr(&s, sizeof(s));
}
/*
SHA256_State *s = handle;
SHA256_Final(s, output);
+ smemclr(s, sizeof(*s));
sfree(s);
}
static void sha256_free_context(void *handle)
{
+ smemclr(handle, 3 * sizeof(SHA256_State));
sfree(handle);
}
SHA512_Init(&s);
SHA512_Bytes(&s, p, len);
SHA512_Final(&s, output);
+ smemclr(&s, sizeof(s));
}
#ifdef TEST
SHA_Init(&s);
SHA_Bytes(&s, p, len);
SHA_Final(&s, output);
+ smemclr(&s, sizeof(s));
}
/*
SHA_State *s = handle;
SHA_Final(s, output);
+ smemclr(s, sizeof(*s));
sfree(s);
}
static void sha1_free_context(void *handle)
{
+ smemclr(handle, 3 * sizeof(SHA_State));
sfree(handle);
}