]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
added version check against libtasn1
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Thu, 30 Oct 2003 19:03:48 +0000 (19:03 +0000)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Thu, 30 Oct 2003 19:03:48 +0000 (19:03 +0000)
configure.in
lib/gnutls_errors.c
lib/gnutls_errors_int.h
lib/gnutls_global.c

index 6d79d43ed5b63c5c7e8bfef0120699d99f28f690..9f8405c26560843b520244fd13b40d66c1d6f7b5 100644 (file)
@@ -18,7 +18,9 @@ GNUTLS_VERSION=$GNUTLS_MAJOR_VERSION.$GNUTLS_MINOR_VERSION.$GNUTLS_MICRO_VERSION
 AC_DEFINE_UNQUOTED(GNUTLS_VERSION, "$GNUTLS_VERSION", [version of gnutls])
 
 GNUTLS_GCRYPT_VERSION=1.1.44
-AC_DEFINE_UNQUOTED(GNUTLS_GCRYPT_VERSION, "$GNUTLS_GCRYPT_VERSION", [version of gnutls])
+GNUTLS_LIBTASN1_VERSION=0.2.5
+AC_DEFINE_UNQUOTED(GNUTLS_GCRYPT_VERSION, "$GNUTLS_GCRYPT_VERSION", [version of gcrypt])
+AC_DEFINE_UNQUOTED(GNUTLS_LIBTASN1_VERSION, "$GNUTLS_LIBTASN1_VERSION", [version of libtasn1])
 
 AM_INIT_AUTOMAKE(gnutls, $GNUTLS_VERSION, [version of gnutls])
 AM_CONFIG_HEADER(config.h)
index e56eb268967a8aaec2394e328957e149673e7069..9a59bf7fdfc220561480f312ce3f6515a3d3ec99 100644 (file)
@@ -125,6 +125,9 @@ static gnutls_error_entry error_algorithms[] = {
                GNUTLS_E_LIBRARY_VERSION_MISMATCH, 1 ), 
        ERROR_ENTRY("The gcrypt library version is too old.", 
                GNUTLS_E_INCOMPATIBLE_GCRYPT_LIBRARY, 1 ), 
+
+       ERROR_ENTRY("The tasn1 library version is too old.", 
+               GNUTLS_E_INCOMPATIBLE_LIBTASN1_LIBRARY, 1 ), 
        ERROR_ENTRY("The specified GnuPG TrustDB version is not supported. TrustDB v4 is supported.", 
                GNUTLS_E_OPENPGP_TRUSTDB_VERSION_UNSUPPORTED, 1 ),
        ERROR_ENTRY("The initialization of LZO has failed.", GNUTLS_E_LZO_INIT_FAILED, 1 ), 
index 30dc5e1376c2b4aa3045934e54d9983001940b2b..0642bc064c91d1c88310c874384e00ca5d2bea9b 100644 (file)
 
 #define GNUTLS_E_BASE64_ENCODING_ERROR -201
 #define GNUTLS_E_INCOMPATIBLE_GCRYPT_LIBRARY -202
+#define GNUTLS_E_INCOMPATIBLE_LIBTASN1_LIBRARY -203
 
 #define GNUTLS_E_UNIMPLEMENTED_FEATURE -1250
 
index 0af34fa73d366987185c84d3c74e3d54c84878a4..f4d59e7c765c33c633c31bd0de40235865e0712a 100644 (file)
@@ -201,6 +201,11 @@ int gnutls_global_init( void)
         * This should not deal with files in the final
         * version.
         */
+
+       if (asn1_check_version(GNUTLS_LIBTASN1_VERSION)==NULL) {
+               gnutls_assert();
+               return GNUTLS_E_INCOMPATIBLE_LIBTASN1_LIBRARY;
+       }
        
        res=asn1_array2tree( pkix_asn1_tab, &_gnutls_pkix1_asn, NULL);
        if (res != ASN1_SUCCESS) {