Skip to content
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

Improve search of trusted CA certificate in AuthenticationResponseValidator.isCertificateTrusted() #99

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cyb3r4nt
Copy link

Improves search of trusted CA certificate in AuthenticationResponseValidator.isCertificateTrusted()

Adds search of trusted CA certificates by their distinguished name. Reduces overall calculations of signatures during certificate validation.

There were some problems in AuthenticationResponseValidator.isCertificateTrusted():

  • all trusted CA certificates were checked despite of known issuer in the signer's certificate
  • signatures were calculated for each trusted CA certificate until proper is found. Trusted CA list may have multiple different certificates with the same key size, and signatures were calculated for almost all of them. Necessary cert may be last in trusted CA list.
  • If log level DEBUG is turned on, then there were quite many error messages from other validations and exceptions were logged as well.
  • There was no good logging when trusted CA check fails (See "Signature length not correct: got 512 but was expecting 256" using DEMO environment #75)

Distinguished names of signer's certificate issuer and trusted CA certificate subject must be same,
because these identify the CA certificate itself,
and are signed within the CA certificate chain.
There is an assumption that CA places its subject name into the issuer field of the person's certificate,
and at least C, O and CN stay same.

Also adds additional logging when trusted CA certificate is missing (#75)

…idator.isCertificateTrusted()

Adds search of trusted CA certificates by their distinguished name.
Reduces overall calculations of signatures during certificate validation.

Distinguished names of signer's certificate issuer
and trusted CA certificate subject must be same,
because these identify the CA certificate,
and are signed within the CA certificate chain.

Also adds additional logging when trusted CA certificate is missing (SK-EID#75)

Signed-off-by: cyb3r4nt <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant