1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-30 02:32:46 +02:00

* keylist.c (status_one_subpacket): New. Send the subpacket data to the

--status interface.

* card-util.c (card_edit): Show when admin is enabled or not.

* status.h, status.c: New STATUS_SIG_SUBPACKET type.

* build-packet.c (build_sig_subpkt): Multiple keyserver URLs are allowed.
This commit is contained in:
David Shaw 2004-10-28 03:14:55 +00:00
parent d89c701acb
commit f5b7a72a48
6 changed files with 115 additions and 83 deletions

View File

@ -1,5 +1,15 @@
2004-10-27 David Shaw <dshaw@jabberwocky.com> 2004-10-27 David Shaw <dshaw@jabberwocky.com>
* keylist.c (status_one_subpacket): New. Send the subpacket data
to the --status interface.
* card-util.c (card_edit): Show when admin is enabled or not.
* status.h, status.c: New STATUS_SIG_SUBPACKET type.
* build-packet.c (build_sig_subpkt): Multiple keyserver URLs are
allowed.
* keyring.c: Make some strings translatable. * keyring.c: Make some strings translatable.
* exec.c, sign.c: Change "can't open file" to "can't open" and * exec.c, sign.c: Change "can't open file" to "can't open" and

View File

@ -658,6 +658,7 @@ build_sig_subpkt (PKT_signature *sig, sigsubpkttype_t type,
case SIGSUBPKT_POLICY: case SIGSUBPKT_POLICY:
case SIGSUBPKT_REV_KEY: case SIGSUBPKT_REV_KEY:
case SIGSUBPKT_SIGNATURE: case SIGSUBPKT_SIGNATURE:
case SIGSUBPKT_PREF_KS:
/* we do allow multiple subpackets */ /* we do allow multiple subpackets */
break; break;

View File

@ -1293,6 +1293,10 @@ card_edit (STRLIST commands)
case cmdADMIN: case cmdADMIN:
allow_admin=!allow_admin; allow_admin=!allow_admin;
if(allow_admin)
tty_printf(_("Admin commands are allowed\n"));
else
tty_printf(_("Admin commands are not allowed\n"));
break; break;
case cmdLIST: case cmdLIST:

View File

@ -158,6 +158,21 @@ print_pubkey_info (FILE *fp, PKT_public_key *pk)
m_free (p); m_free (p);
} }
/* Flags = 0x01 hashed 0x02 critical */
static void
status_one_subpacket(sigsubpkttype_t type,size_t len,int flags,const byte *buf)
{
char status[40];
/* Don't print these. */
if(len>256)
return;
sprintf(status,"%d %u %u ",type,flags,len);
write_status_text_and_buffer(STATUS_SIG_SUBPACKET,status,buf,len,0);
}
/* /*
mode=0 for stdout. mode=0 for stdout.
mode=1 for log_info + status messages mode=1 for log_info + status messages
@ -235,7 +250,8 @@ show_keyserver_url(PKT_signature *sig,int indent,int mode)
fprintf(fp,"\n"); fprintf(fp,"\n");
} }
/* TODO: put in a status-fd tag for preferred keyservers */ if(mode)
status_one_subpacket(SIGSUBPKT_PREF_KS,len,(crit?0x02:0)|0x01,p);
} }
} }

View File

@ -80,7 +80,8 @@ get_status_string ( int no )
{ {
const char *s; const char *s;
switch( no ) { switch( no )
{
case STATUS_ENTER : s = "ENTER"; break; case STATUS_ENTER : s = "ENTER"; break;
case STATUS_LEAVE : s = "LEAVE"; break; case STATUS_LEAVE : s = "LEAVE"; break;
case STATUS_ABORT : s = "ABORT"; break; case STATUS_ABORT : s = "ABORT"; break;
@ -157,6 +158,7 @@ get_status_string ( int no )
case STATUS_CARDCTRL : s = "CARDCTRL"; break; case STATUS_CARDCTRL : s = "CARDCTRL"; break;
case STATUS_PLAINTEXT : s = "PLAINTEXT"; break; case STATUS_PLAINTEXT : s = "PLAINTEXT"; break;
case STATUS_PLAINTEXT_LENGTH:s = "PLAINTEXT_LENGTH"; break; case STATUS_PLAINTEXT_LENGTH:s = "PLAINTEXT_LENGTH"; break;
case STATUS_SIG_SUBPACKET : s = "SIG_SUBPACKET"; break;
default: s = "?"; break; default: s = "?"; break;
} }
return s; return s;
@ -331,7 +333,6 @@ write_status_buffer ( int no, const char *buffer, size_t len, int wrap )
} }
#ifdef USE_SHM_COPROCESSING #ifdef USE_SHM_COPROCESSING
#ifndef IPC_RMID_DEFERRED_RELEASE #ifndef IPC_RMID_DEFERRED_RELEASE
@ -778,4 +779,3 @@ cpr_get_answer_okay_cancel (const char *keyword,
} }
} }
} }

View File

@ -105,6 +105,7 @@
#define STATUS_PLAINTEXT_LENGTH 74 #define STATUS_PLAINTEXT_LENGTH 74
#define STATUS_KEY_NOT_CREATED 75 #define STATUS_KEY_NOT_CREATED 75
#define STATUS_NEED_PASSPHRASE_PIN 76 #define STATUS_NEED_PASSPHRASE_PIN 76
#define STATUS_SIG_SUBPACKET 77
/*-- status.c --*/ /*-- status.c --*/
void set_status_fd ( int fd ); void set_status_fd ( int fd );