I'm considering how to handle SSL re-negotiation in the Apache NSS provider mod_nss to handle the SSL client-initiated handshake bug.

NSS provides a callback, SSL_HandshakeCallback(), which according to the docs is called when an SSL handshake has completed.

So let's say I have the following:

SECStatus FailureHandshakeCallback(PRFileDesc * socket, void *arg)
{
    return SECFailure;
}

SECStatus InitialHandshakeCallback(PRFileDesc * socket, void *arg)
{
return SSL_HandshakeCallback(socket, (SSLHandshakeCallback) FailureHandshakeCallback, NULL)
}

When I create a socket I'll set the handshake callback to InitialHandshakeCallback(). Once the initial SSL handshake is done this will then reset it to the failure mode, so that if any subsequent handshaking happens it will fail.

The Apache configuration lets one have per-location configuration, for example requiring SSL client auth only for a subdirectory. To do this it updates the SSL options on the socket and calls SSL_ReHandshake().

What I was thinking about doing here is setting those options, then setting the callback handler back to InitialHandshakeCallback(). This should allow the server-initiated handshake to succeed and prevent any other handshaking (unless we again want to restart it from the server).

Does this (1) seem like a reasonable approach and (2) will it protect against the client rengotiation issue?

thanks

rob
--
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto

Reply via email to