Пример #1
0
void dtls1_clear(SSL *s)
{
    pqueue unprocessed_rcds;
    pqueue processed_rcds;
    pqueue buffered_messages;
    pqueue sent_messages;
    pqueue buffered_app_data;
    unsigned int mtu;

    if (s->d1) {
        unprocessed_rcds = s->d1->unprocessed_rcds.q;
        processed_rcds = s->d1->processed_rcds.q;
        buffered_messages = s->d1->buffered_messages;
        sent_messages = s->d1->sent_messages;
        buffered_app_data = s->d1->buffered_app_data.q;
        mtu = s->d1->mtu;

        dtls1_clear_queues(s);

        pq_64bit_free(&(s->d1->bitmap.map));
        pq_64bit_free(&(s->d1->bitmap.max_seq_num));

        pq_64bit_free(&(s->d1->next_bitmap.map));
        pq_64bit_free(&(s->d1->next_bitmap.max_seq_num));

        memset(s->d1, 0, sizeof(*(s->d1)));

        if (s->server) {
            s->d1->cookie_len = sizeof(s->d1->cookie);
        }

        if (SSL_get_options(s) & SSL_OP_NO_QUERY_MTU) {
            s->d1->mtu = mtu;
        }

        s->d1->unprocessed_rcds.q = unprocessed_rcds;
        s->d1->processed_rcds.q = processed_rcds;
        s->d1->buffered_messages = buffered_messages;
        s->d1->sent_messages = sent_messages;
        s->d1->buffered_app_data.q = buffered_app_data;

#if defined(OPENSSL_SYS_VMS) || defined(VMS_TEST)
        s->d1->bitmap.length = 64;
#else
        s->d1->bitmap.length = sizeof(s->d1->bitmap.map) * 8;
#endif
        pq_64bit_init(&(s->d1->bitmap.map));
        pq_64bit_init(&(s->d1->bitmap.max_seq_num));

        s->d1->next_bitmap.length = s->d1->bitmap.length;
        pq_64bit_init(&(s->d1->next_bitmap.map));
        pq_64bit_init(&(s->d1->next_bitmap.max_seq_num));
    }

    ssl3_clear(s);
    if (s->options & SSL_OP_CISCO_ANYCONNECT)
        s->version = DTLS1_BAD_VER;
    else
        s->version = DTLS1_VERSION;
}
Пример #2
0
void dtls1_clear (SSL * s)
{
    pqueue unprocessed_rcds;

    pqueue processed_rcds;

    pqueue buffered_messages;

    pqueue sent_messages;

    pqueue buffered_app_data;

    unsigned int mtu;

    unsigned int link_mtu;

    if (s->d1)
    {
        unprocessed_rcds = s->d1->unprocessed_rcds.q;
        processed_rcds = s->d1->processed_rcds.q;
        buffered_messages = s->d1->buffered_messages;
        sent_messages = s->d1->sent_messages;
        buffered_app_data = s->d1->buffered_app_data.q;
        mtu = s->d1->mtu;
        link_mtu = s->d1->link_mtu;

        dtls1_clear_queues (s);

        memset (s->d1, 0, sizeof (*(s->d1)));

        if (s->server)
        {
            s->d1->cookie_len = sizeof (s->d1->cookie);
        }

        if (SSL_get_options (s) & SSL_OP_NO_QUERY_MTU)
        {
            s->d1->mtu = mtu;
            s->d1->link_mtu = link_mtu;
        }

        s->d1->unprocessed_rcds.q = unprocessed_rcds;
        s->d1->processed_rcds.q = processed_rcds;
        s->d1->buffered_messages = buffered_messages;
        s->d1->sent_messages = sent_messages;
        s->d1->buffered_app_data.q = buffered_app_data;
    }

    ssl3_clear (s);
    if (s->options & SSL_OP_CISCO_ANYCONNECT)
        s->version = DTLS1_BAD_VER;
    else
        s->version = DTLS1_VERSION;
}
Пример #3
0
void dtls1_free(SSL *s)
{
    DTLS_RECORD_LAYER_free(&s->rlayer);

    ssl3_free(s);

    dtls1_clear_queues(s);

    pqueue_free(s->d1->buffered_messages);
    pqueue_free(s->d1->sent_messages);

    OPENSSL_free(s->d1);
    s->d1 = NULL;
}
Пример #4
0
void dtls1_free(SSL *s)
	{
	ssl3_free(s);

	dtls1_clear_queues(s);

    pqueue_free(s->d1->unprocessed_rcds.q);
    pqueue_free(s->d1->processed_rcds.q);
    pqueue_free(s->d1->buffered_messages);
	pqueue_free(s->d1->sent_messages);
	pqueue_free(s->d1->buffered_app_data.q);

	OPENSSL_free(s->d1);
	}
