Changes with Apache 1.3.28
+ *) PORT: Take advantage of OpenBSD's arc4random() function for the
+ initial secret [Henning Brauer <hb-apache-dev at bsws.de>]
+
*) If Listen directive is not a port, but just an IP, emit an
error condition as this case is ambiguous.
[Rich Bowen, Justin Erenkrantz, Cliff Woolley]
}
#endif /* HAVE_SHMEM_MM */
-#ifdef WIN32
+#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");
+}
+#elif defined(WIN32)
/* TODO: abstract out the random number generation. APR? */
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)