summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Petretti2014-08-26 16:15:16 +0200
committerMichael Petretti2014-08-26 16:15:16 +0200
commit77ea24ceae1c070e0276736398dfb2e41de5e714 (patch)
tree7eee63e2f0174ef20be1a9a6033a6ff598f7fea1
parentchanged static to nonstatic un db class (diff)
downloadsatellite-daemon-77ea24ceae1c070e0276736398dfb2e41de5e714.tar.gz
satellite-daemon-77ea24ceae1c070e0276736398dfb2e41de5e714.tar.xz
satellite-daemon-77ea24ceae1c070e0276736398dfb2e41de5e714.zip
Authentication is now working again.
-rw-r--r--config/global.properties.example3
-rw-r--r--src/main/java/org/openslx/satellitedaemon/Globals.java3
-rw-r--r--src/main/java/org/openslx/satellitedaemon/filetransfer/ThriftConnection.java5
3 files changed, 5 insertions, 6 deletions
diff --git a/config/global.properties.example b/config/global.properties.example
index 933e426..ce03b0f 100644
--- a/config/global.properties.example
+++ b/config/global.properties.example
@@ -24,9 +24,6 @@ THRIFT_KEYSTORE_PASSWORD=changeit
# and it's path
THRIFT_KEYSTORE_PATH=/path/to/keystore.jks
-# port where the file transfer takes place (get it from the masterserver)
-FILETRANSFER_PORT=1234
-
# port where the thrift connection is opened (usually this is 9191)
THRIFT_PORT=9191
diff --git a/src/main/java/org/openslx/satellitedaemon/Globals.java b/src/main/java/org/openslx/satellitedaemon/Globals.java
index 38be1f3..fd8458d 100644
--- a/src/main/java/org/openslx/satellitedaemon/Globals.java
+++ b/src/main/java/org/openslx/satellitedaemon/Globals.java
@@ -67,9 +67,6 @@ public class Globals {
}
// Integers //
- public static int getFiletransferPort() {
- return tryToParseInt(properties.getProperty("FILETRANSFER_PORT"));
- }
public static int getThriftPort() {
return tryToParseInt(properties.getProperty("THRIFT_PORT"));
diff --git a/src/main/java/org/openslx/satellitedaemon/filetransfer/ThriftConnection.java b/src/main/java/org/openslx/satellitedaemon/filetransfer/ThriftConnection.java
index ed08c85..c77d6d6 100644
--- a/src/main/java/org/openslx/satellitedaemon/filetransfer/ThriftConnection.java
+++ b/src/main/java/org/openslx/satellitedaemon/filetransfer/ThriftConnection.java
@@ -83,6 +83,7 @@ public class ThriftConnection {
} catch (ImageDataException e) {
if (e.isSetNumber()
&& e.getNumber().equals(ImageDataError.INVALID_DATA)) {
+ e.printStackTrace();
// Data in the db is not valid
// TODO: add e.message into DB;
} else {
@@ -356,11 +357,15 @@ public class ThriftConnection {
toEncrypt = theClient.startServerAuthentication(Globals
.getOrganizationName());
log.info("The random String we want to encrypt: " + toEncrypt);
+ log.info("Length of the random String : " + toEncrypt.length());
EncryptWithServerIdPublicKey rse = new EncryptWithServerIdPublicKey(
Globals.getThriftKeystoreAlias(),
Globals.getThriftKeystorePassword(),
Globals.getThriftKeystorePath());
byte[] byteArray = rse.encryptString(toEncrypt);
+ log.info( "Length of the byteArray of the random string after encryption :" + byteArray.length );
+ ByteBuffer b = ByteBuffer.wrap( byteArray );
+ log.info( "Length of the byteBuffer after encryption :" + b.remaining() );
sSD = theClient.serverAuthenticate(
Globals.getOrganizationName(),
ByteBuffer.wrap(byteArray));