Implement preliminary phone number privacy for sender certificate

This commit is contained in:
AsamK 2021-05-09 19:34:07 +02:00
parent 8217541d5e
commit 3643d57d0e
2 changed files with 10 additions and 3 deletions

View file

@ -1284,11 +1284,13 @@ public class Manager implements Closeable {
}
private byte[] getSenderCertificate() {
// TODO support UUID capable sender certificates
// byte[] certificate = accountManager.getSenderCertificateForPhoneNumberPrivacy();
byte[] certificate;
try {
if (account.isPhoneNumberShared()) {
certificate = accountManager.getSenderCertificate();
} else {
certificate = accountManager.getSenderCertificateForPhoneNumberPrivacy();
}
} catch (IOException e) {
logger.warn("Failed to get sender certificate, ignoring: {}", e.getMessage());
return null;

View file

@ -878,6 +878,11 @@ public class SignalAccount implements Closeable {
return true;
}
public boolean isPhoneNumberShared() {
// TODO make configurable
return true;
}
public void finishRegistration(final UUID uuid, final MasterKey masterKey, final String pin) {
this.pinMasterKey = masterKey;
this.encryptedDeviceName = null;