diff options
author | Werner Koch <[email protected]> | 2002-04-09 18:34:38 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2002-04-09 18:34:38 +0000 |
commit | 1943ed5d2cc1c8064be1feb74b9a82a76da9f0c3 (patch) | |
tree | e6f4f216f07061d64c016836fbfeacf0a61415c0 /agent/protect-tool.c | |
parent | yet another test certificate (diff) | |
download | gnupg-1943ed5d2cc1c8064be1feb74b9a82a76da9f0c3.tar.gz gnupg-1943ed5d2cc1c8064be1feb74b9a82a76da9f0c3.zip |
* protect-tool.c (show_file): New. Used as default action.
Diffstat (limited to 'agent/protect-tool.c')
-rw-r--r-- | agent/protect-tool.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/agent/protect-tool.c b/agent/protect-tool.c index e10662880..d783556de 100644 --- a/agent/protect-tool.c +++ b/agent/protect-tool.c @@ -366,6 +366,29 @@ show_shadow_info (const char *fname) } +static void +show_file (const char *fname) +{ + unsigned char *key; + size_t keylen; + char *p; + + key = read_key (fname); + if (!key) + return; + keylen = gcry_sexp_canon_len (key, 0, NULL,NULL); + assert (keylen); + + p = make_advanced (key, keylen); + xfree (key); + if (p) + { + fwrite (p, strlen (p), 1, stdout); + xfree (p); + } +} + + int @@ -424,7 +447,7 @@ main (int argc, char **argv ) else if (cmd == oShowShadowInfo) show_shadow_info (*argv); else - log_info ("no action requested\n"); + show_file (*argv); return 0; } |