diff options
author | Werner Koch <[email protected]> | 2014-06-05 09:19:59 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2014-06-05 09:19:59 +0000 |
commit | 4f0625889b768eabdec52696bf15059a9e8d9c02 (patch) | |
tree | f523eab5acb0666c12c067ba27a159e21f434aa7 /g10/gpg.c | |
parent | gpgsm: Fix commit be07ed65. (diff) | |
download | gnupg-4f0625889b768eabdec52696bf15059a9e8d9c02.tar.gz gnupg-4f0625889b768eabdec52696bf15059a9e8d9c02.zip |
gpg: Auto-migrate existing secring.gpg.
* g10/migrate.c: New.
* g10/import.c (import_old_secring): New.
(import_one): Add arg silent.
(transfer_secret_keys): Add arg batch.
(import_secret_one): Add args batch and for_migration.
* g10/gpg.c (main): Call migration function.
Diffstat (limited to 'g10/gpg.c')
-rw-r--r-- | g10/gpg.c | 37 |
1 files changed, 37 insertions, 0 deletions
@@ -3594,6 +3594,43 @@ main (int argc, char **argv) break; } + + /* Check for certain command whether we need to migrate a + secring.gpg to the gpg-agent. */ + switch (cmd) + { + case aListSecretKeys: + case aSign: + case aSignEncr: + case aSignEncrSym: + case aSignSym: + case aClearsign: + case aDecrypt: + case aSignKey: + case aLSignKey: + case aEditKey: + case aPasswd: + case aDeleteSecretKeys: + case aDeleteSecretAndPublicKeys: + case aKeygen: + case aImport: + case aExportSecret: + case aExportSecretSub: + case aGenRevoke: + case aDesigRevoke: + case aCardEdit: + case aChangePIN: + migrate_secring (ctrl); + break; + case aListKeys: + if (opt.with_secret) + migrate_secring (ctrl); + break; + default: + break; + } + + /* The command dispatcher. */ switch( cmd ) { case aServer: |