1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

Clean up a couple of consts and char pointers.

hmacmd5_do_hmac and hmac_sha1_simple should be consistently referring
to input memory blocks as 'const void *', but one had pointlessly
typed the pointer as 'const unsigned char *' and the other had missed
out the consts.
This commit is contained in:
Simon Tatham 2018-09-13 16:43:30 +01:00
parent 4f9a90fc1a
commit 9738e042f9
3 changed files with 6 additions and 4 deletions

5
ssh.h
View File

@ -380,7 +380,7 @@ struct hmacmd5_context *hmacmd5_make_context(void);
void hmacmd5_free_context(struct hmacmd5_context *ctx);
void hmacmd5_key(struct hmacmd5_context *ctx, void const *key, int len);
void hmacmd5_do_hmac(struct hmacmd5_context *ctx,
unsigned char const *blk, int len, unsigned char *hmac);
const void *blk, int len, unsigned char *hmac);
int supports_sha_ni(void);
@ -396,7 +396,8 @@ void SHA_Init(SHA_State * s);
void SHA_Final(SHA_State * s, unsigned char *output);
void SHA_Simple(const void *p, int len, unsigned char *output);
void hmac_sha1_simple(void *key, int keylen, void *data, int datalen,
void hmac_sha1_simple(const void *key, int keylen,
const void *data, int datalen,
unsigned char *output);
typedef struct SHA256_State {
uint32 h[8];

View File

@ -312,7 +312,7 @@ static void hmacmd5_genresult(ssh2_mac *mac, unsigned char *hmac)
}
void hmacmd5_do_hmac(struct hmacmd5_context *ctx,
unsigned char const *blk, int len, unsigned char *hmac)
const void *blk, int len, unsigned char *hmac)
{
ssh2_mac_start(&ctx->mac);
put_data(&ctx->mac, blk, len);

View File

@ -360,7 +360,8 @@ static void hmacsha1_genresult(ssh2_mac *mac, unsigned char *hmac)
smemclr(intermediate, sizeof(intermediate));
}
void hmac_sha1_simple(void *key, int keylen, void *data, int datalen,
void hmac_sha1_simple(const void *key, int keylen,
const void *data, int datalen,
unsigned char *output) {
SHA_State states[2];
unsigned char intermediate[20];