kpitt / gopass

An experimental fork of gopass, the "slightly more awesome standard unix password manager for teams"
https://www.gopass.pw/
MIT License
0 stars 0 forks source link

`init` doesn't recognize an initialized store if using a different crypto provider #14

Open kpitt opened 1 year ago

kpitt commented 1 year ago

Summary

If you run the init command after a password store has already been initialized, but specify a different crypto provider than the one used in the initialized store, init will not recognize that the store is already initialized.

Steps To Reproduce

  1. Make sure that the root password store is not initialized (e.g. set GOPASS_HOMEDIR to a new temp directory)
  2. Run gopass init to initialize the root store with the default GPG encryption.
  3. Run gopass init --crypto age to initialize the root store with Age encryption.

Expected behavior

When running the second gopass init command, it should report that the store is already initialized. If you run gopass init twice with the same crypto provider, it will report:

✗ Store is already initialized!
kpitt commented 1 year ago

It appears that gopass is only checking for the recipient id file which corresponds to the crypto provider specified in the current init command. It does not check if the store directory already contains an id file for a different crypto provider.