Commit eceae1ee authored by Pekka Pessi's avatar Pekka Pessi

iptsec/auth_digest.c: fixed whitespace

darcs-hash:20081127125811-db55f-ca021bcde1a30fffbe100b9edd780f42ec6ed0f5.gz
parent 65ec7313
......@@ -59,7 +59,7 @@
* found, or -1 upon an error.
*/
issize_t auth_digest_challenge_get(su_home_t *home,
auth_challenge_t *ac0,
auth_challenge_t *ac0,
char const * const params[])
{
ssize_t n;
......@@ -70,7 +70,7 @@ issize_t auth_digest_challenge_get(su_home_t *home,
ac->ac_size = sizeof(ac);
assert(ac0);
assert(ac0);
assert(ac0->ac_size >= (int) sizeof(*ac));
if (ac0 == NULL || params == NULL)
......@@ -103,7 +103,7 @@ issize_t auth_digest_challenge_get(su_home_t *home,
auth_struct_copy(ac0, ac, sizeof(ac));
SU_DEBUG_5(("%s(): got "MOD_ZD"\n", "auth_digest_challenge_get", n));
return n;
}
......@@ -136,7 +136,7 @@ void auth_digest_challenge_free_params(su_home_t *home, auth_challenge_t *ac)
* found, or -1 upon an error.
*/
issize_t auth_digest_response_get(su_home_t *home,
auth_response_t *ar0,
auth_response_t *ar0,
char const *const params[])
{
ssize_t n;
......@@ -189,7 +189,7 @@ static void unquote_update(su_md5_t md5[1], char const *quoted)
if (!quoted)
/*xyzzy*/;
else if (quoted[0] == '"') {
char const *q;
char const *q;
size_t n;
for (q = quoted + 1; *q; q += n + 2) {
......@@ -204,9 +204,9 @@ static void unquote_update(su_md5_t md5[1], char const *quoted)
su_md5_strupdate(md5, quoted);
}
/** Generate A1 hash for digest authentication.
/** Generate A1 hash for digest authentication.
*/
int auth_digest_a1(auth_response_t *ar,
int auth_digest_a1(auth_response_t *ar,
auth_hexmd5_t ha1,
char const *secret)
{
......@@ -222,13 +222,13 @@ int auth_digest_a1(auth_response_t *ar,
su_md5_hexdigest(md5, ha1);
SU_DEBUG_5(("auth_digest_a1() has A1 = MD5(%s:%s:%s) = %s\n",
SU_DEBUG_5(("auth_digest_a1() has A1 = MD5(%s:%s:%s) = %s\n",
ar->ar_username, ar->ar_realm, secret, ha1));
return 0;
}
int auth_digest_a1sess(auth_response_t *ar,
int auth_digest_a1sess(auth_response_t *ar,
auth_hexmd5_t ha1sess,
char const *ha1)
{
......@@ -243,15 +243,15 @@ int auth_digest_a1sess(auth_response_t *ar,
su_md5_hexdigest(md5, ha1sess);
SU_DEBUG_5(("auth_sessionkey has A1' = MD5(%s:%s:%s) = %s\n",
SU_DEBUG_5(("auth_sessionkey has A1' = MD5(%s:%s:%s) = %s\n",
ha1, ar->ar_nonce, ar->ar_cnonce, ha1sess));
return 0;
}
/** Generate MD5 session key for digest authentication.
/** Generate MD5 session key for digest authentication.
*/
int auth_digest_sessionkey(auth_response_t *ar,
int auth_digest_sessionkey(auth_response_t *ar,
auth_hexmd5_t ha1,
char const *secret)
{
......@@ -263,7 +263,7 @@ int auth_digest_sessionkey(auth_response_t *ar,
return -1;
if (ar->ar_md5sess) {
auth_hexmd5_t base_ha1;
auth_hexmd5_t base_ha1;
auth_digest_a1(ar, base_ha1, secret);
auth_digest_a1sess(ar, ha1, base_ha1);
} else {
......@@ -273,12 +273,12 @@ int auth_digest_sessionkey(auth_response_t *ar,
return 0;
}
/** Generate response for digest authentication.
/** Generate response for digest authentication.
*
*/
int auth_digest_response(auth_response_t *ar,
int auth_digest_response(auth_response_t *ar,
auth_hexmd5_t response,
auth_hexmd5_t const ha1,
auth_hexmd5_t const ha1,
char const *method_name,
void const *data, isize_t dlen)
{
......@@ -314,7 +314,7 @@ int auth_digest_response(auth_response_t *ar,
}
su_md5_hexdigest(md5, HA2);
SU_DEBUG_5(("A2 = MD5(%s:%s%s%s)\n", method_name, ar->ar_uri,
SU_DEBUG_5(("A2 = MD5(%s:%s%s%s)\n", method_name, ar->ar_uri,
ar->ar_auth_int ? ":" : "", ar->ar_auth_int ? Hentity : ""));
/* Calculate response */
......@@ -333,17 +333,17 @@ int auth_digest_response(auth_response_t *ar,
}
su_md5_update(md5, ":", 1);
su_md5_update(md5, HA2, 32);
su_md5_update(md5, HA2, 32);
su_md5_hexdigest(md5, response);
SU_DEBUG_5(("auth_response: %s = MD5(%s:%s%s%s%s%s%s%s:%s) (qop=%s)\n",
response, ha1, ar->ar_nonce,
ar->ar_auth || ar->ar_auth_int ? ":" : "",
ar->ar_auth || ar->ar_auth_int ? ar->ar_nc : "",
ar->ar_auth || ar->ar_auth_int ? ":" : "",
ar->ar_auth || ar->ar_auth_int ? ar->ar_cnonce : "",
ar->ar_auth || ar->ar_auth_int ? ":" : "",
ar->ar_auth || ar->ar_auth_int ? ar->ar_qop : "",
SU_DEBUG_5(("auth_response: %s = MD5(%s:%s%s%s%s%s%s%s:%s) (qop=%s)\n",
response, ha1, ar->ar_nonce,
ar->ar_auth || ar->ar_auth_int ? ":" : "",
ar->ar_auth || ar->ar_auth_int ? ar->ar_nc : "",
ar->ar_auth || ar->ar_auth_int ? ":" : "",
ar->ar_auth || ar->ar_auth_int ? ar->ar_cnonce : "",
ar->ar_auth || ar->ar_auth_int ? ":" : "",
ar->ar_auth || ar->ar_auth_int ? ar->ar_qop : "",
HA2,
ar->ar_qop ? ar->ar_qop : "NONE"));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment