mirror of
https://github.com/samba-team/samba.git
synced 2025-10-25 19:33:18 +03:00
r961: convert 'uchar' to 'uint8_t'
metze
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
18062d2ed9
commit
9f914e4af9
@@ -28,14 +28,14 @@
|
||||
/***********************************************************************
|
||||
the rfc 2104 version of hmac_md5 initialisation.
|
||||
***********************************************************************/
|
||||
void hmac_md5_init_rfc2104(uchar* key, int key_len, HMACMD5Context *ctx)
|
||||
void hmac_md5_init_rfc2104(uint8_t *key, int key_len, HMACMD5Context *ctx)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* if key is longer than 64 bytes reset it to key=MD5(key) */
|
||||
if (key_len > 64)
|
||||
{
|
||||
uchar tk[16];
|
||||
uint8_t tk[16];
|
||||
struct MD5Context tctx;
|
||||
|
||||
MD5Init(&tctx);
|
||||
@@ -66,7 +66,7 @@ void hmac_md5_init_rfc2104(uchar* key, int key_len, HMACMD5Context *ctx)
|
||||
/***********************************************************************
|
||||
the microsoft version of hmac_md5 initialisation.
|
||||
***********************************************************************/
|
||||
void hmac_md5_init_limK_to_64(const uchar* key, int key_len,
|
||||
void hmac_md5_init_limK_to_64(const uint8_t *key, int key_len,
|
||||
HMACMD5Context *ctx)
|
||||
{
|
||||
/* if key is longer than 64 bytes truncate it */
|
||||
@@ -81,7 +81,7 @@ void hmac_md5_init_limK_to_64(const uchar* key, int key_len,
|
||||
/***********************************************************************
|
||||
update hmac_md5 "inner" buffer
|
||||
***********************************************************************/
|
||||
void hmac_md5_update(const uchar* text, int text_len, HMACMD5Context *ctx)
|
||||
void hmac_md5_update(const uint8_t *text, int text_len, HMACMD5Context *ctx)
|
||||
{
|
||||
MD5Update(&ctx->ctx, text, text_len); /* then text of datagram */
|
||||
}
|
||||
@@ -89,8 +89,7 @@ void hmac_md5_update(const uchar* text, int text_len, HMACMD5Context *ctx)
|
||||
/***********************************************************************
|
||||
finish off hmac_md5 "inner" buffer and generate outer one.
|
||||
***********************************************************************/
|
||||
void hmac_md5_final(uchar *digest, HMACMD5Context *ctx)
|
||||
|
||||
void hmac_md5_final(uint8_t *digest, HMACMD5Context *ctx)
|
||||
{
|
||||
struct MD5Context ctx_o;
|
||||
|
||||
@@ -106,7 +105,7 @@ void hmac_md5_final(uchar *digest, HMACMD5Context *ctx)
|
||||
single function to calculate an HMAC MD5 digest from data.
|
||||
use the microsoft hmacmd5 init method because the key is 16 bytes.
|
||||
************************************************************/
|
||||
void hmac_md5(const uchar key[16], const uchar *data, int data_len, uchar* digest)
|
||||
void hmac_md5(const uint8_t key[16], const uint8_t *data, int data_len, uint8_t *digest)
|
||||
{
|
||||
HMACMD5Context ctx;
|
||||
hmac_md5_init_limK_to_64(key, 16, &ctx);
|
||||
@@ -116,4 +115,3 @@ void hmac_md5(const uchar key[16], const uchar *data, int data_len, uchar* diges
|
||||
}
|
||||
hmac_md5_final(digest, &ctx);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user