diff options
Diffstat (limited to 'usr.sbin/httpd')
-rw-r--r-- | usr.sbin/httpd/src/modules/experimental/mod_auth_digest.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/usr.sbin/httpd/src/modules/experimental/mod_auth_digest.c b/usr.sbin/httpd/src/modules/experimental/mod_auth_digest.c index f1b8efaf29a..f6d7c3e384b 100644 --- a/usr.sbin/httpd/src/modules/experimental/mod_auth_digest.c +++ b/usr.sbin/httpd/src/modules/experimental/mod_auth_digest.c @@ -291,6 +291,24 @@ static void cleanup_tables(void *not_used) } #endif /* HAVE_SHMEM_MM */ +#ifdef __OpenBSD__ +static void initialize_secret(server_rec *s) +{ + u_int32_t rnd = 0, i; + + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, s, + "Digest: generating secret for digest authentication ..."); + + for (i = 0; i < sizeof(secret); i++) { + if (i % 4 == 0) + rnd = arc4random(); + secret[i] = rnd; + rnd >>= 8; + } + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, s, + "Digest: done"); +} +#else #ifdef WIN32 /* TODO: abstract out the random number generation. APR? */ static void initialize_secret(server_rec *s) @@ -358,6 +376,7 @@ static void initialize_secret(server_rec *s) ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, s, "Digest: done"); } #endif +#endif #ifdef HAVE_SHMEM_MM static void initialize_tables(server_rec *s) |