1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-06 23:17:47 +02:00
gnupg/agent
Werner Koch 7777e68d04 Implement unattended OpenPGP secret key import.
* agent/command.c (cmd_import_key): Add option --unattended.
* agent/cvt-openpgp.c (convert_transfer_key): New.
(do_unprotect): Factor some code out to ...
(prepare_unprotect): new function.
(convert_from_openpgp): Factor all code out to ...
(convert_from_openpgp_main): this.  Add arg 'passphrase'.  Implement
openpgp-native protection modes.
(convert_from_openpgp_native): New.
* agent/t-protect.c (convert_from_openpgp_native): New dummy fucntion
* agent/protect-tool.c (convert_from_openpgp_native): Ditto.
* agent/protect.c (agent_unprotect): Add arg CTRL.  Adjust all
callers.  Support openpgp-native protection.
* g10/call-agent.c (agent_import_key): Add arg 'unattended'.
* g10/import.c (transfer_secret_keys): Use unattended in batch mode.
--

With the gpg-agent taking care of the secret keys, the user needs to
migrate existing keys from secring.gpg to the agent.  This and also
the standard import of secret keys required the user to unprotect the
secret keys first, so that gpg-agent was able to re-protected them
using its own scheme.  With many secret keys this is quite some
usability hurdle.  In particular if a passphrase is not instantly
available.

To make this migration smoother, this patch implements an unattended
key import/migration which delays the conversion to the gpg-agent
format until the key is actually used.  For example:

   gpg2 --batch --import mysecretkey.gpg

works without any user interaction due to the use of --batch.  Now if
a key is used (e.g. "gpg2 -su USERID_FROM_MYSECRETKEY foo"), gpg-agent
has to ask for the passphrase anyway, converts the key from the
openpgp format to the internal format, signs, re-encrypts the key and
tries to store it in the gpg-agent format to the disk.  The next time,
the internal format of the key is used.

This patch has only been tested with the old demo keys, more tests
with other protection formats and no protection are needed.

Signed-off-by: Werner Koch <wk@gnupg.org>
2013-05-22 10:14:57 +02:00
..
agent.h Implement unattended OpenPGP secret key import. 2013-05-22 10:14:57 +02:00
cache.c Change all quotes in strings and comments to the new GNU standard. 2012-06-05 19:29:22 +02:00
call-pinentry.c Use has_leading_keyword in the assuan callbacks. 2013-02-22 10:56:13 +01:00
call-scd.c agent: pksign result conversion to sexp to upper layer. 2013-02-28 11:17:47 +09:00
ChangeLog-2011 Generate the ChangeLog from commit logs. 2011-12-01 11:09:02 +01:00
command-ssh.c Remove some unused variables. 2013-02-22 09:42:46 +01:00
command.c Implement unattended OpenPGP secret key import. 2013-05-22 10:14:57 +02:00
cvt-openpgp.c Implement unattended OpenPGP secret key import. 2013-05-22 10:14:57 +02:00
cvt-openpgp.h Implement unattended OpenPGP secret key import. 2013-05-22 10:14:57 +02:00
divert-scd.c agent: pksign result conversion to sexp to upper layer. 2013-02-28 11:17:47 +09:00
findkey.c Implement unattended OpenPGP secret key import. 2013-05-22 10:14:57 +02:00
genkey.c Fix typos spotted during translations 2012-08-24 09:44:33 +02:00
gpg-agent-w32info.rc w32: Add icons and version information. 2013-05-07 21:35:48 +02:00
gpg-agent.c agent: New option --disable-check-own-socket. 2013-05-22 09:56:05 +02:00
keyformat.txt Implement unattended OpenPGP secret key import. 2013-05-22 10:14:57 +02:00
learncard.c Change all quotes in strings and comments to the new GNU standard. 2012-06-05 19:29:22 +02:00
Makefile.am w32: Add icons and version information. 2013-05-07 21:35:48 +02:00
pkdecrypt.c Nuked almost all trailing white space. 2011-02-04 12:57:53 +01:00
pksign.c agent: pksign result conversion to sexp to upper layer. 2013-02-28 11:17:47 +09:00
preset-passphrase.c common: Add a global variable to for the default error source. 2012-02-06 20:50:47 +01:00
protect-tool.c Implement unattended OpenPGP secret key import. 2013-05-22 10:14:57 +02:00
protect.c Implement unattended OpenPGP secret key import. 2013-05-22 10:14:57 +02:00
t-protect.c Implement unattended OpenPGP secret key import. 2013-05-22 10:14:57 +02:00
trans.c Changed to GPLv3. 2007-07-04 19:49:40 +00:00
trustlist.c Change all quotes in strings and comments to the new GNU standard. 2012-06-05 19:29:22 +02:00
w32main.c Nuked almost all trailing white space. 2011-02-04 12:57:53 +01:00
w32main.h Changed to GPLv3. 2007-07-04 19:49:40 +00:00