Changeset 6016 for pjproject


Ignore:
Timestamp:
May 30, 2019 3:27:25 AM (5 years ago)
Author:
ming
Message:

Fixed #2206: Avoid calling SSL_shutdown() in DTLS media transport if handshake isn't completed yet

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/transport_srtp_dtls.c

    r5860 r6016  
    463463    /* Destroy SSL instance */ 
    464464    if (ds->ossl_ssl) { 
    465         SSL_shutdown(ds->ossl_ssl); 
     465        /** 
     466         * Avoid calling SSL_shutdown() if handshake wasn't completed. 
     467         * OpenSSL 1.0.2f complains if SSL_shutdown() is called during an 
     468         * SSL handshake, while previous versions always return 0.        
     469         */ 
     470        if (SSL_in_init(ossock->ossl_ssl) == 0) { 
     471            SSL_shutdown(ossock->ossl_ssl); 
     472        } 
    466473        SSL_free(ds->ossl_ssl); /* this will also close BIOs */ 
    467474        ds->ossl_ssl = NULL; 
Note: See TracChangeset for help on using the changeset viewer.