Go to the documentation of this file.
23 #define TEST_CERTPROCESS
26 #define TEST_HIGHLEVEL
31 #define TEST_SESSION_LOOPBACK
40 #if defined( TEST_DEVICE )
85 #if defined( __MVS__ ) || defined( __VMCMS__ ) || defined( __ILEC400__ )
86 #define KLUDGE_WARN( str ) \
88 char fileName[ 1000 ]; \
89 strncpy( fileName, __FILE__, 1000 ); \
90 fileName[ 999 ] = '\0'; \
92 printf( "Kludging " str ", file %s, line %d.\n", fileName, __LINE__ ); \
95 #define KLUDGE_WARN( str ) \
96 printf( "Kludging " str ", file " __FILE__ ", line %d.\n", __LINE__ );
101 #if defined( _WIN32_WCE ) && _WIN32_WCE < 400
114 #define BYTE unsigned char
122 #define SENTINEL -1000
136 #define EXIT_SUCCESS 0
137 #define EXIT_FAILURE !EXIT_SUCCESS
149 #define min( a, b ) ( ( ( a ) < ( b ) ) ? ( a ) : ( b ) )
150 #define max( a, b ) ( ( ( a ) > ( b ) ) ? ( a ) : ( b ) )
156 #if defined( __MSDOS__ ) && !defined( __MSDOS32__ )
159 #if defined( _MSC_VER ) && ( _MSC_VER <= 800 )
166 #if defined( _WINDOWS ) || defined( WIN32 ) || defined( _WIN32 ) || \
167 defined( _WIN32_WCE )
175 #if defined( _WIN32_WCE )
177 #define TEXT( x ) L ## x
178 #define paramStrlen( x ) ( wcslen( x ) * sizeof( wchar_t ) )
179 #define paramStrcmp( x, y ) wcscmp( x, y )
180 #define UNICODE_STRINGS
181 #elif ( defined( WIN32 ) || defined( _WIN32 ) ) && 0
184 #define TEXT( x ) L ## x
185 #define paramStrlen( x ) ( wcslen( x ) * sizeof( wchar_t ) )
186 #define paramStrcmp( x, y ) wcscmp( x, y )
187 #define UNICODE_STRINGS
191 #define paramStrlen( x ) strlen( x )
192 #define paramStrcmp( x, y ) strcmp( x, y )
196 #define paramStrlen( x ) strlen( x )
197 #define paramStrcmp( x, y ) strcmp( x, y )
204 #if defined( _MSC_VER ) && ( _MSC_VER <= 800 )
215 #if defined( _MSC_VER ) && ( _MSC_VER >= 1400 )
216 #pragma warning( disable: 4267 )
217 #pragma warning( disable: 4996 )
226 #if defined( __MSDOS16__ ) || defined( __WIN16__ )
227 #define BUFFER_SIZE 4096
228 #define FILEBUFFER_SIZE 20000
229 #elif defined( __QNX__ ) && defined( __WATCOMC__ ) && ( __WATCOMC__ < 1100 )
230 #define BUFFER_SIZE 8192
231 #define FILEBUFFER_SIZE 20000
233 #define BUFFER_SIZE 16384
234 #define FILEBUFFER_SIZE 32768
236 #define FILENAME_BUFFER_SIZE 512
241 #ifdef __PALMSOURCE__
250 #if defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x550 )
258 #define printf wcPrintf
261 void wcPrintf(
const char *format, ... );
262 void wcPuts(
const char *
string );
268 #if( ( defined( _AIX ) || defined( __APPLE__ ) || defined( __FreeBSD__ ) || \
269 defined( __NetBSD__ ) || defined( __linux__ ) || \
270 ( defined( sun ) && ( OSVERSION > 4 ) ) ) && !defined( NO_THREADS ) )
281 #if ( defined( WIN32 ) || defined( _WIN32 ) ) && !defined( _WIN32_WCE )
285 #define WINDOWS_THREADS
288 #if defined( __IBMC__ ) && defined( __OS2__ )
295 #if defined( TEST_SESSION_LOOPBACK ) && !defined( WINDOWS_THREADS )
296 #undef TEST_SESSION_LOOPBACK
302 #if defined( WINDOWS_THREADS )
303 #define THREAD_HANDLE HANDLE
304 #define THREAD_EXIT() _endthreadex( 0 ); return( 0 )
305 #define THREAD_SELF() GetCurrentThreadId()
306 typedef unsigned ( __stdcall *
THREAD_FUNC )(
void *arg );
307 #elif defined( UNIX_THREADS )
308 #define THREAD_HANDLE pthread_t
309 #define THREAD_EXIT() pthread_exit( ( void * ) 0 ); return( 0 )
310 #define THREAD_SELF() pthread_self()
311 typedef void * ( *THREAD_FUNC )(
void *arg );
313 #define THREAD_HANDLE int
314 #define THREAD_EXIT()
315 #define THREAD_SELF() 0
322 #define MAX_NO_THREADS 10
326 #if ( defined( __WINDOWS__ ) && \
327 !( defined( __WIN16__ ) || defined( __BORLANDC__ ) ) ) || \
328 defined( __linux__ ) || \
329 ( defined( sun ) && ( OSVERSION > 4 ) ) || defined( __osf__ )
336 #if defined( __MVS__ ) || defined( __VMCMS__ )
337 #pragma convlit( suspend )
339 #if defined( __ILEC400__ )
346 #if defined( __QNX__ ) && defined( __WATCOMC__ )
354 #define PKC_KEYSIZE 512
361 #ifdef UNICODE_STRINGS
365 const wchar_t *fileTemplate,
369 #define filenameFromTemplate( buffer, fileTemplate, count ) \
370 sprintf( buffer, fileTemplate, count )
371 #define filenameParamFromTemplate( buffer, fileTemplate, count ) \
372 sprintf( buffer, fileTemplate, count )
373 #define convertFileName( fileName ) fileName
379 #if defined( _WIN32_WCE ) && _WIN32_WCE < 500
380 int remove(
const char *pathname );
425 #define TEST_PASSWORD TEXT( "password" )
426 #define TEST_PRIVKEY_PASSWORD TEXT( "test" )
433 #if defined( _MSC_VER )
434 #define DATABASE_KEYSET_TYPE CRYPT_KEYSET_ODBC
435 #define CERTSTORE_KEYSET_TYPE CRYPT_KEYSET_ODBC_STORE
436 #elif defined( DBX_DATABASE )
437 #define DATABASE_KEYSET_TYPE CRYPT_KEYSET_DATABASE
438 #define CERTSTORE_KEYSET_TYPE CRYPT_KEYSET_DATABASE_STORE
439 #elif defined( DBX_PLUGIN )
440 #define DATABASE_KEYSET_TYPE CRYPT_KEYSET_PLUGIN
441 #define CERTSTORE_KEYSET_TYPE CRYPT_KEYSET_PLUGIN_STORE
443 #define DATABASE_KEYSET_TYPE CRYPT_KEYSET_DATABASE
444 #define CERTSTORE_KEYSET_TYPE CRYPT_KEYSET_DATABASE_STORE
446 #define DATABASE_KEYSET_NAME TEXT( "testkeys" )
447 #define DATABASE_KEYSET_NAME_ASCII "testkeys"
448 #define CERTSTORE_KEYSET_NAME TEXT( "testcertstore" )
449 #define CERTSTORE_KEYSET_NAME_ASCII "testcertstore"
450 #define DATABASE_PLUGIN_KEYSET_NAME TEXT( "localhost:6500" )
451 #define DATABASE_PLUGIN_KEYSET_NAME_ASCII "localhost:6500"
459 #define HTTP_KEYSET_CERT_NAME TEXT( "www.cacert.org/certs/root.der" )
460 #define HTTP_KEYSET_CRL_NAME TEXT( "crl.verisign.com/Class1Individual.crl" )
461 #define HTTP_KEYSET_HUGECRL_NAME TEXT( "crl.verisign.com/RSASecureServer.crl" )
469 #define SSH_USER_NAME TEXT( "test" )
470 #define SSH_PASSWORD TEXT( "test" )
471 #define SSL_USER_NAME TEXT( "test" )
472 #define SSL_PASSWORD TEXT( "test" )
473 #define PKI_SRV_NAME TEXT( "_pkiboot._tcp.cryptoapps.com" )
474 #define TSP_DEFAULTSERVER_NAME TEXT( "http://timestamping.edelweb.fr/service/tsp" )
480 #define RSA_PUBKEY_LABEL TEXT( "Test RSA public key" )
481 #define RSA_PRIVKEY_LABEL TEXT( "Test RSA private key" )
482 #define RSA_BIG_PRIVKEY_LABEL TEXT( "Test RSA big private key" )
483 #define DSA_PUBKEY_LABEL TEXT( "Test DSA sigcheck key" )
484 #define DSA_PRIVKEY_LABEL TEXT( "Test DSA signing key" )
485 #define ELGAMAL_PUBKEY_LABEL TEXT( "Test Elgamal public key" )
486 #define ELGAMAL_PRIVKEY_LABEL TEXT( "Test Elgamal private key" )
487 #define DH_KEY1_LABEL TEXT( "Test DH key #1" )
488 #define DH_KEY2_LABEL TEXT( "Test DH key #2" )
489 #define ECDSA_PUBKEY_LABEL TEXT( "Test ECDSA sigcheck key" )
490 #define ECDSA_PRIVKEY_LABEL TEXT( "Test ECDSA signing key" )
491 #define CA_PRIVKEY_LABEL TEXT( "Test RSA private key" )
492 #define USER_PRIVKEY_LABEL TEXT( "Test user key" )
494 #define DUAL_SIGNKEY_LABEL TEXT( "Test signing key" )
495 #define DUAL_ENCRYPTKEY_LABEL TEXT( "Test encryption key" )
496 #define SYMMETRIC_KEY_LABEL TEXT( "Test symmetric key" )
520 const C_STR fileTemplate,
const int number );
522 const CERT_DATA *certData,
const int lineNo );
526 const C_STR keyName );
535 const BOOLEAN showServerKeyInfo,
536 const BOOLEAN showClientCertInfo );
541 const BOOLEAN showOperationType );
550 #if defined( WINDOWS_THREADS )
552 #elif defined( UNIX_THREADS )
566 const int lineNumber );
569 const int lineNumber );
575 const int lineNumber );
581 #if defined( UNIX_THREADS ) || defined( WINDOWS_THREADS ) || defined( OS2_THREADS )
584 #define delayThread( x )
595 const C_STR cryptContextLabel,
596 const C_STR decryptContextLabel,
608 const C_STR signContextLabel,
609 const C_STR sigCheckContextLabel );
646 const C_STR userName );
651 const CERT_DATA *pkiUserCAData,
const char *protocolName );
840 #ifdef TEST_SESSION_LOOPBACK
903 #if defined( __MVS__ ) || defined( __VMCMS__ )
904 #pragma convlit( resume )
906 #if defined( __ILEC400__ )
907 #pragma convert( 819 )