aboutsummaryrefslogtreecommitdiffstats
path: root/g10
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2007-02-26 20:24:29 +0000
committerWerner Koch <[email protected]>2007-02-26 20:24:29 +0000
commitf6243073a87e08d756b2337c63b89cc815824e7d (patch)
treece913fa5eb73b47ae37c637200f2ab1cdf591627 /g10
parentUpdated (diff)
downloadgnupg-f6243073a87e08d756b2337c63b89cc815824e7d.tar.gz
gnupg-f6243073a87e08d756b2337c63b89cc815824e7d.zip
Add new SVN only file README.maint
doc/ * gpg.texi (GPG Configuration): Document envvar LANGUAGE. (GPG Configuration Options): Document show-primary-uid-only. g10/ * gpg.c (main): Add verify option show-primary-uid-only. * options.h (VERIFY_SHOW_PRIMARY_UID_ONLY): New. * mainproc.c (check_sig_and_print): Implement it. * encr-data.c (decrypt_data): Correctly test for unknown algorithm. * import.c (check_prefs): Ditto. * keyedit.c (show_prefs): Ditto. * mainproc.c (proc_symkey_enc): Ditto.
Diffstat (limited to 'g10')
-rw-r--r--g10/ChangeLog13
-rw-r--r--g10/encr-data.c7
-rw-r--r--g10/gpg.c2
-rw-r--r--g10/import.c14
-rw-r--r--g10/keyedit.c14
-rw-r--r--g10/mainproc.c5
-rw-r--r--g10/options.h1
7 files changed, 38 insertions, 18 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index 43e6c06df..fe0f7d69c 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,16 @@
+2007-02-26 Werner Koch <[email protected]>
+
+ * gpg.c (main): Add verify option show-primary-uid-only.
+ * options.h (VERIFY_SHOW_PRIMARY_UID_ONLY): New.
+ * mainproc.c (check_sig_and_print): Implement it.
+
+2007-02-22 Werner Koch <[email protected]>
+
+ * encr-data.c (decrypt_data): Correctly test for unknown algorithm.
+ * import.c (check_prefs): Ditto.
+ * keyedit.c (show_prefs): Ditto.
+ * mainproc.c (proc_symkey_enc): Ditto.
+
2007-02-06 Werner Koch <[email protected]>
* export.c (do_export_stream): Allow reset-subkey-passwd along
diff --git a/g10/encr-data.c b/g10/encr-data.c
index 696f8af9d..851233cde 100644
--- a/g10/encr-data.c
+++ b/g10/encr-data.c
@@ -90,11 +90,10 @@ decrypt_data( void *procctx, PKT_encrypted *ed, DEK *dek )
if ( opt.verbose && !dek->algo_info_printed )
{
- const char *s = gcry_cipher_algo_name (dek->algo);
- if (s && *s)
- log_info(_("%s encrypted data\n"), s );
+ if (!gcry_cipher_test_algo (dek->algo))
+ log_info (_("%s encrypted data\n"), gcry_cipher_algo_name (dek->algo));
else
- log_info(_("encrypted with unknown algorithm %d\n"), dek->algo );
+ log_info (_("encrypted with unknown algorithm %d\n"), dek->algo );
dek->algo_info_printed = 1;
}
rc = openpgp_cipher_test_algo (dek->algo);
diff --git a/g10/gpg.c b/g10/gpg.c
index e8e83c2c5..dc100dc92 100644
--- a/g10/gpg.c
+++ b/g10/gpg.c
@@ -2601,6 +2601,8 @@ main (int argc, char **argv )
N_("show user ID validity during signature verification")},
{"show-unusable-uids",VERIFY_SHOW_UNUSABLE_UIDS,NULL,
N_("show revoked and expired user IDs in signature verification")},
+ {"show-primary-uid-only",VERIFY_SHOW_PRIMARY_UID_ONLY,NULL,
+ N_("show only the primary user ID in signature verification")},
{"pka-lookups",VERIFY_PKA_LOOKUPS,NULL,
N_("validate signatures with PKA data")},
{"pka-trust-increase",VERIFY_PKA_TRUST_INCREASE,NULL,
diff --git a/g10/import.c b/g10/import.c
index b3857fc0a..7978bbba0 100644
--- a/g10/import.c
+++ b/g10/import.c
@@ -603,11 +603,14 @@ check_prefs(KBNODE keyblock)
{
if (openpgp_cipher_test_algo (prefs->value))
{
- const char *algo = gcry_cipher_algo_name (prefs->value);
+ const char *algo =
+ (gcry_cipher_test_algo (prefs->value)
+ ? num
+ : gcry_cipher_algo_name (prefs->value));
if(!problem)
check_prefs_warning(pk);
log_info(_(" \"%s\": preference for cipher"
- " algorithm %s\n"),user,algo?algo:num);
+ " algorithm %s\n"), user, algo);
problem=1;
}
}
@@ -615,11 +618,14 @@ check_prefs(KBNODE keyblock)
{
if(openpgp_md_test_algo(prefs->value))
{
- const char *algo = gcry_md_algo_name (prefs->value);
+ const char *algo =
+ (gcry_md_test_algo (prefs->value)
+ ? num
+ : gcry_md_algo_name (prefs->value));
if(!problem)
check_prefs_warning(pk);
log_info(_(" \"%s\": preference for digest"
- " algorithm %s\n"),user,algo?algo:num);
+ " algorithm %s\n"), user, algo);
problem=1;
}
}
diff --git a/g10/keyedit.c b/g10/keyedit.c
index bb8e63af4..89f26c765 100644
--- a/g10/keyedit.c
+++ b/g10/keyedit.c
@@ -2319,14 +2319,13 @@ show_prefs (PKT_user_id *uid, PKT_signature *selfsig, int verbose)
tty_printf (_("Cipher: "));
for(i=any=0; prefs[i].type; i++ ) {
if( prefs[i].type == PREFTYPE_SYM ) {
- const char *s = gcry_cipher_algo_name (prefs[i].value);
-
if (any)
tty_printf (", ");
any = 1;
/* We don't want to display strings for experimental algos */
- if (s && prefs[i].value < 100 )
- tty_printf ("%s", s );
+ if (!gcry_cipher_test_algo (prefs[i].value)
+ && prefs[i].value < 100 )
+ tty_printf ("%s", gcry_cipher_algo_name (prefs[i].value));
else
tty_printf ("[%d]", prefs[i].value);
if (prefs[i].value == CIPHER_ALGO_3DES )
@@ -2342,14 +2341,13 @@ show_prefs (PKT_user_id *uid, PKT_signature *selfsig, int verbose)
tty_printf (_("Digest: "));
for(i=any=0; prefs[i].type; i++ ) {
if( prefs[i].type == PREFTYPE_HASH ) {
- const char *s = gcry_md_algo_name (prefs[i].value);
-
if (any)
tty_printf (", ");
any = 1;
/* We don't want to display strings for experimental algos */
- if (s && prefs[i].value < 100 )
- tty_printf ("%s", s );
+ if (!gcry_md_test_algo (prefs[i].value)
+ && prefs[i].value < 100 )
+ tty_printf ("%s", gcry_md_algo_name (prefs[i].value) );
else
tty_printf ("[%d]", prefs[i].value);
if (prefs[i].value == DIGEST_ALGO_SHA1 )
diff --git a/g10/mainproc.c b/g10/mainproc.c
index 2a5db6e97..faefacb10 100644
--- a/g10/mainproc.c
+++ b/g10/mainproc.c
@@ -273,7 +273,7 @@ proc_symkey_enc( CTX c, PACKET *pkt )
int algo = enc->cipher_algo;
const char *s = gcry_cipher_algo_name (algo);
- if(s)
+ if (!gcry_cipher_test_algo (algo))
{
if(!opt.quiet)
{
@@ -1768,7 +1768,8 @@ check_sig_and_print( CTX c, KBNODE node )
/* If we have a good signature and already printed
* the primary user ID, print all the other user IDs */
- if ( count && !rc ) {
+ if ( count && !rc
+ && !(opt.verify_options&VERIFY_SHOW_PRIMARY_UID_ONLY)) {
char *p;
for( un=keyblock; un; un = un->next ) {
if( un->pkt->pkttype != PKT_USER_ID )
diff --git a/g10/options.h b/g10/options.h
index 8bc81b943..315912b33 100644
--- a/g10/options.h
+++ b/g10/options.h
@@ -341,6 +341,7 @@ EXTERN_UNLESS_MAIN_MODULE int memory_stat_debug_mode;
#define VERIFY_SHOW_UNUSABLE_UIDS (1<<6)
#define VERIFY_PKA_LOOKUPS (1<<7)
#define VERIFY_PKA_TRUST_INCREASE (1<<8)
+#define VERIFY_SHOW_PRIMARY_UID_ONLY (1<<9)
#define KEYSERVER_USE_TEMP_FILES (1<<0)
#define KEYSERVER_KEEP_TEMP_FILES (1<<1)