Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

openssl >= 1.0.1 has SSL_OP_NO_SSLv2 == 0; fix unused-function warnin… #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
9 changes: 8 additions & 1 deletion src/SSLSocket.m
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@
static SSL_CTX *ctx;
static of_mutex_t *ssl_mutexes;

#if defined(__clang__)
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wunused-function"
#endif
static unsigned long
get_thread_id(void)
{
Expand All @@ -89,6 +93,9 @@
else
of_mutex_unlock(&ssl_mutexes[n]);
}
#if defined(__clang__)
# pragma clang diagnostic pop
#endif

@implementation SSLSocket
@synthesize delegate = _delegate, certificateFile = _certificateFile;
Expand Down Expand Up @@ -126,7 +133,7 @@ + (void)initialize
@throw [OFInitializationFailedException
exceptionWithClass: self];

if ((SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2) & SSL_OP_NO_SSLv2) == 0)
if ((SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2) & SSL_OP_NO_SSLv2) != SSL_OP_NO_SSLv2)
@throw [OFInitializationFailedException
exceptionWithClass: self];

Expand Down