DTS Application Library  0.2.3
Application library containing referenced objects and interfaces to common libraries
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages

TLSv1 SSLv2 SSLv3 DTLSv1 support. More...

#include <stdint.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
#include <sys/stat.h>
#include <unistd.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include "include/dtsapp.h"

Go to the source code of this file.

Data Structures

struct  ssldata
 SSL data structure for enabling encryption on sockets. More...
 

Macros

#define COOKIE_SECRET_LENGTH   32
 length of cookie secret using SHA2-256 HMAC More...
 

Enumerations

enum  SSLFLAGS {
  SSL_TLSV1 = 1 << 0, SSL_SSLV2 = 1 << 1, SSL_SSLV3 = 1 << 2, SSL_DTLSV1 = 1 << 3,
  SSL_CLIENT = 1 << 4, SSL_SERVER = 1 << 5, SSL_DTLSCON = 1 << 6
}
 SSL configuration flags. More...
 

Functions

void ssl_shutdown (void *data, int sock)
 Shutdown the SSL connection. More...
 
void * tlsv1_init (const char *cacert, const char *cert, const char *key, int verify)
 Create a SSL structure for TLSv1. More...
 
void * sslv2_init (const char *cacert, const char *cert, const char *key, int verify)
 Create a SSL structure for SSLv2 (If available) More...
 
void * sslv3_init (const char *cacert, const char *cert, const char *key, int verify)
 Create a SSL structure for SSLv3. More...
 
void * dtlsv1_init (const char *cacert, const char *cert, const char *key, int verify)
 Create a SSL structure for DTLSv1. More...
 
void tlsaccept (struct fwsocket *sock, struct ssldata *orig)
 Create SSL session for new connection. More...
 
int socketread_d (struct fwsocket *sock, void *buf, int num, union sockstruct *addr)
 Read from a socket into a buffer. More...
 
int socketread (struct fwsocket *sock, void *buf, int num)
 Read from a socket into a buffer. More...
 
int socketwrite_d (struct fwsocket *sock, const void *buf, int num, union sockstruct *addr)
 Write a buffer to a socket. More...
 
int socketwrite (struct fwsocket *sock, const void *buf, int num)
 Write a buffer to a socket. More...
 
void sslstartup (void)
 Initialise SSL support this should be called at startup. More...
 
void dtsl_serveropts (struct fwsocket *sock)
 Start up the DTLSv1 Server. More...
 
struct fwsocketdtls_listenssl (struct fwsocket *sock)
 Implementation of "listen" for DTLSv1. More...
 
void startsslclient (struct fwsocket *sock)
 Start SSL on a client socket. More...
 
void dtlstimeout (struct fwsocket *sock, struct timeval *timeleft, int defusec)
 Get DTLSv1 timeout setting todefault timeout. More...
 
void dtlshandltimeout (struct fwsocket *sock)
 Handle DTLSv1 timeout. More...
 

Detailed Description

TLSv1 SSLv2 SSLv3 DTLSv1 support.

Definition in file sslutil.c.