Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Move unhex() out of DTLS ifdef, to build with OpenSSL 0.9.7 again
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Apr 14, 2010
1 parent 12d5a06 commit efcd179
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions dtls.c
Expand Up @@ -35,6 +35,19 @@

#include "openconnect.h"

static unsigned char nybble(unsigned char n)
{
if (n >= '0' && n <= '9') return n - '0';
else if (n >= 'A' && n <= 'F') return n - ('A' - 10);
else if (n >= 'a' && n <= 'f') return n - ('a' - 10);
return 0;
}

unsigned char unhex(const char *data)
{
return (nybble(data[0]) << 4) | nybble(data[1]);
}

#ifdef SSL_F_DTLS1_CONNECT
#if 0
/*
Expand Down Expand Up @@ -90,19 +103,6 @@ int RAND_bytes(char *buf, int len)
* their clients use anyway.
*/

static unsigned char nybble(unsigned char n)
{
if (n >= '0' && n <= '9') return n - '0';
else if (n >= 'A' && n <= 'F') return n - ('A' - 10);
else if (n >= 'a' && n <= 'f') return n - ('a' - 10);
return 0;
}

unsigned char unhex(const char *data)
{
return (nybble(data[0]) << 4) | nybble(data[1]);
}

int connect_dtls_socket(struct openconnect_info *vpninfo)
{
STACK_OF(SSL_CIPHER) *ciphers;
Expand Down

0 comments on commit efcd179

Please sign in to comment.