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

Jeroen C. van Gelderen gelderen@cypherpunks.ai
Thu, 13 Jul 2000 20:17:17 -0400 (AST)


gelderen    00/07/13 20:17:17

  Modified:    webfunds/sox Crypto.java
  Log:
  - Remove useless Jikes workarounds.
  - Rename spurious occurrences of x509 to something else.

Revision  Changes    Path
1.36      +5 -14     java/webfunds/sox/Crypto.java

Index: Crypto.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/sox/Crypto.java,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- Crypto.java	2000/07/13 22:38:24	1.35
+++ Crypto.java	2000/07/14 00:17:16	1.36
@@ -1,4 +1,4 @@
-/* $Id: Crypto.java,v 1.35 2000/07/13 22:38:24 gelderen Exp $
+/* $Id: Crypto.java,v 1.36 2000/07/14 00:17:16 gelderen Exp $
  *
  * Copyright (c) Systemics Inc. 1995-2000 on behalf of
  * The WebFunds Development Team.  All Rights Reserved.
@@ -45,7 +45,7 @@
 /**
  * Centralized crypto methods. Currently being overhauled.
  *
- * @version $Revision: 1.35 $
+ * @version $Revision: 1.36 $
  */
 public class Crypto
 {
@@ -875,7 +875,7 @@
      * @exception KeyException a problem has occurred with the
      *        public key, such as an incorrectly formatted public key.
      */
-    public static boolean verify(PublicKey key, byte[] x509sig, byte[] data)
+    public static boolean verify(PublicKey key, byte[] sigX509, byte[] data)
         throws KeyException
     {
         java.security.Signature sig;
@@ -893,11 +893,11 @@
         sig.initVerify(key);
 
         // Update and verify the data
-        // (remember to convert the x509 sig to a standard one)
+        // (remember to convert the X.509 sig to a standard one)
         try
         {
             sig.update(data);
-            return sig.verify(decodeSignature(x509sig));
+            return sig.verify(decodeSignature(sigX509));
         }
         catch (SignatureException e)
         {
@@ -944,7 +944,6 @@
             // Ensure no excess data
             if (dv.data.available() != 0)
                 throw new InvalidKeyException("excess key data");
-            keydata = null; // jikes warning if not used.
             
             return algorithmId;
         } catch (IOException e) {
@@ -982,7 +981,6 @@
                   throw new InvalidKeyException("invalid key format");
             
               AlgorithmId algorithmId = AlgorithmId.parse(dv.data.getDerValue());
-              algorithmId = null; // jikes
               byte[] keydata = dv.data.getBitString();
             
               // Ensure no excess data
@@ -991,7 +989,6 @@
             
               return keydata;
         } catch (IOException e) {
-            e = null; // jikes
             throw new InvalidKeyException("Could not parse encoded key data");
         }
     }
@@ -1052,7 +1049,6 @@
             
             return sig;
         } catch (IOException e) {
-            e = null; // jikes
             throw new SignatureException("Could not parse encoded signature");
         }
     }
@@ -1085,7 +1081,6 @@
         } catch (NoSuchAlgorithmException e) {
             throw new ProviderException("Algorithm not found: "+e.getMessage());
         } catch (IOException e) {
-            e = null; // jikes
             throw new InternalError("Unexpected IOException");
         }
     }
@@ -1130,7 +1125,6 @@
             // Convert from a Cryptix key
             return (PublicKey)new cryptix.provider.rsa.RawRSAPublicKey(n, e);
         } catch (IOException e) {
-            e = null; // jikes
             throw new InvalidKeyException("Could not parse encoded key data");
         }
     }
@@ -1164,7 +1158,6 @@
             return new DerValue(DerValue.tag_Sequence,
                                 dos.toByteArray()).toByteArray();
         } catch (IOException e) {
-            e = null; // jikes
             throw new InternalError("Unexpected IOException");
         }
     }
@@ -1225,7 +1218,6 @@
 
             // Note - Cryptix RSA private key constructor doesn't bother
             // with values n, e, dmp1 or dmq1
-            n = e = dmp1 = dmq1 = null; // jikes
 
             return k;
         }
@@ -1293,7 +1285,6 @@
             return new DerValue(DerValue.tag_Sequence,
                                 dos.toByteArray()).toByteArray();
         } catch (IOException e) {
-            e = null; // jikes
             throw new InternalError("Unexpected IOException");
         }
     }