From c8ae4fdbf70bb20ccf7c687b772d5296909a56d1 Mon Sep 17 00:00:00 2001 From: Björn Hagemeister Date: Wed, 15 Oct 2014 15:56:56 +0200 Subject: Added failure information. --- src/main/java/org/openslx/satellitedaemon/App.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/openslx/satellitedaemon/App.java b/src/main/java/org/openslx/satellitedaemon/App.java index b413280..24a9f2b 100644 --- a/src/main/java/org/openslx/satellitedaemon/App.java +++ b/src/main/java/org/openslx/satellitedaemon/App.java @@ -38,6 +38,7 @@ public class App if ( checkConfig() ) { System.exit( 0 ); } + log.error( "Config not valid: existing modulus, private and public exponent no valid key pair." ); System.exit( 2 ); } else if ( arg.equals( "--genid" ) ) { if ( i < args.length ) { @@ -52,7 +53,7 @@ public class App System.exit( 2 ); } } else if ( arg.equals( "--import" ) ) { - if ( ( i + 3 ) < args.length ) { + if ( ( i + 4 ) < args.length ) { log.error( "Illelgal option: '--import' requires 4 arguments, " ); System.exit( 2 ); } else { @@ -127,8 +128,10 @@ public class App private static boolean importId( String organizationName, BigInteger modulus, BigInteger privExp, BigInteger pubExp ) { - if ( !Identity.isValidKeyPair( modulus, privExp, pubExp ) ) + if ( !Identity.isValidKeyPair( modulus, privExp, pubExp ) ) { + log.error( "Given arguments not valid: given modulus, private and public exponent no valid key pair." ); return false; + } return Identity.importIdentity( organizationName, modulus, privExp, pubExp ); } -- cgit v1.2.3-55-g7522