summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2006-04-19 13:26:11 +0200
committerWerner Koch <wk@gnupg.org>2006-04-19 13:26:11 +0200
commit29b23dea9731e8f258211bc6fd733d205c18e2a8 (patch)
treeff2a0f66bda0c1f050e8fa00cbf610e18b91c9f7 /include
parent2006-04-14 Marcus Brinkmann <marcus@g10code.de> (diff)
downloadgnupg2-29b23dea9731e8f258211bc6fd733d205c18e2a8.tar.xz
gnupg2-29b23dea9731e8f258211bc6fd733d205c18e2a8.zip
Merged with gpg 1.4.3 code.
The gpg part does not yet build.
Diffstat (limited to 'include')
-rw-r--r--include/ChangeLog4
-rw-r--r--include/cipher.h114
-rw-r--r--include/host2net.h9
-rw-r--r--include/http.h31
-rw-r--r--include/i18n.h5
-rw-r--r--include/keyserver.h10
-rw-r--r--include/memory.h2
-rw-r--r--include/mpi.h2
-rw-r--r--include/types.h9
-rw-r--r--include/util.h2
-rw-r--r--include/zlib-riscos.h3
11 files changed, 107 insertions, 84 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index 5b343f5a0..0211bd618 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,7 @@
+2006-04-18 Werner Koch <wk@g10code.com>
+
+ * keyserver.h, i18n.h, http.h, cipher.h: Updated to gpg 1.4.3.
+
2003-09-04 David Shaw <dshaw@jabberwocky.com>
* cipher.h: Drop TIGER/192 support.
diff --git a/include/cipher.h b/include/cipher.h
index e7e36c6d5..681386c36 100644
--- a/include/cipher.h
+++ b/include/cipher.h
@@ -1,97 +1,101 @@
-/* cipher.h
- * Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+/* cipher.h - Definitions for OpenPGP
+ * Copyright (C) 1998, 1999, 2000, 2001, 2006 Free Software Foundation, Inc.
*
- * This file is part of GNUPG.
+ * This file is part of GnuPG.
*
- * GNUPG is free software; you can redistribute it and/or modify
+ * 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,
+ * 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
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ * USA.
*/
#ifndef G10_CIPHER_H
#define G10_CIPHER_H
#include <gcrypt.h>
-#define CIPHER_ALGO_NONE GCRY_CIPHER_NONE
-#define CIPHER_ALGO_IDEA GCRY_CIPHER_IDEA
-#define CIPHER_ALGO_3DES GCRY_CIPHER_3DES
-#define CIPHER_ALGO_CAST5 GCRY_CIPHER_CAST5
-#define CIPHER_ALGO_BLOWFISH GCRY_CIPHER_BLOWFISH /* 128 bit */
-#define CIPHER_ALGO_SAFER_SK128 GCRY_CIPHER_SK128
-#define CIPHER_ALGO_DES_SK GCRY_CIPHER_DES_SK
-#define CIPHER_ALGO_AES GCRY_CIPHER_AES
-#define CIPHER_ALGO_AES192 GCRY_CIPHER_AES192
-#define CIPHER_ALGO_AES256 GCRY_CIPHER_AES256
+/* Macros for compatibility with older libgcrypt versions. */
+#ifndef GCRY_PK_USAGE_CERT
+# define GCRY_PK_USAGE_CERT 4
+# define GCRY_PK_USAGE_AUTH 8
+# define GCRY_PK_USAGE_UNKN 128
+#endif
+
+
+/* Constants for OpenPGP. */
+
+#define CIPHER_ALGO_NONE /* 0 */ GCRY_CIPHER_NONE
+#define CIPHER_ALGO_IDEA /* 1 */ GCRY_CIPHER_IDEA
+#define CIPHER_ALGO_3DES /* 2 */ GCRY_CIPHER_3DES
+#define CIPHER_ALGO_CAST5 /* 3 */ GCRY_CIPHER_CAST5
+#define CIPHER_ALGO_BLOWFISH /* 4 */ GCRY_CIPHER_BLOWFISH /* 128 bit */
+/* 5 & 6 are reserved */
+#define CIPHER_ALGO_AES /* 7 */ GCRY_CIPHER_AES
+#define CIPHER_ALGO_AES192 /* 8 */ GCRY_CIPHER_AES192
+#define CIPHER_ALGO_AES256 /* 9 */ GCRY_CIPHER_AES256
#define CIPHER_ALGO_RIJNDAEL CIPHER_ALGO_AES
#define CIPHER_ALGO_RIJNDAEL192 CIPHER_ALGO_AES192
#define CIPHER_ALGO_RIJNDAEL256 CIPHER_ALGO_AES256
-#define CIPHER_ALGO_TWOFISH GCRY_CIPHER_TWOFISH /* 256 bit */
-#define CIPHER_ALGO_DUMMY 110 /* no encryption at all */
+#define CIPHER_ALGO_TWOFISH /* 10 */ GCRY_CIPHER_TWOFISH /* 256 bit */
+#define CIPHER_ALGO_DUMMY 110 /* No encryption at all. */
-#define PUBKEY_ALGO_RSA GCRY_PK_RSA
-#define PUBKEY_ALGO_RSA_E GCRY_PK_RSA_E
-#define PUBKEY_ALGO_RSA_S GCRY_PK_RSA_S
-#define PUBKEY_ALGO_ELGAMAL_E GCRY_PK_ELG_E
-#define PUBKEY_ALGO_DSA GCRY_PK_DSA
-#define PUBKEY_ALGO_ELGAMAL GCRY_PK_ELG
+#define PUBKEY_ALGO_RSA /* 1 */ GCRY_PK_RSA
+#define PUBKEY_ALGO_RSA_E /* 2 */ GCRY_PK_RSA_E /* RSA encrypt only. */
+#define PUBKEY_ALGO_RSA_S /* 3 */ GCRY_PK_RSA_S /* RSA sign only. */
+#define PUBKEY_ALGO_ELGAMAL_E /* 16 */ GCRY_PK_ELG_E /* Elgamal encr only */
+#define PUBKEY_ALGO_DSA /* 17 */ GCRY_PK_DSA
+#define PUBKEY_ALGO_ELGAMAL /* 20 */ GCRY_PK_ELG /* Elgamal encr+sign */
-#define PUBKEY_USAGE_SIG GCRY_PK_USAGE_SIGN
-#define PUBKEY_USAGE_ENC GCRY_PK_USAGE_ENCR
-#define PUBKEY_USAGE_CERT 4 /* key is also good to certify other keys*/
-#define PUBKEY_USAGE_AUTH 8
+#define PUBKEY_USAGE_SIG GCRY_PK_USAGE_SIGN /* Good for signatures. */
+#define PUBKEY_USAGE_ENC GCRY_PK_USAGE_ENCR /* Good for encryption. */
+#define PUBKEY_USAGE_CERT GCRY_PK_USAGE_CERT /* Also good to certify keys. */
+#define PUBKEY_USAGE_AUTH GCRY_PK_USAGE_AUTH /* Good for authentication. */
+#define PUBKEY_USAGE_UNKNOWN GCRY_PK_USAGE_UNKN /* Unknown usage flag. */
-#define DIGEST_ALGO_MD5 GCRY_MD_MD5
-#define DIGEST_ALGO_SHA1 GCRY_MD_SHA1
-#define DIGEST_ALGO_RMD160 GCRY_MD_RMD160
-#define DIGEST_ALGO_SHA256 GCRY_MD_SHA256
-#define DIGEST_ALGO_SHA384 GCRY_MD_SHA384
-#define DIGEST_ALGO_SHA512 GCRY_MD_SHA512
+#define DIGEST_ALGO_MD5 /* 1 */ GCRY_MD_MD5
+#define DIGEST_ALGO_SHA1 /* 2 */ GCRY_MD_SHA1
+#define DIGEST_ALGO_RMD160 /* 3 */ GCRY_MD_RMD160
+/* 4, 5, 6, and 7 are reserved */
+#define DIGEST_ALGO_SHA256 /* 8 */ GCRY_MD_SHA256
+#define DIGEST_ALGO_SHA384 /* 9 */ GCRY_MD_SHA384
+#define DIGEST_ALGO_SHA512 /* 10 */ GCRY_MD_SHA512
#define COMPRESS_ALGO_NONE 0
#define COMPRESS_ALGO_ZIP 1
#define COMPRESS_ALGO_ZLIB 2
+#define COMPRESS_ALGO_BZIP2 3
#define is_RSA(a) ((a)==PUBKEY_ALGO_RSA || (a)==PUBKEY_ALGO_RSA_E \
|| (a)==PUBKEY_ALGO_RSA_S )
-#define is_ELGAMAL(a) ((a)==PUBKEY_ALGO_ELGAMAL || (a)==PUBKEY_ALGO_ELGAMAL_E)
+#define is_ELGAMAL(a) ((a)==PUBKEY_ALGO_ELGAMAL_E)
+#define is_DSA(a) ((a)==PUBKEY_ALGO_DSA)
-typedef struct {
- int algo;
- int keylen;
- int algo_info_printed;
- int use_mdc;
- byte key[32]; /* this is the largest used keylen (256 bit) */
+/* The data encryption key object. */
+typedef struct
+{
+ int algo;
+ int keylen;
+ int algo_info_printed;
+ int use_mdc;
+ int symmetric;
+ byte key[32]; /* This is the largest used keylen (256 bit). */
} DEK;
-#ifndef EXTERN_UNLESS_MAIN_MODULE
-#if defined (__riscos__) && !defined (INCLUDED_BY_MAIN_MODULE)
-#define EXTERN_UNLESS_MAIN_MODULE extern
-#else
-#define EXTERN_UNLESS_MAIN_MODULE
-#endif
-#endif
-EXTERN_UNLESS_MAIN_MODULE int g10_opt_verbose;
-EXTERN_UNLESS_MAIN_MODULE const char *g10_opt_homedir;
-
-
+/* Constants to allocate static MPI arrays. */
#define PUBKEY_MAX_NPKEY 4
#define PUBKEY_MAX_NSKEY 6
#define PUBKEY_MAX_NSIG 2
#define PUBKEY_MAX_NENC 2
-#define MD_HANDLE gcry_md_hd_t
-#define CIPHER_HANDLE gcry_cipher_hd_t
-
#endif /*G10_CIPHER_H*/
diff --git a/include/host2net.h b/include/host2net.h
index 0f12a8e1d..e378bfb29 100644
--- a/include/host2net.h
+++ b/include/host2net.h
@@ -1,21 +1,22 @@
/* host2net.h - Some macros
* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
*
- * This file is part of GNUPG.
+ * This file is part of GnuPG.
*
- * GNUPG is free software; you can redistribute it and/or modify
+ * 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,
+ * 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
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ * USA.
*/
#ifndef G10_HOST2NET_H
diff --git a/include/http.h b/include/http.h
index b53ac9f9f..b9ce5b130 100644
--- a/include/http.h
+++ b/include/http.h
@@ -1,5 +1,6 @@
/* http.h - HTTP protocol handler
- * Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+ * Copyright (C) 1999, 2000, 2001, 2003, 2004,
+ * 2005 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@@ -15,12 +16,14 @@
*
* 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
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ * USA.
*/
+
#ifndef G10_HTTP_H
#define G10_HTTP_H 1
-#include "iobuf.h"
+#include "../common/iobuf.h"
struct uri_tuple {
struct uri_tuple *next;
@@ -34,6 +37,7 @@ typedef struct uri_tuple *URI_TUPLE;
struct parsed_uri {
/* all these pointers point into buffer; most stuff is not escaped */
char *scheme; /* pointer to the scheme string (lowercase) */
+ char *auth; /* username/password for basic auth */
char *host; /* host (converted to lowercase) */
ushort port; /* port (always set if the host is set) */
char *path; /* the path */
@@ -49,19 +53,20 @@ typedef enum {
HTTP_REQ_POST = 3
} HTTP_REQ_TYPE;
-enum { /* put flag values into an enum, so that gdb can display them */
- HTTP_FLAG_TRY_PROXY = 1,
- HTTP_FLAG_NO_SHUTDOWN = 2,
- HTTP_FLAG_TRY_SRV = 3
-};
+/* put flag values into an enum, so that gdb can display them */
+enum
+ {
+ HTTP_FLAG_NO_SHUTDOWN = 1,
+ HTTP_FLAG_TRY_SRV = 2
+ };
struct http_context {
int initialized;
unsigned int status_code;
int sock;
int in_data;
- IOBUF fp_read;
- IOBUF fp_write;
+ iobuf_t fp_read;
+ iobuf_t fp_write;
int is_http_0_9;
PARSED_URI uri;
HTTP_REQ_TYPE req_type;
@@ -72,11 +77,11 @@ struct http_context {
typedef struct http_context *HTTP_HD;
int http_open( HTTP_HD hd, HTTP_REQ_TYPE reqtype, const char *url,
- unsigned int flags );
+ char *auth, unsigned int flags, const char *proxy );
void http_start_data( HTTP_HD hd );
int http_wait_response( HTTP_HD hd, unsigned int *ret_status );
void http_close( HTTP_HD hd );
-
-int http_open_document( HTTP_HD hd, const char *document, unsigned int flags );
+int http_open_document( HTTP_HD hd, const char *document, char *auth,
+ unsigned int flags, const char *proxy );
#endif /*G10_HTTP_H*/
diff --git a/include/i18n.h b/include/i18n.h
index 20c2570ab..6abd2dce3 100644
--- a/include/i18n.h
+++ b/include/i18n.h
@@ -15,14 +15,15 @@
*
* 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
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ * USA.
*/
#ifndef G10_I18N_H
#define G10_I18N_H
#ifdef USE_SIMPLE_GETTEXT
-int set_gettext_file( const char *filename );
+int set_gettext_file( const char *filename, const char *regkey );
const char *gettext( const char *msgid );
#define _(a) gettext (a)
diff --git a/include/keyserver.h b/include/keyserver.h
index 33c1b318b..7bd12625e 100644
--- a/include/keyserver.h
+++ b/include/keyserver.h
@@ -1,21 +1,22 @@
/* keyserver.h
* Copyright (C) 2001, 2002 Free Software Foundation, Inc.
*
- * This file is part of GNUPG.
+ * This file is part of GnuPG.
*
- * GNUPG is free software; you can redistribute it and/or modify
+ * 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,
+ * 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
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ * USA.
*/
#ifndef _KEYSERVER_H_
@@ -35,6 +36,7 @@
#define KEYSERVER_KEY_EXISTS 7 /* key already exists */
#define KEYSERVER_KEY_INCOMPLETE 8 /* key incomplete (EOF) */
#define KEYSERVER_UNREACHABLE 9 /* unable to contact keyserver */
+#define KEYSERVER_TIMEOUT 10 /* timeout while accessing keyserver */
/* Must be 127 due to shell internal magic. */
#define KEYSERVER_SCHEME_NOT_FOUND 127
diff --git a/include/memory.h b/include/memory.h
index 959f2999e..35719da62 100644
--- a/include/memory.h
+++ b/include/memory.h
@@ -21,6 +21,8 @@
#ifndef G10_MEMORY_H
#define G10_MEMORY_H
+#error this file should not be used anymore
+
#ifdef M_DEBUG
#ifndef STR
#define STR(v) #v
diff --git a/include/mpi.h b/include/mpi.h
index 424e591a0..b732923a2 100644
--- a/include/mpi.h
+++ b/include/mpi.h
@@ -30,6 +30,8 @@
#ifndef G10_MPI_H
#define G10_MPI_H
+#error this file should not be used anymore
+
#include <gcrypt.h>
#if 0
diff --git a/include/types.h b/include/types.h
index dff512061..6abd500e3 100644
--- a/include/types.h
+++ b/include/types.h
@@ -1,21 +1,22 @@
/* types.h - some common typedefs
* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
*
- * This file is part of GNUPG.
+ * This file is part of GnuPG.
*
- * GNUPG is free software; you can redistribute it and/or modify
+ * 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,
+ * 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
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ * USA.
*/
#ifndef G10_TYPES_H
diff --git a/include/util.h b/include/util.h
index ca5e5e431..c579c152e 100644
--- a/include/util.h
+++ b/include/util.h
@@ -20,7 +20,7 @@
#ifndef G10_UTIL_H
#define G10_UTIL_H
-#warning oops, using old util.h
+#error this file should not be used anymore
#if 0 /* Dont use it anymore */
#if defined (__MINGW32__) || defined (__CYGWIN32__)
diff --git a/include/zlib-riscos.h b/include/zlib-riscos.h
index fad556bcb..6a27b86ef 100644
--- a/include/zlib-riscos.h
+++ b/include/zlib-riscos.h
@@ -15,7 +15,8 @@
*
* 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
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ * USA.
*/
#ifndef G10_ZLIB_RISCOS_H
#define G10_ZLIB_RISCOS_H