-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do CA checks to verify authentication by default #81
base: master
Are you sure you want to change the base?
Conversation
This is a follow-up to b665b28. An attacker that is able to login into a token could bypass authentication by using its own certificate with any valid signature. This change makes the default "ca, signature" with the only way to disable CA check by using "no_ca". This, however, also makes the "none" option disabling CRL and OCSP checks only.
@@ -467,7 +467,7 @@ int verify_certificate(X509 * x509, cert_policy *policy) | |||
X509_STORE_CTX *ctx = NULL; | |||
|
|||
/* if neither ca nor crl check are requested skip */ | |||
if ( (policy->ca_policy==0) && (policy->crl_policy==CRLP_NONE) ) { | |||
if ( (!policy->no_ca_policy==0) && (policy->crl_policy==CRLP_NONE) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be more readable to write this as
if ( (!policy->no_ca_policy==0) && (policy->crl_policy==CRLP_NONE) ) { | |
if ( (policy->no_ca_policy==1) && (policy->crl_policy==CRLP_NONE) ) { |
@@ -408,7 +408,7 @@ static X509_STORE * setup_store(cert_policy *policy) { | |||
} | |||
} | |||
/* add needed hash dir pathname entries */ | |||
if ( (policy->ca_policy) && (is_dir(policy->ca_dir)>0) ) { | |||
if ( (!policy->no_ca_policy) && (is_dir(policy->ca_dir)>0) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this would be better readable as
if ( (!policy->no_ca_policy) && (is_dir(policy->ca_dir)>0) ) { | |
if ( (policy->no_ca_policy==0) && (is_dir(policy->ca_dir)>0) ) { |
(similarly the following change)
# CRLs | ||
# "signature" Does a signature check to ensure that private | ||
# and public key matches | ||
# "no_signature" The only value that disables signature check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be updated also in the documentation. I initially missed that, but I think the xml source is here:
https://github.com/OpenSC/pam_pkcs11/blob/master/doc/pam_pkcs11.xml#L616
If I see right, the no_signature
part is not documented here either.
Having example files as the only documentation is not very good practice.
This is a follow-up to b665b28.
An attacker that is able to login into a token could bypass authentication by using its own certificate with any valid signature.
This change makes the default "ca, signature" with the only way to disable CA check by using "no_ca".
This, however, also makes the "none" option disabling CRL and OCSP checks only.
Resolves #80