summaryrefslogtreecommitdiff
path: root/lib/hmac.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2010-11-08 04:03:11 +0100
committerYang Tse <yangsita@gmail.com>2010-11-08 04:03:11 +0100
commitdc3e7df1c99c2ee9dae06453adbb94fe9584bf75 (patch)
tree6578bc549399f347ce0b196154cd4028a29cdf6a /lib/hmac.c
parent1171bc5c8aff58b337f180a443cd39a30150bfc6 (diff)
downloadcurl-dc3e7df1c99c2ee9dae06453adbb94fe9584bf75.tar.gz
fix compiler warning
Diffstat (limited to 'lib/hmac.c')
-rw-r--r--lib/hmac.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/hmac.c b/lib/hmac.c
index 0c01d1187..8cb5f2eaa 100644
--- a/lib/hmac.c
+++ b/lib/hmac.c
@@ -60,7 +60,7 @@ Curl_HMAC_init(const HMAC_params * hashparams,
/* Create HMAC context. */
i = sizeof *ctxt + 2 * hashparams->hmac_ctxtsize + hashparams->hmac_resultlen;
- ctxt = (HMAC_context *) malloc(i);
+ ctxt = malloc(i);
if(!ctxt)
return ctxt;
@@ -85,9 +85,9 @@ Curl_HMAC_init(const HMAC_params * hashparams,
(*hashparams->hmac_hinit)(ctxt->hmac_hashctxt2);
for (i = 0; i < keylen; i++) {
- b = *key ^ hmac_ipad;
+ b = (unsigned char)(*key ^ hmac_ipad);
(*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt1, &b, 1);
- b = *key++ ^ hmac_opad;
+ b = (unsigned char)(*key++ ^ hmac_opad);
(*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt2, &b, 1);
}