diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2001-12-01 10:50:40 +0000 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2001-12-01 10:50:40 +0000 |
commit | dc8b402208abaf0bc493876f1f7bbc7629790b06 (patch) | |
tree | 85a1c83734c78083a044215c5ba1131b80458f26 | |
parent | 4f1108a440d9554a52b129818b27ce845580f860 (diff) | |
download | gnutls-dc8b402208abaf0bc493876f1f7bbc7629790b06.tar.gz |
updated detection of library settings
-rw-r--r-- | AUTHORS | 5 | ||||
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | acconfig.h | 3 | ||||
-rw-r--r-- | configure.in | 142 | ||||
-rw-r--r-- | lib/auth_x509.c | 2 | ||||
-rw-r--r-- | lib/defines.h | 16 | ||||
-rw-r--r-- | lib/gnutls_random.c | 8 |
8 files changed, 132 insertions, 49 deletions
@@ -1,7 +1,4 @@ -Nikos Mavroyanopoulos <nmav@hellug.gr> - Everything except the files stated below. +Nikos Mavroyanopoulos <nmav@hellug.gr> Fabio Fiorina <Fabio.Fiorina@alcatel.it> - All of the ASN.1 parsing functions (x509_ASN.y, x509_der.c, - x509_asn1.c and the corresponding header files) diff --git a/Makefile.am b/Makefile.am index 9ae41fd054..e3278214e0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,4 +4,4 @@ EXTRA_DIST = ChangeLog NEWS INSTALL README THANKS COPYING SUBDIRS = lib src doc ChangeLog: - cvs2cl --utc -t -U .cvsusers + cvs2cl --utc -t -U .cvsusers --fsf --tags -W 2400 @@ -2,8 +2,9 @@ Version ?.?.? - gnutls_handshake(), gnutls_read() etc. functions no longer require the 'SOCKET cd' argument. This argument is set using the function gnutls_set_transport_ptr(). -- introduced gnutls_x509pki_get_certificate(). This function returns +- introduced gnutls_x509pki_get_peer_certificate(). This function returns the peer's certificate DER encoded. +- Buffer overflow checking in ASN.1 structures parser Version 0.2.11 (16/11/2001) - Changed the meaning of GNUTLS_E_REHANDSHAKE value. If this value diff --git a/acconfig.h b/acconfig.h index 121cbab932..4c3ee30e01 100644 --- a/acconfig.h +++ b/acconfig.h @@ -27,4 +27,7 @@ #undef LIBMCRYPT22 #undef LIBMCRYPT24 + +#undef NO_SIZE_T +#undef NO_TIME_T
\ No newline at end of file diff --git a/configure.in b/configure.in index 91d378f031..814c8fb689 100644 --- a/configure.in +++ b/configure.in @@ -25,15 +25,6 @@ GNUTLS_MOST_RECENT_INTERFACE=$GNUTLS_MINOR_VERSION GNUTLS_CURRENT_INTERFACE_IMPLEMENTATION_NUMBER=$GNUTLS_MICRO_VERSION GNUTLS_OLDEST_INTERFACE=0 -AM_PATH_LIBGCRYPT(1.1.4,, - AC_MSG_ERROR([[ -*** -*** libgcrypt was not found. You may want to get it from -*** ftp://ftp.gnupg.org/pub/gcrypt/alpha/libgcrypt/ -*** -]])) -dnl Can't disable - gnutls depends on gcrypt -AC_DEFINE(USE_GCRYPT) AC_SUBST(GNUTLS_MAJOR_VERSION) AC_SUBST(GNUTLS_MINOR_VERSION) @@ -72,21 +63,37 @@ AC_ARG_ENABLE(profile-mode, opt_profiler_mode=$enableval) AC_MSG_RESULT($opt_profiler_mode) +AC_MSG_RESULT([*** +*** Checking for required for compilation programs... +]) + AC_PROG_CC AC_PROG_YACC -AC_TYPE_SIZE_T AC_PROG_LN_S -AC_C_CONST -AC_C_INLINE dnl Checks for programs. AC_PROG_INSTALL dnl AC_PROG_MAKE_SET +AC_MSG_RESULT([*** +*** Checking for external libraries... +]) + +AM_PATH_LIBGCRYPT(1.1.4,, + AC_MSG_ERROR([[ +*** +*** libgcrypt was not found. You may want to get it from +*** ftp://ftp.gnupg.org/pub/gcrypt/alpha/libgcrypt/ +*** +]])) +dnl Can't disable - gnutls depends on gcrypt +AC_DEFINE(USE_GCRYPT) + +dnl MCRYPT AC_ARG_WITH( mcrypt, [ --with-mcrypt enable libmcrypt support], [AM_PATH_LIBMCRYPT( 2.4.0,, @@ -102,9 +109,38 @@ AC_ARG_WITH( mhash, [ --with-mhash enable libmhash support], [AC_CHECK_LIB(mhash, mhash_init, AC_DEFINE(USE_MHASH) LIBS="${LIBS} -lmhash")]) +AC_MSG_CHECKING([whether to check for external libraries]) + +dnl if used --with-ext-libraries then we will not check +dnl for any library (libz, libgdbm) + +AC_ARG_WITH( ext-libraries, [ --without-ext-libraries disable external libraries support], + ac_ext_libraries=$withval +) + +if test x$ac_ext_libraries != xno; then + AC_MSG_RESULT(yes) + AC_CHECK_LIB(gdbm, gdbm_open,, AC_MSG_WARN("GDBM was not found. You will not be able to use Server side session resuming.")) + AC_CHECK_LIB(z, compress,,AC_MSG_WARN("ZLIB was not found. You will not be able to use ZLIB compression.")) +else + AC_MSG_RESULT() + + +fi + + +AC_MSG_RESULT([*** +*** Detecting compiler options... +]) + + +AC_C_CONST +AC_C_INLINE + if test $ac_cv_c_compiler_gnu != no; then CFLAGS="" + if test x$opt_profiler_mode = xyes; then CFLAGS="${CFLAGS} -O0 -fprofile-arcs -finstrument-functions -ftest-coverage" AC_CHECK_LIB(fnccheck, main, @@ -124,19 +160,37 @@ if test $ac_cv_c_compiler_gnu != no; then AC_CHECK_LIB( dmalloc, main) AC_DEFINE(USE_DMALLOC) fi + + AC_MSG_CHECKING([whether we have GNU assembler]) + + GAS=`as --version|grep GNU` + if test "$GAS"; then + CFLAGS="${CFLAGS} -pipe" + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi fi +AC_MSG_RESULT([*** +*** Detecting library capabilities... +]) + AC_HEADER_STDC AC_CHECK_HEADERS(unistd.h pwd.h locale.h strings.h stdarg.h) AC_CHECK_HEADERS(sys/stat.h sys/types.h sys/socket.h) -AC_CHECK_HEADERS(utime.h errno.h) -AC_CHECK_FUNCS(bzero memset lstat stat umask utime memmove bcopy getpwuid,,) +AC_CHECK_HEADERS(utime.h errno.h sys/time.h time.h) +AC_CHECK_FUNCS(bzero memset utime memmove bcopy,,) + dnl Defines USE_VA_COPY AC_MSG_CHECKING([whether we have va_copy or __va_copy]) AC_TRY_RUN( changequote(<<, >>)dnl -<<#include <stdarg.h> +<< +#ifdef HAVE_STDARG_H +# include <stdarg.h> +#endif int main() { va_list a,b; va_copy(a, b); @@ -154,7 +208,9 @@ dnl ************ NO VA_COPY dnl Defines USE_VA_COPY AC_TRY_RUN( changequote(<<, >>)dnl - <<#include <stdarg.h> + <<#ifdef HAVE_STDARG_H + # include <stdarg.h> + #endif int main() { va_list a,b; __va_copy(a, b); @@ -177,35 +233,47 @@ AC_MSG_RESULT(none) ) -AC_MSG_CHECKING([whether to check for external libraries]) -dnl if used --with-ext-libraries then we will not check -dnl for any library (libz, libgdbm) +AC_MSG_RESULT([*** +*** Detecting system's parameters... +]) -AC_ARG_WITH( ext-libraries, [ --without-ext-libraries disable external libraries support], - ac_ext_libraries=$withval -) - -if test x$ac_ext_libraries != xno; then - AC_MSG_RESULT(yes) - AC_CHECK_LIB(gdbm, gdbm_open,, AC_MSG_WARN("GDBM was not found. You will not be able to use Server side session resuming.")) - AC_CHECK_LIB(z, compress,,AC_MSG_WARN("ZLIB was not found. You will not be able to use ZLIB compression.")) -else - AC_MSG_RESULT() - - -fi - - - -dnl Checks for libraries. -AC_C_BIGENDIAN AC_CHECK_SIZEOF(unsigned long long, 8) AC_CHECK_SIZEOF(unsigned long int, 4) AC_CHECK_SIZEOF(unsigned int, 4) AC_CHECK_SIZEOF(unsigned short int, 2) AC_CHECK_SIZEOF(unsigned char, 1) +AC_CHECK_TYPE(size_t,, +AC_DEFINE(NO_SIZE_T) +,[ +#ifdef HAVE_TIME_H +# include <time.h> +#endif +#ifdef HAVE_SYS_TIME_H +# include <sys/time.h> +#endif +]) + + +AC_CHECK_TYPE(time_t,, +AC_DEFINE(NO_TIME_T), +[ +#ifdef HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#endif +] +) + + +AC_C_BIGENDIAN + +AC_MSG_RESULT([*** +*** Detecting options for shared libraries... +]) AM_PROG_LIBTOOL LIBGNUTLS_LIBS="$LIBS -L${libdir} -lgnutls $LIBGCRYPT_LIBS" diff --git a/lib/auth_x509.c b/lib/auth_x509.c index 3dac0cbaf6..4c134dadf3 100644 --- a/lib/auth_x509.c +++ b/lib/auth_x509.c @@ -876,8 +876,6 @@ int _gnutls_gen_x509_server_cert_req(GNUTLS_STATE state, opaque ** data) WRITEdatum16( pdata, cred->rdn_sequence); pdata += cred->rdn_sequence.size + 2; - /* write the recalculated size */ - return size; } diff --git a/lib/defines.h b/lib/defines.h index 73e2d54fcd..f717b57c80 100644 --- a/lib/defines.h +++ b/lib/defines.h @@ -27,6 +27,16 @@ # include <string.h> # include <stdlib.h> # include <stdio.h> +# include <ctype.h> +#endif + +#ifdef NO_TIME_T + typedef unsigned int time_t; +#endif + +#ifdef NO_SIZE_T + typedef unsigned int size_t; + typedef int ssize_t; #endif #ifdef HAVE_STDARG_H @@ -37,8 +47,10 @@ # include <strings.h> #endif -#include <time.h> -#include <ctype.h> +#ifdef HAVE_TIME_H +# include <time.h> +#endif + /* for open */ #ifdef HAVE_SYS_TYPES_H diff --git a/lib/gnutls_random.c b/lib/gnutls_random.c index 166fe04d9e..7c9e17d052 100644 --- a/lib/gnutls_random.c +++ b/lib/gnutls_random.c @@ -22,11 +22,15 @@ #include <gnutls_random.h> #include <gnutls_errors.h> #ifndef USE_GCRYPT -# include <unistd.h> +# ifdef HAVE_UNISTD_H +# include <unistd.h> +# endif # include <sys/types.h> # include <sys/stat.h> # include <fcntl.h> -# include <sys/time.h> +# ifdef HAVE_SYS_TIME_H +# include <sys/time.h> +# endif #endif int _gnutls_get_random(opaque * res, int bytes, int dev) |