Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Commit

Permalink
Take advantage of PUT_32BIT_MSB_FIRST when constructing sequence numbers
Browse files Browse the repository at this point in the history
to MAC.

[originally from svn r9758]
  • Loading branch information
bjh21 committed Feb 20, 2013
1 parent 329087e commit 3045a9a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
6 changes: 1 addition & 5 deletions sshmd5.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,11 +312,7 @@ static void hmacmd5_do_hmac_ssh(void *handle, unsigned char const *blk, int len,
{
unsigned char seqbuf[16];

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);
hmacmd5_do_hmac_internal(handle, seqbuf, 4, blk, len, hmac);
}

Expand Down
6 changes: 1 addition & 5 deletions sshsha.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3045a9a

Please sign in to comment.