mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
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.
This commit is contained in:
parent
09a2d4ec74
commit
4f0625889b
7 changed files with 274 additions and 62 deletions
37
g10/gpg.c
37
g10/gpg.c
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue