Kevin Wright fca747e
diff -up jss-4.2.6/mozilla/security/jss/org/mozilla/jss/crypto/Algorithm.c.orig jss-4.2.6/mozilla/security/jss/org/mozilla/jss/crypto/Algorithm.c
Kevin Wright fca747e
--- jss-4.2.6/mozilla/security/jss/org/mozilla/jss/crypto/Algorithm.c.orig	2011-05-18 10:01:36.792151000 -0700
Kevin Wright fca747e
+++ jss-4.2.6/mozilla/security/jss/org/mozilla/jss/crypto/Algorithm.c	2011-05-18 10:06:07.483691000 -0700
Kevin Wright fca747e
@@ -110,6 +110,7 @@ JSS_AlgInfo JSS_AlgTable[NUM_ALGS] = {
Kevin Wright fca747e
 /* 47 */    {SEC_OID_ANSIX962_ECDSA_SHA256_SIGNATURE, SEC_OID_TAG},
Kevin Wright fca747e
 /* 48 */    {SEC_OID_ANSIX962_ECDSA_SHA384_SIGNATURE, SEC_OID_TAG},
Kevin Wright fca747e
 /* 49 */    {SEC_OID_ANSIX962_ECDSA_SHA512_SIGNATURE, SEC_OID_TAG},
Kevin Wright fca747e
+/* 50 */    {SEC_OID_ANSIX962_ECDSA_SIGNATURE_SPECIFIED_DIGEST, SEC_OID_TAG},
Kevin Wright fca747e
 /* REMEMBER TO UPDATE NUM_ALGS!!! */
Kevin Wright fca747e
 };
Kevin Wright fca747e
 
Kevin Wright fca747e
diff -up jss-4.2.6/mozilla/security/jss/org/mozilla/jss/crypto/Algorithm.h.orig jss-4.2.6/mozilla/security/jss/org/mozilla/jss/crypto/Algorithm.h
Kevin Wright fca747e
--- jss-4.2.6/mozilla/security/jss/org/mozilla/jss/crypto/Algorithm.h.orig	2011-05-18 10:01:43.561164000 -0700
Kevin Wright fca747e
+++ jss-4.2.6/mozilla/security/jss/org/mozilla/jss/crypto/Algorithm.h	2011-05-18 10:06:07.489690000 -0700
Kevin Wright fca747e
@@ -56,7 +56,7 @@ typedef struct JSS_AlgInfoStr {
Kevin Wright fca747e
     JSS_AlgType type;
Kevin Wright fca747e
 } JSS_AlgInfo;
Kevin Wright fca747e
 
Kevin Wright fca747e
-#define NUM_ALGS 50
Kevin Wright fca747e
+#define NUM_ALGS 51
Kevin Wright fca747e
 
Kevin Wright fca747e
 extern JSS_AlgInfo JSS_AlgTable[];
Kevin Wright fca747e
 extern CK_ULONG JSS_symkeyUsage[];
Kevin Wright fca747e
diff -up jss-4.2.6/mozilla/security/jss/org/mozilla/jss/crypto/Algorithm.java.orig jss-4.2.6/mozilla/security/jss/org/mozilla/jss/crypto/Algorithm.java
Kevin Wright fca747e
--- jss-4.2.6/mozilla/security/jss/org/mozilla/jss/crypto/Algorithm.java.orig	2011-05-18 10:01:51.232179000 -0700
Kevin Wright fca747e
+++ jss-4.2.6/mozilla/security/jss/org/mozilla/jss/crypto/Algorithm.java	2011-05-18 10:06:07.493690000 -0700
Kevin Wright fca747e
@@ -232,5 +232,6 @@ public class Algorithm {
Kevin Wright fca747e
     protected static final short SEC_OID_ANSIX962_ECDSA_SHA256_SIGNATURE=47;
Kevin Wright fca747e
     protected static final short SEC_OID_ANSIX962_ECDSA_SHA384_SIGNATURE=48;
Kevin Wright fca747e
     protected static final short SEC_OID_ANSIX962_ECDSA_SHA512_SIGNATURE=49;
Kevin Wright fca747e
+    protected static final short SEC_OID_ANSIX962_ECDSA_SIGNATURE_SPECIFIED_DIGEST=50;
Kevin Wright fca747e
 
Kevin Wright fca747e
 }
