src/ssl.h

Sat, 17 Dec 2011 10:30:58 -0800

author
Paul Aurich <paul@darkrain42.org>
date
Sat, 17 Dec 2011 10:30:58 -0800
changeset 45
5be249c0ae71
parent 41
e26f1f91118a
permissions
-rw-r--r--

context: Add no_compression for OpenSSL 0.9.8 as well

Since OpenSSL 0.9.8 doesn't have SSL_OP_NO_COMPRESSION, this is
implemented by simplying NULLing out the SSL_CTX->comp_methods stack.

#ifndef __SSL_H__
#define __SSL_H__

/*--------------------------------------------------------------------------
 * LuaSec 0.4
 * Copyright (C) 2006-2009 Bruno Silvestre
 *
 *--------------------------------------------------------------------------*/

#include <openssl/ssl.h>
#include <lua.h>

#include "io.h"
#include "buffer.h"
#include "timeout.h"
#include "socket.h"
#include "context.h"

#define ST_SSL_NEW       1
#define ST_SSL_CONNECTED 2
#define ST_SSL_CLOSED    3

typedef struct t_ssl_ {
  t_socket sock;
  t_io io;
  t_buffer buf;
  t_timeout tm;
  SSL *ssl;
  char state;
  int error;
  int t_cert_errors; /* reference to a table of cert errors...or LUA_NOREF */
} t_ssl;
typedef t_ssl* p_ssl;

extern int luasec_ssl_idx;
LUASEC_API int luaopen_ssl_core(lua_State *L);

#endif

mercurial