From 2b22e8032eb585d717cb1fdc98859a079c171d7e Mon Sep 17 00:00:00 2001 From: J08nY Date: Tue, 26 Feb 2019 16:41:28 +0100 Subject: Fix setting key parts in ECDH util function, fix exports of large keys. --- src/cz/crcs/ectester/reader/command/Command.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/cz/crcs/ectester/reader/command/Command.java') diff --git a/src/cz/crcs/ectester/reader/command/Command.java b/src/cz/crcs/ectester/reader/command/Command.java index bf2441f..b5b9393 100644 --- a/src/cz/crcs/ectester/reader/command/Command.java +++ b/src/cz/crcs/ectester/reader/command/Command.java @@ -121,7 +121,7 @@ public abstract class Command implements Cloneable { * @return a CommandAPDU setting params loaded on the keyPair/s * @throws IOException if any of the key files cannot be found/opened */ - public static Command prepareKey(CardMngr cardManager, EC_Store dataStore, ECTesterReader.Config cfg, byte keyPair) throws IOException { + public static Command prepareKey(CardMngr cardManager, EC_Store dataStore, ECTesterReader.Config cfg, byte keyPair, short allowedParams) throws IOException { short params = EC_Consts.PARAMETERS_NONE; byte[] data = null; @@ -147,7 +147,7 @@ public abstract class Command implements Cloneable { } } - if (cfg.publicKey != null || cfg.namedPublicKey != null) { + if ((cfg.publicKey != null || cfg.namedPublicKey != null) && ((allowedParams & EC_Consts.PARAMETER_W )!= 0)) { params |= EC_Consts.PARAMETER_W; EC_Params pub; if (cfg.publicKey != null) { @@ -172,7 +172,7 @@ public abstract class Command implements Cloneable { } data = pubkey; } - if (cfg.privateKey != null || cfg.namedPrivateKey != null) { + if ((cfg.privateKey != null || cfg.namedPrivateKey != null) && ((allowedParams & EC_Consts.PARAMETER_S )!= 0)) { params |= EC_Consts.PARAMETER_S; EC_Params priv; if (cfg.privateKey != null) { -- cgit v1.2.3-70-g09d2