X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/9916cc1e8d26f1caef36fc1ee525819e6ca62f42..e99bb8bfc8d2c1a47b6ae90ef43683d191c30f66:/sshsha.c diff --git a/sshsha.c b/sshsha.c index cbe9d78b..b2493f2f 100644 --- a/sshsha.c +++ b/sshsha.c @@ -253,7 +253,7 @@ static void sha1_key_internal(void *handle, unsigned char *key, int len) SHA_Init(&keys[1]); SHA_Bytes(&keys[1], foo, 64); - memset(foo, 0, 64); /* burn the evidence */ + smemclr(foo, 64); /* burn the evidence */ } static void sha1_key(void *handle, unsigned char *key) @@ -297,11 +297,7 @@ static void sha1_do_hmac(void *handle, unsigned char *blk, int len, { unsigned char seqbuf[4]; - seqbuf[0] = (unsigned char) ((seq >> 24) & 0xFF); - seqbuf[1] = (unsigned char) ((seq >> 16) & 0xFF); - seqbuf[2] = (unsigned char) ((seq >> 8) & 0xFF); - seqbuf[3] = (unsigned char) ((seq) & 0xFF); - + PUT_32BIT_MSB_FIRST(seqbuf, seq); hmacsha1_start(handle); hmacsha1_bytes(handle, seqbuf, 4); hmacsha1_bytes(handle, blk, len);