diff options
author | Werner Koch <[email protected]> | 2003-07-01 08:34:45 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2003-07-01 08:34:45 +0000 |
commit | 39046ea7ec221efa9db946230ddc9fb3e65d19ab (patch) | |
tree | aa251dc190129aef89d82597f7ffb53ba6486fc9 /g10/build-packet.c | |
parent | Key generation and signing using the OpenPGP card does rudimentary work. (diff) | |
download | gnupg-39046ea7ec221efa9db946230ddc9fb3e65d19ab.tar.gz gnupg-39046ea7ec221efa9db946230ddc9fb3e65d19ab.zip |
* app-openpgp.c (store_fpr): Fixed fingerprint calculation.
* keygen.c (gen_card_key): Obviously we should use the creation
date received from SCDAEMON, so that the fingerprints will match.
* sign.c (do_sign): Pass the serialno to the sign code.
* keyid.c (serialno_and_fpr_from_sk): New.
Diffstat (limited to '')
-rw-r--r-- | g10/build-packet.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/g10/build-packet.c b/g10/build-packet.c index afc123624..a24bdfcc6 100644 --- a/g10/build-packet.c +++ b/g10/build-packet.c @@ -415,7 +415,7 @@ do_secret_key( iobuf_t out, int ctb, PKT_secret_key *sk ) if( sk->protect.s2k.mode == 3 ) iobuf_put(a, sk->protect.s2k.count ); - /* For out special modes 1001 and 1002 we do not need an IV */ + /* For our special modes 1001 and 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 ); @@ -428,8 +428,11 @@ do_secret_key( iobuf_t out, int ctb, PKT_secret_key *sk ) ; /* 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, 0 ); /* length of the serial number or 0 for unknown. */ - /* fixme: write the serial number. */ + 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 */ |