msg (D_HANDSHAKE, "%s%s", s1, s2);
}
-/*
- * The OpenSSL library has a notion of preference in TLS
- * ciphers. Higher preference == more secure.
- * Return the highest preference cipher.
- */
-void
-get_highest_preference_tls_cipher (char *buf, int size)
-{
- SSL_CTX *ctx;
- SSL *ssl;
- const char *cipher_name;
-
- 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");
-
- cipher_name = SSL_get_cipher_list (ssl, 0);
- strncpynt (buf, cipher_name, size);
-
- SSL_free (ssl);
- SSL_CTX_free (ctx);
-}
-
/*
* Map internal constants to ascii names.
*/
/** @} name Functions for managing security parameter state for data channel packets */
-void get_highest_preference_tls_cipher (char *buf, int size);
-
void pem_password_setup (const char *auth_file);
int pem_password_callback (char *buf, int size, int rwflag, void *u);
void auth_user_pass_setup (const char *auth_file, const struct static_challenge_info *sc_info);
*/
void show_available_tls_ciphers ();
+/*
+ * The OpenSSL library has a notion of preference in TLS ciphers. Higher
+ * preference == more secure. Return the highest preference cipher.
+ */
+void get_highest_preference_tls_cipher (char *buf, int size);
+
#endif /* SSL_BACKEND_H_ */
SSL_free (ssl);
SSL_CTX_free (ctx);
}
+
+void
+get_highest_preference_tls_cipher (char *buf, int size)
+{
+ SSL_CTX *ctx;
+ SSL *ssl;
+ const char *cipher_name;
+
+ 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");
+
+ cipher_name = SSL_get_cipher_list (ssl, 0);
+ strncpynt (buf, cipher_name, size);
+
+ SSL_free (ssl);
+ SSL_CTX_free (ctx);
+}