From 02ae08d6ef94c461c7aa82f50fb0c111cc8ead82 Mon Sep 17 00:00:00 2001 From: Stefan Bellon Date: Sun, 28 Dec 2003 14:12:16 +0000 Subject: [PATCH] cleaned up RISC OS code and removed lots of unnecessary stuff --- cipher/ChangeLog | 8 ++ cipher/blowfish.c | 8 -- cipher/rndriscos.c | 5 +- cipher/twofish.c | 27 ------ g10/ChangeLog | 8 ++ g10/g10.c | 5 -- g10/gpgv.c | 8 -- g10/plaintext.c | 11 ++- include/ChangeLog | 4 + include/util.h | 8 -- keyserver/ChangeLog | 5 ++ keyserver/gpgkeys_hkp.c | 8 -- keyserver/gpgkeys_ldap.c | 8 -- scripts/ChangeLog | 4 + scripts/build-riscos | 2 - scripts/conf-riscos/Makefile | 124 ++++++++++++++++---------- scripts/conf-riscos/include/config.h | 44 +++++++-- scripts/conf-riscos/include/g10defs.h | 2 + tools/ChangeLog | 5 ++ tools/gpgsplit.c | 11 +-- util/ChangeLog | 8 ++ util/memory.c | 3 + util/riscos.c | 37 ++++---- 23 files changed, 197 insertions(+), 156 deletions(-) diff --git a/cipher/ChangeLog b/cipher/ChangeLog index a82966200..beda87731 100644 --- a/cipher/ChangeLog +++ b/cipher/ChangeLog @@ -1,3 +1,11 @@ +2003-12-28 Stefan Bellon + + * rndriscos.c (rndriscos_gather_random) [__riscos__]: Declare + variable outside loop. + + * blowfish.c, twofish.c [__riscos__]: Removal of unnecessary + #ifdef __riscos__ sections. + 2003-12-17 David Shaw * dsa.h, dsa.c (dsa_verify), elgamal.h, elgamal.c (elg_verify), diff --git a/cipher/blowfish.c b/cipher/blowfish.c index 409194c52..063fbc910 100644 --- a/cipher/blowfish.c +++ b/cipher/blowfish.c @@ -502,10 +502,6 @@ selftest(void) return NULL; } -#ifdef __riscos__ -/* need to switch off CSE optimisation for Norcroft C (Acorn/Pace) */ -#pragma no_optimise_cse -#endif /* __riscos__ */ static int do_bf_setkey( BLOWFISH_context *c, byte *key, unsigned keylen ) @@ -590,10 +586,6 @@ do_bf_setkey( BLOWFISH_context *c, byte *key, unsigned keylen ) return 0; } -#ifdef __riscos__ -#pragma optimise_cse -#endif /* __riscos__ */ - static int bf_setkey( BLOWFISH_context *c, byte *key, unsigned keylen ) { diff --git a/cipher/rndriscos.c b/cipher/rndriscos.c index ee35beadd..a0fbbc228 100644 --- a/cipher/rndriscos.c +++ b/cipher/rndriscos.c @@ -27,7 +27,6 @@ #include #include "util.h" -#define CryptRandom_Byte 0x51980 static const char * const cryptrandom_path[] = { "GnuPG:CryptRandom", @@ -47,7 +46,7 @@ rndriscos_gather_random(void (*add)(const void*, size_t, int), int requester, size_t length, int level) { static int rndriscos_initialized = 0; - int n; + int n, nbytes; byte buffer[768]; if (!rndriscos_initialized) @@ -55,7 +54,7 @@ rndriscos_gather_random(void (*add)(const void*, size_t, int), int requester, cryptrandom_path, 1); while (length) { - int nbytes = length < sizeof(buffer) ? length : sizeof(buffer); + nbytes = length < sizeof(buffer) ? length : sizeof(buffer); for (n = 0; n < nbytes; ++n) if (_swix(CryptRandom_Byte, _OUT(0), &buffer[n])) diff --git a/cipher/twofish.c b/cipher/twofish.c index a6a571ff0..554b4aa3e 100644 --- a/cipher/twofish.c +++ b/cipher/twofish.c @@ -561,11 +561,6 @@ burn_stack (int bytes) /* Perform the key setup. Note that this works only with 128- and 256-bit * keys, despite the API that looks like it might support other sizes. */ -#ifdef __riscos__ -/* need to switch off CSE optimisation for Norcroft C (Acorn/Pace) */ -#pragma no_optimise_cse -#endif /* __riscos__ */ - static int do_twofish_setkey (TWOFISH_context *ctx, const byte *key, unsigned int keylen) { @@ -701,10 +696,6 @@ do_twofish_setkey (TWOFISH_context *ctx, const byte *key, unsigned int keylen) return 0; } -#ifdef __riscos__ -#pragma optimise_cse -#endif /* __riscos__ */ - static int twofish_setkey (TWOFISH_context *ctx, const byte *key, unsigned int keylen) { @@ -775,11 +766,6 @@ twofish_setkey (TWOFISH_context *ctx, const byte *key, unsigned int keylen) /* Encrypt one block. in and out may be the same. */ -#ifdef __riscos__ -/* need to switch off CSE optimisation for Norcroft C (Acorn/Pace) */ -#pragma no_optimise_cse -#endif /* __riscos__ */ - static void do_twofish_encrypt (const TWOFISH_context *ctx, byte *out, const byte *in) { @@ -812,10 +798,6 @@ do_twofish_encrypt (const TWOFISH_context *ctx, byte *out, const byte *in) OUTUNPACK (3, b, 7); } -#ifdef __riscos__ -#pragma optimise_cse -#endif /* __riscos__ */ - static void twofish_encrypt (const TWOFISH_context *ctx, byte *out, const byte *in) { @@ -825,11 +807,6 @@ twofish_encrypt (const TWOFISH_context *ctx, byte *out, const byte *in) /* Decrypt one block. in and out may be the same. */ -#ifdef __riscos__ -/* need to switch off CSE optimisation for Norcroft C (Acorn/Pace) - bug */ -#pragma no_optimise_cse -#endif /* __riscos__ */ - static void do_twofish_decrypt (const TWOFISH_context *ctx, byte *out, const byte *in) { @@ -862,10 +839,6 @@ do_twofish_decrypt (const TWOFISH_context *ctx, byte *out, const byte *in) OUTUNPACK (3, d, 3); } -#ifdef __riscos__ -#pragma optimise_cse -#endif /* __riscos__ */ - static void twofish_decrypt (const TWOFISH_context *ctx, byte *out, const byte *in) { diff --git a/g10/ChangeLog b/g10/ChangeLog index f2a5d23e4..76e72b072 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,11 @@ +2003-12-28 Stefan Bellon + + * plaintext.c (handle_plaintext) [__riscos__]: Don't mangle + filename if the user specified it. + + * g10.c, gpgv.c [__riscos__]: Removal of unnecessary #ifdef + __riscos__ sections. + 2003-12-27 David Shaw * keyserver.c (strip_leading_space, get_arg): New. diff --git a/g10/g10.c b/g10/g10.c index 2486af3db..531506284 100644 --- a/g10/g10.c +++ b/g10/g10.c @@ -675,10 +675,6 @@ static void add_notation_data( const char *string, int which ); static void add_policy_url( const char *string, int which ); static void add_keyserver_url( const char *string, int which ); -#ifdef __riscos__ -RISCOS_GLOBAL_STATICS("GnuPG Heap") -#endif /* __riscos__ */ - const char * strusage( int level ) { @@ -1191,7 +1187,6 @@ main( int argc, char **argv ) #endif #ifdef __riscos__ - riscos_global_defaults(); opt.lock_once = 1; #endif /* __riscos__ */ diff --git a/g10/gpgv.c b/g10/gpgv.c index c01263fe4..e5d48760e 100644 --- a/g10/gpgv.c +++ b/g10/gpgv.c @@ -78,10 +78,6 @@ static ARGPARSE_OPTS opts[] = { int g10_errors_seen = 0; -#ifdef __riscos__ -RISCOS_GLOBAL_STATICS("GnuPG (gpgv) Heap") -#endif /* __riscos__ */ - const char * strusage( int level ) { @@ -140,10 +136,6 @@ main( int argc, char **argv ) STRLIST nrings=NULL; unsigned configlineno; -#ifdef __riscos__ - riscos_global_defaults(); -#endif /* __riscos__ */ - log_set_name("gpgv"); init_signals(); i18n_init(); diff --git a/g10/plaintext.c b/g10/plaintext.c index 89043026c..6aad0ef5a 100644 --- a/g10/plaintext.c +++ b/g10/plaintext.c @@ -114,10 +114,13 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx, goto leave; } #else /* __riscos__ */ - /* Convert all '.' in fname to '/' -- we don't create directories! */ - for( c=0; fname[c]; ++c ) - if( fname[c] == '.' ) - fname[c] = '/'; + /* If no output filename was given, i.e. we constructed it, + convert all '.' in fname to '/' but not vice versa as + we don't create directories! */ + if( !opt.outfile ) + for( c=0; fname[c]; ++c ) + if( fname[c] == '.' ) + fname[c] = '/'; if( fp || nooutput ) ; diff --git a/include/ChangeLog b/include/ChangeLog index dad9a79d3..d75207fa9 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,7 @@ +2003-12-28 Stefan Bellon + + * util.h [__riscos__]: Removal of unnecessary RISC OS stuff. + 2003-12-17 David Shaw * mpi.h (gcry_mpi, mpi_get_opaque, mpi_set_opaque): Make nbits and diff --git a/include/util.h b/include/util.h index 6492b012b..da555304f 100644 --- a/include/util.h +++ b/include/util.h @@ -287,14 +287,6 @@ int asprintf (char **buf, const char *fmt, ...); /******* RISC OS stuff ***********/ #ifdef __riscos__ -/* needed for strcasecmp() */ -#include -/* needed for filename munging */ -#include -/* needed for image file system feature */ -#include -void riscos_global_defaults(void); -#define RISCOS_GLOBAL_STATICS(a) const char *__dynamic_da_name = (a); int riscos_load_module(const char *name, const char * const path[], int fatal); int riscos_get_filetype_from_string(const char *string, int len); int riscos_get_filetype(const char *filename); diff --git a/keyserver/ChangeLog b/keyserver/ChangeLog index d58e505ad..f4e2387a8 100644 --- a/keyserver/ChangeLog +++ b/keyserver/ChangeLog @@ -1,3 +1,8 @@ +2003-12-28 Stefan Bellon + + * gpgkeys_hkp.c, gpgkeys_ldap.c [__riscos__]: Removal of + unnecessary #ifdef __riscos__ sections. + 2003-11-27 Werner Koch * gpgkeys_hkp.c (get_key): Fixed invalid use of fprintf without diff --git a/keyserver/gpgkeys_hkp.c b/keyserver/gpgkeys_hkp.c index 9e917578a..f8e9bc59b 100644 --- a/keyserver/gpgkeys_hkp.c +++ b/keyserver/gpgkeys_hkp.c @@ -55,10 +55,6 @@ struct keylist struct keylist *next; }; -#ifdef __riscos__ -RISCOS_GLOBAL_STATICS("HKP Keyfetcher Heap") -#endif /* __riscos__ */ - int urlencode_filter( void *opaque, int control, IOBUF a, byte *buf, size_t *ret_len) @@ -748,10 +744,6 @@ main(int argc,char *argv[]) int failed=0; struct keylist *keylist=NULL,*keyptr=NULL; -#ifdef __riscos__ - riscos_global_defaults(); -#endif - console=stderr; while((arg=getopt(argc,argv,"hVo:"))!=-1) diff --git a/keyserver/gpgkeys_ldap.c b/keyserver/gpgkeys_ldap.c index ff42eff7b..7847292c5 100644 --- a/keyserver/gpgkeys_ldap.c +++ b/keyserver/gpgkeys_ldap.c @@ -60,10 +60,6 @@ struct keylist struct keylist *next; }; -#ifdef __riscos__ -RISCOS_GLOBAL_STATICS("LDAP Keyfetcher Heap") -#endif /* __riscos__ */ - int ldap_err_to_gpg_err(int err) { @@ -808,10 +804,6 @@ main(int argc,char *argv[]) LDAPMessage *res; struct keylist *keylist=NULL,*keyptr=NULL; -#ifdef __riscos__ - riscos_global_defaults(); -#endif - console=stderr; while((arg=getopt(argc,argv,"hVo:"))!=-1) diff --git a/scripts/ChangeLog b/scripts/ChangeLog index 07fd87f74..64d078906 100644 --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2003-12-28 Stefan Bellon + + * build-riscos, conf-riscos/*: Updated to reflect latest changes. + 2003-10-25 Werner Koch * autogen.sh: Updated required versions and add -I m4 to aclocal. diff --git a/scripts/build-riscos b/scripts/build-riscos index c255a7827..47b38bd3d 100644 --- a/scripts/build-riscos +++ b/scripts/build-riscos @@ -2,8 +2,6 @@ | for the RISC OS version into the correct places. | It won't run on anything other than RISC OS -- I think ;-) -copy .conf-riscos.cipher.c.construct .^.cipher.c.construct ~cf~v -copy .conf-riscos.cipher.c.constructv .^.cipher.c.constructv ~cf~v copy .conf-riscos.include.h.config .^.include.h.config ~cf~v copy .conf-riscos.include.h.g10defs .^.include.h.g10defs ~cf~v copy .conf-riscos.Makefile .^.Makefile ~cf~v diff --git a/scripts/conf-riscos/Makefile b/scripts/conf-riscos/Makefile index 8fdaff878..2a20e08fb 100644 --- a/scripts/conf-riscos/Makefile +++ b/scripts/conf-riscos/Makefile @@ -1,26 +1,21 @@ -# Makefile for the RISC OS version of GnuPG +# Makefile for the RISC OS development version of GnuPG +BRANCH=devel + CC=cc LINK=link AR=libfile AS=objasm MAKE=amu DEPEND=-depend !Depend -LIBLDAP=^.^.openldap-2/0/18 +LIBLDAP=^.^.openldap-2/0/27 +ZLIB=zlib.zlib -# 26-bit configuration -CC_FLAGS=-Wpc -zo -fw -apcs 3/26bit/fpe2 -throwback -Otime -IUnix:,include,mpi,intl,util,zlib,$(LIBLDAP).include,^.^.regex-0/12 -JUnix: -D__riscos__ -DHAVE_CONFIG_H -DNO_ASM -UIS_MODULE -DVERSION="\"$(GnuPG$Version)\"" $(GnuPG$DevDefine) +CC_FLAGS=-Wdp -throwback -Otime -Iinclude,mpi,intl,util,zlib,$(LIBLDAP).include,^.^.regex-0/12,Unix: -JUnix: -D__riscos__ -DHAVE_CONFIG_H -DNO_ASM -UIS_MODULE -DVERSION="\"$(GnuPG$Version)\"" -DSAFE_VERSION="\"$(GnuPG$SafeVersion)\"" -DIS_DEVELOPMENT_VERSION AR_FLAGS= -AS_FLAGS=-apcs 3/26bit -throwback -predefine "ARMv4 SETA 0" +AS_FLAGS=-throwback -predefine "ARMv4 SETA 0" LD_FLAGS= UNIXLIB=Unix:o.UnixLib -# 32-bit configuration (not yet fully working!) -#CC_FLAGS=-Wpc -zo -fw -apcs 3/32bit/fpe3 -throwback -Otime -IUnix:,include,mpi,intl,util,zlib,$(LIBLDAP).include,^.^.regex-0/12 -JUnix: -D__riscos__ -DHAVE_CONFIG_H -DNO_ASM -UIS_MODULE -DVERSION="\"$(GnuPG$Version)\"" $(GnuPG$DevDefine) -#AR_FLAGS= -#AS_FLAGS=-apcs 3/32bit -throwback -predefine "ARMv4 SETA 0" -#LD_FLAGS= -#UNIXLIB=Unix:o.UnixLib32 - CIPHER_OBJS=cipher.o.blowfish \ cipher.o.cast5 \ cipher.o.cipher \ @@ -39,8 +34,9 @@ CIPHER_OBJS=cipher.o.blowfish \ cipher.o.rndriscos \ cipher.o.rsa \ cipher.o.sha1 \ + cipher.o.sha256 \ + cipher.o.sha512 \ cipher.o.smallprime \ - cipher.o.tiger32 \ cipher.o.twofish GETTEXT_OBJS=intl.o.bindtextdom \ intl.o.dcgettext \ @@ -86,9 +82,23 @@ UTIL_OBJS=util.o.argparse \ util.o.memory \ util.o.miscutil \ util.o.secmem \ + util.o.srv \ util.o.strgutil \ util.o.ttyio \ util.o.riscos +ZLIB_OBJS=zlib.o.adler32 \ + zlib.o.compress \ + zlib.o.crc32 \ + zlib.o.deflate \ + zlib.o.infblock \ + zlib.o.infcodes \ + zlib.o.inffast \ + zlib.o.inflate \ + zlib.o.inftrees \ + zlib.o.infutil \ + zlib.o.trees \ + zlib.o.uncompr \ + zlib.o.zutil G10_OBJS=g10.o.armor \ g10.o.build-packet \ g10.o.cipher \ @@ -124,6 +134,7 @@ G10_OBJS=g10.o.armor \ g10.o.pipemode \ g10.o.pkclist \ g10.o.plaintext \ + g10.o.progress \ g10.o.pubkey-enc \ g10.o.revoke \ g10.o.seckey-cert \ @@ -155,6 +166,7 @@ GPGV_OBJS=g10.o.armor \ g10.o.openfile \ g10.o.parse-packet \ g10.o.plaintext \ + g10.o.progress \ g10.o.seskey \ g10.o.sig-check \ g10.o.signal \ @@ -182,7 +194,8 @@ GPGV_OBJS=g10.o.armor \ cipher.o.rmd160 \ cipher.o.rsa \ cipher.o.sha1 \ - cipher.o.tiger32 \ + cipher.o.sha256 \ + cipher.o.sha512 \ mpi.mpi GPGKEYS_OBJS=util.util \ intl.gettext @@ -214,20 +227,20 @@ intl.gettext: $(GETTEXT_OBJS) mpi.mpi: $(MPI_OBJS) $(AR) $(AR_FLAGS) -c -o mpi.mpi $(MPI_OBJS) -tools.gpgsplit: tools.o.gpgsplit util.util intl.gettext - $(LINK) $(LD_FLAGS) -o tools.gpgsplit tools.o.gpgsplit util.util intl.gettext $(UNIXLIB) +tools.gpgsplit: tools.o.gpgsplit util.util intl.gettext $(ZLIB) + $(LINK) $(LD_FLAGS) -o tools.gpgsplit tools.o.gpgsplit util.util intl.gettext $(ZLIB) $(UNIXLIB) -squeeze tools.gpgsplit - -copy tools.gpgsplit ADFS::A5.$.tmp.!GnuPG.gpgsplit ~CF~V + -copy tools.gpgsplit ADFS::A4.$.tmp.!GnuPG.gpgsplit ~CF~V keyserver.gpgkeys_ldap: keyserver.o.gpgkeys_ldap $(GPGKEYS_OBJS) $(LIBLDAP).libraries.libldap.libldap $(LINK) $(LD_FLAGS) -o keyserver.gpgkeys_ldap keyserver.o.gpgkeys_ldap $(GPGKEYS_OBJS) $(LIBLDAP).libraries.libldap.libldap $(UNIXLIB) -squeeze keyserver.gpgkeys_ldap - -copy keyserver.gpgkeys_ldap ADFS::A5.$.tmp.!GnuPG.gpgkeys_ldap ~CF~V + -copy keyserver.gpgkeys_ldap ADFS::A4.$.tmp.!GnuPG.gpgkeys_ldap ~CF~V keyserver.gpgkeys_hkp: keyserver.o.gpgkeys_hkp $(GPGKEYS_OBJS) $(LINK) $(LD_FLAGS) -o keyserver.gpgkeys_hkp keyserver.o.gpgkeys_hkp $(GPGKEYS_OBJS) $(UNIXLIB) -squeeze keyserver.gpgkeys_hkp - -copy keyserver.gpgkeys_hkp ADFS::A5.$.tmp.!GnuPG.gpgkeys_hkp ~CF~V + -copy keyserver.gpgkeys_hkp ADFS::A4.$.tmp.!GnuPG.gpgkeys_hkp ~CF~V riscos.jpegview.jpegview: -dir riscos.jpegview @@ -237,13 +250,16 @@ riscos.jpegview.jpegview: util.util: $(UTIL_OBJS) $(AR) $(AR_FLAGS) -c -o util.util $(UTIL_OBJS) -g10.gpg: g10.o.g10 $(G10_OBJS) cipher.o.idea cipher.cipher intl.gettext mpi.mpi util.util BUILD - $(LINK) $(LD_FLAGS) -o g10.gpg g10.o.g10 $(G10_OBJS) cipher.o.idea cipher.cipher intl.gettext mpi.mpi util.util $(UNIXLIB) - -copy g10.gpg ADFS::A5.$.tmp.!GnuPG.gpg ~CFR~V +zlib.zlib: $(ZLIB_OBJS) + $(AR) $(AR_FLAGS) -c -o zlib.zlib $(ZLIB_OBJS) -g10.gpgv: $(GPGV_OBJS) intl.gettext BUILD - $(LINK) $(LD_FLAGS) -o g10.gpgv $(GPGV_OBJS) intl.gettext $(UNIXLIB) - -copy g10.gpgv ADFS::A5.$.tmp.!GnuPG.gpgv ~CFR~V +g10.gpg: g10.o.g10 $(G10_OBJS) cipher.o.idea cipher.cipher intl.gettext mpi.mpi util.util $(ZLIB) BUILD + $(LINK) $(LD_FLAGS) -o g10.gpg g10.o.g10 $(G10_OBJS) cipher.o.idea cipher.cipher intl.gettext mpi.mpi util.util $(ZLIB) $(UNIXLIB) + -copy g10.gpg ADFS::A4.$.tmp.!GnuPG.gpg ~CFR~V + +g10.gpgv: $(GPGV_OBJS) intl.gettext $(ZLIB) BUILD + $(LINK) $(LD_FLAGS) -o g10.gpgv $(GPGV_OBJS) intl.gettext $(ZLIB) $(UNIXLIB) + -copy g10.gpgv ADFS::A4.$.tmp.!GnuPG.gpgv ~CFR~V g10.gpgpart: $(G10_OBJS) BUILD copy $(UNIXLIB) g10.gpgpart ~CF~V @@ -251,6 +267,9 @@ g10.gpgpart: $(G10_OBJS) BUILD $(AR) $(AR_FLAGS) -i g10.gpgpart $(GETTEXT_OBJS) $(AR) $(AR_FLAGS) -i g10.gpgpart $(MPI_OBJS) $(AR) $(AR_FLAGS) -i g10.gpgpart $(UTIL_OBJS) +ifdef ZLIB + $(AR) $(AR_FLAGS) -i g10.gpgpart $(ZLIB_OBJS) +endif $(AR) $(AR_FLAGS) -i g10.gpgpart $(G10_OBJS) select-idea-src: @@ -264,13 +283,12 @@ select-gpl-src: distrib.gnupgsrc/zip: select-gpl-src -zip -9@ distrib.gnupgsrc/zip < distrib.resources.distfiles -distrib.gnupg/zip: distrib.gpl-bin.!GnuPG.JPEGview distrib.gpl-bin.!GnuPG.gpgsplit distrib.private.!GnuPG.gpgkeys_hkp distrib.gpl-bin.!GnuPG.gpg distrib.gpl-bin.!GnuPG.gpgv select-gpl-src +distrib.gnupg/zip: distrib.gpl-bin.!GnuPG.JPEGview distrib.gpl-bin.!GnuPG.gpgsplit distrib.gpl-bin.!GnuPG.gpgkeys_hkp distrib.gpl-bin.!GnuPG.gpg distrib.gpl-bin.!GnuPG.gpgv select-gpl-src -copy distrib.resources.History distrib.gpl-bin.History ~CFR~V -copy distrib.resources.Upgrading distrib.gpl-bin.Upgrading ~CFR~V -copy distrib.resources.ReadMe_bin distrib.gpl-bin.!ReadMe1st ~CFR~V -copy distrib.resources.!GnuPG distrib.gpl-bin.!GnuPG ~CFR~V -copy distrib.resources.!GnuPGUser distrib.gpl-bin.!GnuPGUser ~CFR~V - -copy distrib.resources.!System distrib.gpl-bin.!System ~CFR~V -copy distrib.resources.orig_docs distrib.gpl-bin.orig_docs ~CFR~V -dir distrib.gpl-bin -zip -r9 ^.gnupg/zip * @@ -284,7 +302,6 @@ distrib.gnupgdev/zip: distrib.private.!GnuPG.JPEGview distrib.private.!GnuPG.gpg -copy distrib.resources.ReadMe_bin distrib.private.!ReadMe1st ~CFR~V -copy distrib.resources.!GnuPG distrib.private.!GnuPG ~CFR~V -copy distrib.resources.!GnuPGUser distrib.private.!GnuPGUser ~CFR~V - -copy distrib.resources.!System distrib.private.!System ~CFR~V -copy distrib.resources.orig_docs distrib.private.orig_docs ~CFR~V -dir distrib.private -zip -r9 ^.gnupgdev/zip * @@ -376,6 +393,10 @@ clean-util: -ifthere util.o.* then wipe util.o.* ~CFR~V -ifthere util.util then wipe util.util ~CFR~V +clean-zlib: + -ifthere zlib.o.* then wipe zlib.o.* ~CFR~V + -ifthere zlib.zlib then wipe zlib.zlib ~CFR~V + clean-dist: -ifthere distrib.*/zip then wipe distrib.*/zip ~CFR~V @@ -408,7 +429,7 @@ clean-version: -ifthere g10.gpgv then wipe g10.gpgv ~CFR~V -ifthere g10.gpgpart then wipe g10.gpgpart ~CFR~V -clean: clean-dist clean-cipher clean-intl clean-mpi clean-util clean-g10 clean-keyserver clean-tools clean-riscos +clean: clean-dist clean-cipher clean-intl clean-mpi clean-util clean-zlib clean-g10 clean-keyserver clean-tools clean-riscos g10.o.armor: BUILD $(CC) $(CC_FLAGS) $(DEPEND) -c -o g10.o.armor g10.c.armor @@ -432,6 +453,11 @@ dev: clean-version $(MAKE) fast-dev fast-dev: BUILD +ifdef USE_ZLIBRISCOS + zlib-riscos-use +else + zlib-riscos-nouse +endif setver configure/ac AC_INIT(gnupg, , dev wipe distrib.private.!GnuPG.gpg* ~CFR~V -$(MAKE) keyserver.gpgkeys_ldap @@ -441,6 +467,11 @@ fast-dev: BUILD rename distrib.gnupgdev/zip .private.gnupgdev/zip dist: BUILD clean-version tools.gpgsplit +ifdef USE_ZLIBRISCOS + zlib-riscos-use +else + zlib-riscos-nouse +endif setver configure/ac AC_INIT(gnupg, , dist wipe distrib.gpl-bin.!GnuPG.gpg* ~CFR~V $(MAKE) distrib.gnupg/zip @@ -452,26 +483,27 @@ dist: BUILD clean-version tools.gpgsplit $(MAKE) distrib.gnupgintl/zip $(MAKE) distrib.gnupgldap/zip $(MAKE) select-idea-src - ifthere .archives.gnupg/zip then wipe .archives.gnupg/zip ~CFR~V + ifthere .archives.gnupg-$(BRANCH).gnupg/zip then wipe .archives.gnupg-$(BRANCH).gnupg/zip ~CFR~V ifthere .private.gnupgdev/zip then wipe .private.gnupgdev/zip ~CFR~V - ifthere .archives.gnupgidea/zip then wipe .archives.gnupgidea/zip ~CFR~V - ifthere .archives.gnupgpart/zip then wipe .archives.gnupgpart/zip ~CFR~V - ifthere .archives.gnupgsrc/zip then wipe .archives.gnupgsrc/zip ~CFR~V - ifthere .archives.gnupgintl/zip then wipe .archives.gnupgintl/zip ~CFR~V - ifthere .archives.gnupgldap/zip then wipe .archives.gnupgldap/zip ~CFR~V - ifthere .gnupg_history/txt then wipe .gnupg_history/txt ~CFR~V - ifthere .gnupg_news/txt then wipe .gnupg_news/txt ~CFR~V + ifthere .archives.gnupg-$(BRANCH).gnupgidea/zip then wipe .archives.gnupg-$(BRANCH).gnupgidea/zip ~CFR~V + ifthere .archives.gnupg-$(BRANCH).gnupgpart/zip then wipe .archives.gnupg-$(BRANCH).gnupgpart/zip ~CFR~V + ifthere .archives.gnupg-$(BRANCH).gnupgsrc/zip then wipe .archives.gnupg-$(BRANCH).gnupgsrc/zip ~CFR~V + ifthere .archives.gnupg-$(BRANCH).gnupgintl/zip then wipe .archives.gnupg-$(BRANCH).gnupgintl/zip ~CFR~V + ifthere .archives.gnupg-$(BRANCH).gnupgldap/zip then wipe .archives.gnupg-$(BRANCH).gnupgldap/zip ~CFR~V + ifthere .archives.gnupg-$(BRANCH).gnupg_history/txt then wipe .archives.gnupg-$(BRANCH).gnupg_history/txt ~CFR~V + ifthere .archives.gnupg-$(BRANCH).gnupg_news/txt then wipe .archives.gnupg-$(BRANCH).gnupg_news/txt ~CFR~V rename distrib.gnupgdev/zip .private.gnupgdev/zip - rename distrib.gnupg/zip .archives.gnupg/zip - rename distrib.gnupgidea/zip .archives.gnupgidea/zip - rename distrib.gnupgpart/zip .archives.gnupgpart/zip - rename distrib.gnupgsrc/zip .archives.gnupgsrc/zip - rename distrib.gnupgintl/zip .archives.gnupgintl/zip - rename distrib.gnupgldap/zip .archives.gnupgldap/zip - copy distrib.resources.History .gnupg_history/txt ~CFR~V - copy distrib.resources.orig_docs.NEWS .gnupg_news/txt ~CFR~V + rename distrib.gnupg/zip .archives.gnupg-$(BRANCH).gnupg/zip + rename distrib.gnupgidea/zip .archives.gnupg-$(BRANCH).gnupgidea/zip + rename distrib.gnupgpart/zip .archives.gnupg-$(BRANCH).gnupgpart/zip + rename distrib.gnupgsrc/zip .archives.gnupg-$(BRANCH).gnupgsrc/zip + rename distrib.gnupgintl/zip .archives.gnupg-$(BRANCH).gnupgintl/zip + rename distrib.gnupgldap/zip .archives.gnupg-$(BRANCH).gnupgldap/zip + copy distrib.resources.History .archives.gnupg-$(BRANCH).gnupg_history/txt ~CFR~V + copy distrib.resources.orig_docs.NEWS .archives.gnupg-$(BRANCH).gnupg_news/txt ~CFR~V unset GnuPG$DevDefine unset GnuPG$Version - updatesigs .archives --secring adfs::ap.$.secring/gpg + unset GnuPG$SafeVersion + updatesigs .archives.gnupg-$(BRANCH) --secring adfs::pgp.$.secring/gpg # Dynamic dependencies: diff --git a/scripts/conf-riscos/include/config.h b/scripts/conf-riscos/include/config.h index de5609ba2..5b4b6ed67 100644 --- a/scripts/conf-riscos/include/config.h +++ b/scripts/conf-riscos/include/config.h @@ -273,6 +273,9 @@ /* Define if you have the strtoul function. */ #define HAVE_STRTOUL 1 +/* Define if you have the strsep function. */ +#define HAVE_STRSEP 1 + /* Define if you have the tcgetattr function. */ #undef HAVE_TCGETATTR @@ -364,29 +367,58 @@ /* define if compiled symbols have a leading underscore */ #define WITH_SYMBOL_UNDERSCORE 1 +#define HAVE_BUILTIN_EXPECT 1 +#define HAVE_ULONG_TYPEDEF 1 +#define HAVE_USHORT_TYPEDEF 1 +#define HAVE_TIMES 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_FSEEKO 1 +#define HAVE_GETOPT_H 1 +#define HAVE_SIGSET_T 1 +#define HAVE_STRUCT_SIGACTION 1 +#define HAVE_ICONV 0 + +#ifndef __set_errno +#define __set_errno(val) (errno = (val), -1) +#endif + /* RISC OS specifica */ #if (__CC_NORCROFT == 1) /* Norcroft */ # undef __GNUC__ # define __GNUC_MINOR__ 0 # define __GLIBC__ 0 -# define __attribute__(x) -# define SIZEOF_UNSIGNED_LONG_LONG 0 + # if (__CC_NORCROFT_VERSION < 544) /* old version of Norcroft */ # define inline __inline # define STR(a) #a # define __func__ "[" __FILE__ ":" STR(__LINE__) "]" +# define SIZEOF_UNSIGNED_LONG_LONG 0 +# else +# define SIZEOF_UNSIGNED_LONG_LONG 8 # endif #else /* gcc */ # define SIZEOF_UNSIGNED_LONG_LONG 8 #endif -#define USE_RNDRISCOS 1 #define HAVE_LDAP_GET_OPTION 1 +#undef USE_ZLIBRISCOS +#define USE_DNS_SRV 1 +#define USE_RNDRISCOS 1 +#define USE_RSA 1 +#define USE_CAST5 1 +#define USE_BLOWFISH 1 +#define USE_AES 1 +#define USE_TWOFISH 1 +#define USE_SHA256 1 +#if SIZEOF_UNSIGNED_LONG_LONG == 8 +# define USE_SHA512 +#endif #ifdef IS_DEVELOPMENT_VERSION -# define DEBUG 1 -/*# define M_DEBUG */ -# define M_GUARD 1 +# define DEBUG 1 +/*# define M_DEBUG */ +# define M_GUARD 1 +# define USE_IDEA 1 #endif #include "g10defs.h" diff --git a/scripts/conf-riscos/include/g10defs.h b/scripts/conf-riscos/include/g10defs.h index 6b47a6b38..08f4a7a0a 100644 --- a/scripts/conf-riscos/include/g10defs.h +++ b/scripts/conf-riscos/include/g10defs.h @@ -30,6 +30,8 @@ #define EXTSEP_C '/' #define DIRSEP_S "." #define EXTSEP_S "/" +#define SAFE_VERSION_DOT '/' +#define SAFE_VERSION_DASH '-' /* This file defines some basic constants for the MPI machinery. We * need to define the types on a per-CPU basis, so it is done with diff --git a/tools/ChangeLog b/tools/ChangeLog index d34913df0..466a71569 100644 --- a/tools/ChangeLog +++ b/tools/ChangeLog @@ -1,3 +1,8 @@ +2003-12-28 Stefan Bellon + + * gpgsplit.c [__riscos__]: Removal of unnecessary #ifdef + __riscos__ sections. + 2003-12-06 David Shaw * gpgsplit.c (write_part): Split off decompression code. diff --git a/tools/gpgsplit.c b/tools/gpgsplit.c index 8d3349eec..856e9aa29 100644 --- a/tools/gpgsplit.c +++ b/tools/gpgsplit.c @@ -37,10 +37,9 @@ #ifdef HAVE_BZIP2 #include #endif /* HAVE_BZIP2 */ -#ifdef __riscos__ +#if defined(__riscos__) && defined(USE_ZLIBRISCOS) # include "zlib-riscos.h" -# include -#endif /* __riscos__ */ +#endif #define INCLUDED_BY_MAIN_MODULE 1 #include "../g10/packet.h" @@ -114,10 +113,6 @@ main( int argc, char **argv ) { ARGPARSE_ARGS pargs; -#ifdef __riscos__ - /* set global RISC OS specific properties */ - __riscosify_control = __RISCOSIFY_NO_PROCESS; -#endif /* __riscos__ */ #ifdef HAVE_DOSISH_SYSTEM setmode( fileno(stdin), O_BINARY ); setmode( fileno(stdout), O_BINARY ); @@ -533,7 +528,7 @@ write_part ( const char *fname, FILE *fpin, unsigned long pktlen, unsigned char *p; const char *outname = create_filename (pkttype); -#ifdef __riscos__ +#if defined(__riscos__) && defined(USE_ZLIBRISCOS) static int initialized = 0; if (!initialized) diff --git a/util/ChangeLog b/util/ChangeLog index 301b9e504..e65b81af2 100644 --- a/util/ChangeLog +++ b/util/ChangeLog @@ -1,3 +1,11 @@ +2003-12-28 Stefan Bellon + + * riscos.c [__riscos__]: Better filetype handling (use a + different SWI) and removal of unnecessary function. + + * memory.c (out_of_core) [__riscos__]: Produce stack backtrace on + RISC OS if out_of_core() is called and M_GUARD is compiled in. + 2003-12-06 David Shaw * http.c (send_request): Add a Host: header for virtual hosts. diff --git a/util/memory.c b/util/memory.c index cb8a3b3e3..c062bdd5f 100644 --- a/util/memory.c +++ b/util/memory.c @@ -406,6 +406,9 @@ out_of_core(size_t n, int secure) log_info ("(this may be caused by too many secret keys used " "simultaneously or due to excessive large key sizes)\n"); } +#if defined(M_GUARD) && defined(__riscos__) + abort(); +#endif exit (2); } diff --git a/util/riscos.c b/util/riscos.c index 70ec98fb7..256f3f65d 100644 --- a/util/riscos.c +++ b/util/riscos.c @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -32,11 +33,18 @@ #include "util.h" #include "memory.h" +#include /* needed for RISCOSIFY_NO_PROCESS */ #define __UNIXLIB_INTERNALS #include /* needed for MMM_TYPE_* definitions */ #undef __UNIXLIB_INTERNALS +/* static symbols that trigger UnixLib behaviour */ + +int __riscosify_control = __RISCOSIFY_NO_PROCESS; +int __feature_imagefs_is_file = 1; + + /* RISC OS file open descriptor control list */ struct fds_item { @@ -69,13 +77,6 @@ is_read_only(const char *filename) /* exported RISC OS functions */ -void -riscos_global_defaults(void) -{ - __riscosify_control = __RISCOSIFY_NO_PROCESS; - __feature_imagefs_is_file = 1; -} - int riscos_load_module(const char *name, const char * const path[], int fatal) { @@ -118,10 +119,13 @@ riscos_get_filetype(const char *filename) { int result; - if (_swix(OS_File, _INR(0,1) | _OUT(6), 23, filename, &result)) + if (_swix(OS_File, _INR(0,1) | _OUT(2), 17, filename, &result)) log_fatal("Can't get filetype for file \"%s\"!\n", filename); - return result; + if ((result & 0xfff00000) == 0xfff00000) + return (result & 0xfff00) >> 8; + else + return 0; } void @@ -307,18 +311,21 @@ riscos_gstrans(const char *old) char * riscos_make_basename(const char *filepath, const char *realfname) { - char *result, *p = (char*)filepath-1; + char *result, *p; int i, filetype; - if ( !(p=strrchr(filepath, DIRSEP_C)) ) - if ( !(p=strrchr(filepath, ':')) ) - ; + if ( (p = strrchr(filepath, DIRSEP_C)) ) + p++; + else if ( (p = strrchr(filepath, ':')) ) + p++; + else + p = (char*) filepath; - i = strlen(p+1); + i = strlen(p); result = m_alloc(i + 5); if (!result) log_fatal("Can't claim memory for riscos_make_basename() buffer!\n"); - strcpy(result, p+1); + strcpy(result, p); filetype = riscos_get_filetype( realfname ); result[i++] = ',';