Пример #5
0
void dtls1_free(SSL *s) {
  ssl3_free(s);

  if (s == NULL || s->d1 == NULL) {
    return;
  }

  dtls1_clear_queues(s);

  pqueue_free(s->d1->buffered_messages);
  pqueue_free(s->d1->sent_messages);

  OPENSSL_free(s->d1);
  s->d1 = NULL;
}
Пример #6
0
int dtls1_clear(SSL *s)
{
    pqueue *buffered_messages;
    pqueue *sent_messages;
    size_t mtu;
    size_t link_mtu;

    DTLS_RECORD_LAYER_clear(&s->rlayer);

    if (s->d1) {
        buffered_messages = s->d1->buffered_messages;
        sent_messages = s->d1->sent_messages;
        mtu = s->d1->mtu;
        link_mtu = s->d1->link_mtu;

        dtls1_clear_queues(s);

        memset(s->d1, 0, sizeof(*s->d1));

        if (s->server) {
            s->d1->cookie_len = sizeof(s->d1->cookie);
        }

        if (SSL_get_options(s) & SSL_OP_NO_QUERY_MTU) {
            s->d1->mtu = mtu;
            s->d1->link_mtu = link_mtu;
        }

        s->d1->buffered_messages = buffered_messages;
        s->d1->sent_messages = sent_messages;
    }

    if (!ssl3_clear(s))
        return 0;

    if (s->method->version == DTLS_ANY_VERSION)
        s->version = DTLS_MAX_VERSION;
#ifndef OPENSSL_NO_DTLS1_METHOD
    else if (s->options & SSL_OP_CISCO_ANYCONNECT)
        s->client_version = s->version = DTLS1_BAD_VER;
#endif
    else
        s->version = s->method->version;

    return 1;
}
Пример #7
0
void
dtls1_clear(SSL *s)
{
	struct dtls1_state_internal_st *internal;
	pqueue unprocessed_rcds;
	pqueue processed_rcds;
	pqueue buffered_messages;
	pqueue sent_messages;
	pqueue buffered_app_data;
	unsigned int mtu;

	if (s->d1) {
		unprocessed_rcds = D1I(s)->unprocessed_rcds.q;
		processed_rcds = D1I(s)->processed_rcds.q;
		buffered_messages = D1I(s)->buffered_messages;
		sent_messages = s->d1->sent_messages;
		buffered_app_data = D1I(s)->buffered_app_data.q;
		mtu = D1I(s)->mtu;

		dtls1_clear_queues(s);

		memset(s->d1->internal, 0, sizeof(*s->d1->internal));
		internal = s->d1->internal;
		memset(s->d1, 0, sizeof(*s->d1));
		s->d1->internal = internal;

		if (s->server) {
			D1I(s)->cookie_len = sizeof(D1I(s)->cookie);
		}

		if (SSL_get_options(s) & SSL_OP_NO_QUERY_MTU) {
			D1I(s)->mtu = mtu;
		}

		D1I(s)->unprocessed_rcds.q = unprocessed_rcds;
		D1I(s)->processed_rcds.q = processed_rcds;
		D1I(s)->buffered_messages = buffered_messages;
		s->d1->sent_messages = sent_messages;
		D1I(s)->buffered_app_data.q = buffered_app_data;
	}

	ssl3_clear(s);

	s->version = DTLS1_VERSION;
}
Пример #8
0
void dtls1_free(SSL *s)
	{
	ssl3_free(s);

	dtls1_clear_queues(s);

    pqueue_free(s->d1->unprocessed_rcds.q);
    pqueue_free(s->d1->processed_rcds.q);
    pqueue_free(s->d1->buffered_messages);
	pqueue_free(s->d1->sent_messages);
	pqueue_free(s->d1->buffered_app_data.q);
	
	pq_64bit_free(&(s->d1->bitmap.map));
	pq_64bit_free(&(s->d1->bitmap.max_seq_num));

	pq_64bit_free(&(s->d1->next_bitmap.map));
	pq_64bit_free(&(s->d1->next_bitmap.max_seq_num));

	OPENSSL_free(s->d1);
	}
