aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ChangeLog5
-rw-r--r--Makefile.am9
-rw-r--r--configure.in14
-rw-r--r--g10/ChangeLog5
-rw-r--r--g10/status.c2
-rw-r--r--include/ChangeLog12
-rw-r--r--include/distfiles1
-rw-r--r--include/gpga-prot.h126
-rw-r--r--util/ChangeLog4
-rw-r--r--util/logger.c22
10 files changed, 184 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 6a445a9dc..8ab82092a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Aug 18 14:27:14 CEST 2000 Werner Koch <[email protected]>
+
+ * agent/: New.
+ * Makefile.am, configure.in: Support for the new directory.
+
Mon Jul 17 16:35:47 CEST 2000 Werner Koch <wk@>
* configure.in (mingw32): Changes to allow for mingw32msvc
diff --git a/Makefile.am b/Makefile.am
index c05fa23d9..b9983fd19 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -17,7 +17,14 @@ else
checks = checks
endif
-SUBDIRS = intl zlib jnlib util mpi cipher ${gcrypt} g10 po tools doc ${checks}
+if COMPILE_AGENT
+agent = agent
+else
+agent =
+endif
+
+SUBDIRS = intl zlib jnlib util mpi cipher ${gcrypt} g10 po tools \
+ ${agent} doc ${checks}
EXTRA_DIST = README-alpha VERSION PROJECTS BUGS
# gettext never gets it right, so we take here care of deleting the
# symlink. my_clean_gcrypt is just a kludge until we can include
diff --git a/configure.in b/configure.in
index 9cc324fea..65b6c8471 100644
--- a/configure.in
+++ b/configure.in
@@ -302,6 +302,19 @@ AC_SUBST(USE_NLS)
AC_SUBST(USE_INCLUDED_LIBINTL)
fi
+dnl Where is the GTK+ toolkit
+if test "$cross_compiling" = yes ; then
+ CFLAGS="$CFLAGS -I/home/wk/work/gtk+w32/include/gtk+/gdk/win32 \
+ -I/home/wk/work/gtk+w32/include -I/home/wk/work/gtk+w32/include/gtk+"
+ LIBS="$LIBS -L/home/wk/work/gtk+w32/lib -lgtk -lgdk -lglib"
+ compile_agent=no
+else
+ AM_PATH_GTK(1.2.1, compile_agent=yes,compile_agent=no)
+fi
+AM_CONDITIONAL(COMPILE_AGENT, test x$compile_agent = xyes)
+
+
+
dnl
dnl There are lot of misconfigured systems. We include
dnl gdbm support only if the lib and the header is installed.
@@ -760,6 +773,7 @@ util/Makefile
mpi/Makefile
cipher/Makefile
g10/Makefile
+agent/Makefile
doc/Makefile
doc/version.sgml
tools/Makefile
diff --git a/g10/ChangeLog b/g10/ChangeLog
index 65137a440..09b38287a 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,8 @@
+Fri Aug 18 14:27:14 CEST 2000 Werner Koch <[email protected]>
+
+ * status.c (do_get_from_fd): Ooops, we used fd instead of opt.command_fd.
+ Thanks to Michael Tokarev.
+
Mon Jul 31 10:04:47 CEST 2000 Werner Koch <[email protected]>
* encode.c, sign.c, keygen.c, pubkey-enc.c: Replaced all
diff --git a/g10/status.c b/g10/status.c
index c35a8adba..2eb6724f3 100644
--- a/g10/status.c
+++ b/g10/status.c
@@ -368,7 +368,7 @@ do_get_from_fd( const char *keyword, int hidden, int bool )
i=0;
}
/* Hmmm: why not use our read_line function here */
- if( read( fd, string+i, 1) != 1 || string[i] == '\n' )
+ if( read( opt.command_fd, string+i, 1) != 1 || string[i] == '\n' )
break;
}
string[i] = 0;
diff --git a/include/ChangeLog b/include/ChangeLog
index addfc24a2..91515d4a1 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,12 +1,16 @@
+Fri Aug 18 14:27:14 CEST 2000 Werner Koch <[email protected]>
+
+ * gpga-prot.h: New.
+
Fri Jul 14 19:38:23 CEST 2000 Werner Koch <wk@>
- * http.h (HTTP_FLAG_TRY_PROXY): new.
+ * http.h (HTTP_FLAG_TRY_PROXY): new.
- * error.h (G10ERR_NOT_PROCESSED): New.
+ * error.h (G10ERR_NOT_PROCESSED): New.
- * iobuf.h (IOBUFCTRL_CANCEL): New.
+ * iobuf.h (IOBUFCTRL_CANCEL): New.
- * types.h (HAVE_U64_TYPEDEF): Defined depending on configure test.
+ * types.h (HAVE_U64_TYPEDEF): Defined depending on configure test.
Thu Jan 27 18:00:44 CET 2000 Werner Koch <[email protected]>
diff --git a/include/distfiles b/include/distfiles
index 8f4bd896c..7e066ad44 100644
--- a/include/distfiles
+++ b/include/distfiles
@@ -6,5 +6,6 @@ util.h
i18n.h
host2net.h
http.h
+gpga-prot.h
ChangeLog
diff --git a/include/gpga-prot.h b/include/gpga-prot.h
new file mode 100644
index 000000000..f0afdb1eb
--- /dev/null
+++ b/include/gpga-prot.h
@@ -0,0 +1,126 @@
+/* gpga-prot.h - GnuPG Agent protocol definition
+ * Copyright (C) 2000 Free Software Foundation, Inc.
+ *
+ * This file is part of GnuPG.
+ *
+ * GnuPG is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * GnuPG is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+/*
+ * The gpg-agent protocol:
+ * The protocol is connection based and runs over a Unix Domain socket.
+ * The client requests a service from the server and waits for the result.
+ * A connection request starts with a magic string to transfer the
+ * version number the followed by the regular traffic. All numbers
+ * are transfered in network-byte-order, strings are prefixed with a
+ * 32 bit length and NOT 0 terminated.
+ * The magic string is:
+ * 0x47, 0x50, 0x47, 0x41, 0x00, 0x00, 0x00, 0x01
+ * which nicely fits into 2 32 bit words.
+ * The server does not respond to this magic string if the protocol
+ is supported; otherwise it will return an error packet and close
+ the connection.
+ Standard request and reply packets are composed like this
+ u32 Length of following packet ( 4 <= n < 2048 )
+ u32 Request/Reply type or error code
+ n-bytes Data specific to the request/reply
+
+ Request codes are just the given number,
+ Reply codes are all to be ORed with 0x00010000,
+ Error codes are all to be ORer with 0x00020000.
+
+ Requests:
+ =========
+ GET_VERSION
+
+ GET_PASSPHRASE, expected data:
+ 20 Bytes fingerprint of the key
+ (use all zeroes to get a passphrase not associated with a key)
+ n Bytes with the text to be displayed in case the
+ passphrase is not cached or the fingerprint was all zero.
+
+ CLEAR_PASSPHRASE, expected data:
+ 20 Bytes fingerprint of the key
+
+ Returns either OKAY or NO_PASSPHRASE
+
+ HAVE_PASSPHRASE, expected data:
+ 20 Bytes fingerprint of the key
+
+ Returns either OKAY or NO_PASSPHRASE
+
+
+ Replies:
+ ========
+ OKAY (reply code 1)
+ Data may be interpreted as the version string
+
+ GOT_PASSPHRASE (reply code 2)
+ u32 Length of passphrase
+ n bytes passphrase
+ m bytes padding so that the packets have some standard length
+
+
+ Error Replies:
+ ==============
+ PROTOCOL_ERROR
+ no data yes specified
+
+ CANCELED
+ User canceled the input
+
+ NO_PASSPHRASE
+ No user intercation possible and passphrase not available.
+ Also return as answer on HAVE_PASSPHRASE etc.
+
+ BAD_PASSPHRASE
+ Returned when the user does not repeat the passphrase correctly
+
+ INVALID_DATA
+
+ */
+
+
+
+#ifndef GPG_GPGA_PROT_H
+#define GPG_GPGA_PROT_H 1
+
+enum gpga_protocol_codes {
+ /* Request codes */
+ GPGA_PROT_GET_VERSION = 1,
+ GPGA_PROT_GET_PASSPHRASE = 2,
+ GPGA_PROT_CLEAR_PASSPHRASE= 3,
+ GPGA_PROT_SHUTDOWN = 4,
+
+ /* Reply codes */
+ GPGA_PROT_REPLY_BASE = 0x10000,
+ GPGA_PROT_OKAY = 0x10001,
+ GPGA_PROT_GOT_PASSPHRASE = 0x10002,
+
+ /* Error codes */
+ GPGA_PROT_ERROR_BASE = 0x20000,
+ GPGA_PROT_PROTOCOL_ERROR = 0x20001,
+ GPGA_PROT_INVALID_REQUEST= 0x20002,
+ GPGA_PROT_CANCELED = 0x20003,
+ GPGA_PROT_NO_PASSPHRASE = 0x20004,
+ GPGA_PROT_BAD_PASSPHRASE = 0x20005,
+ GPGA_PROT_INVALID_DATA = 0x20006,
+ GPGA_PROT_NOT_IMPLEMENTED= 0x20007,
+ GPGA_PROT_UI_PROBLEM = 0x20008,
+};
+
+
+
+#endif /*GPG_GPGA_PROT_H*/
diff --git a/util/ChangeLog b/util/ChangeLog
index 68964a664..956c2085d 100644
--- a/util/ChangeLog
+++ b/util/ChangeLog
@@ -1,3 +1,7 @@
+Fri Aug 18 14:27:14 CEST 2000 Werner Koch <[email protected]>
+
+ * logger.c (log_set_file): Allow to set the file by name.
+
Fri Jul 28 18:19:11 CEST 2000 Werner Koch <[email protected]>
* iobuf.c: Use setmode() at several places to set stdin and stdout
diff --git a/util/logger.c b/util/logger.c
index bb0b89e8b..ccf049f0c 100644
--- a/util/logger.c
+++ b/util/logger.c
@@ -41,17 +41,19 @@ static FILE *logfp;
void
log_set_logfile( const char *name, int fd )
{
- if( name )
- BUG();
-
if( logfp && logfp != stderr && logfp != stdout )
- fclose( logfp );
- if( fd == 1 )
- logfp = stdout;
- else if( fd == 2 )
- logfp = stderr;
- else
- logfp = fdopen( fd, "a" );
+ fclose( logfp );
+ if( name ) {
+ logfp = fopen ( name, "a" );
+ }
+ else {
+ if( fd == 1 )
+ logfp = stdout;
+ else if( fd == 2 )
+ logfp = stderr;
+ else
+ logfp = fdopen( fd, "a" );
+ }
if( !logfp ) {
logfp = stderr;
log_fatal("can't open fd %d for logging: %s\n", fd, strerror(errno));