aboutsummaryrefslogtreecommitdiffstats
path: root/g10
diff options
context:
space:
mode:
Diffstat (limited to 'g10')
-rw-r--r--g10/ChangeLog16
-rw-r--r--g10/Makefile.am19
-rw-r--r--g10/compress.c17
-rw-r--r--g10/cpr.c6
-rw-r--r--g10/decrypt.c5
-rw-r--r--g10/exec.c8
-rw-r--r--g10/gpg.c14
-rw-r--r--g10/keygen.c11
-rw-r--r--g10/keyring.c4
-rw-r--r--g10/main.h7
-rw-r--r--g10/misc.c17
11 files changed, 92 insertions, 32 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index fd1167e41..8e2d65552 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,19 @@
+2010-04-14 Werner Koch <[email protected]>
+
+ * cpr.c (myread) [W32CE]: Do not use raise.
+
+ * misc.c (check_compress_algo): Rewrite to handle the new HAVE_ZIP.
+ * compress.c (push_compress_filter2): Ditto.
+ (init_compress, do_compress, init_uncompress, do_uncompress)
+ (compress_filter) [!HAVE_ZIP]: Do not build.
+ * main.h (DEFAULT_COMPRESS_ALGO): Depend on HAVE_ZIP.
+ * keygen.c (keygen_set_std_prefs): Use check_compress_algo also
+ for ZIP and ZLIB.
+
+ * Makefile.am (install-exec-hook) [W32CE]: New.
+ (bin_PROGRAMS) [W32CE]: Do not build gpgv2.
+ (gpg2_LDADD): Add extra_syslibs.
+
2010-04-06 Werner Koch <[email protected]>
* openfile.c (mkdir): Remove.
diff --git a/g10/Makefile.am b/g10/Makefile.am
index b89ff8ee6..d0ed298a0 100644
--- a/g10/Makefile.am
+++ b/g10/Makefile.am
@@ -1,5 +1,5 @@
# Copyright (C) 1998, 1999, 2000, 2001, 2002,
-# 2003, 2006 Free Software Foundation, Inc.
+# 2003, 2006, 2010 Free Software Foundation, Inc.
#
# This file is part of GnuPG.
#
@@ -29,7 +29,10 @@ AM_CFLAGS = $(LIBGCRYPT_CFLAGS) $(LIBASSUAN_CFLAGS) $(GPG_ERROR_CFLAGS)
needed_libs = $(libcommon) ../gl/libgnu.a
-bin_PROGRAMS = gpg2 gpgv2
+bin_PROGRAMS = gpg2
+if !HAVE_W32CE_SYSTEM
+bin_PROGRAMS += gpgv2
+endif
noinst_PROGRAMS = $(module_tests)
TESTS = $(module_tests)
@@ -120,9 +123,9 @@ LDADD = $(needed_libs) ../common/libgpgrl.a \
$(ZLIBS) $(DNSLIBS) $(LIBREADLINE) \
$(LIBINTL) $(CAPLIBS) $(NETLIBS)
gpg2_LDADD = $(LDADD) $(LIBGCRYPT_LIBS) $(LIBASSUAN_LIBS) $(GPG_ERROR_LIBS) \
- $(LIBICONV)
+ $(LIBICONV) $(extra_sys_libs)
gpgv2_LDADD = $(LDADD) $(LIBGCRYPT_LIBS) $(LIBASSUAN_LIBS) $(GPG_ERROR_LIBS) \
- $(LIBICONV)
+ $(LIBICONV) $(extra_sys_libs)
t_common_ldadd =
module_tests = t-rmd160
@@ -139,3 +142,11 @@ install-data-local:
uninstall-local:
-@rm $(DESTDIR)$(pkgdatadir)/gpg-conf.skel
+
+
+# There has never been a gpg for WindowsCE, thus we don't need a gpg2 here
+if HAVE_W32CE_SYSTEM
+install-exec-hook:
+ mv -f $(DESTDIR)$(bindir)/gpg2$(EXEEXT) \
+ $(DESTDIR)$(bindir)/gpg$(EXEEXT)
+endif
diff --git a/g10/compress.c b/g10/compress.c
index 6a29c0a94..db9fedb64 100644
--- a/g10/compress.c
+++ b/g10/compress.c
@@ -1,6 +1,6 @@
/* compress.c - compress filter
* Copyright (C) 1998, 1999, 2000, 2001, 2002,
- * 2003, 2006 Free Software Foundation, Inc.
+ * 2003, 2006, 2010 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@@ -31,10 +31,12 @@
#include <unistd.h>
#include <assert.h>
#include <errno.h>
-#include <zlib.h>
-#if defined(__riscos__) && defined(USE_ZLIBRISCOS)
-# include "zlib-riscos.h"
-#endif
+#ifdef HAVE_ZIP
+# include <zlib.h>
+# if defined(__riscos__) && defined(USE_ZLIBRISCOS)
+# include "zlib-riscos.h"
+# endif
+#endif
#include "gpg.h"
#include "util.h"
@@ -55,6 +57,7 @@
int compress_filter_bz2( void *opaque, int control,
IOBUF a, byte *buf, size_t *ret_len);
+#ifdef HAVE_ZIP
static void
init_compress( compress_filter_context_t *zfx, z_stream *zs )
{
@@ -285,7 +288,7 @@ compress_filter( void *opaque, int control,
*(char**)buf = "compress_filter";
return rc;
}
-
+#endif /*HAVE_ZIP*/
static void
release_context (compress_filter_context_t *ctx)
@@ -337,10 +340,12 @@ push_compress_filter2(IOBUF out,compress_filter_context_t *zfx,
case COMPRESS_ALGO_NONE:
break;
+#ifdef HAVE_ZIP
case COMPRESS_ALGO_ZIP:
case COMPRESS_ALGO_ZLIB:
iobuf_push_filter2(out,compress_filter,zfx,rel);
break;
+#endif
#ifdef HAVE_BZIP2
case COMPRESS_ALGO_BZIP2:
diff --git a/g10/cpr.c b/g10/cpr.c
index cb4de6339..365295400 100644
--- a/g10/cpr.c
+++ b/g10/cpr.c
@@ -24,7 +24,9 @@
#include <string.h>
#include <errno.h>
#include <unistd.h>
-#include <signal.h>
+#ifdef HAVE_SIGNAL_H
+# include <signal.h>
+#endif
#include "gpg.h"
#include "util.h"
@@ -312,7 +314,9 @@ myread(int fd, void *buf, size_t count)
}
else { /* Ctrl-D not caught - do something reasonable */
#ifdef HAVE_DOSISH_SYSTEM
+#ifndef HAVE_W32CE_SYSTEM
raise (SIGINT); /* nothing to hangup under DOS */
+#endif
#else
raise (SIGHUP); /* no more input data */
#endif
diff --git a/g10/decrypt.c b/g10/decrypt.c
index 82eefcccc..870c21616 100644
--- a/g10/decrypt.c
+++ b/g10/decrypt.c
@@ -131,7 +131,12 @@ decrypt_message_fd (int input_fd, int output_fd)
return err;
}
+#ifdef HAVE_W32CE_SYSTEM
+#warning Ned to fix this
+ opt.outfp = NULL;
+#else
opt.outfp = fdopen (dup (output_fd), "wb");
+#endif
if (!opt.outfp)
{
char xname[64];
diff --git a/g10/exec.c b/g10/exec.c
index 8f26edadf..2803812dc 100644
--- a/g10/exec.c
+++ b/g10/exec.c
@@ -74,6 +74,9 @@ set_exec_path(const char *path) { return G10ERR_GENERAL; }
static int
w32_system(const char *command)
{
+#ifdef HAVE_W32CE_SYSTEM
+#warning Change this code to use common/exechelp.c
+#else
PROCESS_INFORMATION pi;
STARTUPINFO si;
char *string;
@@ -99,6 +102,7 @@ w32_system(const char *command)
xfree(string);
return 0;
+#endif
}
#endif
@@ -106,6 +110,9 @@ w32_system(const char *command)
int
set_exec_path(const char *path)
{
+#ifdef HAVE_W32CE_SYSTEM
+#warning Change this code to use common/exechelp.c
+#else
char *p;
p=xmalloc(5+strlen(path)+1);
@@ -123,6 +130,7 @@ set_exec_path(const char *path)
return G10ERR_GENERAL;
else
return 0;
+#endif
}
/* Makes a temp directory and filenames */
diff --git a/g10/gpg.c b/g10/gpg.c
index 9f5a51540..0d94969df 100644
--- a/g10/gpg.c
+++ b/g10/gpg.c
@@ -1242,7 +1242,7 @@ rm_group(char *name)
Returns true if the item is unsafe. */
static int
-check_permissions(const char *path,int item)
+check_permissions (const char *path, int item)
{
#if defined(HAVE_STAT) && !defined(HAVE_DOSISH_SYSTEM)
static int homedir_cache=-1;
@@ -1428,9 +1428,11 @@ check_permissions(const char *path,int item)
return ret;
-#endif /* HAVE_STAT && !HAVE_DOSISH_SYSTEM */
-
+#else /*!(HAVE_STAT && !HAVE_DOSISH_SYSTEM)*/
+ (void)path;
+ (void)item;
return 0;
+#endif /*!(HAVE_STAT && !HAVE_DOSISH_SYSTEM)*/
}
@@ -4028,8 +4030,10 @@ main (int argc, char **argv)
if( argc > 1 )
wrong_args(_("[filename]"));
/* Issue some output for the unix newbie */
- if( !fname && !opt.outfile && isatty( fileno(stdin) )
- && isatty( fileno(stdout) ) && isatty( fileno(stderr) ) )
+ if (!fname && !opt.outfile
+ && gnupg_isatty (fileno (stdin))
+ && gnupg_isatty (fileno (stdout))
+ && gnupg_isatty (fileno (stderr)))
log_info(_("Go ahead and type your message ...\n"));
a = iobuf_open(fname);
diff --git a/g10/keygen.c b/g10/keygen.c
index 5b625dba1..836b559f6 100644
--- a/g10/keygen.c
+++ b/g10/keygen.c
@@ -1,6 +1,6 @@
/* keygen.c - generate a key pair
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- * 2006, 2007, 2009 Free Software Foundation, Inc.
+ * 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@@ -374,15 +374,14 @@ keygen_set_std_prefs (const char *string,int personal)
if (!openpgp_md_test_algo (DIGEST_ALGO_SHA224))
strcat (dummy_string, "H11 ");
-
- /* ZLIB */
- strcat(dummy_string,"Z2 ");
+ if(!check_compress_algo(COMPRESS_ALGO_ZLIB))
+ strcat(dummy_string,"Z2 ");
if(!check_compress_algo(COMPRESS_ALGO_BZIP2))
strcat(dummy_string,"Z3 ");
- /* ZIP */
- strcat(dummy_string,"Z1");
+ if(!check_compress_algo(COMPRESS_ALGO_ZIP))
+ strcat(dummy_string,"Z1");
string=dummy_string;
}
diff --git a/g10/keyring.c b/g10/keyring.c
index bef9b932b..ab0316065 100644
--- a/g10/keyring.c
+++ b/g10/keyring.c
@@ -1274,7 +1274,7 @@ rename_tmp_file (const char *bakfname, const char *tmpfname,
if (!secret)
{
#if defined(HAVE_DOSISH_SYSTEM) || defined(__riscos__)
- remove (bakfname);
+ gnupg_remove (bakfname);
#endif
if (rename (fname, bakfname) )
{
@@ -1287,7 +1287,7 @@ rename_tmp_file (const char *bakfname, const char *tmpfname,
/* then rename the file */
#if defined(HAVE_DOSISH_SYSTEM) || defined(__riscos__)
- remove( fname );
+ gnupg_remove( fname );
#endif
if (secret)
unregister_secured_file (fname);
diff --git a/g10/main.h b/g10/main.h
index 781a49f38..540d9b1d9 100644
--- a/g10/main.h
+++ b/g10/main.h
@@ -33,8 +33,13 @@
#define DEFAULT_CIPHER_ALGO CIPHER_ALGO_CAST5
#define DEFAULT_DIGEST_ALGO DIGEST_ALGO_SHA1
-#define DEFAULT_COMPRESS_ALGO COMPRESS_ALGO_ZIP
#define DEFAULT_S2K_DIGEST_ALGO DIGEST_ALGO_SHA1
+#ifdef HAVE_ZIP
+# define DEFAULT_COMPRESS_ALGO COMPRESS_ALGO_ZIP
+#else
+# define DEFAULT_COMPRESS_ALGO COMPRESS_ALGO_NONE
+#endif
+
#define S2K_DIGEST_ALGO (opt.s2k_digest_algo?opt.s2k_digest_algo:DEFAULT_S2K_DIGEST_ALGO)
diff --git a/g10/misc.c b/g10/misc.c
index 5e0ba9449..eb3eceee9 100644
--- a/g10/misc.c
+++ b/g10/misc.c
@@ -905,15 +905,18 @@ string_to_compress_algo(const char *string)
int
check_compress_algo(int algo)
{
+ switch (algo)
+ {
+ case 0: return 0;
+#ifdef HAVE_ZIP
+ case 1:
+ case 2: return 0;
+#endif
#ifdef HAVE_BZIP2
- if(algo>=0 && algo<=3)
- return 0;
-#else
- if(algo>=0 && algo<=2)
- return 0;
+ case 3: return 0;
#endif
-
- return G10ERR_COMPR_ALGO;
+ default: return G10ERR_COMPR_ALGO;
+ }
}
int