From 795965437732e50f6216d7f5db0e6174e90548a9 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 27 Jan 2015 10:22:47 +0100 Subject: agent: Add some extra robustness to extract_private_key * agent/cvt-openpgp.c (extract_private_key): Add arg "arraysize". Make sure that R_FLAGS and R_CURVE are set to NULL. -- Given that extract_private_key is not file local it is good to have some extra asserts to protect against future wrong use. Signed-off-by: Werner Koch --- agent/agent.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'agent/agent.h') diff --git a/agent/agent.h b/agent/agent.h index 0560835b0..45362421d 100644 --- a/agent/agent.h +++ b/agent/agent.h @@ -501,7 +501,8 @@ int agent_handle_learn (ctrl_t ctrl, int send, void *assuan_context); gpg_error_t extract_private_key (gcry_sexp_t s_key, int req_private_key_data, const char **r_algoname, int *r_npkey, int *r_nskey, - const char **r_format, gcry_mpi_t *mpi_array, + const char **r_format, + gcry_mpi_t *mpi_array, int arraysize, gcry_sexp_t *r_curve, gcry_sexp_t *r_flags); #endif /*AGENT_H*/ -- cgit v1.2.3