From ee9ad49e68cd69759ca643579c2f0de0747c4f61 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Mon, 16 Jul 2001 20:47:03 +0000 Subject: [PATCH] updates. --- CHANGES | 18 ++++++++++ Makefile.defines.pre | 7 ++-- includes/Makefile.am | 10 +++++- lib/silcclient/Makefile.am | 10 +++++- lib/silccore/Makefile.am | 13 +++++++ lib/silccrypt/Makefile.am | 22 ++++++++++++ lib/silccrypt/aes.c | 1 + lib/silccrypt/aes.h | 2 -- lib/silccrypt/blowfish.c | 1 + lib/silccrypt/blowfish.h | 2 -- lib/silccrypt/cast.c | 1 + lib/silccrypt/cast.h | 2 -- lib/silccrypt/mars.c | 1 + lib/silccrypt/mars.h | 10 ------ lib/silccrypt/md5.c | 1 + lib/silccrypt/md5.h | 10 ------ lib/silccrypt/pkcs1.c | 1 + lib/silccrypt/rc5.c | 1 + lib/silccrypt/rc5.h | 2 -- lib/silccrypt/rc6.c | 1 + lib/silccrypt/rc6.h | 10 ------ lib/silccrypt/rsa.c | 1 + lib/silccrypt/rsa.h | 2 -- lib/silccrypt/sha1.c | 1 + lib/silccrypt/sha1.h | 10 ------ lib/silccrypt/twofish.c | 1 + lib/silccrypt/twofish.h | 10 ------ lib/silcmath/Makefile.am | 6 ++++ lib/silcsim/Makefile.am | 2 ++ lib/silcske/Makefile.am | 6 ++++ lib/silcske/groups.h | 1 - lib/silcske/payload.c | 1 - lib/silcske/payload.h | 47 +++++++++++++++++++++++- lib/silcske/payload_internal.h | 66 ---------------------------------- lib/silcske/silcske.c | 2 +- lib/silcutil/Makefile.am | 16 +++++++++ 36 files changed, 161 insertions(+), 137 deletions(-) delete mode 100644 lib/silcske/payload_internal.h diff --git a/CHANGES b/CHANGES index a8730a0d..43d3dcbd 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,21 @@ +Mon Jul 16 22:55:26 EEST 2001 Pekka Riikonen + + * Fixed various compilation problems under WIN32. Affected + files lib/silcutil/win32/silcwin32thread.c and + lib/silcutil/win32/silcwin32schedule.c. + + * Removed all _internal.h #includes from public header + files. Internal headers must never be included from + public headers. + + Removed also the lib/silcske/payload_internal.h file. + + * All include files that may be needed (public and some others + included by the public headers) by application developers are + now copied to the ./includes directory. It does not copy any + internal headers. Affected file Makefile.defines.pre and all + Makefile.am's under lib/ and subdirs. + Thu Jul 12 17:49:31 EEST 2001 Pekka Riikonen * Do not change the ~/.silc directory's permissions automatically. diff --git a/Makefile.defines.pre b/Makefile.defines.pre index cee43cf8..eb53e2d7 100644 --- a/Makefile.defines.pre +++ b/Makefile.defines.pre @@ -58,11 +58,8 @@ INCLUDES = $(ADD_INCLUDES) $(SILC_CFLAGS) \ -I$(silc_top_srcdir)/lib/trq includes-install: Makefile - for i in $(include_HEADERS); \ - do \ - s=$(srcdir)/$$i; \ - d=$(silc_top_srcdir)/includes/$$i; \ - ln $$s $$d 2>/dev/null || cp -fp $$s $$d; \ + for i in $(include_HEADERS); do s=$(srcdir)/$$i; d=$(silc_top_srcdir)/includes/$$i; \ + ln $$s $$d 2>/dev/null || (rm -f $$d; cp -p $$s $$d;); \ done; all-local: includes-install diff --git a/includes/Makefile.am b/includes/Makefile.am index 6702d837..12cc20fa 100644 --- a/includes/Makefile.am +++ b/includes/Makefile.am @@ -21,4 +21,12 @@ AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign all: -cd .. -EXTRA_DIST = *.h \ No newline at end of file +include_HEADERS = \ + bitmove.h \ + clientlibincludes.h \ + silcdefs.h \ + silcincludes.h \ + silcwin32.h \ + version.h \ + version_internal.h + diff --git a/lib/silcclient/Makefile.am b/lib/silcclient/Makefile.am index b51424c6..43032ca3 100644 --- a/lib/silcclient/Makefile.am +++ b/lib/silcclient/Makefile.am @@ -31,6 +31,14 @@ libsilcclient_a_SOURCES = \ idlist.c \ protocol.c +include_HEADERS= \ + client.h \ + command.h \ + command_reply.h \ + idlist.h \ + protocol.h \ + silcapi.h + EXTRA_DIST = *.h -include $(top_srcdir)/Makefile.defines.in \ No newline at end of file +include $(top_srcdir)/Makefile.defines.in diff --git a/lib/silccore/Makefile.am b/lib/silccore/Makefile.am index 038ed448..2933ba4e 100644 --- a/lib/silccore/Makefile.am +++ b/lib/silccore/Makefile.am @@ -32,6 +32,19 @@ libsilccore_a_SOURCES = \ silcauth.c \ silcprivate.c +include_HEADERS = \ + silcauth.h \ + silcchannel.h \ + silccommand.h \ + silcidcache.h \ + silcid.h \ + silcmode.h \ + silcnotify.h \ + silcpacket.h \ + silcpayload.h \ + silcprivate.h \ + silcprotocol.h + EXTRA_DIST = *.h include $(top_srcdir)/Makefile.defines.in diff --git a/lib/silccrypt/Makefile.am b/lib/silccrypt/Makefile.am index 3af1fac9..e55cb151 100644 --- a/lib/silccrypt/Makefile.am +++ b/lib/silccrypt/Makefile.am @@ -39,6 +39,28 @@ libsilccrypt_a_SOURCES = \ silcpkcs.c \ pkcs1.c +include_HEADERS = \ + aes.h \ + blowfish.h \ + cast.h \ + ciphers_def.h \ + ciphers.h \ + mars.h \ + md5.h \ + none.h \ + pkcs1.h \ + rc5.h \ + rc6.h \ + rsa.h \ + sha1.h \ + silccipher.h \ + silcdh.h \ + silchash.h \ + silchmac.h \ + silcpkcs.h \ + silcrng.h \ + twofish.h + EXTRA_DIST = *.h include $(top_srcdir)/Makefile.defines.in diff --git a/lib/silccrypt/aes.c b/lib/silccrypt/aes.c index 568881d6..840dfdde 100644 --- a/lib/silccrypt/aes.c +++ b/lib/silccrypt/aes.c @@ -40,6 +40,7 @@ Mean: 500 cycles = 51.2 mbits/sec */ #include "silcincludes.h" +#include "rijndael_internal.h" #include "aes.h" /* diff --git a/lib/silccrypt/aes.h b/lib/silccrypt/aes.h index d505f90c..6efd6582 100644 --- a/lib/silccrypt/aes.h +++ b/lib/silccrypt/aes.h @@ -21,8 +21,6 @@ #ifndef RIJNDAEL_H #define RIJNDAEL_H -#include "rijndael_internal.h" - /* * SILC Crypto API for Rijndael */ diff --git a/lib/silccrypt/blowfish.c b/lib/silccrypt/blowfish.c index cf6fe609..1bea0310 100644 --- a/lib/silccrypt/blowfish.c +++ b/lib/silccrypt/blowfish.c @@ -34,6 +34,7 @@ */ #include "silcincludes.h" +#include "blowfish_internal.h" #include "blowfish.h" /* diff --git a/lib/silccrypt/blowfish.h b/lib/silccrypt/blowfish.h index 64634636..c0caeee7 100644 --- a/lib/silccrypt/blowfish.h +++ b/lib/silccrypt/blowfish.h @@ -21,8 +21,6 @@ #ifndef BLOWFISH_H #define BLOWFISH_H -#include "blowfish_internal.h" - /* * SILC Crypto API for Blowfish */ diff --git a/lib/silccrypt/cast.c b/lib/silccrypt/cast.c index a814ac02..b3428cb2 100644 --- a/lib/silccrypt/cast.c +++ b/lib/silccrypt/cast.c @@ -59,6 +59,7 @@ Mean: 674 cycles = 38.0 mbits/sec */ #include "silcincludes.h" +#include "cast_internal.h" #include "cast.h" #define io_swap diff --git a/lib/silccrypt/cast.h b/lib/silccrypt/cast.h index 9f361395..fe735190 100644 --- a/lib/silccrypt/cast.h +++ b/lib/silccrypt/cast.h @@ -21,8 +21,6 @@ #ifndef CAST_H #define CAST_H -#include "cast_internal.h" - /* * SILC Crypto API for Cast-256 */ diff --git a/lib/silccrypt/mars.c b/lib/silccrypt/mars.c index 454b402a..73af702f 100644 --- a/lib/silccrypt/mars.c +++ b/lib/silccrypt/mars.c @@ -39,6 +39,7 @@ Mean: 373 cycles = 68.7 mbits/sec */ #include "silcincludes.h" +#include "mars_internal.h" #include "mars.h" /* diff --git a/lib/silccrypt/mars.h b/lib/silccrypt/mars.h index 33dd8264..23a47b69 100644 --- a/lib/silccrypt/mars.h +++ b/lib/silccrypt/mars.h @@ -17,20 +17,10 @@ GNU General Public License for more details. */ -/* - * $Id$ - * $Log$ - * Revision 1.1 2000/06/27 11:36:54 priikone - * Initial revision - * - * - */ #ifndef MARS_H #define MARS_H -#include "mars_internal.h" - /* * SILC Crypto API for MARS */ diff --git a/lib/silccrypt/md5.c b/lib/silccrypt/md5.c index 5a198c74..63514cd1 100644 --- a/lib/silccrypt/md5.c +++ b/lib/silccrypt/md5.c @@ -19,6 +19,7 @@ */ #include "silcincludes.h" +#include "md5_internal.h" #include "md5.h" /* diff --git a/lib/silccrypt/md5.h b/lib/silccrypt/md5.h index c80f4a32..8b10d7ea 100644 --- a/lib/silccrypt/md5.h +++ b/lib/silccrypt/md5.h @@ -17,20 +17,10 @@ GNU General Public License for more details. */ -/* - * $Id$ - * $Log$ - * Revision 1.1 2000/06/27 11:36:55 priikone - * Initial revision - * - * - */ #ifndef MD5_H #define MD5_H -#include "md5_internal.h" - /* * SILC Hash API for MD5 */ diff --git a/lib/silccrypt/pkcs1.c b/lib/silccrypt/pkcs1.c index 47950d3b..3b99b69b 100644 --- a/lib/silccrypt/pkcs1.c +++ b/lib/silccrypt/pkcs1.c @@ -77,6 +77,7 @@ */ #include "silcincludes.h" +#include "rsa_internal.h" #include "rsa.h" #define RSA_BLOCK_MIN_PAD_LEN 8 diff --git a/lib/silccrypt/rc5.c b/lib/silccrypt/rc5.c index 1a886bee..34afc43f 100644 --- a/lib/silccrypt/rc5.c +++ b/lib/silccrypt/rc5.c @@ -39,6 +39,7 @@ */ #include "silcincludes.h" +#include "rc5_internal.h" #include "rc5.h" /* diff --git a/lib/silccrypt/rc5.h b/lib/silccrypt/rc5.h index b8f02416..8909ebc0 100644 --- a/lib/silccrypt/rc5.h +++ b/lib/silccrypt/rc5.h @@ -21,8 +21,6 @@ #ifndef RC5_H #define RC5_H -#include "rc5_internal.h" - /* * SILC Crypto API for RC5 */ diff --git a/lib/silccrypt/rc6.c b/lib/silccrypt/rc6.c index 68dcb3c0..7939b288 100644 --- a/lib/silccrypt/rc6.c +++ b/lib/silccrypt/rc6.c @@ -37,6 +37,7 @@ Mean: 249 cycles = 103.0 mbits/sec */ #include "silcincludes.h" +#include "rc6_internal.h" #include "rc6.h" /* diff --git a/lib/silccrypt/rc6.h b/lib/silccrypt/rc6.h index ee859795..c1d2ec0c 100644 --- a/lib/silccrypt/rc6.h +++ b/lib/silccrypt/rc6.h @@ -17,20 +17,10 @@ GNU General Public License for more details. */ -/* - * $Id$ - * $Log$ - * Revision 1.1 2000/06/27 11:36:54 priikone - * Initial revision - * - * - */ #ifndef RC6_H #define RC6_H -#include "rc6_internal.h" - /* * SILC Crypto API for RC6 */ diff --git a/lib/silccrypt/rsa.c b/lib/silccrypt/rsa.c index 7694e324..79d88cd2 100644 --- a/lib/silccrypt/rsa.c +++ b/lib/silccrypt/rsa.c @@ -64,6 +64,7 @@ */ #include "silcincludes.h" +#include "rsa_internal.h" #include "rsa.h" /* diff --git a/lib/silccrypt/rsa.h b/lib/silccrypt/rsa.h index 0c1ab1ba..5f8262fa 100644 --- a/lib/silccrypt/rsa.h +++ b/lib/silccrypt/rsa.h @@ -21,8 +21,6 @@ #ifndef RSA_H #define RSA_H -#include "rsa_internal.h" - /* * SILC PKCS API for RSA */ diff --git a/lib/silccrypt/sha1.c b/lib/silccrypt/sha1.c index ef51330d..e06c5b1b 100644 --- a/lib/silccrypt/sha1.c +++ b/lib/silccrypt/sha1.c @@ -5,6 +5,7 @@ By Steve Reid */ #include "silcincludes.h" +#include "sha1_internal.h" #include "sha1.h" /* diff --git a/lib/silccrypt/sha1.h b/lib/silccrypt/sha1.h index 6ac0d5b5..ac52d624 100644 --- a/lib/silccrypt/sha1.h +++ b/lib/silccrypt/sha1.h @@ -17,20 +17,10 @@ GNU General Public License for more details. */ -/* - * $Id$ - * $Log$ - * Revision 1.1 2000/06/27 11:36:55 priikone - * Initial revision - * - * - */ #ifndef SHA1_H #define SHA1_H -#include "sha1_internal.h" - /* * SILC Hash API for SHA1 */ diff --git a/lib/silccrypt/twofish.c b/lib/silccrypt/twofish.c index b9036b4e..c4cf7c86 100644 --- a/lib/silccrypt/twofish.c +++ b/lib/silccrypt/twofish.c @@ -40,6 +40,7 @@ Mean: 378 cycles = 67.8 mbits/sec */ #include "silcincludes.h" +#include "twofish_internal.h" #include "twofish.h" /* diff --git a/lib/silccrypt/twofish.h b/lib/silccrypt/twofish.h index 565bb8e3..6b96b302 100644 --- a/lib/silccrypt/twofish.h +++ b/lib/silccrypt/twofish.h @@ -17,20 +17,10 @@ GNU General Public License for more details. */ -/* - * $Id$ - * $Log$ - * Revision 1.1 2000/06/27 11:36:55 priikone - * Initial revision - * - * - */ #ifndef TWOFISH_H #define TWOFISH_H -#include "twofish_internal.h" - /* * SILC Crypto API for Twofish */ diff --git a/lib/silcmath/Makefile.am b/lib/silcmath/Makefile.am index e362edcb..d4f5b7e2 100644 --- a/lib/silcmath/Makefile.am +++ b/lib/silcmath/Makefile.am @@ -38,6 +38,12 @@ libsilcmath_a_SOURCES = \ mpbin.c \ $(MP_SOURCE) +include_HEADERS = \ + mp_gmp.h \ + mp_mpi.h \ + silcmath.h \ + silcmp.h + EXTRA_DIST = *.h include $(top_srcdir)/Makefile.defines.in diff --git a/lib/silcsim/Makefile.am b/lib/silcsim/Makefile.am index 2a89eeef..ad45d5be 100644 --- a/lib/silcsim/Makefile.am +++ b/lib/silcsim/Makefile.am @@ -75,6 +75,8 @@ $(SIM_HASH_OBJS): ../silccrypt/libsilccrypt.a CLEANFILES = $(SIM_MODULES_DIR)/*.sim.so +include_HEADERS = silcsim.h silcsimutil.h + EXTRA_DIST = *.h include $(top_srcdir)/Makefile.defines.in diff --git a/lib/silcske/Makefile.am b/lib/silcske/Makefile.am index 620f38dc..94dffa26 100644 --- a/lib/silcske/Makefile.am +++ b/lib/silcske/Makefile.am @@ -25,6 +25,12 @@ libsilcske_a_SOURCES = \ payload.c \ groups.c +include_HEADERS = \ + groups.h \ + payload.h \ + silcske.h \ + silcske_status.h + EXTRA_DIST = *.h include $(top_srcdir)/Makefile.defines.in diff --git a/lib/silcske/groups.h b/lib/silcske/groups.h index eacd3f25..29941dbf 100644 --- a/lib/silcske/groups.h +++ b/lib/silcske/groups.h @@ -22,7 +22,6 @@ #define GROUPS_H #include "silcske_status.h" -#include "groups_internal.h" /* Forward declaration */ typedef struct SilcSKEDiffieHellmanGroupStruct *SilcSKEDiffieHellmanGroup; diff --git a/lib/silcske/payload.c b/lib/silcske/payload.c index 0a987e8e..ef420bde 100644 --- a/lib/silcske/payload.c +++ b/lib/silcske/payload.c @@ -20,7 +20,6 @@ /* $Id$ */ #include "silcincludes.h" -#include "payload_internal.h" /* Encodes Key Exchange Start Payload into a SILC Buffer to be sent to the other end. */ diff --git a/lib/silcske/payload.h b/lib/silcske/payload.h index df982a7b..dd31fc10 100644 --- a/lib/silcske/payload.h +++ b/lib/silcske/payload.h @@ -22,7 +22,52 @@ #define PAYLOAD_H #include "silcske_status.h" -#include "payload_internal.h" + +/* Forward declarations */ +typedef struct SilcSKEStartPayloadStruct SilcSKEStartPayload; +typedef struct SilcSKEKEPayloadStruct SilcSKEKEPayload; + +/* SILC Key Exchange Start Payload */ +struct SilcSKEStartPayloadStruct { + unsigned char flags; + uint16 len; + + unsigned char *cookie; + uint16 cookie_len; + + unsigned char *version; + uint16 version_len; + + uint16 ke_grp_len; + unsigned char *ke_grp_list; + + uint16 pkcs_alg_len; + unsigned char *pkcs_alg_list; + + uint16 enc_alg_len; + unsigned char *enc_alg_list; + + uint16 hash_alg_len; + unsigned char *hash_alg_list; + + uint16 hmac_alg_len; + unsigned char *hmac_alg_list; + + uint16 comp_alg_len; + unsigned char *comp_alg_list; +}; + +/* SILC Key Exchange Payload */ +struct SilcSKEKEPayloadStruct { + uint16 pk_len; + unsigned char *pk_data; + uint16 pk_type; + + SilcMPInt x; + + uint16 sign_len; + unsigned char *sign_data; +}; /* Prototypes */ SilcSKEStatus silc_ske_payload_start_encode(SilcSKE ske, diff --git a/lib/silcske/payload_internal.h b/lib/silcske/payload_internal.h deleted file mode 100644 index 3312d1ea..00000000 --- a/lib/silcske/payload_internal.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - - payload_internal.h - - Author: Pekka Riikonen - - Copyright (C) 2000 - 2001 Pekka Riikonen - - This program 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. - - This program 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. - -*/ - -#ifndef PAYLOAD_INTERNAL_H -#define PAYLOAD_INTERNAL_H - -/* SILC Key Exchange Start Payload */ -typedef struct { - unsigned char flags; - uint16 len; - - unsigned char *cookie; - uint16 cookie_len; - - unsigned char *version; - uint16 version_len; - - uint16 ke_grp_len; - unsigned char *ke_grp_list; - - uint16 pkcs_alg_len; - unsigned char *pkcs_alg_list; - - uint16 enc_alg_len; - unsigned char *enc_alg_list; - - uint16 hash_alg_len; - unsigned char *hash_alg_list; - - uint16 hmac_alg_len; - unsigned char *hmac_alg_list; - - uint16 comp_alg_len; - unsigned char *comp_alg_list; -} SilcSKEStartPayload; - -/* SILC Key Exchange Payload */ -typedef struct { - uint16 pk_len; - unsigned char *pk_data; - uint16 pk_type; - - SilcMPInt x; - - uint16 sign_len; - unsigned char *sign_data; -} SilcSKEKEPayload; - -#endif diff --git a/lib/silcske/silcske.c b/lib/silcske/silcske.c index 0d0e4ff3..b9d45b4b 100644 --- a/lib/silcske/silcske.c +++ b/lib/silcske/silcske.c @@ -20,7 +20,7 @@ /* $Id$ */ #include "silcincludes.h" -#include "payload_internal.h" +#include "silcske.h" #include "groups_internal.h" /* Structure to hold all SKE callbacks-> */ diff --git a/lib/silcutil/Makefile.am b/lib/silcutil/Makefile.am index fbf6b12d..161f0471 100644 --- a/lib/silcutil/Makefile.am +++ b/lib/silcutil/Makefile.am @@ -38,6 +38,22 @@ libsilcutil_a_SOURCES = \ silchashtable.c \ silcsockconn.c +include_HEADERS = \ + silcbuffer.h \ + silcbuffmt.h \ + silcbufutil.h \ + silcconfig.h \ + silchashtable.h \ + silclog.h \ + silcmemory.h \ + silcmutex.h \ + silcnet.h \ + silcschedule.h \ + silcsockconn.h \ + silctask.h \ + silcthread.h \ + silcutil.h + EXTRA_DIST = *.h include $(top_srcdir)/Makefile.defines.in -- 2.24.0