Skip to content

Commit 36994e4

Browse files
SjonHortensiuskaralabe
authored andcommitted
all: replace passPHRASE with passWORD in user interactions (#19932)
* Ref #19906 - replace passPHRASE with passWORD in any user interactions this skips doccomments and variablenames to minimize impact. It does however include a rename of the `ethkey` `changepassphrase` parameter * console: fix JavaScript error capitalization
1 parent c9cdf14 commit 36994e4

File tree

19 files changed

+94
-94
lines changed

19 files changed

+94
-94
lines changed

accounts/errors.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var ErrNotSupported = errors.New("not supported")
3535

3636
// ErrInvalidPassphrase is returned when a decryption operation receives a bad
3737
// passphrase.
38-
var ErrInvalidPassphrase = errors.New("invalid passphrase")
38+
var ErrInvalidPassphrase = errors.New("invalid password")
3939

4040
// ErrWalletAlreadyOpen is returned if a wallet is attempted to be opened the
4141
// second time.

accounts/external/backend.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,14 +204,14 @@ func (api *ExternalSigner) SignTx(account accounts.Account, tx *types.Transactio
204204
}
205205

206206
func (api *ExternalSigner) SignTextWithPassphrase(account accounts.Account, passphrase string, text []byte) ([]byte, error) {
207-
return []byte{}, fmt.Errorf("passphrase-operations not supported on external signers")
207+
return []byte{}, fmt.Errorf("password-operations not supported on external signers")
208208
}
209209

210210
func (api *ExternalSigner) SignTxWithPassphrase(account accounts.Account, passphrase string, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error) {
211-
return nil, fmt.Errorf("passphrase-operations not supported on external signers")
211+
return nil, fmt.Errorf("password-operations not supported on external signers")
212212
}
213213
func (api *ExternalSigner) SignDataWithPassphrase(account accounts.Account, passphrase, mimeType string, data []byte) ([]byte, error) {
214-
return nil, fmt.Errorf("passphrase-operations not supported on external signers")
214+
return nil, fmt.Errorf("password-operations not supported on external signers")
215215
}
216216

217217
func (api *ExternalSigner) listAccounts() ([]common.Address, error) {

accounts/keystore/keystore.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ import (
4343
var (
4444
ErrLocked = accounts.NewAuthNeededError("password or unlock")
4545
ErrNoMatch = errors.New("no key for given address or file")
46-
ErrDecrypt = errors.New("could not decrypt key with given passphrase")
46+
ErrDecrypt = errors.New("could not decrypt key with given password")
4747
)
4848

4949
// KeyStoreType is the reflect type of a keystore backend.

accounts/keystore/plain_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func TestKeyStorePassphraseDecryptionFail(t *testing.T) {
9696
t.Fatal(err)
9797
}
9898
if _, err = ks.GetKey(k1.Address, account.URL.Path, "bar"); err != ErrDecrypt {
99-
t.Fatalf("wrong error for invalid passphrase\ngot %q\nwant %q", err, ErrDecrypt)
99+
t.Fatalf("wrong error for invalid password\ngot %q\nwant %q", err, ErrDecrypt)
100100
}
101101
}
102102

accounts/keystore/testdata/keystore/README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
This directory contains accounts for testing.
2-
The passphrase that unlocks them is "foobar".
2+
The password that unlocks them is "foobar".
33

44
The "good" key files which are supposed to be loadable are:
55

cmd/clef/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,8 +566,8 @@ Response
566566
### account_export
567567

568568
#### Export account from keystore
569-
Export a private key from the keystore. The exported private key is encrypted with the original passphrase. When the
570-
key is imported later this passphrase is required.
569+
Export a private key from the keystore. The exported private key is encrypted with the original password. When the
570+
key is imported later this password is required.
571571

572572
#### Arguments
573573
- account [address]: export private key that is associated with this account

cmd/clef/main.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ func setCredential(ctx *cli.Context) error {
335335
utils.Fatalf("Invalid address specified: %s", addr)
336336
}
337337
address := common.HexToAddress(addr)
338-
password := getPassPhrase("Please enter a passphrase to store for this address:", true)
338+
password := getPassPhrase("Please enter a password to store for this address:", true)
339339
fmt.Println()
340340

341341
stretchedKey, err := readMasterKey(ctx, nil)
@@ -845,17 +845,17 @@ func testExternalUI(api *core.SignerAPI) {
845845
// TODO: there are many `getPassPhrase` functions, it will be better to abstract them into one.
846846
func getPassPhrase(prompt string, confirmation bool) string {
847847
fmt.Println(prompt)
848-
password, err := console.Stdin.PromptPassword("Passphrase: ")
848+
password, err := console.Stdin.PromptPassword("Password: ")
849849
if err != nil {
850-
utils.Fatalf("Failed to read passphrase: %v", err)
850+
utils.Fatalf("Failed to read password: %v", err)
851851
}
852852
if confirmation {
853-
confirm, err := console.Stdin.PromptPassword("Repeat passphrase: ")
853+
confirm, err := console.Stdin.PromptPassword("Repeat password: ")
854854
if err != nil {
855-
utils.Fatalf("Failed to read passphrase confirmation: %v", err)
855+
utils.Fatalf("Failed to read password confirmation: %v", err)
856856
}
857857
if password != confirm {
858-
utils.Fatalf("Passphrases do not match")
858+
utils.Fatalf("Passwords do not match")
859859
}
860860
}
861861
return password

cmd/clef/tutorial.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ Enter 'ok' to proceed:
2222
2323
The master seed of clef will be locked with a password.
2424
Please specify a password. Do not forget this password!
25-
Passphrase:
26-
Repeat passphrase:
25+
Password:
26+
Repeat password:
2727
2828
A master seed has been generated into /home/martin/.clef/masterseed.json
2929
@@ -124,7 +124,7 @@ $ sha256sum rules.js
124124
125125
$ clef attest 645b58e4f945e24d0221714ff29f6aa8e860382ced43490529db1695f5fcc71c
126126
Decrypt master seed of clef
127-
Passphrase:
127+
Password:
128128
INFO [07-01|13:25:03.290] Ruleset attestation updated sha256=645b58e4f945e24d0221714ff29f6aa8e860382ced43490529db1695f5fcc71c
129129
```
130130

@@ -193,12 +193,12 @@ In order to make more useful rules - like signing transactions - the signer need
193193
```text
194194
$ clef setpw 0xd9c9cd5f6779558b6e0ed4e6acf6b1947e7fa1f3
195195
196-
Please enter a passphrase to store for this address:
197-
Passphrase:
198-
Repeat passphrase:
196+
Please enter a password to store for this address:
197+
Password:
198+
Repeat password:
199199
200200
Decrypt master seed of clef
201-
Passphrase:
201+
Passpword:
202202
INFO [07-01|14:05:56.031] Credential store updated key=0xd9c9cd5f6779558b6e0ed4e6acf6b1947e7fa1f3
203203
```
204204

@@ -237,7 +237,7 @@ f163a1738b649259bb9b369c593fdc4c6b6f86cc87e343c3ba58faee03c2a178 rules.js
237237
238238
$ clef attest f163a1738b649259bb9b369c593fdc4c6b6f86cc87e343c3ba58faee03c2a178
239239
Decrypt master seed of clef
240-
Passphrase:
240+
Password:
241241
INFO [07-01|14:11:28.509] Ruleset attestation updated sha256=f163a1738b649259bb9b369c593fdc4c6b6f86cc87e343c3ba58faee03c2a178
242242
```
243243

cmd/ethkey/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,18 @@ It is possible to refer to a file containing the message.
3535
To sign a message contained in a file, use the --msgfile flag.
3636

3737

38-
### `ethkey changepassphrase <keyfile>`
38+
### `ethkey changepassword <keyfile>`
3939

40-
Change the passphrase of a keyfile.
40+
Change the password of a keyfile.
4141
use the `--newpasswordfile` to point to the new password file.
4242

4343

44-
## Passphrases
44+
## Passwords
4545

4646
For every command that uses a keyfile, you will be prompted to provide the
47-
passphrase for decrypting the keyfile. To avoid this message, it is possible
48-
to pass the passphrase by using the `--passwordfile` flag pointing to a file that
49-
contains the passphrase.
47+
password for decrypting the keyfile. To avoid this message, it is possible
48+
to pass the password by using the `--passwordfile` flag pointing to a file that
49+
contains the password.
5050

5151
## JSON
5252

cmd/ethkey/changepassphrase.go renamed to cmd/ethkey/changepassword.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ import (
2828

2929
var newPassphraseFlag = cli.StringFlag{
3030
Name: "newpasswordfile",
31-
Usage: "the file that contains the new passphrase for the keyfile",
31+
Usage: "the file that contains the new password for the keyfile",
3232
}
3333

3434
var commandChangePassphrase = cli.Command{
35-
Name: "changepassphrase",
36-
Usage: "change the passphrase on a keyfile",
35+
Name: "changepassword",
36+
Usage: "change the password on a keyfile",
3737
ArgsUsage: "<keyfile>",
3838
Description: `
39-
Change the passphrase of a keyfile.`,
39+
Change the password of a keyfile.`,
4040
Flags: []cli.Flag{
4141
passphraseFlag,
4242
newPassphraseFlag,
@@ -58,12 +58,12 @@ Change the passphrase of a keyfile.`,
5858
}
5959

6060
// Get a new passphrase.
61-
fmt.Println("Please provide a new passphrase")
61+
fmt.Println("Please provide a new password")
6262
var newPhrase string
6363
if passFile := ctx.String(newPassphraseFlag.Name); passFile != "" {
6464
content, err := ioutil.ReadFile(passFile)
6565
if err != nil {
66-
utils.Fatalf("Failed to read new passphrase file '%s': %v", passFile, err)
66+
utils.Fatalf("Failed to read new password file '%s': %v", passFile, err)
6767
}
6868
newPhrase = strings.TrimRight(string(content), "\r\n")
6969
} else {
@@ -73,7 +73,7 @@ Change the passphrase of a keyfile.`,
7373
// Encrypt the key with the new passphrase.
7474
newJson, err := keystore.EncryptKey(key, newPhrase, keystore.StandardScryptN, keystore.StandardScryptP)
7575
if err != nil {
76-
utils.Fatalf("Error encrypting with new passphrase: %v", err)
76+
utils.Fatalf("Error encrypting with new password: %v", err)
7777
}
7878

7979
// Then write the new keyfile in place of the old one.

0 commit comments

Comments
 (0)