X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=ssl%2Fd1_lib.c;h=b568944ba0a49065329c7a636044aad6998a1088;hp=4ca6bb31a98b14480ad9954f39252e3e3c3ec29a;hb=69f682374868ba2b19a8aeada496bf03dbb037cf;hpb=d2a0d72f33e2cd81a5c81b29b05d6fdb2cc67ac2 diff --git a/ssl/d1_lib.c b/ssl/d1_lib.c index 4ca6bb31a9..b568944ba0 100644 --- a/ssl/d1_lib.c +++ b/ssl/d1_lib.c @@ -273,7 +273,7 @@ void dtls1_clear(SSL *s) ssl3_clear(s); if (s->options & SSL_OP_CISCO_ANYCONNECT) - s->version = DTLS1_BAD_VER; + s->client_version = s->version = DTLS1_BAD_VER; else if (s->method->version == DTLS_ANY_VERSION) s->version = DTLS1_2_VERSION; else @@ -546,6 +546,9 @@ int dtls1_listen(SSL *s, struct sockaddr *client) { int ret; + /* Ensure there is no state left over from a previous invocation */ + SSL_clear(s); + SSL_set_options(s, SSL_OP_COOKIE_EXCHANGE); s->d1->listen = 1; @@ -564,7 +567,11 @@ static void dtls1_set_handshake_header(SSL *s, int htype, unsigned long len) s->init_num = (int)len + DTLS1_HM_HEADER_LENGTH; s->init_off = 0; /* Buffer the message to handle re-xmits */ - dtls1_buffer_message(s, 0); + /* + * Deliberately swallow error return. We really should do something with + * this - but its a void function that can't (easily) be changed + */ + if(!dtls1_buffer_message(s, 0)); } static int dtls1_handshake_write(SSL *s)