Skip to content

Commit

Permalink
Fix decrypting keystores with password ending in pipe character (#5282)
Browse files Browse the repository at this point in the history
This only affected users which provide their password from a file via
'--importKeystoresPassword' and the password ends with a pipe character
('|'). The pipe character was trimmed off by the regex which is only
supposed to remove newline characters and carriage return characters.
  • Loading branch information
nflaig authored Mar 18, 2023
1 parent 794ebdd commit 9f7b830
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/cli/src/util/passphrase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import fs from "node:fs";
export function readPassphraseFile(passphraseFile: string): string {
const data = fs.readFileSync(passphraseFile, "utf8");
// Remove trailing new lines '\n' or '\r' if any
const passphrase = data.replace(/[\n|\r]+$/g, "");
const passphrase = data.replace(/[\n\r]+$/g, "");

// Validate the passphraseFile contents to prevent the user to create a wallet with a password
// that is the contents a random unintended file
Expand Down

0 comments on commit 9f7b830

Please sign in to comment.