Clarify CMS_decrypt behaviour.
[openssl.git] / ssl / d1_lib.c
index ddbb78a199a7b764f4a723048a579c1d3b2c94d4..2287ba6fa42ddffda61ac53051311394318474db 100644 (file)
@@ -222,6 +222,7 @@ void dtls1_free(SSL *s)
        pqueue_free(s->d1->buffered_app_data.q);
 
        OPENSSL_free(s->d1);
+       s->d1 = NULL;
        }
 
 void dtls1_clear(SSL *s)
@@ -266,6 +267,8 @@ void dtls1_clear(SSL *s)
        ssl3_clear(s);
        if (s->options & SSL_OP_CISCO_ANYCONNECT)
                s->version=DTLS1_BAD_VER;
+       else if (s->method->version == DTLS_ANY_VERSION)
+               s->version=DTLS1_2_VERSION;
        else
                s->version=s->method->version;
        }
@@ -484,7 +487,11 @@ static void get_current_time(struct timeval *t)
 
        GetSystemTime(&st);
        SystemTimeToFileTime(&st,&now.ft);
+#ifdef __MINGW32__
+       now.ul -= 116444736000000000ULL;
+#else
        now.ul -= 116444736000000000UI64;       /* re-bias to 1/1/1970 */
+#endif
        t->tv_sec  = (long)(now.ul/10000000);
        t->tv_usec = ((int)(now.ul%10000000))/10;
 #elif defined(OPENSSL_SYS_VMS)
@@ -525,5 +532,3 @@ static int dtls1_handshake_write(SSL *s)
        {
        return dtls1_do_write(s, SSL3_RT_HANDSHAKE);
        }
-       
-