]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Removed stubs for srp and anonymous authentication. Added test suite directory.
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Sun, 2 Jun 2002 20:50:02 +0000 (20:50 +0000)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Sun, 2 Jun 2002 20:50:02 +0000 (20:50 +0000)
Makefile.am
NEWS
configure.in
doc/TODO
lib/gnutls_anon_cred.c
lib/gnutls_x509.c
lib/gnutls_x509.h
libextra/gnutls_srp.c

index bfce46c0675d2eb46dcd7d66deb1f756099ca534..40346967405f71485e08abe85a0ee47849b59fb1 100644 (file)
@@ -1,7 +1,7 @@
 ## Process this file with automake to produce Makefile.in
 
 EXTRA_DIST = ChangeLog NEWS INSTALL README THANKS COPYING PGPKEYS COPYING.LIB
-SUBDIRS = lib libextra src doc
+SUBDIRS = lib libextra src doc tests
 
 ChangeLog:
        cvs2cl --utc -U .cvsusers --fsf -t -S --prune
diff --git a/NEWS b/NEWS
index 195a327224b507d7fa2bbc43d718b347d2136371..a49a0d488f4224d87036f285256b38184cd73840 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+Version ?.?.?
+- Added X.509 certificate tests in tests/ directory
+
 Version 0.4.3 (23/05/2002)
 - The gnutls-extra library now compiles fine, if the opencdk library is
   not present.
index 72d6c0adce0ebf6d10e26b370b01627600250c1b..9b1c3abb8735d9784b6d92bc15967b65cbdbc4ed 100644 (file)
@@ -12,7 +12,7 @@ AC_DEFINE_UNQUOTED(T_OS, "$target_os")
 dnl Gnutls Version
 GNUTLS_MAJOR_VERSION=0
 GNUTLS_MINOR_VERSION=4
-GNUTLS_MICRO_VERSION=3
+GNUTLS_MICRO_VERSION=4
 GNUTLS_VERSION=$GNUTLS_MAJOR_VERSION.$GNUTLS_MINOR_VERSION.$GNUTLS_MICRO_VERSION
 
 AC_DEFINE_UNQUOTED(GNUTLS_VERSION, "$GNUTLS_VERSION")
@@ -341,7 +341,8 @@ AC_CONFIG_COMMANDS([lib/gnutls.h],[[
 AC_CONFIG_FILES([Makefile src/Makefile libextra/Makefile lib/Makefile \
 lib/libgnutls-config libextra/libgnutls-extra-config \
 doc/Makefile src/x509/Makefile src/srp/Makefile src/openpgp/Makefile \
-doc/tex/Makefile doc/tex/cover.tex doc/scripts/Makefile ])
+doc/tex/Makefile doc/tex/cover.tex doc/scripts/Makefile \
+tests/Makefile ])
 
 
 AC_OUTPUT
index 269bead0c163ca72fa7b79feb41b8d186bb153fe..f23d2d6f07db5774f53cd930f40a794b39b8e91f 100644 (file)
--- a/doc/TODO
+++ b/doc/TODO
@@ -4,8 +4,6 @@ in order to avoid having people working on the same thing.
 
 Current list:
 * Audit the code
-* Optimize functions which now return malloc'd data
-* Minimize footprint.
 * Add function(s) to get the DHE/A parameters
 * Add function(s) to extract the certificate key's parameters
 * Add PKCS-12 support
index 8fc90566d5d3af00b13c1a3463b7a86f23d509b5..00314013acc7159d6670c10d7d9d649dbe4d4a2e 100644 (file)
@@ -92,24 +92,4 @@ int gnutls_anon_allocate_client_sc( GNUTLS_ANON_CLIENT_CREDENTIALS *sc) {
        return 0;
 }
 
-#else /* No ANON: define stubs */
-
-void gnutls_anon_free_server_sc( GNUTLS_ANON_SERVER_CREDENTIALS sc) {
-       return;
-}
-
-int gnutls_anon_allocate_server_sc( GNUTLS_ANON_SERVER_CREDENTIALS *sc) {
-
-       return GNUTLS_E_UNIMPLEMENTED_FEATURE;
-}
-
-void gnutls_anon_free_client_sc( GNUTLS_ANON_CLIENT_CREDENTIALS sc) {
-       return;
-}
-
-
-int gnutls_anon_allocate_client_sc( GNUTLS_ANON_CLIENT_CREDENTIALS *sc) {
-       return GNUTLS_E_UNIMPLEMENTED_FEATURE;
-}
-
 #endif
index de2d10a79759917459aaac2220f431d89b808ad1..636b4eaec0ca06ca97b0313ddaebe16871a5789d 100644 (file)
@@ -978,7 +978,6 @@ static int _gnutls_check_key_cert_match( GNUTLS_CERTIFICATE_CREDENTIALS res) {
 }
 
 #define MAX_FILE_SIZE 100*1024
-#define CERT_SEP "-----BEGIN"
 
 /* Reads a DER encoded certificate list from memory and stores it to
  * a gnutls_cert structure. This is only called if PKCS7 read fails.
@@ -1162,13 +1161,13 @@ static int parse_pem_cert_mem( gnutls_cert** cert_list, int* ncerts,
                gnutls_free(b64);
 
                /* now we move ptr after the pem header */
-               ptr = strstr(ptr, CERT_SEP);
+               ptr = strstr(ptr, PEM_CERT_SEP);
                if (ptr!=NULL)
                        ptr++;
 
                i++;
                count++;
-       } while ((ptr = strstr(ptr, CERT_SEP)) != NULL);
+       } while ((ptr = strstr(ptr, PEM_CERT_SEP)) != NULL);
 
        *ncerts = i - 1;
 
