Beispiel #1
0
static void testKludge( const char *argPtr )
	{
#if 0
	testReadCorruptedKey();
#endif /* 0 */

	/* To test dodgy certificate collections */
#if 0
	int result;

	if( argPtr == NULL )
		{
		printf( "Error: Missing argument.\n" );
		exit( EXIT_FAILURE );
		}
	if( *argPtr == '@' )
		{
		cryptSetAttribute( CRYPT_UNUSED, CRYPT_OPTION_CERT_COMPLIANCELEVEL,
						   CRYPT_COMPLIANCELEVEL_OBLIVIOUS );
		argPtr++;
		}
	if( *argPtr == '#' )
		{
		cryptSetAttribute( CRYPT_UNUSED, CRYPT_OPTION_CERT_COMPLIANCELEVEL,
						   CRYPT_COMPLIANCELEVEL_PKIX_FULL );
		argPtr++;
		}
	result = xxxCertImport( argPtr );
	cryptEnd();
	exit( result ? EXIT_SUCCESS : EXIT_FAILURE );
#endif /* 1 */

	/* Performance-testing test harness */
#if 0
	void performanceTests( const CRYPT_DEVICE cryptDevice );

	performanceTests( CRYPT_UNUSED );
#endif /* 0 */

	/* Memory diagnostic test harness */
#if 0
	testReadFileCertPrivkey();
	testEnvelopePKCCrypt();		/* Use "Datasize, certificate" */
	testEnvelopeSign();			/* Use "Datasize, certificate" */
#endif /* 0 */

	/* Simple (brute-force) server code. NB: Remember to change
	   setLocalConnect() to not bind the server to localhost if expecting
	   external connections */
#if 0
	while( TRUE )
		testSessionTSPServer();
#endif /* 0 */

	/* Exit point for the test harnesses above, used when we don't want to 
	   fall through to the main test code */
#if 0
	cleanupAndExit( EXIT_SUCCESS );
#endif /* 0 */
	}
void testKludge( const char *argPtr )
	{
#if 0
//	testGetBorkenKey();

//	testKeyset();		/* For client-server tests */
//	testWriteCert();	/* For client-server tests */
	testSessionSuiteBClientServer();
#endif

#if 0
//	testSessionTLS12();

//	testKeyset();		/* For client-server tests */
//	testWriteCert();	/* For client-server tests */
//	testSessionSSLClientCertClientServer();

//	testSessionTLS12ClientServerEccKey();
//	testSessionTLS12ClientServerEcc384Key();

//	testKeyset();		/* For client-server tests */
//	testWriteCert();	/* For client-server tests */
//	testSessionTLS12ClientCertClientServer();
#endif

#if 0
	testReadCorruptedKey();
#endif /* 0 */

	/* Performance-testing test harness */
#if 0
	void performanceTests( const CRYPT_DEVICE cryptDevice );

	performanceTests( CRYPT_UNUSED );
#endif /* 0 */

	/* Memory diagnostic test harness */
#if 0
	testReadFileCertPrivkey();
	testEnvelopePKCCrypt();		/* Use "Datasize, certificate" */
	testEnvelopeSign();			/* Use "Datasize, certificate" */
#endif /* 0 */

	/* Simple (brute-force) server code. NB: Remember to change
	   setLocalConnect() to not bind the server to localhost if expecting
	   external connections */
#if 0
	while( TRUE )
		testSessionTSPServer();
#endif /* 0 */

	/* Shared exit point for the test harnesses above, used when we don't 
	   want to fall through to the main test code */
#if 0
	cryptEnd();
	puts( "\nPress a key to exit." );
	getchar();
	exit( EXIT_SUCCESS );
#endif /* 0 */
	}