[Webfunds-commits] java/webfunds/sox Crypto.java

Jeroen C. van Gelderen gelderen@cypherpunks.ai
Fri, 11 Aug 2000 16:43:21 -0400 (AST)


gelderen    00/08/11 16:43:21

  Modified:    webfunds/sox Crypto.java
  Log:
  Change provider order (JCE provider first, then Cryptix3) so that OpenPGP
  obtains the correct cipher implementations.
  
  This solves (hopefully) as nasty bug where the JCE javax.crypto implementation
  loads Ciphers registered by the Cryptix3 provider. Cryptix3 ciphers do not
  extend from CipherSpi so when javax.crypto.Cipher tries to cast the object
  to a CipherSpi, WebFunds dies a horrible death.
  
  This only occurs in the OpenPGP library (only when symmetric encryption is
  being used, i.e. only in the SignContractWizard) because WebFunds itself
  explicitly names the CryptixCrypto provider when loading symmetric ciphers.

Revision  Changes    Path
1.48      +5 -3      java/webfunds/sox/Crypto.java

Index: Crypto.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/sox/Crypto.java,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- Crypto.java	2000/08/08 04:02:36	1.47
+++ Crypto.java	2000/08/11 20:43:21	1.48
@@ -1,4 +1,4 @@
-/* $Id: Crypto.java,v 1.47 2000/08/08 04:02:36 edwin Exp $
+/* $Id: Crypto.java,v 1.48 2000/08/11 20:43:21 gelderen Exp $
  *
  * Copyright (c) Systemics Inc. 1995-2000 on behalf of
  * The WebFunds Development Team.  All Rights Reserved.
@@ -64,7 +64,7 @@
  *
  * Centralized crypto methods. Currently being overhauled.
  *
- * @version $Revision: 1.47 $
+ * @version $Revision: 1.48 $
  */
 public final class Crypto
 {
@@ -79,9 +79,11 @@
 //............................................................................
 
     static {
-        java.security.Security.addProvider(new cryptix.provider.Cryptix());
         java.security.Security.addProvider(
             new cryptix.jce.provider.CryptixCrypto() );
+
+        //'till JCE porting is complete, Cryptix3 MUST come AFTER CryptixCrypto
+        java.security.Security.addProvider(new cryptix.provider.Cryptix());
     }