@@ -2024,101 +2023,6 @@ int _gnutls_check_x509_key_usage(const gnutls_cert * cert,
        return 0;
 }
 
-#ifdef DEBUG
-
-/* Verifies a base64 encoded certificate list from memory 
- */
-int _gnutls_verify_x509_mem( const char *ca, int ca_size)
-{
-       int siz, siz2, i;
-       opaque *b64;
-       const char *ptr;
-       int ret;
-       gnutls_datum tmp;
-       gnutls_cert* x509_ca_list=NULL;
-       int x509_ncas;
-
-       siz = ca_size;
-
-       ptr = ca;
-
-       i = 1;
-
-       do {
-               siz2 = _gnutls_fbase64_decode(ptr, siz, &b64);
-               siz -= siz2;    /* FIXME: this is not enough
-                                */
-
-               if (siz2 < 0) {
-                       gnutls_assert();
-                       return GNUTLS_E_PARSING_ERROR;
-               }
-
-               x509_ca_list =
-                   (gnutls_cert *) gnutls_realloc( x509_ca_list,
-                                                  i *
-                                                  sizeof(gnutls_cert));
-               if (x509_ca_list == NULL) {
-                       gnutls_assert();
-                       gnutls_free(b64);
-                       return GNUTLS_E_MEMORY_ERROR;
-               }
-
-               tmp.data = b64;
-               tmp.size = siz2;
-
-               if ((ret =
-                    _gnutls_x509_cert2gnutls_cert(&x509_ca_list[i - 1],
-                                            tmp)) < 0) {
-                       gnutls_assert();
-                       gnutls_free(b64);
-                       return ret;
-               }
-               gnutls_free(b64);
-
-               /* now we move ptr after the pem header */
-               ptr = strstr(ptr, CERT_SEP);
-               if (ptr!=NULL)
-                       ptr++;
-
-               i++;
-       } while ((ptr = strstr(ptr, CERT_SEP)) != NULL);
-
-       x509_ncas = i - 1;
-
-       siz = _gnutls_x509_verify_certificate( x509_ca_list, x509_ncas-1,
-               &x509_ca_list[x509_ncas-1], 1, NULL, 0);
-
-       return siz;
-}
-
-
-
-/* Reads and verifies a base64 encoded certificate file 
- */
-int _gnutls_verify_x509_file( char *cafile)
-{
-       int siz;
-       char x[MAX_FILE_SIZE];
-       FILE *fd1;
-
-       fd1 = fopen(cafile, "rb");
-       if (fd1 == NULL) {
-               gnutls_assert();
-               return GNUTLS_E_FILE_ERROR;
-       }
-
-       siz = fread(x, 1, sizeof(x)-1, fd1);
-       fclose(fd1);
-
-       x[siz] = 0;
-
-       return _gnutls_verify_x509_mem( x, siz);
-}
-
-
-
-#endif
 
 /**
   * gnutls_x509_pkcs7_extract_certificate - This function returns a certificate in a PKCS7 certificate set
index 5e8bba52e8c3165288310a7e4e58cff3e7c43988..9c6ef036d4a27c4ccedfc525aa5cd6a987d4168a 100644 (file)
@@ -4,6 +4,8 @@ int _gnutls_x509_cert2gnutls_cert(gnutls_cert * gCert, gnutls_datum derCert);
 #define MAX_INT_DIGITS 4
 void _gnutls_int2str(unsigned int k, char *data);
 
+#define PEM_CERT_SEP "-----BEGIN"
+
 int _gnutls_check_x509_key_usage( const gnutls_cert * cert, KXAlgorithm alg);
 time_t gnutls_x509_extract_certificate_activation_time( const gnutls_datum*);
 time_t gnutls_x509_extract_certificate_expiration_time( const gnutls_datum*);
index d1b1a422dfdbc226a90e50388de4e13a319132d7..29e7030a8639889dbaf3b2fd0e0158f973828495 100644 (file)
@@ -526,42 +526,4 @@ const char *gnutls_srp_server_get_username(GNUTLS_STATE state)
        return info->username;
 }
 
-
-#else /* NO SRP: so define stubs */
-
-const char *gnutls_srp_server_get_username(GNUTLS_STATE state)
-{
-       return NULL;
-}
-
-void gnutls_srp_free_client_sc( GNUTLS_SRP_CLIENT_CREDENTIALS sc) {
-       return;
-}
-
-int gnutls_srp_allocate_client_sc( GNUTLS_SRP_CLIENT_CREDENTIALS *sc) {
-       return GNUTLS_E_UNIMPLEMENTED_FEATURE;
-}
-
-int gnutls_srp_set_client_cred( GNUTLS_SRP_CLIENT_CREDENTIALS res, char *username, char * password) {
-       return GNUTLS_E_UNIMPLEMENTED_FEATURE;
-}
-
-void gnutls_srp_free_server_sc( GNUTLS_SRP_SERVER_CREDENTIALS sc) {
-       return;
-}
-
-int gnutls_srp_allocate_server_sc( GNUTLS_SRP_SERVER_CREDENTIALS *sc) {
-       return GNUTLS_E_UNIMPLEMENTED_FEATURE;
-}
-
-int gnutls_srp_set_server_cred_file( GNUTLS_SRP_SERVER_CREDENTIALS res, char *password_file, char * password_conf_file) {
-       return GNUTLS_E_UNIMPLEMENTED_FEATURE;
-}
-
-void gnutls_srp_server_set_select_func(GNUTLS_STATE state,
-                                            srp_server_select_func
-                                            * func) {
-       return;
-}
-
 #endif /* ENABLE_SRP */