}
}
+ /*
+ * Mismatch between build time OpenSSL and linked SSL,
+ * better to die here than segfault later.
+ */
+ if (ssl_check_version() < 0) {
+ exit(1);
+ }
+
if (flag && (flag != 0x03)) {
fprintf(stderr, "radiusd: The options -i and -p cannot be used individually.\n");
exit(1);
if (debug_flag)
version();
+
/* Read the configuration files, BEFORE doing anything else. */
if (read_mainconfig(0) < 0) {
} else {
setlinebuf(stdout); /* unbuffered output */
}
+
+ /*
+ * Now we have logging check that the OpenSSL
+ */
/*
* Initialize the event pool, including threads.
#include <freeradius-devel/radiusd.h>
+
+#ifdef HAVE_OPENSSL_CRYPTO_H
+#include <openssl/crypto.h>
+#include <openssl/opensslv.h>
+
+static long ssl_built = OPENSSL_VERSION_NUMBER;
+
+/** Check build and linked versions of OpenSSL match
+ *
+ * Startup check for whether the linked version of OpenSSL matches the
+ * version the server was built against.
+ *
+ * @return 0 if ok, else -1
+ */
+int ssl_check_version(void)
+{
+ long ssl_linked;
+
+ ssl_linked = SSLeay();
+
+ if (ssl_linked != ssl_built) {
+ radlog(L_ERR, "libssl version mismatch."
+ " Built with: %lx\n Linked: %lx",
+ (unsigned long) ssl_built,
+ (unsigned long) ssl_linked);
+
+ return -1;
+ };
+
+ return 0;
+}
+
+/** Print the current linked version of Openssl
+ *
+ * Print the currently linked version of the OpenSSL library.
+ */
+const char *ssl_version(void)
+{
+ return SSLeay_version(SSLEAY_VERSION);
+}
+#else
+int ssl_version_check(void) {
+ return 0;
+}
+
+const char *ssl_version()
+{
+ return "not linked"
+}
+#endif
+
/*
* Display the revision number for this program
*/
{
radlog(L_INFO, "%s: %s", progname, radiusd_version);
- DEBUG3("Compilation flags: ");
-
+ DEBUG3("Server was built with: ");
+
+#ifdef WITH_ACCOUNTING
+ DEBUG3(" accounting");
+#endif
+ DEBUG3(" authentication"); /* always enabled */
/* here are all the conditional feature flags */
#if defined(WITH_DHCP)
DEBUG3(" WITH_DHCP");
#if defined(WITHOUT_COA)
DEBUG3(" WITHOUT_COA");
#endif
- radlog(L_INFO, "Copyright (C) 1999-2012 The FreeRADIUS server project and contributors.");
+ DEBUG3("Server core libs:");
+ DEBUG3(" ssl: %s", ssl_version());
+
+ radlog(L_INFO, "Copyright (C) 1999-2013 The FreeRADIUS server project and contributors.");
radlog(L_INFO, "There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A");
radlog(L_INFO, "PARTICULAR PURPOSE.");
radlog(L_INFO, "You may redistribute copies of FreeRADIUS under the terms of the");