Пример #9
0
void dtls1_clear(SSL *s)
{
    pqueue buffered_messages;
    pqueue sent_messages;
    unsigned int mtu;
    unsigned int link_mtu;

    DTLS_RECORD_LAYER_clear(&s->rlayer);

    if (s->d1) {
        buffered_messages = s->d1->buffered_messages;
        sent_messages = s->d1->sent_messages;
        mtu = s->d1->mtu;
        link_mtu = s->d1->link_mtu;

        dtls1_clear_queues(s);

        memset(s->d1, 0, sizeof(*s->d1));

        if (s->server) {
            s->d1->cookie_len = sizeof(s->d1->cookie);
        }

        if (SSL_get_options(s) & SSL_OP_NO_QUERY_MTU) {
            s->d1->mtu = mtu;
            s->d1->link_mtu = link_mtu;
        }

        s->d1->buffered_messages = buffered_messages;
        s->d1->sent_messages = sent_messages;
    }

    ssl3_clear(s);
    if (s->options & SSL_OP_CISCO_ANYCONNECT)
        s->client_version = s->version = DTLS1_BAD_VER;
    else if (s->method->version == DTLS_ANY_VERSION)
        s->version = DTLS1_2_VERSION;
    else
        s->version = s->method->version;
}
Пример #10
0
void dtls1_clear(SSL *s)
	{
    pqueue unprocessed_rcds;
    pqueue processed_rcds;
    pqueue buffered_messages;
	pqueue sent_messages;
	pqueue buffered_app_data;
	
	if (s->d1)
		{
		unprocessed_rcds = s->d1->unprocessed_rcds.q;
		processed_rcds = s->d1->processed_rcds.q;
		buffered_messages = s->d1->buffered_messages;
		sent_messages = s->d1->sent_messages;
		buffered_app_data = s->d1->buffered_app_data.q;

		dtls1_clear_queues(s);

		memset(s->d1, 0, sizeof(*(s->d1)));

		if (s->server)
			{
			s->d1->cookie_len = sizeof(s->d1->cookie);
			}

		s->d1->unprocessed_rcds.q = unprocessed_rcds;
		s->d1->processed_rcds.q = processed_rcds;
		s->d1->buffered_messages = buffered_messages;
		s->d1->sent_messages = sent_messages;
		s->d1->buffered_app_data.q = buffered_app_data;
		}

	ssl3_clear(s);
	if (s->options & SSL_OP_CISCO_ANYCONNECT)
		s->version=DTLS1_BAD_VER;
	else
		s->version=DTLS1_VERSION;
	}
Пример #11
0
void
dtls1_free(SSL *s)
{
	if (s == NULL)
		return;

	ssl3_free(s);

	dtls1_clear_queues(s);

	pqueue_free(D1I(s)->unprocessed_rcds.q);
	pqueue_free(D1I(s)->processed_rcds.q);
	pqueue_free(D1I(s)->buffered_messages);
	pqueue_free(s->d1->sent_messages);
	pqueue_free(D1I(s)->buffered_app_data.q);

	explicit_bzero(s->d1->internal, sizeof(*s->d1->internal));
	free(s->d1->internal);

	explicit_bzero(s->d1, sizeof(*s->d1));
	free(s->d1);

	s->d1 = NULL;
}