Skip to content

Commit

Permalink
Build against old OpenSSL without DTLS support (OSX, OpenBSD)
Browse files Browse the repository at this point in the history
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Jun 2, 2009
1 parent 8c9f1e1 commit cc872bc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
10 changes: 9 additions & 1 deletion dtls.c
Expand Up @@ -29,11 +29,13 @@
#include <unistd.h>
#include <netinet/in.h>
#include <openssl/err.h>
#include <openssl/ssl.h>
#include <fcntl.h>
#include <string.h>

#include "openconnect.h"

#ifdef SSL_F_DTLS1_CONNECT
#if 0
/*
* Useful for catching test cases, where we want everything to be
Expand Down Expand Up @@ -512,5 +514,11 @@ int dtls_mainloop(struct openconnect_info *vpninfo, int *timeout)

return work_done;
}

#else /* No DTLS support in OpenSSL */
int setup_dtls(struct openconnect_info *vpninfo)
{
vpninfo->progress(vpninfo, PRG_ERR, "Built against OpenSSL with no DTLS support\n");
return -EINVAL;
}
#endif

5 changes: 4 additions & 1 deletion mainloop.c
Expand Up @@ -31,6 +31,8 @@
#include <unistd.h>
#include <string.h>

#include <openssl/ssl.h>

#include "openconnect.h"

void queue_packet(struct pkt **q, struct pkt *new)
Expand Down Expand Up @@ -78,6 +80,7 @@ int vpn_mainloop(struct openconnect_info *vpninfo)
struct timeval tv;
fd_set rfds, wfds, efds;

#ifdef SSL_F_DTLS1_CONNECT
if (vpninfo->new_dtls_ssl)
dtls_try_handshake(vpninfo);

Expand All @@ -88,7 +91,7 @@ int vpn_mainloop(struct openconnect_info *vpninfo)
}
if (vpninfo->dtls_ssl)
did_work += dtls_mainloop(vpninfo, &timeout);

#endif
if (vpninfo->quit_reason)
break;

Expand Down

0 comments on commit cc872bc

Please sign in to comment.