]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Add SSL library version reporting.
authorGert Doering <gert@greenie.muc.de>
Sun, 13 Apr 2014 15:29:32 +0000 (17:29 +0200)
committerGert Doering <gert@greenie.muc.de>
Fri, 18 Apr 2014 18:50:15 +0000 (20:50 +0200)
Print the version of the SSL and LZO library (if any) used.

SSL library version is also sent as IV_SSL=<version> to the server if
--push-peer-info is enabled.

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: <20140416152456.GI16637@greenie.muc.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8537

src/openvpn/openvpn.c
src/openvpn/options.c
src/openvpn/ssl.c
src/openvpn/ssl_backend.h
src/openvpn/ssl_openssl.c
src/openvpn/ssl_polarssl.c

index 5125eae9267b44457118abbfd2f10341df5567a8..fd87fc16f1708e7ab7616d6bbdfe44de843e2609 100644 (file)
@@ -220,6 +220,7 @@ openvpn_main (int argc, char *argv[])
 
          /* print version number */
          msg (M_INFO, "%s", title_string);
+         show_library_versions(M_INFO);
 
          /* misc stuff */
          pre_setup (&c.options);
index 18cb35417c5a64202ea84d4632d6056c14dab55d..4af2974801da6d26d71e114c94acf073814a27d6 100644 (file)
@@ -3435,10 +3435,28 @@ usage_small (void)
   openvpn_exit (OPENVPN_EXIT_STATUS_USAGE); /* exit point */
 }
 
+void
+show_library_versions(const unsigned int flags)
+{
+  msg (flags, "library versions: %s%s%s",
+#ifdef ENABLE_SSL
+                       get_ssl_library_version(),
+#else
+                       "",
+#endif
+#ifdef ENABLE_LZO
+                       ", LZO ", lzo_version_string()
+#else
+                       "", ""
+#endif
+       );
+}
+
 static void
 usage_version (void)
 {
   msg (M_INFO|M_NOPREFIX, "%s", title_string);
+  show_library_versions( M_INFO|M_NOPREFIX );
   msg (M_INFO|M_NOPREFIX, "Originally developed by James Yonan");
   msg (M_INFO|M_NOPREFIX, "Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>");
 #ifndef ENABLE_SMALL
index d4acc0fc74a8ed10059cd7a6cf3c5fc6ac62e475..b09e52b7840b372ba97f468e4695472edbc909e3 100644 (file)
@@ -1835,6 +1835,7 @@ push_peer_info(struct buffer *buf, struct tls_session *session)
          get_default_gateway (&rgi);
          if (rgi.flags & RGI_HWADDR_DEFINED)
            buf_printf (&out, "IV_HWADDR=%s\n", format_hex_ex (rgi.hwaddr, 6, 0, 1, ":", &gc));
+         buf_printf (&out, "IV_SSL=%s\n", get_ssl_library_version() );
         }
 
       /* push env vars that begin with UV_ and IV_GUI_VER */
index a6fc3bdb13db3dc4245cb5c89efb9f847552462d..57b03df32fb767bc615949ab7c3924b2341e2e26 100644 (file)
@@ -466,4 +466,10 @@ void show_available_tls_ciphers (const char *tls_ciphers);
  */
 void get_highest_preference_tls_cipher (char *buf, int size);
 
+/**
+ * return a pointer to a static memory area containing the
+ * name and version number of the SSL library in use
+ */
+char * get_ssl_library_version(void);
+
 #endif /* SSL_BACKEND_H_ */
index 0b63e260778892965afc827bf641f87ab6abd770..1923230ee6ace75f862506b67b063207fd4f2224 100644 (file)
@@ -1320,4 +1320,10 @@ get_highest_preference_tls_cipher (char *buf, int size)
   SSL_CTX_free (ctx);
 }
 
+char *
+get_ssl_library_version(void)
+{
+    return SSLeay_version(SSLEAY_VERSION);
+}
+
 #endif /* defined(ENABLE_SSL) && defined(ENABLE_CRYPTO_OPENSSL) */
index 9dc4e879631ecdfcf085fad74df8ec816016f3c3..c110d0d485880483fc7b63c0a6b797c57e0a05c1 100644 (file)
@@ -1079,4 +1079,14 @@ get_highest_preference_tls_cipher (char *buf, int size)
   strncpynt (buf, cipher_name, size);
 }
 
+char *
+get_ssl_library_version(void)
+{
+    static char polar_version[30];
+    unsigned int pv = version_get_number();
+    sprintf( polar_version, "PolarSSL %d.%d.%d",
+               (pv>>24)&0xff, (pv>>16)&0xff, (pv>>8)&0xff );
+    return polar_version;
+}
+
 #endif /* defined(ENABLE_SSL) && defined(ENABLE_CRYPTO_POLARSSL) */