OpenBazaar / openbazaar-go

OpenBazaar 2.0 Server Daemon in Go
MIT License
991 stars 284 forks source link

Validate mnemonic inputs #1316

Open placer14 opened 5 years ago

placer14 commented 5 years ago

Currently, any amount of entropy can be passed in to generate a new identity seed. To prevent the user from accidentally using an invalid mnemonic, we should validate the mnemonic against the bip39 package we use in ob-go instead of assuming it's valid.

Todo:

Inputs to patch:

placer14 commented 5 years ago

Related to #1397

cpacia commented 5 years ago

It is standard practice to accept any string as a mnemonic and not force it to be a specific string. This allows users to use a custom seed .. such as one with more entropy if they want.

placer14 commented 5 years ago

I wasn't aware of this practice. Then what is the point of the Valid check in the mnemonic package? Should we raise a warning while still accepting the "invalid" input?