mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-23 10:29:58 +01:00
* keyedit.c (sign_uids): Show keyid of the key making the signature.
* trustdb.h, trustdb.c (is_disabled), keylist.c (print_capabilities), gpgv.c (is_disabled): is_disabled now takes a pk and not just the keyid. This is for speed since there is no need to re-fetch a key when we already have that key handy. * getkey.c (skip_disabled): New function to get a pk and call is_disabled on it. (key_byname): Use it here.
This commit is contained in:
parent
879014e14b
commit
53f2944998
@ -1,3 +1,17 @@
|
||||
2003-05-07 David Shaw <dshaw@jabberwocky.com>
|
||||
|
||||
* keyedit.c (sign_uids): Show keyid of the key making the
|
||||
signature.
|
||||
|
||||
* trustdb.h, trustdb.c (is_disabled), keylist.c
|
||||
(print_capabilities), gpgv.c (is_disabled): is_disabled now takes
|
||||
a pk and not just the keyid. This is for speed since there is no
|
||||
need to re-fetch a key when we already have that key handy.
|
||||
|
||||
* getkey.c (skip_disabled): New function to get a pk and call
|
||||
is_disabled on it.
|
||||
(key_byname): Use it here.
|
||||
|
||||
2003-05-02 David Shaw <dshaw@jabberwocky.com>
|
||||
|
||||
* g10.c (main): Show errors for failure in export, send-keys,
|
||||
|
23
g10/getkey.c
23
g10/getkey.c
@ -733,6 +733,27 @@ classify_user_id (const char *name, KEYDB_SEARCH_DESC *desc)
|
||||
return classify_user_id2 (name, desc, &dummy);
|
||||
}
|
||||
|
||||
static int
|
||||
skip_disabled(void *dummy,u32 *keyid)
|
||||
{
|
||||
int rc,disabled=0;
|
||||
PKT_public_key *pk=m_alloc_clear(sizeof(PKT_public_key));
|
||||
|
||||
rc = get_pubkey(pk, keyid);
|
||||
if(rc)
|
||||
{
|
||||
log_error("error checking disabled status of %08lX: %s\n",
|
||||
(ulong)keyid[1],g10_errstr(rc));
|
||||
goto leave;
|
||||
}
|
||||
|
||||
disabled=is_disabled(pk);
|
||||
|
||||
leave:
|
||||
free_public_key(pk);
|
||||
return disabled;
|
||||
}
|
||||
|
||||
/****************
|
||||
* Try to get the pubkey by the userid. This function looks for the
|
||||
* first pubkey certificate which has the given name in a user_id.
|
||||
@ -784,7 +805,7 @@ key_byname( GETKEY_CTX *retctx, STRLIST namelist,
|
||||
&& ctx->items[n].mode!=KEYDB_SEARCH_MODE_FPR16
|
||||
&& ctx->items[n].mode!=KEYDB_SEARCH_MODE_FPR20
|
||||
&& ctx->items[n].mode!=KEYDB_SEARCH_MODE_FPR)
|
||||
ctx->items[n].skipfnc=is_disabled;
|
||||
ctx->items[n].skipfnc=skip_disabled;
|
||||
}
|
||||
|
||||
ctx->kr_handle = keydb_new (secmode);
|
||||
|
@ -243,7 +243,7 @@ check_signatures_trust( PKT_signature *sig )
|
||||
*/
|
||||
|
||||
int
|
||||
is_disabled(void *dummy,u32 *keyid)
|
||||
is_disabled(PKT_public_key *pk)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -637,7 +637,7 @@ sign_uids( KBNODE keyblock, STRLIST locusr, int *ret_modified,
|
||||
p = get_user_id( sk_keyid, &n );
|
||||
tty_print_utf8_string( p, n );
|
||||
m_free(p); p = NULL;
|
||||
tty_printf("\"\n");
|
||||
tty_printf("\" (%08lX)\n",(ulong)sk_keyid[1]);
|
||||
|
||||
if(selfsig)
|
||||
{
|
||||
|
@ -315,23 +315,17 @@ print_capabilities (PKT_public_key *pk, PKT_secret_key *sk, KBNODE keyblock)
|
||||
}
|
||||
}
|
||||
|
||||
if ( keyblock ) { /* figure our the usable capabilities */
|
||||
if ( keyblock ) { /* figure out the usable capabilities */
|
||||
KBNODE k;
|
||||
int enc=0, sign=0, cert=0, disabled=0;
|
||||
|
||||
for (k=keyblock; k; k = k->next ) {
|
||||
if ( k->pkt->pkttype == PKT_PUBLIC_KEY
|
||||
|| k->pkt->pkttype == PKT_PUBLIC_SUBKEY ) {
|
||||
u32 kid[2];
|
||||
pk = k->pkt->pkt.public_key;
|
||||
|
||||
if(k->pkt->pkttype==PKT_PUBLIC_KEY)
|
||||
{
|
||||
keyid_from_pk(pk,kid);
|
||||
|
||||
if(is_disabled(NULL,kid))
|
||||
disabled=1;
|
||||
}
|
||||
if(pk->is_primary)
|
||||
disabled=is_disabled(pk);
|
||||
|
||||
if ( pk->is_valid && !pk->is_revoked && !pk->has_expired ) {
|
||||
if ( pk->pubkey_usage & PUBKEY_USAGE_ENC )
|
||||
|
@ -745,23 +745,14 @@ clear_validity (PKT_public_key *pk)
|
||||
|
||||
/* Return true if key is disabled */
|
||||
int
|
||||
is_disabled(void *dummy,u32 *keyid)
|
||||
is_disabled(PKT_public_key *pk)
|
||||
{
|
||||
int rc;
|
||||
TRUSTREC trec;
|
||||
int disabled=0; /* default to not disabled */
|
||||
PKT_public_key *pk=m_alloc_clear(sizeof(PKT_public_key));
|
||||
int disabled=0;
|
||||
|
||||
init_trustdb ();
|
||||
init_trustdb();
|
||||
|
||||
rc = get_pubkey(pk, keyid);
|
||||
if(rc)
|
||||
{
|
||||
log_error("error checking disabled status of %08lX: %s\n",
|
||||
(ulong)keyid[1],g10_errstr(rc));
|
||||
goto leave;
|
||||
}
|
||||
|
||||
rc = read_trust_record (pk, &trec);
|
||||
if (rc && rc != -1)
|
||||
{
|
||||
@ -775,8 +766,7 @@ is_disabled(void *dummy,u32 *keyid)
|
||||
disabled=1;
|
||||
|
||||
leave:
|
||||
free_public_key(pk);
|
||||
return disabled;
|
||||
return disabled;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -48,7 +48,7 @@ void sync_trustdb( void );
|
||||
|
||||
void revalidation_mark (void);
|
||||
|
||||
int is_disabled(void *dummy,u32 *keyid);
|
||||
int is_disabled(PKT_public_key *pk);
|
||||
unsigned int get_validity (PKT_public_key *pk, PKT_user_id *uid);
|
||||
int get_validity_info (PKT_public_key *pk, PKT_user_id *uid);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user