Skip to content

Commit

Permalink
Create account entropy pool instead of master key
Browse files Browse the repository at this point in the history
  • Loading branch information
AsamK committed Dec 15, 2024
1 parent 9d92a3e commit c3f8d68
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1550,9 +1550,7 @@ public MasterKey getOrCreatePinMasterKey() {
return key;
}

pinMasterKey = KeyUtils.createMasterKey();
save();
return pinMasterKey;
return getOrCreateAccountEntropyPool().deriveMasterKey();
}

private MasterKey getMasterKey() {
Expand Down
5 changes: 0 additions & 5 deletions lib/src/main/java/org/asamk/signal/manager/util/KeyUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import org.signal.libsignal.zkgroup.profiles.ProfileKey;
import org.whispersystems.signalservice.api.account.PreKeyCollection;
import org.whispersystems.signalservice.api.backup.MediaRootBackupKey;
import org.whispersystems.signalservice.api.kbs.MasterKey;

import java.security.SecureRandom;
import java.util.ArrayList;
Expand Down Expand Up @@ -109,10 +108,6 @@ public static byte[] createStickerUploadKey() {
return getSecretBytes(32);
}

public static MasterKey createMasterKey() {
return MasterKey.createNew(secureRandom);
}

public static MediaRootBackupKey createMediaRootBackupKey() {
return new MediaRootBackupKey(getSecretBytes(32));
}
Expand Down

0 comments on commit c3f8d68

Please sign in to comment.