mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-14 21:47:19 +02:00
* keygen.c (do_add_key_flags, parse_parameter_usage): Add support
the proposed AUTH key flag. * getkey.c (fixup_uidnode, merge_selfsigs_main) (merge_selfsigs_subkey, premerge_public_with_secret): Ditto. * keylist.c (print_capabilities): Ditto. * parse-packet.c (parse_key): Allow to parse the divert-to-card S2K mode. * build-packet.c (do_secret_key): Handle divert-to-card S2K * seckey-cert.c (is_secret_key_protected): Ditto. (check_secret_key): Ditto. * keygen.c (do_ask_passphrase): Renamed from ask_passphrase. * passphrase.c (ask_passphrase): New.
This commit is contained in:
parent
4b929ff36d
commit
8062cb418a
13 changed files with 193 additions and 38 deletions
|
@ -410,8 +410,9 @@ do_secret_key( IOBUF out, int ctb, PKT_secret_key *sk )
|
|||
if( sk->protect.s2k.mode == 3 )
|
||||
iobuf_put(a, sk->protect.s2k.count );
|
||||
|
||||
/* For out special mode 1001 we do not need an IV */
|
||||
if( sk->protect.s2k.mode != 1001 )
|
||||
/* For out special modes 1001, 1002 we do not need an IV */
|
||||
if( sk->protect.s2k.mode != 1001
|
||||
&& sk->protect.s2k.mode != 1002 )
|
||||
iobuf_write(a, sk->protect.iv, sk->protect.ivlen );
|
||||
}
|
||||
}
|
||||
|
@ -420,6 +421,14 @@ do_secret_key( IOBUF out, int ctb, PKT_secret_key *sk )
|
|||
|
||||
if( sk->protect.s2k.mode == 1001 )
|
||||
; /* GnuPG extension - don't write a secret key at all */
|
||||
else if( sk->protect.s2k.mode == 1002 )
|
||||
{ /* GnuPG extension - divert to OpenPGP smartcard. */
|
||||
iobuf_put(a, sk->protect.ivlen ); /* length of the serial
|
||||
number or 0 for no serial
|
||||
number. */
|
||||
/* The serial number gets stored in the IV field. */
|
||||
iobuf_write(a, sk->protect.iv, sk->protect.ivlen);
|
||||
}
|
||||
else if( sk->is_protected && sk->version >= 4 ) {
|
||||
/* The secret key is protected - write it out as it is */
|
||||
byte *p;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue