httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s.@apache.org
Subject svn commit: r1458020 - /httpd/httpd/trunk/modules/aaa/mod_auth_digest.c
Date Mon, 18 Mar 2013 21:34:37 GMT
Author: sf
Date: Mon Mar 18 21:34:37 2013
New Revision: 1458020

URL: http://svn.apache.org/r1458020
Log:
more simplification with ap_bin2hex()

Modified:
    httpd/httpd/trunk/modules/aaa/mod_auth_digest.c

Modified: httpd/httpd/trunk/modules/aaa/mod_auth_digest.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/aaa/mod_auth_digest.c?rev=1458020&r1=1458019&r2=1458020&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/aaa/mod_auth_digest.c (original)
+++ httpd/httpd/trunk/modules/aaa/mod_auth_digest.c Mon Mar 18 21:34:37 2013
@@ -1056,10 +1056,8 @@ static void gen_nonce_hash(char *hash, c
                            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, c
     }
     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);
 }
 
 



Mime
View raw message