I'm slowly plowing through the issues preventing Azureus from running. Here are some of the latest items. Casey - I had to apply to the attached two patches to gnu-crypto. The first one makes sure that GnuKeyring.engineLoad(null, null) creates an empty keyring, as per the KeyStore API. I'm not sure if it's exactly correct. The second one makes sure that the IllegalStateExceptions we throw have useful stack traces. Before this change, every IllegalStateException thrown would have a stack trace showing where NOT_LOADED was created. We should apply something like these patches to the FC gnu-crypto (or take a new upstream version if there is one). Next I had to struggle with Cryptix. Azureus uses PKCS5Padding, which only seems to be provided by Sun and Cryptix. First of all, I had to move cryptix.jar into /usr/share/java/gcj-endorsed. Can we do this? But it still doesn't work because cryptix.CryptixProperties can't find the Cryptix.properties file. Perhaps this never worked. It's required, in any case, since that file defines the mapping between the PKCS5Padding alias and the class that implements it. If anybody has insight into how this is supposed to work... well, that would be a great xmas present :-) Try running "java cryptix.CryptixProperties" to see what I mean. For what it's worth, Sun's JRE can't find it either, so cryptix and/or JPackage is likely to blame. Thanks, AG
--- source/gnu/crypto/jce/keyring/GnuKeyring.java~ 2005-12-24 15:40:13.000000000 -0500 +++ source/gnu/crypto/jce/keyring/GnuKeyring.java 2005-12-24 15:39:48.000000000 -0500 @@ -321,6 +321,8 @@ } keyring.load(attr); } + if (keyring == null) + keyring = new GnuPrivateKeyring(); loaded = true; }
--- source/gnu/crypto/jce/keyring/GnuKeyring.java~ 2004-02-09 16:44:58.000000000 -0500 +++ source/gnu/crypto/jce/keyring/GnuKeyring.java 2005-12-24 15:02:13.000000000 -0500 @@ -83,9 +83,6 @@ // Constants and fields. // ------------------------------------------------------------------------ - private static final IllegalStateException NOT_LOADED = - new IllegalStateException("keyring not loaded"); - private boolean loaded; private IKeyring keyring; @@ -100,7 +97,7 @@ public Enumeration engineAliases() { if (!loaded) { - throw NOT_LOADED; + throw new IllegalStateException("keyring not loaded"); } if (keyring == null) { return new Enumeration() { @@ -113,7 +110,7 @@ public boolean engineContainsAlias(String alias) { if (!loaded) { - throw NOT_LOADED; + throw new IllegalStateException("keyring not loaded"); } if (keyring == null) { return false; @@ -123,7 +120,7 @@ public void engineDeleteEntry(String alias) { if (!loaded) { - throw NOT_LOADED; + throw new IllegalStateException("keyring not loaded"); } if (keyring != null) { keyring.remove(alias); @@ -132,7 +129,7 @@ public Certificate engineGetCertificate(String alias) { if (!loaded) { - throw NOT_LOADED; + throw new IllegalStateException("keyring not loaded"); } if (keyring == null) { return null; @@ -145,7 +142,7 @@ public String engineGetCertificateAlias(Certificate cert) { if (!loaded) { - throw NOT_LOADED; + throw new IllegalStateException("keyring not loaded"); } if (keyring == null) { return null; @@ -166,7 +163,7 @@ public void engineSetCertificateEntry(String alias, Certificate cert) { if (!loaded) { - throw NOT_LOADED; + throw new IllegalStateException("keyring not loaded"); } if (keyring == null) { keyring = new GnuPublicKeyring("HMAC-SHA-1", 20); @@ -179,7 +176,7 @@ public Certificate[] engineGetCertificateChain(String alias) { if (!loaded) { - throw NOT_LOADED; + throw new IllegalStateException("keyring not loaded"); } if (keyring == null) { return null; @@ -192,7 +189,7 @@ public Date engineGetCreationDate(String alias) { if (!loaded) { - throw NOT_LOADED; + throw new IllegalStateException("keyring not loaded"); } if (keyring == null) { return null; @@ -214,7 +211,7 @@ throws UnrecoverableKeyException { if (!loaded) { - throw NOT_LOADED; + throw new IllegalStateException("keyring not loaded"); } if (keyring == null) { return null; @@ -238,7 +235,7 @@ throws KeyStoreException { if (!loaded) { - throw NOT_LOADED; + throw new IllegalStateException("keyring not loaded"); } if (keyring == null) { keyring = new GnuPrivateKeyring("HMAC-SHA-1", 20, "AES", "OFB", 16); @@ -271,7 +268,7 @@ public boolean engineIsCertificateEntry(String alias) { if (!loaded) { - throw NOT_LOADED; + throw new IllegalStateException("keyring not loaded"); } if (keyring == null) { return false; @@ -284,7 +281,7 @@ public boolean engineIsKeyEntry(String alias) { if (!loaded) { - throw NOT_LOADED; + throw new IllegalStateException("keyring not loaded"); } if (keyring == null) { return false; @@ -331,7 +328,7 @@ throws IOException { if (!loaded || keyring == null) { - throw NOT_LOADED; + throw new IllegalStateException("keyring not loaded"); } HashMap attr = new HashMap(); attr.put(IKeyring.KEYRING_DATA_OUT, out); @@ -341,7 +338,7 @@ public int engineSize() { if (!loaded) { - throw NOT_LOADED; + throw new IllegalStateException("keyring not loaded"); } if (keyring == null) { return 0;