mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
* main.h, keygen.c (keygen_add_revkey): Add revocation key subpackets to a
signature (callable by make_keysig_packet). (write_direct_sig): Write a 1F direct key signature. (parse_revocation_key): Parse a string in algo:fpr:sensitive format into a revocation key. (get_parameter_revkey, do_generate_keypair): Call above functions when prompted from a batch key generation file. * build-packet.c (build_sig_subpkt): Allow multiple revocation key subpackets in a single sig. * keydb.h, getkey.c (get_seckey_byfprint): Same as get_pubkey_byfprint, except for secret keys. We only know the fingerprint of a revocation key, so this is needed to retrieve the secret key needed to issue a revokation. * packet.h, parse-packet.c (parse_signature, parse_revkeys): Split revkey parsing off into a new function that can be used to reparse after manipulating the revkey list. * sign.c (make_keysig_packet): Ability to make 1F direct key signatures.
This commit is contained in:
parent
fcfc223dbb
commit
4dcdaa3b1b
9 changed files with 232 additions and 27 deletions
35
g10/getkey.c
35
g10/getkey.c
|
@ -963,6 +963,41 @@ get_seckey_end( GETKEY_CTX ctx )
|
|||
}
|
||||
|
||||
|
||||
/****************
|
||||
* Search for a key with the given fingerprint.
|
||||
* FIXME:
|
||||
* We should replace this with the _byname function. Thiscsan be done
|
||||
* by creating a userID conforming to the unified fingerprint style.
|
||||
*/
|
||||
int
|
||||
get_seckey_byfprint( PKT_secret_key *sk,
|
||||
const byte *fprint, size_t fprint_len)
|
||||
{
|
||||
int rc;
|
||||
|
||||
if( fprint_len == 20 || fprint_len == 16 ) {
|
||||
struct getkey_ctx_s ctx;
|
||||
KBNODE kb = NULL;
|
||||
|
||||
memset( &ctx, 0, sizeof ctx );
|
||||
ctx.exact = 1 ;
|
||||
ctx.not_allocated = 1;
|
||||
ctx.kr_handle = keydb_new (1);
|
||||
ctx.nitems = 1;
|
||||
ctx.items[0].mode = fprint_len==16? KEYDB_SEARCH_MODE_FPR16
|
||||
: KEYDB_SEARCH_MODE_FPR20;
|
||||
memcpy( ctx.items[0].u.fpr, fprint, fprint_len );
|
||||
rc = lookup( &ctx, &kb, 1 );
|
||||
if (!rc && sk )
|
||||
sk_from_block ( &ctx, sk, kb );
|
||||
release_kbnode ( kb );
|
||||
get_pubkey_end( &ctx );
|
||||
}
|
||||
else
|
||||
rc = G10ERR_GENERAL; /* Oops */
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
************* Merging stuff ********************
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue