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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
diff --git a/src/streams/mbedtls.c b/src/streams/mbedtls.c
index 27e076c..fdc9f6f 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 effe458..7de94b9 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 1092c30..e39622d 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 7296b7a..826d1ef 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 7994b36..1026e20 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