Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tls: remove ifdef from public API #580

Merged
merged 1 commit into from
Oct 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 5 additions & 16 deletions include/re_tls.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,11 @@
* Copyright (C) 2010 Creytiv.com
*/

#ifdef USE_OPENSSL
#include <openssl/ossl_typ.h>
#endif

struct tls;
struct tls_conn;
struct tcp_conn;
struct udp_sock;

#ifndef USE_OPENSSL
struct ssl_ctx_st;

typedef struct ssl_ctx_st SSL_CTX;
#endif


/** Defines the TLS method */
enum tls_method {
Expand Down Expand Up @@ -79,7 +69,6 @@ void tls_disable_verify_server(struct tls *tls);

int tls_set_min_proto_version(struct tls *tls, int version);
int tls_set_max_proto_version(struct tls *tls, int version);
SSL_CTX *tls_ssl_ctx(const struct tls *tls);

int tls_set_session_reuse(struct tls *tls, int enabled);
bool tls_get_session_reuse(const struct tls_conn *tc);
Expand Down Expand Up @@ -127,8 +116,8 @@ void dtls_recv_packet(struct dtls_sock *sock, const struct sa *src,
struct mbuf *mb);


#ifdef USE_OPENSSL
SSL_CTX *tls_openssl_context(const struct tls *tls);
int tls_set_certificate_openssl(struct tls *tls, X509* cert, EVP_PKEY* pkey,
bool up_ref);
#endif
struct x509_st;
struct evp_pkey_st;

int tls_set_certificate_openssl(struct tls *tls, struct x509_st *cert,
struct evp_pkey_st *pkey, bool up_ref);
13 changes: 0 additions & 13 deletions src/tls/openssl/tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -1328,19 +1328,6 @@ void tls_flush_error(void)
}


/**
* Get the backend-specific (OpenSSL) context
*
* @param tls Generic TLS Context
*
* @return OpenSSL context
*/
SSL_CTX *tls_openssl_context(const struct tls *tls)
{
return tls ? tls->ctx : NULL;
}


/**
* Convert a X509_NAME object into a human-readable form placed in an mbuf
*
Expand Down
1 change: 1 addition & 0 deletions src/tls/openssl/tls.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ typedef X509_NAME*(tls_get_certfield_h)(X509 *);
struct tls;

void tls_flush_error(void);
SSL_CTX *tls_ssl_ctx(const struct tls *tls);