1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-09-22 04:15:54 -04:00

Feature: Added function to check for specific TLS implementation

This commit is contained in:
Philipp Schafft 2017-05-18 07:33:44 +00:00
parent 9cbc110f78
commit 68b3b1c72a
2 changed files with 19 additions and 0 deletions

View File

@ -15,12 +15,28 @@
#endif
#include <stdlib.h>
#include <strings.h>
#include "tls.h"
#include "logging.h"
#define CATMODULE "tls"
/* Check for a specific implementation. Returns 0 if supported, 1 if unsupported and -1 on error. */
int tls_check_impl(const char *impl)
{
#ifdef HAVE_OPENSSL
if (!strcasecmp(impl, "openssl"))
return 0;
#endif
#ifdef ICECAST_CAP_TLS
if (!strcasecmp(impl, "generic"))
return 0;
#endif
return 1;
}
#ifdef HAVE_OPENSSL
struct tls_ctx_tag {
size_t refc;

View File

@ -25,6 +25,9 @@
typedef struct tls_ctx_tag tls_ctx_t;
typedef struct tls_tag tls_t;
/* Check for a specific implementation. Returns 0 if supported, 1 if unsupported and -1 on error. */
int tls_check_impl(const char *impl);
void tls_initialize(void);
void tls_shutdown(void);