aboutsummaryrefslogtreecommitdiffstats
path: root/agent
diff options
context:
space:
mode:
Diffstat (limited to 'agent')
-rw-r--r--agent/ChangeLog13
-rw-r--r--agent/call-scd.c2
-rw-r--r--agent/gpg-agent.c16
-rw-r--r--agent/protect-tool.c20
4 files changed, 37 insertions, 14 deletions
diff --git a/agent/ChangeLog b/agent/ChangeLog
index e0bf52b45..3669b0e43 100644
--- a/agent/ChangeLog
+++ b/agent/ChangeLog
@@ -1,3 +1,16 @@
+2004-12-15 Werner Koch <[email protected]>
+
+ * gpg-agent.c [W32]: Various hacks to make it work.
+
+ * findkey.c (agent_write_private_key) [W32]: Adjust open call.
+
+ * call-scd.c (start_scd) [W32]: Don't check whether the daemon
+ didn't died. To hard to do under Windows.
+ (start_scd) [W32]: Disable sending of the event signal option.
+
+ * protect-tool.c (read_file, export_p12_file) [W32]: Use setmode
+ to get stdout and stin into binary mode.
+
2004-12-05 Moritz Schulte <[email protected]>
* query.c (start_pinentry): Allow CTRL be NULL.
diff --git a/agent/call-scd.c b/agent/call-scd.c
index 575986dc9..828040772 100644
--- a/agent/call-scd.c
+++ b/agent/call-scd.c
@@ -215,7 +215,7 @@ start_scd (ctrl_t ctrl)
/* We better do a sanity check now to see whether it has
accidently died. */
-#ifndef HAVE_W32_SYSTEM /* fixme */
+#ifndef HAVE_W32_SYSTEM
pid = assuan_get_pid (scd_ctx);
if (pid != (pid_t)(-1) && pid
&& ((rc=waitpid (pid, NULL, WNOHANG))==-1 || (rc == pid)) )
diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c
index 0a483ac48..307d43d36 100644
--- a/agent/gpg-agent.c
+++ b/agent/gpg-agent.c
@@ -33,7 +33,7 @@
#ifndef HAVE_W32_SYSTEM
#include <sys/socket.h>
#include <sys/un.h>
-#endif
+#endif /*HAVE_W32_SYSTEM*/
#include <unistd.h>
#include <signal.h>
#ifdef USE_GNU_PTH
@@ -438,17 +438,18 @@ main (int argc, char **argv )
/* Libgcrypt requires us to register the threading model first.
Note that this will also do the pth_init. */
-#if defined(USE_GNU_PTH) && !defined(HAVE_W32_SYSTEM)
+#ifdef USE_GNU_PTH
+# ifdef HAVE_W32_SYSTEM
+ pth_init ();
+# else /*!HAVE_W32_SYSTEM*/
err = gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pth);
if (err)
{
log_fatal ("can't register GNU Pth with Libgcrypt: %s\n",
gpg_strerror (err));
}
-#endif /*USE_GNU_PTH && !HAVE_W32_SYSTEM*/
-#ifdef HAVE_W32_SYSTEM
- pth_init ();
-#endif
+# endif/*!HAVE_W32_SYSTEM*/
+#endif /*USE_GNU_PTH*/
/* Check that the libraries are suitable. Do it here because
the option parsing may need services of the library. */
@@ -716,12 +717,11 @@ main (int argc, char **argv )
}
/* Make sure that we have a default ttyname. */
-#ifndef HAVE_W32_SYSTEM
if (!default_ttyname && ttyname (1))
default_ttyname = xstrdup (ttyname (1));
if (!default_ttytype && getenv ("TERM"))
default_ttytype = xstrdup (getenv ("TERM"));
-#endif
+
if (pipe_server)
{ /* this is the simple pipe based server */
diff --git a/agent/protect-tool.c b/agent/protect-tool.c
index 286adde54..ef8a50916 100644
--- a/agent/protect-tool.c
+++ b/agent/protect-tool.c
@@ -35,6 +35,9 @@
#ifdef HAVE_LANGINFO_CODESET
#include <langinfo.h>
#endif
+#ifdef HAVE_DOSISH_SYSTEM
+#include <fcntl.h> /* for setmode() */
+#endif
#define JNLIB_NEED_LOG_LOGV
#include "agent.h"
@@ -262,6 +265,9 @@ read_file (const char *fname, size_t *r_length)
size_t nread, bufsize = 0;
fp = stdin;
+#ifdef HAVE_DOSISH_SYSTEM
+ setmode ( fileno(fp) , O_BINARY );
+#endif
buf = NULL;
buflen = 0;
#define NCHUNK 8192
@@ -975,6 +981,9 @@ export_p12_file (const char *fname)
if (!key)
return;
+#ifdef HAVE_DOSISH_SYSTEM
+ setmode ( fileno (stdout) , O_BINARY );
+#endif
fwrite (key, keylen, 1, stdout);
xfree (key);
}
@@ -1056,12 +1065,12 @@ main (int argc, char **argv )
gcry_control (GCRYCTL_INIT_SECMEM, 16384, 0);
-#ifdef __MINGW32__
+#ifdef HAVE_W32_SYSTEM
opt_homedir = read_w32_registry_string ( NULL,
"Software\\GNU\\GnuPG", "HomeDir" );
-#else
+#else /*!HAVE_W32_SYSTEM*/
opt_homedir = getenv ("GNUPGHOME");
-#endif
+#endif /*!HAVE_W32_SYSTEM*/
if (!opt_homedir || !*opt_homedir)
opt_homedir = GNUPG_DEFAULT_HOMEDIR;
@@ -1213,9 +1222,10 @@ get_passphrase (int promptno)
if (!pw)
{
if (err)
- log_error ("error while asking for the passphrase\n");
+ log_error (_("error while asking for the passphrase: %s\n"),
+ gpg_strerror (err));
else
- log_info ("cancelled\n");
+ log_info (_("cancelled\n"));
agent_exit (0);
}