Oops use up to date patch for PR#2506

This commit is contained in:
Dr. Stephen Henson 2011-05-25 14:29:55 +00:00
parent dda8dcd2c0
commit 4e5755cd85
2 changed files with 16 additions and 2 deletions

@ -133,15 +133,26 @@ static void dtls1_clear_queues(SSL *s)
{ {
pitem *item = NULL; pitem *item = NULL;
hm_fragment *frag = NULL; hm_fragment *frag = NULL;
DTLS1_RECORD_DATA *rdata;
while( (item = pqueue_pop(s->d1->unprocessed_rcds.q)) != NULL) while( (item = pqueue_pop(s->d1->unprocessed_rcds.q)) != NULL)
{ {
rdata = (DTLS1_RECORD_DATA *) item->data;
if (rdata->rbuf.buf)
{
OPENSSL_free(rdata->rbuf.buf);
}
OPENSSL_free(item->data); OPENSSL_free(item->data);
pitem_free(item); pitem_free(item);
} }
while( (item = pqueue_pop(s->d1->processed_rcds.q)) != NULL) while( (item = pqueue_pop(s->d1->processed_rcds.q)) != NULL)
{ {
rdata = (DTLS1_RECORD_DATA *) item->data;
if (rdata->rbuf.buf)
{
OPENSSL_free(rdata->rbuf.buf);
}
OPENSSL_free(item->data); OPENSSL_free(item->data);
pitem_free(item); pitem_free(item);
} }

@ -150,6 +150,7 @@ int dtls1_accept(SSL *s)
unsigned long alg_k; unsigned long alg_k;
int ret= -1; int ret= -1;
int new_state,state,skip=0; int new_state,state,skip=0;
int listen;
RAND_add(&Time,sizeof(Time),0); RAND_add(&Time,sizeof(Time),0);
ERR_clear_error(); ERR_clear_error();
@ -160,6 +161,8 @@ int dtls1_accept(SSL *s)
else if (s->ctx->info_callback != NULL) else if (s->ctx->info_callback != NULL)
cb=s->ctx->info_callback; cb=s->ctx->info_callback;
listen = s->d1->listen;
/* init things to blank */ /* init things to blank */
s->in_handshake++; s->in_handshake++;
if (!SSL_in_init(s) || SSL_in_before(s)) SSL_clear(s); if (!SSL_in_init(s) || SSL_in_before(s)) SSL_clear(s);
@ -274,7 +277,7 @@ int dtls1_accept(SSL *s)
s->init_num=0; s->init_num=0;
/* If we're just listening, stop here */ /* If we're just listening, stop here */
if (s->d1->listen && s->state == SSL3_ST_SW_SRVR_HELLO_A) if (listen && s->state == SSL3_ST_SW_SRVR_HELLO_A)
{ {
ret = 2; ret = 2;
s->d1->listen = 0; s->d1->listen = 0;