aboutsummaryrefslogtreecommitdiffstats
path: root/sm
diff options
context:
space:
mode:
Diffstat (limited to 'sm')
-rw-r--r--sm/ChangeLog6
-rw-r--r--sm/export.c12
-rw-r--r--sm/import.c12
3 files changed, 24 insertions, 6 deletions
diff --git a/sm/ChangeLog b/sm/ChangeLog
index 9f926cfc7..a988a200f 100644
--- a/sm/ChangeLog
+++ b/sm/ChangeLog
@@ -1,3 +1,9 @@
+2009-04-01 Werner Koch <[email protected]>
+
+ * export.c (popen_protect_tool): Add command line option
+ --agent-program and pass flag bit 6.
+ * import.c (popen_protect_tool): Ditto.
+
2009-03-26 Werner Koch <[email protected]>
* gpgsm.c (main): s/def_digest_string/forced_digest_algo/ and
diff --git a/sm/export.c b/sm/export.c
index f8e23cec1..fcf1dccc1 100644
--- a/sm/export.c
+++ b/sm/export.c
@@ -574,13 +574,14 @@ popen_protect_tool (ctrl_t ctrl, const char *pgmname,
const char *prompt, const char *keygrip,
pid_t *pid)
{
- const char *argv[20];
+ const char *argv[22];
int i=0;
/* Make sure that the agent is running so that the protect tool is
able to ask for a passphrase. This has only an effect under W32
where the agent is started on demand; sending a NOP does not harm
- on other platforms. */
+ on other platforms. This is not really necessary anymore because
+ the protect tool does this now by itself; it does not harm either.*/
gpgsm_agent_send_nop (ctrl);
argv[i++] = "--homedir";
@@ -595,13 +596,18 @@ popen_protect_tool (ctrl_t ctrl, const char *pgmname,
argv[i++] = "--p12-charset";
argv[i++] = opt.p12_charset;
}
+ if (opt.agent_program)
+ {
+ argv[i++] = "--agent-program";
+ argv[i++] = opt.agent_program;
+ }
argv[i++] = "--",
argv[i++] = keygrip,
argv[i] = NULL;
assert (i < sizeof argv);
return gnupg_spawn_process (pgmname, argv, infile, outfile,
- setup_pinentry_env, 128,
+ setup_pinentry_env, (128|64),
statusfile, pid);
}
diff --git a/sm/import.c b/sm/import.c
index cb1922ed5..5e8b42971 100644
--- a/sm/import.c
+++ b/sm/import.c
@@ -463,13 +463,14 @@ static gpg_error_t
popen_protect_tool (ctrl_t ctrl, const char *pgmname,
FILE *infile, FILE *outfile, FILE **statusfile, pid_t *pid)
{
- const char *argv[20];
+ const char *argv[22];
int i=0;
/* Make sure that the agent is running so that the protect tool is
able to ask for a passphrase. This has only an effect under W32
where the agent is started on demand; sending a NOP does not harm
- on other platforms. */
+ on other platforms. This is not really necessary anymore because
+ the protect tool does this now by itself; it does not harm either. */
gpgsm_agent_send_nop (ctrl);
argv[i++] = "--homedir";
@@ -483,12 +484,17 @@ popen_protect_tool (ctrl_t ctrl, const char *pgmname,
argv[i++] = "--passphrase";
argv[i++] = opt.fixed_passphrase;
}
+ if (opt.agent_program)
+ {
+ argv[i++] = "--agent-program";
+ argv[i++] = opt.agent_program;
+ }
argv[i++] = "--",
argv[i] = NULL;
assert (i < sizeof argv);
return gnupg_spawn_process (pgmname, argv, infile, outfile,
- setup_pinentry_env, 128,
+ setup_pinentry_env, (128 | 64),
statusfile, pid);
}