• Kenny Root's avatar
    Wrap cached sessions before returning · edfc6deb
    Kenny Root authored
    SSLSession should be wrapped so that cached sessions might have the
    functionality that ExtendedSSLSession offers. This also made the
    SSLSessionTest fail because the pre-cached instance would be
    ExtendedSSLSession and the post-cached session would be a regular
    SSLSession.
    
    To keep compatibility with older versions of the platform, it was
    impossible to directly switch OpenSSLSessionImpl over to
    ExtendedSSLSession. So the use of a delegate in the case when the
    platform does have ExtendedSSLSession was required. Since older platform
    versions still use OpenSSLSessionImpl that extends SSLSession, we just
    directly inflate the serialized sessions to that.
    
    The SSLSessionTest was changed to accomodate the delegate scheme since
    SSLSession does not have an equals method, the tests for SSLSessionTest
    were directly comparing object instance equality which fails when the
    sessions are wrapped in a delegate like this.
    
    (cherry picked from commit 710c0817)
    
    Bug: 27123298
    Change-Id: Iefbea03a72dbcc76ae0b439cfdcecd817926b7d0
    edfc6deb
SSLParametersImpl.java 44.5 KB