gnupg/g10 (6 files)
cvs user dshaw
cvs at cvs.gnupg.org
Thu Oct 28 05:10:54 CEST 2004
Date: Thursday, October 28, 2004 @ 05:14:55
Author: dshaw
Path: /cvs/gnupg/gnupg/g10
Modified: ChangeLog build-packet.c card-util.c keylist.c status.c status.h
* 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.
----------------+
ChangeLog | 10 +++
build-packet.c | 1
card-util.c | 4 +
keylist.c | 18 +++++-
status.c | 164 +++++++++++++++++++++++++++----------------------------
status.h | 1
6 files changed, 115 insertions(+), 83 deletions(-)
Index: gnupg/g10/ChangeLog
diff -u gnupg/g10/ChangeLog:1.630 gnupg/g10/ChangeLog:1.631
--- gnupg/g10/ChangeLog:1.630 Thu Oct 28 04:14:06 2004
+++ gnupg/g10/ChangeLog Thu Oct 28 05:14:55 2004
@@ -1,5 +1,15 @@
2004-10-27 David Shaw <dshaw at 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.
* exec.c, sign.c: Change "can't open file" to "can't open" and
Index: gnupg/g10/build-packet.c
diff -u gnupg/g10/build-packet.c:1.88 gnupg/g10/build-packet.c:1.89
--- gnupg/g10/build-packet.c:1.88 Fri Apr 16 18:31:19 2004
+++ gnupg/g10/build-packet.c Thu Oct 28 05:14:55 2004
@@ -658,6 +658,7 @@
case SIGSUBPKT_POLICY:
case SIGSUBPKT_REV_KEY:
case SIGSUBPKT_SIGNATURE:
+ case SIGSUBPKT_PREF_KS:
/* we do allow multiple subpackets */
break;
Index: gnupg/g10/card-util.c
diff -u gnupg/g10/card-util.c:1.19 gnupg/g10/card-util.c:1.20
--- gnupg/g10/card-util.c:1.19 Tue Oct 26 09:50:47 2004
+++ gnupg/g10/card-util.c Thu Oct 28 05:14:55 2004
@@ -1293,6 +1293,10 @@
case cmdADMIN:
allow_admin=!allow_admin;
+ if(allow_admin)
+ tty_printf(_("Admin commands are allowed\n"));
+ else
+ tty_printf(_("Admin commands are not allowed\n"));
break;
case cmdLIST:
Index: gnupg/g10/keylist.c
diff -u gnupg/g10/keylist.c:1.88 gnupg/g10/keylist.c:1.89
--- gnupg/g10/keylist.c:1.88 Thu Oct 14 22:13:16 2004
+++ gnupg/g10/keylist.c Thu Oct 28 05:14:55 2004
@@ -158,6 +158,21 @@
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=1 for log_info + status messages
@@ -235,7 +250,8 @@
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);
}
}
Index: gnupg/g10/status.c
diff -u gnupg/g10/status.c:1.47 gnupg/g10/status.c:1.48
--- gnupg/g10/status.c:1.47 Fri Oct 15 15:16:57 2004
+++ gnupg/g10/status.c Thu Oct 28 05:14:55 2004
@@ -78,88 +78,90 @@
static const char *
get_status_string ( int no )
{
- const char *s;
+ const char *s;
- switch( no ) {
- case STATUS_ENTER : s = "ENTER"; break;
- case STATUS_LEAVE : s = "LEAVE"; break;
- case STATUS_ABORT : s = "ABORT"; break;
- case STATUS_NEWSIG : s = "NEWSIG"; break;
- case STATUS_GOODSIG: s = "GOODSIG"; break;
- case STATUS_KEYEXPIRED: s = "KEYEXPIRED"; break;
- case STATUS_KEYREVOKED: s = "KEYREVOKED"; break;
- case STATUS_BADSIG : s = "BADSIG"; break;
- case STATUS_ERRSIG : s = "ERRSIG"; break;
- case STATUS_BADARMOR : s = "BADARMOR"; break;
- case STATUS_RSA_OR_IDEA : s= "RSA_OR_IDEA"; break;
- case STATUS_TRUST_UNDEFINED: s = "TRUST_UNDEFINED"; break;
- case STATUS_TRUST_NEVER : s = "TRUST_NEVER"; break;
- case STATUS_TRUST_MARGINAL : s = "TRUST_MARGINAL"; break;
- case STATUS_TRUST_FULLY : s = "TRUST_FULLY"; break;
- case STATUS_TRUST_ULTIMATE : s = "TRUST_ULTIMATE"; break;
- case STATUS_GET_BOOL : s = "GET_BOOL"; break;
- case STATUS_GET_LINE : s = "GET_LINE"; break;
- case STATUS_GET_HIDDEN : s = "GET_HIDDEN"; break;
- case STATUS_GOT_IT : s = "GOT_IT"; break;
- case STATUS_SHM_INFO : s = "SHM_INFO"; break;
- case STATUS_SHM_GET : s = "SHM_GET"; break;
- case STATUS_SHM_GET_BOOL : s = "SHM_GET_BOOL"; break;
- case STATUS_SHM_GET_HIDDEN : s = "SHM_GET_HIDDEN"; break;
- case STATUS_NEED_PASSPHRASE: s = "NEED_PASSPHRASE"; break;
- case STATUS_VALIDSIG : s = "VALIDSIG"; break;
- case STATUS_SIG_ID : s = "SIG_ID"; break;
- case STATUS_ENC_TO : s = "ENC_TO"; break;
- case STATUS_NODATA : s = "NODATA"; break;
- case STATUS_BAD_PASSPHRASE : s = "BAD_PASSPHRASE"; break;
- case STATUS_NO_PUBKEY : s = "NO_PUBKEY"; break;
- case STATUS_NO_SECKEY : s = "NO_SECKEY"; break;
- case STATUS_NEED_PASSPHRASE_SYM: s = "NEED_PASSPHRASE_SYM"; break;
- case STATUS_NEED_PASSPHRASE_PIN: s = "NEED_PASSPHRASE_PIN"; break;
- case STATUS_DECRYPTION_FAILED: s = "DECRYPTION_FAILED"; break;
- case STATUS_DECRYPTION_OKAY: s = "DECRYPTION_OKAY"; break;
- case STATUS_MISSING_PASSPHRASE: s = "MISSING_PASSPHRASE"; break;
- case STATUS_GOOD_PASSPHRASE : s = "GOOD_PASSPHRASE"; break;
- case STATUS_GOODMDC : s = "GOODMDC"; break;
- case STATUS_BADMDC : s = "BADMDC"; break;
- case STATUS_ERRMDC : s = "ERRMDC"; break;
- case STATUS_IMPORTED : s = "IMPORTED"; break;
- case STATUS_IMPORT_OK : s = "IMPORT_OK"; break;
- case STATUS_IMPORT_CHECK : s = "IMPORT_CHECK"; break;
- case STATUS_IMPORT_RES : s = "IMPORT_RES"; break;
- case STATUS_FILE_START : s = "FILE_START"; break;
- case STATUS_FILE_DONE : s = "FILE_DONE"; break;
- case STATUS_FILE_ERROR : s = "FILE_ERROR"; break;
- case STATUS_BEGIN_DECRYPTION:s = "BEGIN_DECRYPTION"; break;
- case STATUS_END_DECRYPTION : s = "END_DECRYPTION"; break;
- case STATUS_BEGIN_ENCRYPTION:s = "BEGIN_ENCRYPTION"; break;
- case STATUS_END_ENCRYPTION : s = "END_ENCRYPTION"; break;
- case STATUS_DELETE_PROBLEM : s = "DELETE_PROBLEM"; break;
- case STATUS_PROGRESS : s = "PROGRESS"; break;
- case STATUS_SIG_CREATED : s = "SIG_CREATED"; break;
- case STATUS_SESSION_KEY : s = "SESSION_KEY"; break;
- case STATUS_NOTATION_NAME : s = "NOTATION_NAME" ; break;
- case STATUS_NOTATION_DATA : s = "NOTATION_DATA" ; break;
- case STATUS_POLICY_URL : s = "POLICY_URL" ; break;
- case STATUS_BEGIN_STREAM : s = "BEGIN_STREAM"; break;
- case STATUS_END_STREAM : s = "END_STREAM"; break;
- case STATUS_KEY_CREATED : s = "KEY_CREATED"; break;
- case STATUS_KEY_NOT_CREATED: s = "KEY_NOT_CREATED"; break;
- case STATUS_USERID_HINT : s = "USERID_HINT"; break;
- case STATUS_UNEXPECTED : s = "UNEXPECTED"; break;
- case STATUS_INV_RECP : s = "INV_RECP"; break;
- case STATUS_NO_RECP : s = "NO_RECP"; break;
- case STATUS_ALREADY_SIGNED : s = "ALREADY_SIGNED"; break;
- case STATUS_SIGEXPIRED : s = "SIGEXPIRED deprecated-use-keyexpired-instead"; break;
- case STATUS_EXPSIG : s = "EXPSIG"; break;
- case STATUS_EXPKEYSIG : s = "EXPKEYSIG"; break;
- case STATUS_REVKEYSIG : s = "REVKEYSIG"; break;
- case STATUS_ATTRIBUTE : s = "ATTRIBUTE"; break;
- case STATUS_CARDCTRL : s = "CARDCTRL"; break;
- case STATUS_PLAINTEXT : s = "PLAINTEXT"; break;
- case STATUS_PLAINTEXT_LENGTH:s = "PLAINTEXT_LENGTH"; break;
- default: s = "?"; break;
+ switch( no )
+ {
+ case STATUS_ENTER : s = "ENTER"; break;
+ case STATUS_LEAVE : s = "LEAVE"; break;
+ case STATUS_ABORT : s = "ABORT"; break;
+ case STATUS_NEWSIG : s = "NEWSIG"; break;
+ case STATUS_GOODSIG: s = "GOODSIG"; break;
+ case STATUS_KEYEXPIRED: s = "KEYEXPIRED"; break;
+ case STATUS_KEYREVOKED: s = "KEYREVOKED"; break;
+ case STATUS_BADSIG : s = "BADSIG"; break;
+ case STATUS_ERRSIG : s = "ERRSIG"; break;
+ case STATUS_BADARMOR : s = "BADARMOR"; break;
+ case STATUS_RSA_OR_IDEA : s= "RSA_OR_IDEA"; break;
+ case STATUS_TRUST_UNDEFINED: s = "TRUST_UNDEFINED"; break;
+ case STATUS_TRUST_NEVER : s = "TRUST_NEVER"; break;
+ case STATUS_TRUST_MARGINAL : s = "TRUST_MARGINAL"; break;
+ case STATUS_TRUST_FULLY : s = "TRUST_FULLY"; break;
+ case STATUS_TRUST_ULTIMATE : s = "TRUST_ULTIMATE"; break;
+ case STATUS_GET_BOOL : s = "GET_BOOL"; break;
+ case STATUS_GET_LINE : s = "GET_LINE"; break;
+ case STATUS_GET_HIDDEN : s = "GET_HIDDEN"; break;
+ case STATUS_GOT_IT : s = "GOT_IT"; break;
+ case STATUS_SHM_INFO : s = "SHM_INFO"; break;
+ case STATUS_SHM_GET : s = "SHM_GET"; break;
+ case STATUS_SHM_GET_BOOL : s = "SHM_GET_BOOL"; break;
+ case STATUS_SHM_GET_HIDDEN : s = "SHM_GET_HIDDEN"; break;
+ case STATUS_NEED_PASSPHRASE: s = "NEED_PASSPHRASE"; break;
+ case STATUS_VALIDSIG : s = "VALIDSIG"; break;
+ case STATUS_SIG_ID : s = "SIG_ID"; break;
+ case STATUS_ENC_TO : s = "ENC_TO"; break;
+ case STATUS_NODATA : s = "NODATA"; break;
+ case STATUS_BAD_PASSPHRASE : s = "BAD_PASSPHRASE"; break;
+ case STATUS_NO_PUBKEY : s = "NO_PUBKEY"; break;
+ case STATUS_NO_SECKEY : s = "NO_SECKEY"; break;
+ case STATUS_NEED_PASSPHRASE_SYM: s = "NEED_PASSPHRASE_SYM"; break;
+ case STATUS_NEED_PASSPHRASE_PIN: s = "NEED_PASSPHRASE_PIN"; break;
+ case STATUS_DECRYPTION_FAILED: s = "DECRYPTION_FAILED"; break;
+ case STATUS_DECRYPTION_OKAY: s = "DECRYPTION_OKAY"; break;
+ case STATUS_MISSING_PASSPHRASE: s = "MISSING_PASSPHRASE"; break;
+ case STATUS_GOOD_PASSPHRASE : s = "GOOD_PASSPHRASE"; break;
+ case STATUS_GOODMDC : s = "GOODMDC"; break;
+ case STATUS_BADMDC : s = "BADMDC"; break;
+ case STATUS_ERRMDC : s = "ERRMDC"; break;
+ case STATUS_IMPORTED : s = "IMPORTED"; break;
+ case STATUS_IMPORT_OK : s = "IMPORT_OK"; break;
+ case STATUS_IMPORT_CHECK : s = "IMPORT_CHECK"; break;
+ case STATUS_IMPORT_RES : s = "IMPORT_RES"; break;
+ case STATUS_FILE_START : s = "FILE_START"; break;
+ case STATUS_FILE_DONE : s = "FILE_DONE"; break;
+ case STATUS_FILE_ERROR : s = "FILE_ERROR"; break;
+ case STATUS_BEGIN_DECRYPTION:s = "BEGIN_DECRYPTION"; break;
+ case STATUS_END_DECRYPTION : s = "END_DECRYPTION"; break;
+ case STATUS_BEGIN_ENCRYPTION:s = "BEGIN_ENCRYPTION"; break;
+ case STATUS_END_ENCRYPTION : s = "END_ENCRYPTION"; break;
+ case STATUS_DELETE_PROBLEM : s = "DELETE_PROBLEM"; break;
+ case STATUS_PROGRESS : s = "PROGRESS"; break;
+ case STATUS_SIG_CREATED : s = "SIG_CREATED"; break;
+ case STATUS_SESSION_KEY : s = "SESSION_KEY"; break;
+ case STATUS_NOTATION_NAME : s = "NOTATION_NAME" ; break;
+ case STATUS_NOTATION_DATA : s = "NOTATION_DATA" ; break;
+ case STATUS_POLICY_URL : s = "POLICY_URL" ; break;
+ case STATUS_BEGIN_STREAM : s = "BEGIN_STREAM"; break;
+ case STATUS_END_STREAM : s = "END_STREAM"; break;
+ case STATUS_KEY_CREATED : s = "KEY_CREATED"; break;
+ case STATUS_KEY_NOT_CREATED: s = "KEY_NOT_CREATED"; break;
+ case STATUS_USERID_HINT : s = "USERID_HINT"; break;
+ case STATUS_UNEXPECTED : s = "UNEXPECTED"; break;
+ case STATUS_INV_RECP : s = "INV_RECP"; break;
+ case STATUS_NO_RECP : s = "NO_RECP"; break;
+ case STATUS_ALREADY_SIGNED : s = "ALREADY_SIGNED"; break;
+ case STATUS_SIGEXPIRED : s = "SIGEXPIRED deprecated-use-keyexpired-instead"; break;
+ case STATUS_EXPSIG : s = "EXPSIG"; break;
+ case STATUS_EXPKEYSIG : s = "EXPKEYSIG"; break;
+ case STATUS_REVKEYSIG : s = "REVKEYSIG"; break;
+ case STATUS_ATTRIBUTE : s = "ATTRIBUTE"; break;
+ case STATUS_CARDCTRL : s = "CARDCTRL"; break;
+ case STATUS_PLAINTEXT : s = "PLAINTEXT"; break;
+ case STATUS_PLAINTEXT_LENGTH:s = "PLAINTEXT_LENGTH"; break;
+ case STATUS_SIG_SUBPACKET : s = "SIG_SUBPACKET"; break;
+ default: s = "?"; break;
}
- return s;
+ return s;
}
@@ -331,7 +333,6 @@
}
-
#ifdef USE_SHM_COPROCESSING
#ifndef IPC_RMID_DEFERRED_RELEASE
@@ -778,4 +779,3 @@
}
}
}
-
Index: gnupg/g10/status.h
diff -u gnupg/g10/status.h:1.30 gnupg/g10/status.h:1.31
--- gnupg/g10/status.h:1.30 Fri Oct 15 15:16:56 2004
+++ gnupg/g10/status.h Thu Oct 28 05:14:55 2004
@@ -105,6 +105,7 @@
#define STATUS_PLAINTEXT_LENGTH 74
#define STATUS_KEY_NOT_CREATED 75
#define STATUS_NEED_PASSPHRASE_PIN 76
+#define STATUS_SIG_SUBPACKET 77
/*-- status.c --*/
void set_status_fd ( int fd );
More information about the Gnupg-commits
mailing list