From da1ee8381f2f7eaf1cfcd4941ec9f95287435625 Mon Sep 17 00:00:00 2001 From: J08nY Date: Sun, 11 Dec 2016 14:20:00 +0100 Subject: Fixed some issues with errors in key generation, and their propagation --- src/applets/ECKeyGenerator.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/applets/ECKeyGenerator.java') diff --git a/src/applets/ECKeyGenerator.java b/src/applets/ECKeyGenerator.java index 491cd86..2eb5679 100644 --- a/src/applets/ECKeyGenerator.java +++ b/src/applets/ECKeyGenerator.java @@ -215,8 +215,8 @@ public class ECKeyGenerator { public short exportParameter(byte key, short param, byte[] outputBuffer, short outputOffset) { if (key == KEY_BOTH) { - return -1; - }//TODO: change error handling. + ISOException.throwIt(ISO7816.SW_FUNC_NOT_SUPPORTED); + } short length = 0; try { switch (param) { @@ -255,9 +255,9 @@ public class ECKeyGenerator { ISOException.throwIt(ISO7816.SW_FUNC_NOT_SUPPORTED); } } catch (CryptoException ce) { - length = -1; + ISOException.throwIt(ce.getReason()); } catch (Exception e) { - length = -1; + ISOException.throwIt(ISO7816.SW_UNKNOWN); } return length; } -- cgit v1.3.1