Kevin Wright fca747e
diff -up jss-4.2.6/mozilla/security/jss/org/mozilla/jss/crypto/KeyPairAlgorithm.java.orig jss-4.2.6/mozilla/security/jss/org/mozilla/jss/crypto/KeyPairAlgorithm.java
Kevin Wright fca747e
--- jss-4.2.6/mozilla/security/jss/org/mozilla/jss/crypto/KeyPairAlgorithm.java.orig	2011-05-18 10:02:01.056198000 -0700
Kevin Wright fca747e
+++ jss-4.2.6/mozilla/security/jss/org/mozilla/jss/crypto/KeyPairAlgorithm.java	2011-05-18 13:46:33.452948000 -0700
Kevin Wright fca747e
@@ -94,7 +94,12 @@ public class KeyPairAlgorithm extends Al
Kevin Wright fca747e
     DSAFamily = new Algorithm(SEC_OID_ANSIX9_DSA_SIGNATURE, "DSA");
Kevin Wright fca747e
 
Kevin Wright fca747e
     public static final Algorithm
Kevin Wright fca747e
-    ECFamily = new Algorithm(SEC_OID_ANSIX962_EC_PUBLIC_KEY, "EC");
Kevin Wright fca747e
+
Kevin Wright fca747e
+//    To support both ECDSA and ECDH, it is best to provide two EC Families;
Kevin Wright fca747e
+//    However, since there is no token that does only CKM_DERIVE to
Kevin Wright fca747e
+//    date, we will just do ECDSA for now as it is sufficient enough today.
Kevin Wright fca747e
+//    This fix will support tokens that do not do ECDH
Kevin Wright fca747e
+    ECFamily = new Algorithm(SEC_OID_ANSIX962_ECDSA_SIGNATURE_SPECIFIED_DIGEST, "EC");
Kevin Wright fca747e
 
Kevin Wright fca747e
     public static final KeyPairAlgorithm
Kevin Wright fca747e
     RSA = new KeyPairAlgorithm(CKM_RSA_PKCS_KEY_PAIR_GEN, "RSA", RSAFamily);
Kevin Wright fca747e
diff -up jss-4.2.6/mozilla/security/jss/org/mozilla/jss/crypto/SignatureAlgorithm.java.orig jss-4.2.6/mozilla/security/jss/org/mozilla/jss/crypto/SignatureAlgorithm.java
Kevin Wright fca747e
--- jss-4.2.6/mozilla/security/jss/org/mozilla/jss/crypto/SignatureAlgorithm.java.orig	2011-05-18 10:02:10.696218000 -0700
Kevin Wright fca747e
+++ jss-4.2.6/mozilla/security/jss/org/mozilla/jss/crypto/SignatureAlgorithm.java	2011-05-18 10:06:07.496691000 -0700
Kevin Wright fca747e
@@ -124,7 +124,7 @@ public class SignatureAlgorithm extends 
Kevin Wright fca747e
      * operates on its input, which should be a hash.
Kevin Wright fca747e
      */
Kevin Wright fca747e
     public static final SignatureAlgorithm
Kevin Wright fca747e
-    ECSignature = new SignatureAlgorithm(SEC_OID_ANSIX962_EC_PUBLIC_KEY, 
Kevin Wright fca747e
+    ECSignature = new SignatureAlgorithm(SEC_OID_ANSIX962_ECDSA_SIGNATURE_SPECIFIED_DIGEST, 
Kevin Wright fca747e
 	"EC",
Kevin Wright fca747e
         null, null, ANSI_X962_OID.subBranch(2).subBranch(1) );
Kevin Wright fca747e