Skip to content

Commit

Permalink
Rename GIT_SSL to GIT_OPENSSL
Browse files Browse the repository at this point in the history
This is what it's meant all along, but now we actually have multiple
implementations, it's clearer to use the name of the library.
  • Loading branch information
carlosmn committed Apr 23, 2015
1 parent 70b852c commit 24e53d2
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ IF (SECURITY_FOUND)
ENDIF ()

IF (OPENSSL_FOUND)
ADD_DEFINITIONS(-DGIT_SSL)
ADD_DEFINITIONS(-DGIT_OPENSSL)
INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR})
SET(SSL_LIBRARIES ${OPENSSL_LIBRARIES})
ENDIF()
Expand Down
8 changes: 4 additions & 4 deletions src/global.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ git_mutex git__mwindow_mutex;

#define MAX_SHUTDOWN_CB 8

#ifdef GIT_SSL
#ifdef GIT_OPENSSL
# include <openssl/ssl.h>
SSL_CTX *git__ssl_ctx;
# ifdef GIT_THREADS
Expand Down Expand Up @@ -57,7 +57,7 @@ static void git__shutdown(void)
}
}

#if defined(GIT_THREADS) && defined(GIT_SSL)
#if defined(GIT_THREADS) && defined(GIT_OPENSSL)
void openssl_locking_function(int mode, int n, const char *file, int line)
{
int lock;
Expand Down Expand Up @@ -89,7 +89,7 @@ static void shutdown_ssl_locking(void)

static void init_ssl(void)
{
#ifdef GIT_SSL
#ifdef GIT_OPENSSL
long ssl_opts = SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3;

/* Older OpenSSL and MacOS OpenSSL doesn't have this */
Expand Down Expand Up @@ -118,7 +118,7 @@ static void init_ssl(void)

int git_openssl_set_locking(void)
{
#ifdef GIT_SSL
#ifdef GIT_OPENSSL
# ifdef GIT_THREADS
int num_locks, i;

Expand Down
2 changes: 1 addition & 1 deletion src/global.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ typedef struct {
char oid_fmt[GIT_OID_HEXSZ+1];
} git_global_st;

#ifdef GIT_SSL
#ifdef GIT_OPENSSL
# include <openssl/ssl.h>
extern SSL_CTX *git__ssl_ctx;
#endif
Expand Down
4 changes: 2 additions & 2 deletions src/netops.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
#include "common.h"
#include "stream.h"

#ifdef GIT_SSL
#ifdef GIT_OPENSSL
# include <openssl/ssl.h>
#endif

typedef struct gitno_ssl {
#ifdef GIT_SSL
#ifdef GIT_OPENSSL
SSL *ssl;
#else
size_t dummy;
Expand Down
2 changes: 1 addition & 1 deletion src/openssl_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* a Linking Exception. For full terms see the included COPYING file.
*/

#ifdef GIT_SSL
#ifdef GIT_OPENSSL

#include <ctype.h>

Expand Down
6 changes: 3 additions & 3 deletions src/settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* a Linking Exception. For full terms see the included COPYING file.
*/

#ifdef GIT_SSL
#ifdef GIT_OPENSSL
# include <openssl/err.h>
#endif

Expand All @@ -28,7 +28,7 @@ int git_libgit2_features()
#ifdef GIT_THREADS
| GIT_FEATURE_THREADS
#endif
#if defined(GIT_SSL) || defined(GIT_WINHTTP) || defined(GIT_SECURE_TRANSPORT)
#if defined(GIT_OPENSSL) || defined(GIT_WINHTTP) || defined(GIT_SECURE_TRANSPORT)
| GIT_FEATURE_HTTPS
#endif
#if defined(GIT_SSH)
Expand Down Expand Up @@ -138,7 +138,7 @@ int git_libgit2_opts(int key, ...)
break;

case GIT_OPT_SET_SSL_CERT_LOCATIONS:
#ifdef GIT_SSL
#ifdef GIT_OPENSSL
{
const char *file = va_arg(ap, const char *);
const char *path = va_arg(ap, const char *);
Expand Down
2 changes: 1 addition & 1 deletion src/tls_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ int git_tls_stream_new(git_stream **out, const char *host, const char *port)
{
#ifdef GIT_SECURE_TRANSPORT
return git_stransport_stream_new(out, host, port);
#elif defined(GIT_SSL)
#elif defined(GIT_OPENSSL)
return git_openssl_stream_new(out, host, port);
#else
GIT_UNUSED(out);
Expand Down
2 changes: 1 addition & 1 deletion src/transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ static transport_definition local_transport_definition = { "file://", git_transp
static transport_definition transports[] = {
{ "git://", git_transport_smart, &git_subtransport_definition },
{ "http://", git_transport_smart, &http_subtransport_definition },
#if defined(GIT_SSL) || defined(GIT_WINHTTP) || defined(GIT_SECURE_TRANSPORT)
#if defined(GIT_OPENSSL) || defined(GIT_WINHTTP) || defined(GIT_SECURE_TRANSPORT)
{ "https://", git_transport_smart, &http_subtransport_definition },
#endif
{ "file://", git_transport_local, NULL },
Expand Down
2 changes: 1 addition & 1 deletion src/transports/http.c
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ static int http_connect(http_subtransport *t)

error = git_stream_connect(t->io);

#if defined(GIT_SSL) || defined(GIT_SECURE_TRANSPORT)
#if defined(GIT_OPENSSL) || defined(GIT_SECURE_TRANSPORT)
if ((!error || error == GIT_ECERTIFICATE) && t->owner->certificate_check_cb != NULL &&
git_stream_is_encrypted(t->io)) {
git_cert *cert;
Expand Down
2 changes: 1 addition & 1 deletion tests/core/features.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void test_core_features__0(void)
cl_assert((caps & GIT_FEATURE_THREADS) == 0);
#endif

#if defined(GIT_SSL) || defined(GIT_WINHTTP) || defined(GIT_SECURE_TRANSPORT)
#if defined(GIT_OPENSSL) || defined(GIT_WINHTTP) || defined(GIT_SECURE_TRANSPORT)
cl_assert((caps & GIT_FEATURE_HTTPS) != 0);
#else
cl_assert((caps & GIT_FEATURE_HTTPS) == 0);
Expand Down

0 comments on commit 24e53d2

Please sign in to comment.