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

Add support for server certificate authenticity verification #24

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

Conversation

Sovietaced
Copy link

Reviewer: @wlanmac

This addresses part of my concern raised in #23
I personally only have use for EAP-TTLS so I have no need to send client certificates.

In short, this performs server certificate verification upon receipt of a certificate during the handshake when a valid X509TrustManager can be found. In order to verify the server certificate dynamically I had to pass the key exchange algorithm into the trust manager. I extended the KeyExchange interface and created enum values instead of static integers. This allows the enum to hold a name string as well as the integer value. The name string is what is passed to the trust manager dynamically.

I also made some changes to how the KeyUsage object was constructed in the KeyExchange implementations since I was getting an IllegalArgumentException during testing. I updated some of the bouncy castle classes so that I could leverage KeyUsage.fromExtensions. This seemed to alleviate the problem.

…verifying server certificates

Similarly to JDK, I have moved the key exchange algorithm into an enum. This is helpful to verifying client certificates because I can leverage the algorithm name."
…e validating key usage

During testing I was running into the following exception : Exception in thread "main" net.jradius.exception.RadiusException: java.lang.IllegalArgumentException: illegal object in getInstance: org.bouncycastle.asn1.x509.X509Extension. It appears that there is an updated KeyUsage.fromExtensions API that fixes this issue. In order to leverage this I had to update some of the bouncy castle classes to use newer versions.
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