X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2FTinySSL.java;h=637e41c7d15064f7ce8f1e90fa42fba172261f9d;hb=937a064e3217ad35dff63cabf16f5df67dfa0954;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..637e41c 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