aboutsummaryrefslogtreecommitdiffstats
path: root/g10
diff options
context:
space:
mode:
Diffstat (limited to 'g10')
-rw-r--r--g10/ChangeLog10
-rw-r--r--g10/g10.c6
-rw-r--r--g10/keylist.c4
-rw-r--r--g10/options.h2
-rw-r--r--g10/packet.h2
-rw-r--r--g10/sig-check.c5
-rw-r--r--g10/sign.c2
7 files changed, 24 insertions, 7 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index 2e60f2d81..bbaae1b1c 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,5 +1,15 @@
2001-03-27 Werner Koch <[email protected]>
+ * packet.h: Add a missing typedef to an enum. Thanks to Stefan Bellon.
+
+ * g10.c: New option --no-sig-create-check.
+ * sign.c (do_sign): Implement it here.
+ * g10.c: New option --no-sig-cache.
+ * sig-check.c (check_key_signature2): Implement it here.
+ (cache_selfsig_result): and here.
+
+ * keylist.c (list_keyblock): Removed debugging stuff.
+
* getkey.c (cache_public_key): Made global.
* keygen.c (write_selfsig, write_keybinding): Cache the new key.
diff --git a/g10/g10.c b/g10/g10.c
index af3e7f5c6..0ee6f32c4 100644
--- a/g10/g10.c
+++ b/g10/g10.c
@@ -204,6 +204,8 @@ enum cmd_and_opt_values { aNull = 0,
oTrustedKey,
oNoExpensiveTrustChecks,
oFixedListMode,
+ oNoSigCache,
+ oNoSigCreateCheck,
oEmu3DESS2KBug, /* will be removed in 1.1 */
oEmuMDEncodeBug,
aTest };
@@ -394,6 +396,8 @@ static ARGPARSE_OPTS opts[] = {
{ oOverrideSessionKey, "override-session-key", 2, "@" },
{ oNoRandomSeedFile, "no-random-seed-file", 0, "@" },
{ oNoAutoKeyRetrieve, "no-auto-key-retrieve", 0, "@" },
+ { oNoSigCache, "no-sig-cache", 0, "@" },
+ { oNoSigCreateCheck, "no-sig-create-check", 0, "@" },
{ oMergeOnly, "merge-only", 0, "@" },
{ oAllowSecretKeyImport, "allow-secret-key-import", 0, "@" },
{ oTryAllSecrets, "try-all-secrets", 0, "@" },
@@ -961,6 +965,8 @@ main( int argc, char **argv )
case oDisablePubkeyAlgo:
disable_pubkey_algo( string_to_pubkey_algo(pargs.r.ret_str) );
break;
+ case oNoSigCache: opt.no_sig_cache = 1; break;
+ case oNoSigCreateCheck: opt.no_sig_create_check = 1; break;
case oAllowNonSelfsignedUID: opt.allow_non_selfsigned_uid = 1; break;
case oAllowFreeformUID: opt.allow_freeform_uid = 1; break;
case oNoLiteral: opt.no_literal = 1; break;
diff --git a/g10/keylist.c b/g10/keylist.c
index 22f578b0d..4f26dc27d 100644
--- a/g10/keylist.c
+++ b/g10/keylist.c
@@ -696,11 +696,7 @@ reorder_keyblock (KBNODE keyblock)
static void
list_keyblock( KBNODE keyblock, int secret )
{
- log_debug ("before reorder:\n");
- dump_kbnode (keyblock);
reorder_keyblock (keyblock);
- log_debug ("after reorder:\n");
- dump_kbnode (keyblock);
if (opt.with_colons)
list_keyblock_colon (keyblock, secret );
else
diff --git a/g10/options.h b/g10/options.h
index 54fd0df32..58f5f0b58 100644
--- a/g10/options.h
+++ b/g10/options.h
@@ -101,6 +101,8 @@ struct {
int allow_secret_key_import;
int try_all_secrets;
int no_expensive_trust_checks;
+ int no_sig_cache;
+ int no_sig_create_check;
} opt;
diff --git a/g10/packet.h b/g10/packet.h
index 1033c7b88..7da7cb20c 100644
--- a/g10/packet.h
+++ b/g10/packet.h
@@ -56,7 +56,7 @@ typedef enum {
typedef struct packet_struct PACKET;
/* PKT_GPG_CONTROL types */
-enum {
+typedef enum {
CTRLPKT_CLEARSIGN_START = 1,
CTRLPKT_PIPEMODE = 2
} ctrlpkttype_t;
diff --git a/g10/sig-check.c b/g10/sig-check.c
index 8267e61cf..5282281d7 100644
--- a/g10/sig-check.c
+++ b/g10/sig-check.c
@@ -442,6 +442,9 @@ cache_selfsig_result ( PKT_signature *sig, int result )
{
byte buf[6];
+ if ( opt.no_sig_cache )
+ return;
+
buf[0] = 'G';
buf[1] = 'P';
buf[2] = 'G';
@@ -503,7 +506,7 @@ check_key_signature2( KBNODE root, KBNODE node, int *is_selfsig,
#endif
/* Check whether we have cached the result of a previous signature check.*/
- {
+ if ( !opt.no_sig_cache ) {
const byte *p;
size_t len;
diff --git a/g10/sign.c b/g10/sign.c
index 4388a56a2..bb1f2679a 100644
--- a/g10/sign.c
+++ b/g10/sign.c
@@ -132,7 +132,7 @@ do_sign( PKT_secret_key *sk, PKT_signature *sig,
digest_algo, mpi_get_nbits(sk->skey[0]), 0 );
rc = pubkey_sign( sk->pubkey_algo, sig->data, frame, sk->skey );
mpi_free(frame);
- if (!rc) {
+ if (!rc && !opt.no_sig_create_check) {
/* check that the signature verification worked and nothing is
* fooling us e.g. by a bug in the signature create
* code or by deliberately introduced faults. */