]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Refactored tls_show_available_ciphers
authorAdriaan de Jong <dejong@fox-it.com>
Mon, 27 Jun 2011 07:44:47 +0000 (09:44 +0200)
committerDavid Sommerseth <davids@redhat.com>
Wed, 19 Oct 2011 20:31:46 +0000 (22:31 +0200)
Signed-off-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Acked-by: James Yonan <james@openvpn.net>
Signed-off-by: David Sommerseth <davids@redhat.com>
ssl.c
ssl.h
ssl_backend.h
ssl_openssl.c

diff --git a/ssl.c b/ssl.c
index c658441aa4f0a3bc5a585447b0ae3e68b83a1c32..2935088aa0ab88e1b499e01442657e462e17a7b8 100644 (file)
--- a/ssl.c
+++ b/ssl.c
@@ -2449,35 +2449,6 @@ print_details (SSL * c_ssl, const char *prefix)
   msg (D_HANDSHAKE, "%s%s", s1, s2);
 }
 
-/*
- * Show the TLS ciphers that are available for us to use
- * in the OpenSSL library.
- */
-void
-show_available_tls_ciphers ()
-{
-  SSL_CTX *ctx;
-  SSL *ssl;
-  const char *cipher_name;
-  int priority = 0;
-
-  ctx = SSL_CTX_new (TLSv1_method ());
-  if (!ctx)
-    msg (M_SSLERR, "Cannot create SSL_CTX object");
-  ssl = SSL_new (ctx);
-  if (!ssl)
-    msg (M_SSLERR, "Cannot create SSL object");
-
-  printf ("Available TLS Ciphers,\n");
-  printf ("listed in order of preference:\n\n");
-  while ((cipher_name = SSL_get_cipher_list (ssl, priority++)))
-    printf ("%s\n", cipher_name);
-  printf ("\n");
-
-  SSL_free (ssl);
-  SSL_CTX_free (ctx);
-}
-
 /*
  * The OpenSSL library has a notion of preference in TLS
  * ciphers.  Higher preference == more secure.
diff --git a/ssl.h b/ssl.h
index fbdb2c6dfdec3845b8ff76d0215c640bfe4a9c6a..2ff4c4d8b23403377c102a587eccc4287e501180 100644 (file)
--- a/ssl.h
+++ b/ssl.h
@@ -824,8 +824,6 @@ void tls_post_encrypt (struct tls_multi *multi, struct buffer *buf);
 
 /** @} name Functions for managing security parameter state for data channel packets */
 
-
-void show_available_tls_ciphers (void);
 void get_highest_preference_tls_cipher (char *buf, int size);
 
 void pem_password_setup (const char *auth_file);
index 639d85097fc8f054c7602024b3bfcd32ab2ca14d..336e9238a7dd0d0dd409be50466552b388b11914 100644 (file)
@@ -64,4 +64,10 @@ void tls_free_lib();
  */
 void tls_clear_error();
 
+/*
+ * Show the TLS ciphers that are available for us to use in the OpenSSL
+ * library.
+ */
+void show_available_tls_ciphers ();
+
 #endif /* SSL_BACKEND_H_ */
index eff0bc400ec9ef8eb57a6a63a21308c5e6be7f64..6f6f1b3f7a741f713eabdf2573178ee946d15dc8 100644 (file)
@@ -74,3 +74,29 @@ tls_clear_error()
 {
   ERR_clear_error ();
 }
+
+void
+show_available_tls_ciphers ()
+{
+  SSL_CTX *ctx;
+  SSL *ssl;
+  const char *cipher_name;
+  int priority = 0;
+
+  ctx = SSL_CTX_new (TLSv1_method ());
+  if (!ctx)
+    msg (M_SSLERR, "Cannot create SSL_CTX object");
+
+  ssl = SSL_new (ctx);
+  if (!ssl)
+    msg (M_SSLERR, "Cannot create SSL object");
+
+  printf ("Available TLS Ciphers,\n");
+  printf ("listed in order of preference:\n\n");
+  while ((cipher_name = SSL_get_cipher_list (ssl, priority++)))
+    printf ("%s\n", cipher_name);
+  printf ("\n");
+
+  SSL_free (ssl);
+  SSL_CTX_free (ctx);
+}