PM-4368 - Resolving issue with incorrect account fingerprint being generated on desktop (an undefined public key was being converted into "" which then was being considered a valid, in memory public key for the handling in the getPublicKey method on the crypto service). Persisting undefined helps the crypto service properly identify that there is not a public key and it will instead derive it properly from the private key. (#6715)
This commit is contained in:
parent
161c1c63ff
commit
f5aae4709d
|
@ -140,8 +140,11 @@ export class AccountKeys {
|
|||
>();
|
||||
|
||||
toJSON() {
|
||||
// If you pass undefined into fromBufferToByteString, you will get an empty string back
|
||||
// which will cause all sorts of headaches down the line when you try to getPublicKey
|
||||
// and expect a Uint8Array and get an empty string instead.
|
||||
return Utils.merge(this, {
|
||||
publicKey: Utils.fromBufferToByteString(this.publicKey),
|
||||
publicKey: this.publicKey ? Utils.fromBufferToByteString(this.publicKey) : undefined,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -149,7 +152,6 @@ export class AccountKeys {
|
|||
if (obj == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return Object.assign(new AccountKeys(), {
|
||||
userKey: SymmetricCryptoKey.fromJSON(obj?.userKey),
|
||||
masterKey: SymmetricCryptoKey.fromJSON(obj?.masterKey),
|
||||
|
|
Loading…
Reference in New Issue