From 9e157bc1d0a42848bb8f780f4f7b294ad535feda Mon Sep 17 00:00:00 2001 From: J08nY Date: Fri, 9 Nov 2018 19:42:35 +0100 Subject: FIx loading of F2m field, fix some utility functions. --- src/cz/crcs/ectester/reader/command/Command.java | 9 +++++++++ 1 file changed, 9 insertions(+) (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 d2e08ee..7a3f3b0 100644 --- a/src/cz/crcs/ectester/reader/command/Command.java +++ b/src/cz/crcs/ectester/reader/command/Command.java @@ -133,6 +133,9 @@ public abstract class Command implements Cloneable { } else { keypair = dataStore.getObject(EC_Keypair.class, cfg.namedKey); } + if (keypair == null) { + throw new IOException("KeyPair not found."); + } data = keypair.flatten(); if (data == null) { @@ -155,6 +158,9 @@ public abstract class Command implements Cloneable { pub = dataStore.getObject(EC_Keypair.class, cfg.namedPublicKey); } } + if (pub == null) { + throw new IOException("Public key not found."); + } byte[] pubkey = pub.flatten(EC_Consts.PARAMETER_W); if (pubkey == null) { @@ -177,6 +183,9 @@ public abstract class Command implements Cloneable { priv = dataStore.getObject(EC_Keypair.class, cfg.namedPrivateKey); } } + if (priv == null) { + throw new IOException("Private key not found."); + } byte[] privkey = priv.flatten(EC_Consts.PARAMETER_S); if (privkey == null) { -- cgit v1.2.3-70-g09d2