• M
    Ensure SSL_set_session clears the old session from cache if it is bad · e70656cf
    Matt Caswell 提交于
    SSL_clear() and SSL_free() will remove a session from the cache if it is
    considered "bad". However SSL_set_session() does not do this for the session
    it is replacing.
    
    SSL_clear() clears an SSL object ready for reuse. It does not clear the
    session though. This means that:
    
      SSL_clear(s)
      SSL_set_session(s, sess);
    
    and
      SSL_set_session(s, sess);
      SSL_clear(s);
    
    do not do the same thing, although logically you would expect that they
    would.
    
    The failure of SSL_set_session() to remove bad sessions from the cache
    should be considered a bug, so this commit fixes it.
    
    RT#597
    Reviewed-by: NRich Salz <rsalz@openssl.org>
    e70656cf
ssl_sess.c 34.6 KB