Skip to content
Snippets Groups Projects

Use XSalsa20-Poly1305 instead of AES-GCM for transport encryption and password storage.

Merged akwizgran requested to merge use-xsalsa20-poly1305 into master
+ 64
115
Compare changes
  • Side-by-side
  • Inline
Files
@@ -55,12 +55,12 @@ implements InvitationListener {
@@ -55,12 +55,12 @@ implements InvitationListener {
private boolean localCompared = false, remoteCompared = false;
private boolean localCompared = false, remoteCompared = false;
private boolean localMatched = false, remoteMatched = false;
private boolean localMatched = false, remoteMatched = false;
private String contactName = null;
private String contactName = null;
private boolean bluetoothWasEnabled = false;
// Fields that are accessed from background threads must be volatile
// Fields that are accessed from background threads must be volatile
@Inject private volatile DatabaseComponent db;
@Inject private volatile DatabaseComponent db;
@Inject private volatile IdentityManager identityManager;
@Inject private volatile IdentityManager identityManager;
private volatile boolean leaveBluetoothEnabled = true;
private volatile boolean bluetoothWasEnabled = false;
 
private volatile boolean leaveBluetoothEnabled = false;
@Override
@Override
public void onCreate(Bundle state) {
public void onCreate(Bundle state) {
@@ -173,7 +173,8 @@ implements InvitationListener {
@@ -173,7 +173,8 @@ implements InvitationListener {
long duration = System.currentTimeMillis() - now;
long duration = System.currentTimeMillis() - now;
if (LOG.isLoggable(INFO))
if (LOG.isLoggable(INFO))
LOG.info("Loading setting took " + duration + " ms");
LOG.info("Loading setting took " + duration + " ms");
leaveBluetoothEnabled = c.getBoolean("enable", false);
leaveBluetoothEnabled = bluetoothWasEnabled
 
|| c.getBoolean("enable", false);
} catch (DbException e) {
} catch (DbException e) {
if (LOG.isLoggable(WARNING))
if (LOG.isLoggable(WARNING))
LOG.log(WARNING, e.toString(), e);
LOG.log(WARNING, e.toString(), e);
@@ -328,7 +329,7 @@ implements InvitationListener {
@@ -328,7 +329,7 @@ implements InvitationListener {
}
}
public void disableBluetooth() {
public void disableBluetooth() {
if (!bluetoothWasEnabled && !leaveBluetoothEnabled) {
if (!leaveBluetoothEnabled) {
if (LOG.isLoggable(INFO)) LOG.info("Turning off Bluetooth again");
if (LOG.isLoggable(INFO)) LOG.info("Turning off Bluetooth again");
BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
Loading