提交 2462764e 编写于 作者: C coffeys

8051614: smartcardio TCK tests fail due to lack of 'reset' permission

Reviewed-by: valeriep
上级 89e05400
...@@ -244,9 +244,6 @@ final class CardImpl extends Card { ...@@ -244,9 +244,6 @@ final class CardImpl extends Card {
"sun.security.smartcardio.invertCardReset", "false"))); "sun.security.smartcardio.invertCardReset", "false")));
public void disconnect(boolean reset) throws CardException { public void disconnect(boolean reset) throws CardException {
if (invertReset) {
reset = !reset;
}
if (reset) { if (reset) {
checkSecurity("reset"); checkSecurity("reset");
} }
...@@ -254,6 +251,10 @@ final class CardImpl extends Card { ...@@ -254,6 +251,10 @@ final class CardImpl extends Card {
return; return;
} }
checkExclusive(); checkExclusive();
// to preserve old behaviour, don't change flag until here
if (invertReset) {
reset = !reset;
}
try { try {
SCardDisconnect(cardId, (reset ? SCARD_RESET_CARD : SCARD_LEAVE_CARD)); SCardDisconnect(cardId, (reset ? SCARD_RESET_CARD : SCARD_LEAVE_CARD));
} catch (PCSCException e) { } catch (PCSCException e) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册