jdk/src/share/classes/sun/security/pkcs11/P11Signature.java
changeset 25213 04804347bc19
parent 21848 3902d25a64b1
--- a/jdk/src/share/classes/sun/security/pkcs11/P11Signature.java	Tue Jul 01 10:20:56 2014 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11Signature.java	Tue Jul 01 20:35:30 2014 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -340,7 +340,10 @@
         }
         int minKeySize = (int) mechInfo.ulMinKeySize;
         int maxKeySize = (int) mechInfo.ulMaxKeySize;
-
+        // need to override the MAX keysize for SHA1withDSA
+        if (md != null && mechanism == CKM_DSA && maxKeySize > 1024) {
+               maxKeySize = 1024;
+        }
         int keySize = 0;
         if (key instanceof P11Key) {
             keySize = ((P11Key) key).length();