From cfa0e8abab7dcbe857e618e866b7767651f83d28 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Mon, 18 Mar 2013 21:34:37 +0000 Subject: [PATCH] more simplification with ap_bin2hex() git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1458020 13f79535-47bb-0310-9956-ffa450edef68 --- modules/aaa/mod_auth_digest.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/modules/aaa/mod_auth_digest.c b/modules/aaa/mod_auth_digest.c index 65183160335..d718e2c65c7 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> 4]; - *hash++ = hex[sha1[idx] & 0xF]; - } - - *hash++ = '\0'; + ap_bin2hex(sha1, APR_SHA1_DIGESTSIZE, hash); } -- 2.47.3