X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2FTinySSL.java;h=d036d3378d22049da920bd2e6ef5727192b4695d;hb=4f1aad4e9c5d755d602cbfcf95ff01eb75ffc5dd;hp=44b998c6dc41bbeb0c0873b461a9fe9b30dd6956;hpb=ce478ac0d941574e9165a09a00c95a5930fa7838;p=org.ibex.core.git diff --git a/src/org/xwt/TinySSL.java b/src/org/xwt/TinySSL.java index 44b998c..d036d33 100644 --- a/src/org/xwt/TinySSL.java +++ b/src/org/xwt/TinySSL.java @@ -112,6 +112,7 @@ public class TinySSL extends Socket { public static class SSLException extends IOException { public SSLException(String s) { super(s); } } static SubjectPublicKeyInfo[] trusted_CA_public_keys; + static String[] trusted_CA_public_key_identifiers; public static byte[] pad1 = new byte[48]; public static byte[] pad2 = new byte[48]; public static byte[] pad1_sha = new byte[40]; @@ -386,7 +387,7 @@ public class TinySSL extends Socket { Log.log(this, "server cert (name, validity dates) checks out okay"); } else if (!isSignedBy(last_cert, this_cert.getSubjectPublicKeyInfo())) - throw new SSLException("certificate chain discontinuity"); + throw new SSLException("the server sent a broken chain of certificates"); last_cert = this_cert; i += certlen + 3; @@ -395,13 +396,27 @@ public class TinySSL extends Socket { if (Log.on) Log.log(this, " Certificate (" + numcerts + " certificates)"); boolean good = false; + + // pass 1 -- only check CA's whose subject is a partial match + String subject = this_cert.getSubject().toString(); for(int i=0; i