aboutsummaryrefslogtreecommitdiffstats
path: root/agent/protect-tool.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2005-05-20 20:39:36 +0000
committerWerner Koch <[email protected]>2005-05-20 20:39:36 +0000
commit41862f5f13bef8113cf040ecaba34a35c370eeb3 (patch)
tree8deaa1ca3c63351b2ef028947aa445b422081e9f /agent/protect-tool.c
parentChanged the scdaemon to handle concurrent sessions. Adjusted (diff)
downloadgnupg-41862f5f13bef8113cf040ecaba34a35c370eeb3.tar.gz
gnupg-41862f5f13bef8113cf040ecaba34a35c370eeb3.zip
* protect-tool.c: New option --canonical.
(show_file): Implement it. * keyformat.txt: Define the created-at attribute for keys. * ccid-driver.c: Replaced macro DEBUG_T1 by a new debug level. (parse_ccid_descriptor): Mark SCR335 firmware version 5.18 good. (ccid_transceive): Arghhh. The seqno is another bit in the R-block than in the I block, this was wrong at one place. * scdaemon.c: New options --debug-ccid-driver and --debug-disable-ticker. * app-openpgp.c (do_genkey, do_writekey): Factored code to check for existing key out into .. (does_key_exist): .. New function. * gpg-connect-agent.c (add_definq, show_definq, clear_definq) (handle_inquire): New. (read_and_print_response): Handle INQUIRE command. (main): Implement control commands.
Diffstat (limited to 'agent/protect-tool.c')
-rw-r--r--agent/protect-tool.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/agent/protect-tool.c b/agent/protect-tool.c
index c21aa0517..e8f1d2c10 100644
--- a/agent/protect-tool.c
+++ b/agent/protect-tool.c
@@ -60,6 +60,7 @@ enum cmd_and_opt_values
oShadow,
oShowShadowInfo,
oShowKeygrip,
+ oCanonical,
oP12Import,
oP12Export,
@@ -86,6 +87,7 @@ struct rsa_secret_key_s
static const char *opt_homedir;
static int opt_armor;
+static int opt_canonical;
static int opt_store;
static int opt_force;
static int opt_no_fail_on_exist;
@@ -107,6 +109,7 @@ static ARGPARSE_OPTS opts[] = {
{ oVerbose, "verbose", 0, "verbose" },
{ oArmor, "armor", 0, "write output in advanced format" },
+ { oCanonical, "canonical", 0, "write output in canonical format" },
{ oPassphrase, "passphrase", 2, "|STRING|use passphrase STRING" },
{ oProtect, "protect", 256, "protect a private key"},
{ oUnprotect, "unprotect", 256, "unprotect a private key"},
@@ -508,14 +511,21 @@ show_file (const char *fname)
keylen = gcry_sexp_canon_len (key, 0, NULL,NULL);
assert (keylen);
-
- p = make_advanced (key, keylen);
- xfree (key);
- if (p)
+
+ if (opt_canonical)
{
- fwrite (p, strlen (p), 1, stdout);
- xfree (p);
+ fwrite (key, keylen, 1, stdout);
}
+ else
+ {
+ p = make_advanced (key, keylen);
+ if (p)
+ {
+ fwrite (p, strlen (p), 1, stdout);
+ xfree (p);
+ }
+ }
+ xfree (key);
}
static void
@@ -1079,6 +1089,7 @@ main (int argc, char **argv )
{
case oVerbose: opt.verbose++; break;
case oArmor: opt_armor=1; break;
+ case oCanonical: opt_canonical=1; break;
case oHomedir: opt_homedir = pargs.r.ret_str; break;
case oProtect: cmd = oProtect; break;