diff options
author | Stefan Fritsch <sf@apache.org> | 2013-03-18 22:34:37 +0100 |
---|---|---|
committer | Stefan Fritsch <sf@apache.org> | 2013-03-18 22:34:37 +0100 |
commit | ea79dca257161dc18e06dd979ed286bd3de91f36 (patch) | |
tree | 0f265998d1a8f5fb20ee53b581f1d34a8fb7cf52 /modules/aaa/mod_auth_digest.c | |
parent | update xforms (diff) | |
download | apache2-ea79dca257161dc18e06dd979ed286bd3de91f36.tar.xz apache2-ea79dca257161dc18e06dd979ed286bd3de91f36.zip |
more simplification with ap_bin2hex()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1458020 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/aaa/mod_auth_digest.c')
-rw-r--r-- | modules/aaa/mod_auth_digest.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/modules/aaa/mod_auth_digest.c b/modules/aaa/mod_auth_digest.c index 6518316033..d718e2c65c 100644 --- a/modules/aaa/mod_auth_digest.c +++ b/modules/aaa/mod_auth_digest.c @@ -1056,10 +1056,8 @@ static void gen_nonce_hash(char *hash, const char *timestr, const char *opaque, const server_rec *server, const digest_config_rec *conf) { - const char *hex = "0123456789abcdef"; unsigned char sha1[APR_SHA1_DIGESTSIZE]; apr_sha1_ctx_t ctx; - int idx; memcpy(&ctx, &conf->nonce_ctx, sizeof(ctx)); /* @@ -1075,12 +1073,7 @@ static void gen_nonce_hash(char *hash, const char *timestr, const char *opaque, } apr_sha1_final(sha1, &ctx); - for (idx=0; idx<APR_SHA1_DIGESTSIZE; idx++) { - *hash++ = hex[sha1[idx] >> 4]; - *hash++ = hex[sha1[idx] & 0xF]; - } - - *hash++ = '\0'; + ap_bin2hex(sha1, APR_SHA1_DIGESTSIZE, hash); } |