Hi Ralf

I'm testing the optimized dynamic renegotiations and found some points I would
like to discuss. 


1. If for example mod_ssl tries to make a quick renegotiation and fails, now
   mod_ssl returns a 'FORBIDDEN' reply which is a dead end from which you cannot
   escape. I think it would be better to force a full renegotiation in such
cases.


2. In the function ssl_hook_Access in the 'optimized' case you call
   'SSL_get_peer_cert_chain(ssl)' to get the cert chain for re-verification.
   From what I can see (in the debugger) this chain does NOT contain the
   leaf and root certificates. The leaf gets shiftet from the chain in the
   function 'ssl3_get_client_certificate()' on the line ~1630 
   's->session->peer=sk_X509_shift(sk);'. The root cert seems not to be sent
   by the client.
   That leads to two things. First if the real chain lengt is more than 2
   the code seems to work, but it does nor verify the leaf cert but the
   first intermediate ca-cert. Secornd if the real chain length is 2 the
   SSL_get_peer_cert_chain(ssl) returns an empty stack and the check fails
   and returns 'FORBIDDEN'.
   To fix it we have to push the peer cert on the stack (copy).

3. This cert chain is only held in the 'local' cache. That means as soon as
   the SSL-Session gets reused in a new process out of the shared cache there
   is no such chain.
   There are two possible solutions.
   1. Change the functions 'i2d_SSL_SESSION' and 'i2d_SSL_SESSION' to also
      contain the cert chain or
   2. Change the cache to separately cache this chain

4. If a full renegotiation has been successfully finished I think it would
   be good to delete the old session from the cache.
   Probably it would be even better to delete it before the renegotiation get
   initiated. Any thoughts?

5. What are the reasons for the choosen logic for the session id context:
   if (r->main != NULL)
       SSL_set_session_id_context(ssl, (unsigned char *)&(r->main),
sizeof(r->main));
   else
       SSL_set_session_id_context(ssl, (unsigned char *)&r, sizeof(r));

   Am I right that this context get only checked if a new tcp connection gets
   established and the client tries to reuse an already established ssl session
   (which happens in the context of the server and not the location) and only
   if in the server config a client cert is requested.

   In other words as long as the server config does not require client certs
   there can't be any 'mismatching' session.

   On the other hand as soon as the server config requires a client cert and 
   the location triggers a renegotiation these sessions can never be reused
   because the context of the new session is the pointer of the request, and
   the context on server scope is the 'virtual host id'.

   And what happens if a location has a cipher list with weaker ciphers than
   the server and a client tries to reuse such a session. From what I can see
   an think of, the context check does not trigger an the access hock neither.
   Am I missing something or should the '/' location inherit the 'requirements'
   from the server config, so that it gets checked again in the access hock?

   But then this context check make no sens any more (if each call gets realy
   checked in the access hock).

6. By the way because there are some companies (mainly banks) which do not like 
   that anybody can simply snoop to get a list of the names of their customers,
   a server config should never require a client certificate because they are
   transfered in plain text. If client certs are required it is much better to
   configure them in the '/' location because in a renegotiation the client
certs
   are transfered encrypted.
   But this makes the renegotiation optimizations even more important.

So that's it for the moment.

best regards Matthias

-------------------------------------------------------------------------------
Matthias Loepfe, AdNovum Informatik AG, Roentgenstr. 22, CH-8005 Zurich
Email: [EMAIL PROTECTED]   Voice: +41 1 272 6111   Fax: +41 1 272 6312
______________________________________________________________________
Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
User Support Mailing List                      [EMAIL PROTECTED]
Automated List Manager                            [EMAIL PROTECTED]

Reply via email to