## 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
+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.
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")
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
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
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
}
#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.
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;
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
#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*);
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 */