summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2018-10-29 08:59:33 +0000
committerEdward Thomson <ethomson@edwardthomson.com>2018-11-28 15:46:57 +0000
commit2878ad08316155bfaf7b2d7b3204aece13c9936a (patch)
tree2f5e818bab84b5b68b8cdbc2898eafc8763a7453
parent5d4e1e040f6c4530ac18f3ce82685e780192b2bb (diff)
downloadlibgit2-2878ad08316155bfaf7b2d7b3204aece13c9936a.tar.gz
streams: remove unused tls functions
The implementations of git_openssl_stream_new and git_mbedtls_stream_new have callers protected by #ifdefs and are never called unless compiled in. There's no need for a dummy implementation. Remove them.
-rw-r--r--src/streams/mbedtls.c19
-rw-r--r--src/streams/mbedtls.h6
-rw-r--r--src/streams/openssl.c19
-rw-r--r--src/streams/openssl.h6
-rw-r--r--src/streams/stransport.h4
5 files changed, 12 insertions, 42 deletions
diff --git a/src/streams/mbedtls.c b/src/streams/mbedtls.c
index 27e076cb8..fdc9f6f7c 100644
--- a/src/streams/mbedtls.c
+++ b/src/streams/mbedtls.c
@@ -490,23 +490,4 @@ int git_mbedtls_stream_global_init(void)
return 0;
}
-int git_mbedtls_stream_new(git_stream **out, const char *host, const char *port)
-{
- GIT_UNUSED(out);
- GIT_UNUSED(host);
- GIT_UNUSED(port);
-
- giterr_set(GITERR_SSL, "mbedTLS is not supported in this version");
- return -1;
-}
-
-int git_mbedtls__set_cert_location(const char *path, int is_dir)
-{
- GIT_UNUSED(path);
- GIT_UNUSED(is_dir);
-
- giterr_set(GITERR_SSL, "mbedTLS is not supported in this version");
- return -1;
-}
-
#endif
diff --git a/src/streams/mbedtls.h b/src/streams/mbedtls.h
index effe4589d..7de94b9fb 100644
--- a/src/streams/mbedtls.h
+++ b/src/streams/mbedtls.h
@@ -13,9 +13,11 @@
extern int git_mbedtls_stream_global_init(void);
+#ifdef GIT_MBEDTLS
+extern int git_mbedtls__set_cert_location(const char *path, int is_dir);
+
extern int git_mbedtls_stream_new(git_stream **out, const char *host, const char *port);
extern int git_mbedtls_stream_wrap(git_stream **out, git_stream *in, const char *host);
-
-extern int git_mbedtls__set_cert_location(const char *path, int is_dir);
+#endif
#endif
diff --git a/src/streams/openssl.c b/src/streams/openssl.c
index 1092c3055..e39622d84 100644
--- a/src/streams/openssl.c
+++ b/src/streams/openssl.c
@@ -799,23 +799,4 @@ int git_openssl_set_locking(void)
return -1;
}
-int git_openssl_stream_new(git_stream **out, const char *host, const char *port)
-{
- GIT_UNUSED(out);
- GIT_UNUSED(host);
- GIT_UNUSED(port);
-
- giterr_set(GITERR_SSL, "openssl is not supported in this version");
- return -1;
-}
-
-int git_openssl__set_cert_location(const char *file, const char *path)
-{
- GIT_UNUSED(file);
- GIT_UNUSED(path);
-
- giterr_set(GITERR_SSL, "openssl is not supported in this version");
- return -1;
-}
-
#endif
diff --git a/src/streams/openssl.h b/src/streams/openssl.h
index 7296b7a08..826d1efbc 100644
--- a/src/streams/openssl.h
+++ b/src/streams/openssl.h
@@ -13,9 +13,11 @@
extern int git_openssl_stream_global_init(void);
+#ifdef GIT_OPENSSL
+extern int git_openssl__set_cert_location(const char *file, const char *path);
+
extern int git_openssl_stream_new(git_stream **out, const char *host, const char *port);
extern int git_openssl_stream_wrap(git_stream **out, git_stream *in, const char *host);
-
-extern int git_openssl__set_cert_location(const char *file, const char *path);
+#endif
#endif
diff --git a/src/streams/stransport.h b/src/streams/stransport.h
index 7994b3677..1026e204b 100644
--- a/src/streams/stransport.h
+++ b/src/streams/stransport.h
@@ -11,7 +11,11 @@
#include "git2/sys/stream.h"
+#ifdef GIT_SECURE_TRANSPORT
+
extern int git_stransport_stream_new(git_stream **out, const char *host, const char *port);
extern int git_stransport_stream_wrap(git_stream **out, git_stream *in, const char *host);
#endif
+
+#endif