gnutls_srpcrypt_LDADD = ../lib/libgnutls.la ../libextra/libgnutls-extra.la $(LIBGCRYPT_LIBS) $(LIBOPENCDK_LIBS)
gnutls_cli_SOURCES = cli-gaa.c cli.c common.c
gnutls_cli_LDADD = ../lib/libgnutls.la ../libextra/libgnutls-extra.la $(LIBGCRYPT_LIBS) $(LIBOPENCDK_LIBS)
-gnutls_cli_debug_SOURCES = tls_test-gaa.c tls_test.c tests.c
+gnutls_cli_debug_SOURCES = tls_test-gaa.c tls_test.c tests.c common.c
gnutls_cli_debug_LDADD = ../lib/libgnutls.la ../libextra/libgnutls-extra.la $(LIBGCRYPT_LIBS) $(LIBOPENCDK_LIBS)
#include <gnutls/extra.h>
#include <time.h>
+void print_cert_info(GNUTLS_STATE state);
+
#define PRINTX(x,y) if (y[0]!=0) printf(" # %s %s\n", x, y)
#define PRINT_DN(X) PRINTX( "CN:", X.common_name); \
PRINTX( "OU:", X.organizational_unit_name); \
gnutls_srp_server_get_username(state));
break;
case GNUTLS_CRD_CERTIFICATE:
- switch (gnutls_cert_type_get(state)) {
- case GNUTLS_CRT_X509:
- printf
- ("- Peer requested X.509 certificate authentication.\n");
-
- print_x509_info(state);
-
- break;
- case GNUTLS_CRT_OPENPGP:{
- printf
- ("- Peer requested OpenPGP certificate authentication.\n");
-
- print_openpgp_info(state);
-
- break;
- }
- }
+ print_cert_info( state);
print_cert_vrfy(state);
return 0;
}
+void print_cert_info(GNUTLS_STATE state)
+{
+
+ printf( " - Certificate type: ");
+ switch (gnutls_cert_type_get(state)) {
+ case GNUTLS_CRT_X509:
+ printf("X.509\n");
+ print_x509_info(state);
+ break;
+ case GNUTLS_CRT_OPENPGP:
+ printf("OpenPGP\n");
+ print_openpgp_info(state);
+ break;
+ }
+
+}
+
void print_list(void)
{
/* FIXME: This is hard coded. Make it print all the supported
printf(", SSL3.0\n");
printf("Ciphers:");
- printf(" RIJNDAEL_128_CBC");
- printf(", TWOFISH_128_CBC");
- printf(", 3DES_CBC");
+ printf(" RIJNDAEL-128-CBC");
+ printf(", TWOFISH-128-CBC");
+ printf(", 3DES-CBC");
printf(", ARCFOUR\n");
+ printf(", ARCFOUR-40\n");
printf("MACs:");
printf(" MD5");
printf("Key exchange algorithms:");
printf(" RSA");
- printf(", DHE_DSS");
- printf(", DHE_RSA");
+ printf(", RSA-EXPORT");
+ printf(", DHE-DSS");
+ printf(", DHE-RSA");
printf(", SRP");
- printf(", ANON_DH\n");
+ printf(", ANON-DH\n");
printf("Compression methods:");
printf(" ZLIB");
#include <gnutls/gnutls.h>
int print_info( GNUTLS_STATE state);
+void print_cert_info( GNUTLS_STATE state);
int print_list(void);
#include <signal.h>
#include <stdlib.h>
#include <string.h>
+#include <common.h>
extern GNUTLS_SRP_CLIENT_CREDENTIALS srp_cred;
extern GNUTLS_ANON_CLIENT_CREDENTIALS anon_cred;
return FAILED;
}
+
+int test_certificate( GNUTLS_STATE state) {
+int ret;
+
+ ADD_ALL_CIPHERS(state);
+ ADD_ALL_COMP(state);
+ ADD_ALL_CERTTYPES(state);
+ ADD_ALL_PROTOCOLS(state);
+ ADD_ALL_MACS(state);
+ ADD_ALL_KX(state);
+
+ gnutls_cred_set(state, GNUTLS_CRD_CERTIFICATE, xcred);
+
+ ret = do_handshake( state);
+ if (ret < 0) return FAILED;
+
+ printf("\n");
+ print_cert_info( state);
+
+ return SUCCEED;
+}
int test_unknown_ciphersuites( GNUTLS_STATE state);
int test_openpgp1( GNUTLS_STATE state);
int test_bye( GNUTLS_STATE state);
+int test_certificate( GNUTLS_STATE state);
int test_session_resume2( GNUTLS_STATE state);
#define GERR(ret) fprintf(stderr, "*** Error: %s\n", gnutls_strerror(ret))
static const TLS_TEST tls_tests[] = {
{ "for TLS 1.0 support", test_tls1, "yes", "no", "dunno" },
{ "for SSL 3.0 support", test_ssl3, "yes", "no", "dunno" },
+ { "for certificate information", test_certificate, "", "", "" },
{ "for version rollback bug in RSA PMS", test_rsa_pms, "no", "yes", "dunno" },
{ "for version rollback bug in Client Hello", test_version_rollback, "no", "yes", "dunno" },
/* this test will disable TLS 1.0 if the server is