|
| #define | TEST_SELFTEST /* Perform internal self-test */ |
| |
| #define | TEST_LOWLEVEL /* Test low-level functions */ |
| |
| #define | TEST_RANDOM /* Test randomness functions */ |
| |
| #define | TEST_CONFIG /* Test configuration functions */ |
| |
| #define | TEST_MIDLEVEL /* Test high-level encr/sig.functions */ |
| |
| #define | TEST_CERT /* Test certificate management functions */ |
| |
| #define | TEST_KEYSET /* Test keyset read functions */ |
| |
| #define | TEST_CERTPROCESS /* Test certificate handling/CA management */ |
| |
| #define | TEST_HIGHLEVEL /* Test high-level encr/sig.functions */ |
| |
| #define | TEST_ENVELOPE /* Test enveloping functions */ |
| |
| #define | TEST_SESSION /* Test session functions */ |
| |
| #define | TEST_SESSION_LOOPBACK /* Test session functions via local loopback */ |
| |
| #define | KLUDGE_WARN(str) printf( "Kludging " str ", file " __FILE__ ", line %d.\n", __LINE__ ); |
| |
| #define | BOOLEAN int |
| |
| #define | BYTE unsigned char |
| |
| #define | FALSE 0 |
| |
| #define | TRUE !FALSE |
| |
| #define | SENTINEL -1000 |
| |
| #define | DUMMY_INIT 0 |
| |
| #define | EXIT_SUCCESS 0 |
| |
| #define | EXIT_FAILURE !EXIT_SUCCESS |
| |
| #define | min(a, b) ( ( ( a ) < ( b ) ) ? ( a ) : ( b ) ) |
| |
| #define | max(a, b) ( ( ( a ) > ( b ) ) ? ( a ) : ( b ) ) |
| |
| #define | TEXT(x) x |
| |
| #define | paramStrlen(x) strlen( x ) |
| |
| #define | paramStrcmp(x, y) strcmp( x, y ) |
| |
| #define | FAR_BSS |
| |
| #define | BUFFER_SIZE 16384 |
| |
| #define | FILEBUFFER_SIZE 32768 |
| |
| #define | FILENAME_BUFFER_SIZE 512 |
| |
| #define | THREAD_HANDLE int |
| |
| #define | THREAD_EXIT() |
| |
| #define | THREAD_SELF() 0 |
| |
| #define | MAX_NO_THREADS 10 |
| |
| #define | PKC_KEYSIZE 512 |
| |
| #define | filenameFromTemplate(buffer, fileTemplate, count) sprintf( buffer, fileTemplate, count ) |
| |
| #define | filenameParamFromTemplate(buffer, fileTemplate, count) sprintf( buffer, fileTemplate, count ) |
| |
| #define | convertFileName(fileName) fileName |
| |
| #define | TEST_PASSWORD TEXT( "password" ) |
| |
| #define | TEST_PRIVKEY_PASSWORD TEXT( "test" ) |
| |
| #define | DATABASE_KEYSET_TYPE CRYPT_KEYSET_DATABASE |
| |
| #define | CERTSTORE_KEYSET_TYPE CRYPT_KEYSET_DATABASE_STORE |
| |
| #define | DATABASE_KEYSET_NAME TEXT( "testkeys" ) |
| |
| #define | DATABASE_KEYSET_NAME_ASCII "testkeys" |
| |
| #define | CERTSTORE_KEYSET_NAME TEXT( "testcertstore" ) |
| |
| #define | CERTSTORE_KEYSET_NAME_ASCII "testcertstore" |
| |
| #define | DATABASE_PLUGIN_KEYSET_NAME TEXT( "localhost:6500" ) |
| |
| #define | DATABASE_PLUGIN_KEYSET_NAME_ASCII "localhost:6500" |
| |
| #define | HTTP_KEYSET_CERT_NAME TEXT( "www.cacert.org/certs/root.der" ) |
| |
| #define | HTTP_KEYSET_CRL_NAME TEXT( "crl.verisign.com/Class1Individual.crl" ) |
| |
| #define | HTTP_KEYSET_HUGECRL_NAME TEXT( "crl.verisign.com/RSASecureServer.crl" ) |
| |
| #define | SSH_USER_NAME TEXT( "test" ) |
| |
| #define | SSH_PASSWORD TEXT( "test" ) |
| |
| #define | SSL_USER_NAME TEXT( "test" ) |
| |
| #define | SSL_PASSWORD TEXT( "test" ) |
| |
| #define | PKI_SRV_NAME TEXT( "_pkiboot._tcp.cryptoapps.com" ) |
| |
| #define | TSP_DEFAULTSERVER_NAME TEXT( "http://timestamping.edelweb.fr/service/tsp" ) |
| |
| #define | RSA_PUBKEY_LABEL TEXT( "Test RSA public key" ) |
| |
| #define | RSA_PRIVKEY_LABEL TEXT( "Test RSA private key" ) |
| |
| #define | RSA_BIG_PRIVKEY_LABEL TEXT( "Test RSA big private key" ) |
| |
| #define | DSA_PUBKEY_LABEL TEXT( "Test DSA sigcheck key" ) |
| |
| #define | DSA_PRIVKEY_LABEL TEXT( "Test DSA signing key" ) |
| |
| #define | ELGAMAL_PUBKEY_LABEL TEXT( "Test Elgamal public key" ) |
| |
| #define | ELGAMAL_PRIVKEY_LABEL TEXT( "Test Elgamal private key" ) |
| |
| #define | DH_KEY1_LABEL TEXT( "Test DH key #1" ) |
| |
| #define | DH_KEY2_LABEL TEXT( "Test DH key #2" ) |
| |
| #define | ECDSA_PUBKEY_LABEL TEXT( "Test ECDSA sigcheck key" ) |
| |
| #define | ECDSA_PRIVKEY_LABEL TEXT( "Test ECDSA signing key" ) |
| |
| #define | CA_PRIVKEY_LABEL TEXT( "Test RSA private key" ) |
| |
| #define | USER_PRIVKEY_LABEL TEXT( "Test user key" ) |
| |
| #define | USER_EMAIL TEXT( "[email protected]" ) |
| |
| #define | DUAL_SIGNKEY_LABEL TEXT( "Test signing key" ) |
| |
| #define | DUAL_ENCRYPTKEY_LABEL TEXT( "Test encryption key" ) |
| |
| #define | SYMMETRIC_KEY_LABEL TEXT( "Test symmetric key" ) |
| |
| #define | delayThread(x) |
| |
|
| const C_STR | getKeyfileName (const KEYFILE_TYPE type, const BOOLEAN isPrivKey) |
| |
| const C_STR | getKeyfilePassword (const KEYFILE_TYPE type) |
| |
| const C_STR | getKeyfileUserID (const KEYFILE_TYPE type, const BOOLEAN isPrivKey) |
| |
| void | printErrorAttributeInfo (const CRYPT_CERTIFICATE certificate) |
| |
| int | displayAttributes (const CRYPT_HANDLE cryptHandle) |
| |
| int | printCertInfo (const CRYPT_CERTIFICATE certificate) |
| |
| int | printCertChainInfo (const CRYPT_CERTIFICATE certChain) |
| |
| void | printExtError (const CRYPT_HANDLE cryptHandle, const char *functionName, const int functionStatus, const int lineNo) |
| |
| int | importCertFile (CRYPT_CERTIFICATE *cryptCert, const C_STR fileName) |
| |
| int | importCertFromTemplate (CRYPT_CERTIFICATE *cryptCert, const C_STR fileTemplate, const int number) |
| |
| int | addCertFields (const CRYPT_CERTIFICATE certificate, const CERT_DATA *certData, const int lineNo) |
| |
| int | checkFileAccess (void) |
| |
| int | checkNetworkAccess (void) |
| |
| int | getPublicKey (CRYPT_CONTEXT *cryptContext, const C_STR keysetName, const C_STR keyName) |
| |
| int | getPrivateKey (CRYPT_CONTEXT *cryptContext, const C_STR keysetName, const C_STR keyName, const C_STR password) |
| |
| void | debugDump (const char *fileName, const void *data, const int dataLength) |
| |
| int | printConnectInfo (const CRYPT_SESSION cryptSession) |
| |
| int | printSecurityInfo (const CRYPT_SESSION cryptSession, const BOOLEAN isServer, const BOOLEAN showFingerprint, const BOOLEAN showServerKeyInfo, const BOOLEAN showClientCertInfo) |
| |
| int | printFingerprint (const CRYPT_SESSION cryptSession, const BOOLEAN isServer) |
| |
| BOOLEAN | setLocalConnect (const CRYPT_SESSION cryptSession, const int port) |
| |
| int | activatePersistentServerSession (const CRYPT_SESSION cryptSession, const BOOLEAN showOperationType) |
| |
| void | createMutex (void) |
| |
| void | acquireMutex (void) |
| |
| void | releaseMutex (void) |
| |
| int | waitMutex (void) |
| |
| void | destroyMutex (void) |
| |
| void | waitForThread (const int hThread) |
| |
| int | multiThreadDispatch (THREAD_FUNC clientFunction, THREAD_FUNC serverFunction, const int noThreads) |
| |
| BOOLEAN | attrErrorExit (const CRYPT_HANDLE cryptHandle, const char *functionName, const int errorCode, const int lineNumber) |
| |
| BOOLEAN | extErrorExit (const CRYPT_HANDLE cryptHandle, const char *functionName, const int errorCode, const int lineNumber) |
| |
| BOOLEAN | certErrorExit (const CRYPT_HANDLE cryptHandle, const char *functionName, const int errorCode, const int lineNumber) |
| |
| int | setRootTrust (const CRYPT_CERTIFICATE cryptCertChain, BOOLEAN *oldTrustValue, const BOOLEAN newTrustValue) |
| |
| CRYPT_ALGO_TYPE | selectCipher (const CRYPT_ALGO_TYPE algorithm) |
| |
| BOOLEAN | loadDHKey (const CRYPT_DEVICE cryptDevice, CRYPT_CONTEXT *cryptContext) |
| |
| BOOLEAN | loadRSAContextsEx (const CRYPT_DEVICE cryptDevice, CRYPT_CONTEXT *cryptContext, CRYPT_CONTEXT *decryptContext, const C_STR cryptContextLabel, const C_STR decryptContextLabel, const BOOLEAN useLargeKey, const BOOLEAN useMinimalKey) |
| |
| BOOLEAN | loadRSAContexts (const CRYPT_DEVICE cryptDevice, CRYPT_CONTEXT *cryptContext, CRYPT_CONTEXT *decryptContext) |
| |
| BOOLEAN | loadRSAContextsLarge (const CRYPT_DEVICE cryptDevice, CRYPT_CONTEXT *cryptContext, CRYPT_CONTEXT *decryptContext) |
| |
| BOOLEAN | loadDSAContextsEx (const CRYPT_DEVICE cryptDevice, CRYPT_CONTEXT *signContext, CRYPT_CONTEXT *sigCheckContext, const C_STR signContextLabel, const C_STR sigCheckContextLabel) |
| |
| BOOLEAN | loadDSAContexts (const CRYPT_DEVICE cryptDevice, CRYPT_CONTEXT *signContext, CRYPT_CONTEXT *sigCheckContext) |
| |
| BOOLEAN | loadElgamalContexts (CRYPT_CONTEXT *cryptContext, CRYPT_CONTEXT *decryptContext) |
| |
| BOOLEAN | loadDHContexts (CRYPT_CONTEXT *cryptContext1, CRYPT_CONTEXT *cryptContext2) |
| |
| BOOLEAN | loadECDSAContexts (CRYPT_CONTEXT *signContext, CRYPT_CONTEXT *sigCheckContext) |
| |
| void | destroyContexts (const CRYPT_DEVICE cryptDevice, CRYPT_CONTEXT cryptContext, CRYPT_CONTEXT decryptContext) |
| |
| int | testLowlevel (const CRYPT_DEVICE cryptDevice, const CRYPT_ALGO_TYPE cryptAlgo, const BOOLEAN checkOnly) |
| |
| int | testCrypt (CRYPT_CONTEXT cryptContext, CRYPT_CONTEXT decryptContext, BYTE *buffer, const BOOLEAN isDevice, const BOOLEAN noWarnFail) |
| |
| int | testRSAMinimalKey (void) |
| |
| int | testEnvelopePKCCryptEx (const CRYPT_CONTEXT cryptContext, const CRYPT_HANDLE decryptKeyset) |
| |
| int | testCMSEnvelopeSignEx (const CRYPT_CONTEXT signContext) |
| |
| int | testCMSEnvelopePKCCryptEx (const CRYPT_HANDLE encryptContext, const CRYPT_HANDLE decryptKeyset, const C_STR password, const C_STR recipient) |
| |
| int | testSessionTSPServerEx (const CRYPT_CONTEXT privKeyContext) |
| |
| int | pkiGetUserInfo (C_STR userID, C_STR issuePW, C_STR revPW, const C_STR userName) |
| |
| int | pkiServerInit (CRYPT_CONTEXT *cryptPrivateKey, CRYPT_KEYSET *cryptCertStore, const C_STR keyFileName, const C_STR keyLabel, const CERT_DATA *pkiUserData, const CERT_DATA *pkiUserAltData, const CERT_DATA *pkiUserCAData, const char *protocolName) |
| |
| int | testLargeBufferEncrypt (void) |
| |
| int | testDeriveKey (void) |
| |
| int | testRandomRoutines (void) |
| |
| int | testConventionalExportImport (void) |
| |
| int | testMACExportImport (void) |
| |
| int | testKeyExportImport (void) |
| |
| int | testSignData (void) |
| |
| int | testKeygen (void) |
| |
| int | testKeygenAsync (void) |
| |
| int | testKeyExportImportCMS (void) |
| |
| int | testSignDataCMS (void) |
| |
| int | testDevices (void) |
| |
| int | testUser (void) |
| |
| int | testGetPGPPublicKey (void) |
| |
| int | testGetPGPPrivateKey (void) |
| |
| int | testReadWriteFileKey (void) |
| |
| int | testReadWriteAltFileKey (void) |
| |
| int | testImportFileKey (void) |
| |
| int | testReadFilePublicKey (void) |
| |
| int | testAddTrustedCert (void) |
| |
| int | testAddGloballyTrustedCert (void) |
| |
| int | testDeleteFileKey (void) |
| |
| int | testChangeFileKeyPassword (void) |
| |
| int | testUpdateFileCert (void) |
| |
| int | testWriteFileCertChain (void) |
| |
| int | testWriteFileLongCertChain (void) |
| |
| int | testReadFileCert (void) |
| |
| int | testReadFileCertPrivkey (void) |
| |
| int | testReadFileCertChain (void) |
| |
| int | testReadCorruptedKey (void) |
| |
| int | testSingleStepFileCert (void) |
| |
| int | testSingleStepAltFileCert (void) |
| |
| int | testDoubleCertFile (void) |
| |
| int | testRenewedCertFile (void) |
| |
| int | testReadAltFileKey (void) |
| |
| int | testReadMiscFile (void) |
| |
| int | testWriteCert (void) |
| |
| int | testReadCert (void) |
| |
| int | testKeysetQuery (void) |
| |
| int | testWriteCertDbx (void) |
| |
| int | testWriteCertLDAP (void) |
| |
| int | testReadCertLDAP (void) |
| |
| int | testReadCertURL (void) |
| |
| int | testReadCertHTTP (void) |
| |
| int | testEnvelopeData (void) |
| |
| int | testEnvelopeDataLargeBuffer (void) |
| |
| int | testEnvelopeCompress (void) |
| |
| int | testPGPEnvelopeCompressedDataImport (void) |
| |
| int | testEnvelopeSessionCrypt (void) |
| |
| int | testEnvelopeSessionCryptLargeBuffer (void) |
| |
| int | testEnvelopeCrypt (void) |
| |
| int | testEnvelopePasswordCrypt (void) |
| |
| int | testEnvelopePasswordCryptImport (void) |
| |
| int | testPGPEnvelopePasswordCryptImport (void) |
| |
| int | testEnvelopePKCCrypt (void) |
| |
| int | testEnvelopePKCCryptAlgo (void) |
| |
| int | testPGPEnvelopePKCCryptImport (void) |
| |
| int | testEnvelopeSign (void) |
| |
| int | testEnvelopeSignAlgo (void) |
| |
| int | testEnvelopeSignOverflow (void) |
| |
| int | testPGPEnvelopeSignedDataImport (void) |
| |
| int | testEnvelopeAuthenticate (void) |
| |
| int | testEnvelopeAuthEnc (void) |
| |
| int | testCMSEnvelopePKCCrypt (void) |
| |
| int | testCMSEnvelopePKCCryptDoubleCert (void) |
| |
| int | testCMSEnvelopePKCCryptImport (void) |
| |
| int | testCMSEnvelopeSign (void) |
| |
| int | testCMSEnvelopeDualSign (void) |
| |
| int | testCMSEnvelopeDetachedSig (void) |
| |
| int | testCMSEnvelopeSignedDataImport (void) |
| |
| int | testBasicCert (void) |
| |
| int | testCACert (void) |
| |
| int | testXyzzyCert (void) |
| |
| int | testTextStringCert (void) |
| |
| int | testComplexCert (void) |
| |
| int | testCertExtension (void) |
| |
| int | testCustomDNCert (void) |
| |
| int | testCertAttributeHandling (void) |
| |
| int | testSETCert (void) |
| |
| int | testAttributeCert (void) |
| |
| int | testCRL (void) |
| |
| int | testComplexCRL (void) |
| |
| int | testCertChain (void) |
| |
| int | testCertRequest (void) |
| |
| int | testComplexCertRequest (void) |
| |
| int | testCRMFRequest (void) |
| |
| int | testComplexCRMFRequest (void) |
| |
| int | testRevRequest (void) |
| |
| int | testCMSAttributes (void) |
| |
| int | testRTCSReqResp (void) |
| |
| int | testOCSPReqResp (void) |
| |
| int | testPKIUser (void) |
| |
| int | testCertImport (void) |
| |
| int | testCertImportECC (void) |
| |
| int | testCertReqImport (void) |
| |
| int | testCRLImport (void) |
| |
| int | testCertChainImport (void) |
| |
| int | testOCSPImport (void) |
| |
| int | testBase64CertImport (void) |
| |
| int | testBase64CertChainImport (void) |
| |
| int | testMiscImport (void) |
| |
| int | testNonchainCert (void) |
| |
| int | testCertComplianceLevel (void) |
| |
| int | testPathProcessing (void) |
| |
| int | testPKCS1Padding (void) |
| |
| int | testCertProcess (void) |
| |
| int | testCertManagement (void) |
| |
| int | testSessionSCEP (void) |
| |
| int | testSessionSCEPCACert (void) |
| |
| int | testSessionSCEPServer (void) |
| |
| int | testSessionCMP (void) |
| |
| int | testSessionCMPServer (void) |
| |
| int | testSessionPNPPKI (void) |
| |
| int | testSessionEnvTSP (void) |
| |
| int | testSessionHTTPCertstoreServer (void) |
| |
| int | testSessionRTCS (void) |
| |
| int | testSessionRTCSServer (void) |
| |
| int | testSessionOCSP (void) |
| |
| int | testSessionOCSPServer (void) |
| |
| int | testSessionTSP (void) |
| |
| int | testSessionTSPServer (void) |
| |
| int | testSessionUrlParse (void) |
| |
| int | testSessionAttributes (void) |
| |
| int | testSessionSSHv1 (void) |
| |
| int | testSessionSSH (void) |
| |
| int | testSessionSSHClientCert (void) |
| |
| int | testSessionSSHPortforward (void) |
| |
| int | testSessionSSHExec (void) |
| |
| int | testSessionSSH_SFTP (void) |
| |
| int | testSessionSSHv1Server (void) |
| |
| int | testSessionSSHServer (void) |
| |
| int | testSessionSSH_SFTPServer (void) |
| |
| int | testSessionSSL (void) |
| |
| int | testSessionSSLLocalSocket (void) |
| |
| int | testSessionSSLClientCert (void) |
| |
| int | testSessionSSLSharedKey (void) |
| |
| int | testSessionSSLServer (void) |
| |
| int | testSessionSSLServerCached (void) |
| |
| int | testSessionSSLServerClientCert (void) |
| |
| int | testSessionTLS (void) |
| |
| int | testSessionTLSServer (void) |
| |
| int | testSessionTLSServerSharedKey (void) |
| |
| int | testSessionTLS11 (void) |
| |
| int | testSessionTLS11Server (void) |
| |
| int | testSessionTLS12 (void) |
| |
| int | testSessionTLS12ClientCert (void) |
| |
| int | testSessionSSHv1ClientServer (void) |
| |
| int | testSessionSSHClientServer (void) |
| |
| int | testSessionSSHClientServerDsaKey (void) |
| |
| int | testSessionSSHClientServerEccKey (void) |
| |
| int | testSessionSSHClientServerFingerprint (void) |
| |
| int | testSessionSSHClientServerSFTP (void) |
| |
| int | testSessionSSHClientServerPortForward (void) |
| |
| int | testSessionSSHClientServerExec (void) |
| |
| int | testSessionSSHClientServerMultichannel (void) |
| |
| int | testSessionSSHClientServerDualThread (void) |
| |
| int | testSessionSSHClientServerMultiThread (void) |
| |
| int | testSessionSSLClientServer (void) |
| |
| int | testSessionSSLClientCertClientServer (void) |
| |
| int | testSessionTLSClientServer (void) |
| |
| int | testSessionTLSSharedKeyClientServer (void) |
| |
| int | testSessionTLSNoSharedKeyClientServer (void) |
| |
| int | testSessionTLSBulkTransferClientServer (void) |
| |
| int | testSessionTLSResumeClientServer (void) |
| |
| int | testSessionTLS11ClientServer (void) |
| |
| int | testSessionTLS12ClientServer (void) |
| |
| int | testSessionTLS12ClientServerEccKey (void) |
| |
| int | testSessionTLS12ClientServerEcc384Key (void) |
| |
| int | testSessionTLS12ClientCertClientServer (void) |
| |
| int | testSessionTLSClientServerDualThread (void) |
| |
| int | testSessionTLSClientServerMultiThread (void) |
| |
| int | testSessionHTTPCertstoreClientServer (void) |
| |
| int | testSessionRTCSClientServer (void) |
| |
| int | testSessionOCSPClientServer (void) |
| |
| int | testSessionTSPClientServer (void) |
| |
| int | testSessionTSPClientServerPersistent (void) |
| |
| int | testSessionSCEPClientServer (void) |
| |
| int | testSessionSCEPSHA2ClientServer (void) |
| |
| int | testSessionSCEPCACertClientServer (void) |
| |
| int | testSessionCMPClientServer (void) |
| |
| int | testSessionCMPSHA2ClientServer (void) |
| |
| int | testSessionCMPPKIBootClientServer (void) |
| |
| int | testSessionCMPFailClientServer (void) |
| |
| int | testSessionPNPPKIClientServer (void) |
| |
| int | testSessionPNPPKIDeviceClientServer (void) |
| |
| int | testSessionPNPPKICAClientServer (void) |
| |
| int | testSessionPNPPKIIntermedCAClientServer (void) |
| |
| int | testSessionSuiteBClientServer (void) |
| |
| BOOLEAN | testSelfTest (void) |
| |
| BOOLEAN | testLowLevel (void) |
| |
| BOOLEAN | testRandom (void) |
| |
| BOOLEAN | testConfig (void) |
| |
| BOOLEAN | testDevice (void) |
| |
| BOOLEAN | testMidLevel (void) |
| |
| BOOLEAN | testHighLevel (void) |
| |
| BOOLEAN | testCert (void) |
| |
| BOOLEAN | testCertMgmt (void) |
| |
| BOOLEAN | testKeysetFile (void) |
| |
| BOOLEAN | testKeysetDatabase (void) |
| |
| BOOLEAN | testEnveloping (void) |
| |
| BOOLEAN | testSessions (void) |
| |
| BOOLEAN | testSessionsLoopback (void) |
| |
| BOOLEAN | testUsers (void) |
| |