Skip to contentSkip to conversation

client-cert-not-required == client-cert-do-not-check

Openvpn-devel Faidon Liambotis 2 participants 2 messages Jan 5, 2007 – Jan 8, 2007

lore
Share & tools
lore
#0 lore raw

Hello again,
While fiddling with the OpenVPN code for the patch -look at my other mail- I noticed the following:
When a server specifies client-cert-not-required and the client passes a certificate, the server does not check this certificate for validity, i.e. no trust verification (signed by the CA, not in a CRL etc.), no tls-remote/ns-cert-type/tls-verify handling.
Right now there is a conditional that calls SSL_CTX_set_verify (ctx, SSL_VERIFY_PEER |

			 SSL_VERIFY_FAIL_IF_NO_PEER_CERT,
			 verify_callback);

when client-cert-not-required is not set and does nothing but warn when it's set in the options.

I think that the proper thing to do would be to alter the behavior and call SSL_CTX_set_verify (ctx, SSL_VERIFY_PEER, verify_callback); when the option is passed to OpenVPN and keep the current behavior for the other case.

Is there a reason not to?
I can think of a reason to do that: allow a server that either accepts a username/password _or_ a valid certificate -- to allow a migration for example. This of course would need a clever hack with auth-user-pass-verify/tls-verify scripts or may be a new environmental variable TLS_VERIFIED.

Another reason to do it is because it's the obvious thing to do:
-not-required doesn't mean -do-not-check/-ignored, it means "I will not fail if you don't provide it but I will fail if provide one that I can't verify", IMHO.

Comments?

Regards,
Faidon

#1 lore raw
Quoted 4 lines · Faidon Liambotis

Another reason to do it is because it's the obvious thing to do:
-not-required doesn't mean -do-not-check/-ignored, it means "I will not fail if you don't provide it but I will fail if provide one that I can't verify", IMHO.

Checking the certificate only if present and treating it as successful should it not be present adds no real (non-illusory) security over not checking the certificate at all. Leading people to believe that they have some additional certificate-provided level of security when using certificates in conjunction with client-cert-not-required is thus the Wrong Thing as opposed to making it clear that there is no certificate-related security provided when client-cert-not-required is in use.

Also, modifying the code to add an illusory level of security is more work than not having that (illusory-only) security at all.