summaryrefslogtreecommitdiff
path: root/src/openvpn/httpdigest.c
diff options
context:
space:
mode:
authorAlberto Gonzalez Iniesta <agi@inittab.org>2016-01-20 12:01:07 +0100
committerAlberto Gonzalez Iniesta <agi@inittab.org>2016-01-20 12:01:07 +0100
commit9653b1bffea4e96c1eb7c1814e8bed21fea62321 (patch)
tree485f02f91b424955a45c1cc12876c31d3d957f9b /src/openvpn/httpdigest.c
parent41ffafc126abd9af67061f4931b7614f3cb898b0 (diff)
Imported Upstream version 2.3.10upstream/2.3.10
Diffstat (limited to 'src/openvpn/httpdigest.c')
-rw-r--r--src/openvpn/httpdigest.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/openvpn/httpdigest.c b/src/openvpn/httpdigest.c
index 78b8344..99bbda4 100644
--- a/src/openvpn/httpdigest.c
+++ b/src/openvpn/httpdigest.c
@@ -76,20 +76,20 @@ DigestCalcHA1(
const md_kt_t *md5_kt = md_kt_get("MD5");
md_ctx_init(&md5_ctx, md5_kt);
- md_ctx_update(&md5_ctx, pszUserName, strlen(pszUserName));
- md_ctx_update(&md5_ctx, ":", 1);
- md_ctx_update(&md5_ctx, pszRealm, strlen(pszRealm));
- md_ctx_update(&md5_ctx, ":", 1);
- md_ctx_update(&md5_ctx, pszPassword, strlen(pszPassword));
+ md_ctx_update(&md5_ctx, (const uint8_t *) pszUserName, strlen(pszUserName));
+ md_ctx_update(&md5_ctx, (const uint8_t *) ":", 1);
+ md_ctx_update(&md5_ctx, (const uint8_t *) pszRealm, strlen(pszRealm));
+ md_ctx_update(&md5_ctx, (const uint8_t *) ":", 1);
+ md_ctx_update(&md5_ctx, (const uint8_t *) pszPassword, strlen(pszPassword));
md_ctx_final(&md5_ctx, HA1);
if (pszAlg && strcasecmp(pszAlg, "md5-sess") == 0)
{
md_ctx_init(&md5_ctx, md5_kt);
md_ctx_update(&md5_ctx, HA1, HASHLEN);
- md_ctx_update(&md5_ctx, ":", 1);
- md_ctx_update(&md5_ctx, pszNonce, strlen(pszNonce));
- md_ctx_update(&md5_ctx, ":", 1);
- md_ctx_update(&md5_ctx, pszCNonce, strlen(pszCNonce));
+ md_ctx_update(&md5_ctx, (const uint8_t *) ":", 1);
+ md_ctx_update(&md5_ctx, (const uint8_t *) pszNonce, strlen(pszNonce));
+ md_ctx_update(&md5_ctx, (const uint8_t *) ":", 1);
+ md_ctx_update(&md5_ctx, (const uint8_t *) pszCNonce, strlen(pszCNonce));
md_ctx_final(&md5_ctx, HA1);
};
md_ctx_cleanup(&md5_ctx);
@@ -119,12 +119,12 @@ DigestCalcResponse(
/* calculate H(A2) */
md_ctx_init(&md5_ctx, md5_kt);
- md_ctx_update(&md5_ctx, pszMethod, strlen(pszMethod));
- md_ctx_update(&md5_ctx, ":", 1);
- md_ctx_update(&md5_ctx, pszDigestUri, strlen(pszDigestUri));
+ md_ctx_update(&md5_ctx, (const uint8_t *) pszMethod, strlen(pszMethod));
+ md_ctx_update(&md5_ctx, (const uint8_t *) ":", 1);
+ md_ctx_update(&md5_ctx, (const uint8_t *) pszDigestUri, strlen(pszDigestUri));
if (strcasecmp(pszQop, "auth-int") == 0)
{
- md_ctx_update(&md5_ctx, ":", 1);
+ md_ctx_update(&md5_ctx, (const uint8_t *) ":", 1);
md_ctx_update(&md5_ctx, HEntity, HASHHEXLEN);
};
md_ctx_final(&md5_ctx, HA2);
@@ -133,17 +133,17 @@ DigestCalcResponse(
/* calculate response */
md_ctx_init(&md5_ctx, md5_kt);
md_ctx_update(&md5_ctx, HA1, HASHHEXLEN);
- md_ctx_update(&md5_ctx, ":", 1);
- md_ctx_update(&md5_ctx, pszNonce, strlen(pszNonce));
- md_ctx_update(&md5_ctx, ":", 1);
+ md_ctx_update(&md5_ctx, (const uint8_t *) ":", 1);
+ md_ctx_update(&md5_ctx, (const uint8_t *) pszNonce, strlen(pszNonce));
+ md_ctx_update(&md5_ctx, (const uint8_t *) ":", 1);
if (*pszQop)
{
- md_ctx_update(&md5_ctx, pszNonceCount, strlen(pszNonceCount));
- md_ctx_update(&md5_ctx, ":", 1);
- md_ctx_update(&md5_ctx, pszCNonce, strlen(pszCNonce));
- md_ctx_update(&md5_ctx, ":", 1);
- md_ctx_update(&md5_ctx, pszQop, strlen(pszQop));
- md_ctx_update(&md5_ctx, ":", 1);
+ md_ctx_update(&md5_ctx, (const uint8_t *) pszNonceCount, strlen(pszNonceCount));
+ md_ctx_update(&md5_ctx, (const uint8_t *) ":", 1);
+ md_ctx_update(&md5_ctx, (const uint8_t *) pszCNonce, strlen(pszCNonce));
+ md_ctx_update(&md5_ctx, (const uint8_t *) ":", 1);
+ md_ctx_update(&md5_ctx, (const uint8_t *) pszQop, strlen(pszQop));
+ md_ctx_update(&md5_ctx, (const uint8_t *) ":", 1);
};
md_ctx_update(&md5_ctx, HA2Hex, HASHHEXLEN);
md_ctx_final(&md5_ctx, RespHash);