Option to set current cert to server certificate.
[openssl.git] / ssl / ssl_sess.c
index 093ea60ae6235ac6273c196a2d9c0005f78bfe32..73d87fd6c1a3c3088606370d04e04d1473b2fb62 100644 (file)
@@ -328,6 +328,11 @@ int ssl_get_new_session(SSL *s, int session)
                        ss->ssl_version=DTLS1_VERSION;
                        ss->session_id_length=SSL3_SSL_SESSION_ID_LENGTH;
                        }
+               else if (s->version == DTLS1_2_VERSION)
+                       {
+                       ss->ssl_version=DTLS1_2_VERSION;
+                       ss->session_id_length=SSL3_SSL_SESSION_ID_LENGTH;
+                       }
                else
                        {
                        SSLerr(SSL_F_SSL_GET_NEW_SESSION,SSL_R_UNSUPPORTED_SSL_VERSION);
@@ -589,12 +594,14 @@ int ssl_get_prev_session(SSL *s, unsigned char *session_id, int len,
        if (ret != NULL)
                {
                SSL_SESSION_free(ret);
+#ifndef OPENSSL_NO_TLSEXT
                if (!try_session_cache)
                        {
                        /* The session was from a ticket, so we should
                         * issue a ticket for the new session */
                        s->tlsext_ticket_expected = 1;
                        }
+#endif
                }
        if (fatal)
                return -1;
@@ -739,8 +746,6 @@ void SSL_SESSION_free(SSL_SESSION *ss)
        ss->tlsext_ellipticcurvelist_length = 0;
        if (ss->tlsext_ellipticcurvelist != NULL) OPENSSL_free(ss->tlsext_ellipticcurvelist);
 #endif /* OPENSSL_NO_EC */
-       if (ss->audit_proof != NULL) OPENSSL_free(ss->audit_proof);
-       ss->audit_proof_length = 0;
 #endif
 #ifndef OPENSSL_NO_PSK
        if (ss->psk_identity_hint != NULL)
@@ -862,15 +867,6 @@ int SSL_SESSION_set1_id_context(SSL_SESSION *s,const unsigned char *sid_ctx,
        return 1;
        }
 
-#ifndef OPENSSL_NO_TLSEXT
-unsigned char *SSL_SESSION_get_tlsext_authz_server_audit_proof(SSL_SESSION *s, size_t *proof_length)
-       {
-       if (s->audit_proof != NULL)
-               *proof_length = s->audit_proof_length;
-       return s->audit_proof;
-       }
-#endif
-
 long SSL_CTX_set_timeout(SSL_CTX *s, long t)
        {
        long l;