changeset 8092:acb5d48ed0da

8051614: smartcardio TCK tests fail due to lack of 'reset' permission Reviewed-by: valeriep
author coffeys
date Wed, 23 Jul 2014 20:14:02 +0100
parents 6c4164200421
children 319ceec1d2f8
files src/share/classes/sun/security/smartcardio/CardImpl.java
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/security/smartcardio/CardImpl.java	Fri Oct 24 19:38:57 2014 +0400
+++ b/src/share/classes/sun/security/smartcardio/CardImpl.java	Wed Jul 23 20:14:02 2014 +0100
@@ -262,9 +262,6 @@
                     "sun.security.smartcardio.invertCardReset", "true")));
 
     public void disconnect(boolean reset) throws CardException {
-        if (invertReset) {
-            reset = !reset;
-        }
         if (reset) {
             checkSecurity("reset");
         }
@@ -272,6 +269,10 @@
             return;
         }
         checkExclusive();
+        // to preserve old behaviour, don't change flag until here
+        if (invertReset) {
+            reset = !reset;
+        }
         try {
             SCardDisconnect(cardId, (reset ? SCARD_RESET_CARD : SCARD_LEAVE_CARD));
         } catch (PCSCException e) {