Fix missing return value checks
[openssl.git] / ssl / d1_lib.c
index 4ca6bb31a98b14480ad9954f39252e3e3c3ec29a..b568944ba0a49065329c7a636044aad6998a1088 100644 (file)
@@ -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)