summaryrefslogtreecommitdiffstats
path: root/gpglib/genkey.c
diff options
context:
space:
mode:
authorSam Varshavchik2016-11-27 11:58:51 -0500
committerSam Varshavchik2016-11-27 11:58:51 -0500
commite21842e21535133d86f4c304e445e6d69f029ab5 (patch)
tree14d6af1c94c0417817c77e3cf6c08ddf8f58e06a /gpglib/genkey.c
parent22aa61750562f69db443f93518080cd1b5d923ea (diff)
downloadcourier-libs-e21842e21535133d86f4c304e445e6d69f029ab5.tar.bz2
gpglib: fixes for gpg2.
Add --with-gpg2 compiler option, to prefer gpg2 instead of gpg. When compiled against gpg2, --pinentry-mode local must be given, for certain operations. Implement libmail_gpg_makepassphrasepipe(), to help apps pass passphrases via pipes. Removes obsolete 'trust level' parameter from libmail_gpg_signkey().
Diffstat (limited to 'gpglib/genkey.c')
-rw-r--r--gpglib/genkey.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gpglib/genkey.c b/gpglib/genkey.c
index 15f7822..a6910ed 100644
--- a/gpglib/genkey.c
+++ b/gpglib/genkey.c
@@ -139,6 +139,7 @@ static char *mkcmdbuf(const char *name, const char *addr, const char *comment,
const char *passphrase)
{
static const char genkey_cmd[]=
+ "%s"
"Key-Type: DSA\n"
"Key-Length: %s\n"
"Subkey-Type: ELG-E\n"
@@ -189,7 +190,9 @@ static char *mkcmdbuf(const char *name, const char *addr, const char *comment,
while (*comment == ' ' || *comment == '\t')
++comment;
- sprintf(p, genkey_cmd, skl_buf, kl_buf,
+ sprintf(p, genkey_cmd,
+ *passphrase ? "":"%no-protection\n",
+ skl_buf, kl_buf,
*name ? namereal1:"",
name,