aboutsummaryrefslogtreecommitdiffstats
path: root/agent/findkey.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2016-06-23 11:17:25 +0000
committerWerner Koch <[email protected]>2016-06-23 11:17:25 +0000
commit3ead21da80da4570e77036cc05303914c9b1f364 (patch)
tree097664acffb2bf71683c2c51278527a60c9018f8 /agent/findkey.c
parentcommon: Rename external symbols in name-value.c. (diff)
downloadgnupg-3ead21da80da4570e77036cc05303914c9b1f364.tar.gz
gnupg-3ead21da80da4570e77036cc05303914c9b1f364.zip
common: Add dedicated private key functions to name-value.c.
* common/name-value.c (struct name_value_container): Add field 'private_key_mode'. (my_error): New. Use instead of gpg_error. (nvc_new_private_key): New. (nve_release): Add arg 'private_key_mode'. (nvc_release): Call nve_release with private_key_mode flag. (nvc_delete): Ditto. (_nvc_add): Do no special case "Key:" in non-private_key_mode. (nvc_get_private_key): Return error in non-private_key_mode. (nvc_set_private_key): Ditto. (nvc_parse): Factor all code out to ... (do_nvc_parse): new. Add arg 'for_private_key'. (nvc_parse_private_key): New. * agent/findkey.c (write_extended_private_key): Replace nvc_parse by nvc_parse_private_key. (read_key_file): Ditto. * common/t-name-value.c (private_key_mode): New variable. (my_nvc_new): New. Replace all callers. (test_key_extraction): Take mode in account. (run_tests): Ditto. (run_modification_tests): Ditto. (parse): Ditto. (main): Add option --parse and rename --parse to --parse-key. -- Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'agent/findkey.c')
-rw-r--r--agent/findkey.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/agent/findkey.c b/agent/findkey.c
index dc7099c76..c5ab0e905 100644
--- a/agent/findkey.c
+++ b/agent/findkey.c
@@ -62,7 +62,7 @@ write_extended_private_key (char *fname, estream_t fp,
int remove = 0;
int line;
- err = nvc_parse (&pk, &line, fp);
+ err = nvc_parse_private_key (&pk, &line, fp);
if (err)
{
log_error ("error parsing '%s' line %d: %s\n",
@@ -690,7 +690,7 @@ read_key_file (const unsigned char *grip, gcry_sexp_t *result)
nvc_t pk;
int line;
- rc = nvc_parse (&pk, &line, fp);
+ rc = nvc_parse_private_key (&pk, &line, fp);
es_fclose (fp);
if (rc)