summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2000-08-18 14:23:17 +0200
committerWerner Koch <wk@gnupg.org>2000-08-18 14:23:17 +0200
commitc9c709545aef163b7f9c1e4d7ca01db34f6dab40 (patch)
treeb7683e80e54f04d299f5621870352632d111f907 /include
parentSee ChangeLog: Mon Jul 31 10:04:47 CEST 2000 Werner Koch (diff)
downloadgnupg2-c9c709545aef163b7f9c1e4d7ca01db34f6dab40.tar.xz
gnupg2-c9c709545aef163b7f9c1e4d7ca01db34f6dab40.zip
See ChangeLog: Fri Aug 18 14:27:14 CEST 2000 Werner Koch
Diffstat (limited to 'include')
-rw-r--r--include/ChangeLog12
-rw-r--r--include/distfiles1
-rw-r--r--include/gpga-prot.h126
3 files changed, 135 insertions, 4 deletions
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 <wk@openit.de>
+
+ * 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 <wk@gnupg.de>
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*/