From dea7370b83b3fac0c325184a77d526286e1ed241 Mon Sep 17 00:00:00 2001 From: Felix Prahl-Kamps Date: Mon, 15 Jul 2019 17:46:37 +0200 Subject: [PATCH] fix sync information encryption --- .../java/lu/circl/mispbump/activities/ExchangeActivity.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/lu/circl/mispbump/activities/ExchangeActivity.java b/app/src/main/java/lu/circl/mispbump/activities/ExchangeActivity.java index 21ea9cc..d98e42f 100644 --- a/app/src/main/java/lu/circl/mispbump/activities/ExchangeActivity.java +++ b/app/src/main/java/lu/circl/mispbump/activities/ExchangeActivity.java @@ -68,7 +68,6 @@ public class ExchangeActivity extends AppCompatActivity { uploadInformation = new UploadInformation(); publicKeyQr = generatePublicKeyBitmap(); - dataQr = generateLocalSyncInfoBitmap(); setSyncState(SyncState.KEY_EXCHANGE); } @@ -112,7 +111,7 @@ public class ExchangeActivity extends AppCompatActivity { private Bitmap generateLocalSyncInfoBitmap() { uploadInformation.setLocal(generateLocalSyncInfo()); - return qrCodeGenerator.generateQrCode(new Gson().toJson(uploadInformation.getLocal())); + return qrCodeGenerator.generateQrCode(diffieHellman.encrypt(new Gson().toJson(uploadInformation.getLocal()))); } private SyncInformation generateLocalSyncInfo() { @@ -273,6 +272,7 @@ public class ExchangeActivity extends AppCompatActivity { try { diffieHellman.setForeignPublicKey(DiffieHellman.publicKeyFromString(qrData)); setSyncState(SyncState.KEY_EXCHANGE_DONE); + dataQr = generateLocalSyncInfoBitmap(); } catch (InvalidKeySpecException | NoSuchAlgorithmException e) { if (currentReadQrStatus == ReadQrStatus.PENDING) { setReadQrStatus(ReadQrStatus.FAILURE);