mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Only send plain text pin if locked with registration lock v1
This commit is contained in:
parent
db756bfe10
commit
da29cdfe10
1 changed files with 12 additions and 10 deletions
|
@ -129,9 +129,10 @@ public class RegistrationManager implements Closeable {
|
||||||
VerifyAccountResponse response;
|
VerifyAccountResponse response;
|
||||||
MasterKey masterKey;
|
MasterKey masterKey;
|
||||||
try {
|
try {
|
||||||
response = verifyAccountWithCode(verificationCode, pin, null);
|
response = verifyAccountWithCode(verificationCode, null, null);
|
||||||
|
|
||||||
masterKey = null;
|
masterKey = null;
|
||||||
|
pin = null;
|
||||||
} catch (LockedException e) {
|
} catch (LockedException e) {
|
||||||
if (pin == null) {
|
if (pin == null) {
|
||||||
throw e;
|
throw e;
|
||||||
|
@ -139,9 +140,9 @@ public class RegistrationManager implements Closeable {
|
||||||
|
|
||||||
var registrationLockData = pinHelper.getRegistrationLockData(pin, e);
|
var registrationLockData = pinHelper.getRegistrationLockData(pin, e);
|
||||||
if (registrationLockData == null) {
|
if (registrationLockData == null) {
|
||||||
throw e;
|
response = verifyAccountWithCode(verificationCode, pin, null);
|
||||||
}
|
masterKey = null;
|
||||||
|
} else {
|
||||||
var registrationLock = registrationLockData.getMasterKey().deriveRegistrationLock();
|
var registrationLock = registrationLockData.getMasterKey().deriveRegistrationLock();
|
||||||
try {
|
try {
|
||||||
response = verifyAccountWithCode(verificationCode, null, registrationLock);
|
response = verifyAccountWithCode(verificationCode, null, registrationLock);
|
||||||
|
@ -150,6 +151,7 @@ public class RegistrationManager implements Closeable {
|
||||||
}
|
}
|
||||||
masterKey = registrationLockData.getMasterKey();
|
masterKey = registrationLockData.getMasterKey();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TODO response.isStorageCapable()
|
// TODO response.isStorageCapable()
|
||||||
//accountManager.setGcmId(Optional.of(GoogleCloudMessaging.getInstance(this).register(REGISTRATION_ID)));
|
//accountManager.setGcmId(Optional.of(GoogleCloudMessaging.getInstance(this).register(REGISTRATION_ID)));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue