summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Petretti2014-06-11 14:11:58 +0200
committerMichael Petretti2014-06-11 14:11:58 +0200
commit40e6d09b42f81ceb1f2a6aace35195eaf3eda468 (patch)
treef10b0db628bef53ed4c6f628487b8a9273cb766b
parentNarrowed the problem down to ThriftConnection class line 127 throwing a TTran... (diff)
downloadsatellite-daemon-40e6d09b42f81ceb1f2a6aace35195eaf3eda468.tar.gz
satellite-daemon-40e6d09b42f81ceb1f2a6aace35195eaf3eda468.tar.xz
satellite-daemon-40e6d09b42f81ceb1f2a6aace35195eaf3eda468.zip
Moved the rest to Globals.java
-rw-r--r--src/main/java/org/openslx/satellitedaemon/Globals.java25
-rw-r--r--src/main/java/org/openslx/satellitedaemon/ftp/ThriftConnection.java9
2 files changed, 28 insertions, 6 deletions
diff --git a/src/main/java/org/openslx/satellitedaemon/Globals.java b/src/main/java/org/openslx/satellitedaemon/Globals.java
index 8fe87c5..f120abc 100644
--- a/src/main/java/org/openslx/satellitedaemon/Globals.java
+++ b/src/main/java/org/openslx/satellitedaemon/Globals.java
@@ -25,7 +25,8 @@ public class Globals
public static enum PropString
{ // More strings's? Add them separated with ","
- FTPSERVERIP, KEYSTORETYPE, FTPSKEYSTOREPATH, FTPSKEYSTOREPWD
+ FTPSERVERIP, KEYSTORETYPE, FTPSKEYSTOREPATH, FTPSKEYSTOREPWD, THRIFTORGANIZATIONNAME,
+ RNDSTRINGENCRYPTALIAS, RNDSTRINGENCRYPTPASSWORD, RNDSTRINGENCRYPTPATH
}
public static boolean loadProperties() throws IOException
@@ -77,6 +78,18 @@ public class Globals
case FTPSKEYSTOREPWD:
result = properties.getProperty( "ftps_keyStore_password" );
break;
+ case THRIFTORGANIZATIONNAME:
+ result = properties.getProperty( "organization_name" );
+ break;
+ case RNDSTRINGENCRYPTALIAS:
+ result = properties.getProperty( "RndStringEncrypt_alias" );
+ break;
+ case RNDSTRINGENCRYPTPASSWORD:
+ result = properties.getProperty( "RndStringEncrypt_password" );
+ break;
+ case RNDSTRINGENCRYPTPATH:
+ result = properties.getProperty( "RndStringEncrypt_path" );
+ break;
default:
result = "";
break;
@@ -94,7 +107,15 @@ public class Globals
|| Globals.getPropertyString( PropString.FTPSKEYSTOREPATH ).isEmpty()
|| Globals.getPropertyString( PropString.FTPSKEYSTOREPATH ) == null
|| Globals.getPropertyString( PropString.FTPSKEYSTOREPWD ).isEmpty()
- || Globals.getPropertyString( PropString.FTPSKEYSTOREPWD ) == null ) {
+ || Globals.getPropertyString( PropString.FTPSKEYSTOREPWD ) == null
+ || Globals.getPropertyString( PropString.THRIFTORGANIZATIONNAME ).isEmpty()
+ || Globals.getPropertyString( PropString.THRIFTORGANIZATIONNAME ) == null
+ || Globals.getPropertyString( PropString.RNDSTRINGENCRYPTALIAS ).isEmpty()
+ || Globals.getPropertyString( PropString.RNDSTRINGENCRYPTALIAS ) == null
+ || Globals.getPropertyString( PropString.RNDSTRINGENCRYPTPASSWORD ).isEmpty()
+ || Globals.getPropertyString( PropString.RNDSTRINGENCRYPTPASSWORD ) == null
+ || Globals.getPropertyString( PropString.RNDSTRINGENCRYPTPATH ).isEmpty()
+ || Globals.getPropertyString( PropString.RNDSTRINGENCRYPTPATH ) == null) {
return false;
}
else {
diff --git a/src/main/java/org/openslx/satellitedaemon/ftp/ThriftConnection.java b/src/main/java/org/openslx/satellitedaemon/ftp/ThriftConnection.java
index c3fb21c..0f28c39 100644
--- a/src/main/java/org/openslx/satellitedaemon/ftp/ThriftConnection.java
+++ b/src/main/java/org/openslx/satellitedaemon/ftp/ThriftConnection.java
@@ -124,13 +124,14 @@ public class ThriftConnection
log.debug( "The client was null" );
}
try {
- toEncrypt = theClient.startServerAuthentication( "michis-test.de" );
+ toEncrypt = theClient.startServerAuthentication( Globals.getPropertyString( PropString.THRIFTORGANIZATIONNAME) );
log.info( "The random String we want to encrypt: " + toEncrypt );
- EncryptWithServerIdPublicKey rse = new EncryptWithServerIdPublicKey( "serverid", "password",
- "/home/michael/satellite-daemon/config/serverid.jks" );
+ EncryptWithServerIdPublicKey rse = new EncryptWithServerIdPublicKey( Globals.getPropertyString( PropString.RNDSTRINGENCRYPTALIAS ),
+ Globals.getPropertyString( PropString.RNDSTRINGENCRYPTPASSWORD ),
+ Globals.getPropertyString( PropString.RNDSTRINGENCRYPTPATH ) );
byte[] byteArray = rse.encryptString( toEncrypt );
sSD = theClient.serverAuthenticate(
- "michis-test.de", ByteBuffer.wrap( byteArray ) );
+ Globals.getPropertyString( PropString.THRIFTORGANIZATIONNAME), ByteBuffer.wrap( byteArray ) );
} catch ( ServerAuthenticationException e ) {
log.error( "ThriftConnection: Server Authetication was not sucessful." );
e.printStackTrace();