LuaSec 0.3.3

This commit is contained in:
Bruno Silvestre 2012-09-02 11:31:22 -03:00
parent d28c5e4f9e
commit 29c6bd65d2
8 changed files with 26 additions and 13 deletions

View File

@ -1,3 +1,10 @@
--------------------------------------------------------------------------------
LuaSec 0.3.3
------------
- BUG: Clear the error queue before call I/O functions (see SSL_get_error
manual).
(thanks Matthew Wild)
--------------------------------------------------------------------------------
LuaSec 0.3.2
------------

View File

@ -1,4 +1,4 @@
LuaSec 0.3.2
LuaSec 0.3.3
------------
* On Linux, BSD, and Mac OS X:

View File

@ -1,4 +1,4 @@
LuaSec 0.3.2 license
LuaSec 0.3.3 license
Copyright (C) 2006-2009 Bruno Silvestre
Permission is hereby granted, free of charge, to any person obtaining

View File

@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
* LuaSec 0.3.2
* LuaSec 0.3.3
* Copyright (C) 2006-2009 Bruno Silvestre
*
*--------------------------------------------------------------------------*/

View File

@ -2,7 +2,7 @@
#define __CONTEXT_H__
/*--------------------------------------------------------------------------
* LuaSec 0.3.2
* LuaSec 0.3.3
* Copyright (C) 2006-2009 Bruno Silvestre
*
*--------------------------------------------------------------------------*/

View File

@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
* LuaSec 0.3.2
* LuaSec 0.3.3
* Copyright (C) 2006-2009 Bruno Silvestre
*
*--------------------------------------------------------------------------*/
@ -63,11 +63,13 @@ static int meth_destroy(lua_State *L)
*/
static int handshake(p_ssl ssl)
{
int err;
p_timeout tm = timeout_markstart(&ssl->tm);
if (ssl->state == ST_SSL_CLOSED)
return IO_CLOSED;
for ( ; ; ) {
int err = SSL_do_handshake(ssl->ssl);
ERR_clear_error();
err = SSL_do_handshake(ssl->ssl);
ssl->error = SSL_get_error(ssl->ssl, err);
switch(ssl->error) {
case SSL_ERROR_NONE:
@ -104,12 +106,14 @@ static int handshake(p_ssl ssl)
static int ssl_send(void *ctx, const char *data, size_t count, size_t *sent,
p_timeout tm)
{
int err;
p_ssl ssl = (p_ssl) ctx;
if (ssl->state == ST_SSL_CLOSED)
return IO_CLOSED;
*sent = 0;
for ( ; ; ) {
int err = SSL_write(ssl->ssl, data, (int) count);
ERR_clear_error();
err = SSL_write(ssl->ssl, data, (int) count);
ssl->error = SSL_get_error(ssl->ssl, err);
switch(ssl->error) {
case SSL_ERROR_NONE:
@ -146,12 +150,14 @@ static int ssl_send(void *ctx, const char *data, size_t count, size_t *sent,
static int ssl_recv(void *ctx, char *data, size_t count, size_t *got,
p_timeout tm)
{
int err;
p_ssl ssl = (p_ssl) ctx;
if (ssl->state == ST_SSL_CLOSED)
return IO_CLOSED;
*got = 0;
for ( ; ; ) {
int err = SSL_read(ssl->ssl, data, (int) count);
ERR_clear_error();
err = SSL_read(ssl->ssl, data, (int) count);
ssl->error = SSL_get_error(ssl->ssl, err);
switch(ssl->error) {
case SSL_ERROR_NONE:

View File

@ -2,7 +2,7 @@
#define __SSL_H__
/*--------------------------------------------------------------------------
* LuaSec 0.3.2
* LuaSec 0.3.3
* Copyright (C) 2006-2009 Bruno Silvestre
*
*--------------------------------------------------------------------------*/

View File

@ -1,6 +1,6 @@
------------------------------------------------------------------------------
-- LuaSec 0.3.2
-- Copyright (C) 2006-2008 Bruno Silvestre
-- LuaSec 0.3.3
-- Copyright (C) 2006-2009 Bruno Silvestre
--
------------------------------------------------------------------------------
@ -10,8 +10,8 @@ require("ssl.core")
require("ssl.context")
_VERSION = "0.3.2"
_COPYRIGHT = "LuaSec 0.3.2 - Copyright (C) 2006-2009 Bruno Silvestre\n" ..
_VERSION = "0.3.3"
_COPYRIGHT = "LuaSec 0.3.3 - Copyright (C) 2006-2009 Bruno Silvestre\n" ..
"LuaSocket 2.0.2 - Copyright (C) 2004-2007 Diego Nehab"
-- Export functions