Open liusong1111 opened 4 years ago
const privateKeyBuffer = await PasswordKeystore.decrypt(wallet.keystore, password); const Uint8ArrayPk = new Uint8Array(privateKeyBuffer.data);
privateKeyBuffer === null when input wrong password
Hi @syuukawa
Thanks for making these updates according to the feedback by @liusong1111.
There is an area I would need a bit of clarification. I saw the newly added checks also include a notification to the other part of the Chrome extension but it is commented out. Will this part of the code be reactivated at a certain point? I think it would be helpful to let the user know if it is an invalid password instead of silence the error.
Hi Kata Choi
The check about password just has added, Just like .
const privateKeyBuffer = await PasswordKeystore.decrypt(wallet.keystore, password);
if (privateKeyBuffer === null) {
const responseEorrorMsg = {
type: MESSAGE_TYPE.SEND_TX_ERROR,
success: true,
message: 'INVALID_PASSWORD',
data: '',
};
browser.runtime.sendMessage(responseEorrorMsg);
return;
}
First, I fixed the issues and then added the message about invaild password, they are not in the same commit, so it is not react in the code.
It can be found here
https://github.com/rebase-network/synapse-extension/blob/master/src/background/index.ts https://github.com/rebase-network/synapse-extension/blob/master/src/background/index.ts
If any questions ,Let me know, thanks
Syuukawa
在 2020年7月27日,下午4:33,Kata Choi notifications@github.com 写道:
Hi @syuukawa https://github.com/syuukawa Thanks for making these updates according to the feedback by @liusong1111 https://github.com/liusong1111.
There is an area I would need a bit of clarification. I saw the newly added checks also include a notification to the other part of the Chrome extension but it is commented out. Will this part of the code be reactivated at a certain point? I think it would be helpful to let the user know if it is an invalid password instead of silence the error.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/liusong1111/synapse-extension/issues/12#issuecomment-664201649, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE66OAZQ242STNJ7WVXHQ4TR5U3V7ANCNFSM4PAZ4PYQ.
https://github.com/rebase-network/synapse-extension/blob/af0985a81b5a6d578b3605bb459b4487283ffab4/src/background/index.ts#L432
privateKeyBuffer === null when input wrong password