X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/80e2389990082500d76eb566d4946be3e786c3ef..d8f41ccd20de16f8ebe2ccc84d47bf1cb2b26bbb:/SecurityTests/clxutils/threadTest/copyRoots.cpp?ds=inline diff --git a/SecurityTests/clxutils/threadTest/copyRoots.cpp b/SecurityTests/clxutils/threadTest/copyRoots.cpp new file mode 100644 index 00000000..f0d4fa1c --- /dev/null +++ b/SecurityTests/clxutils/threadTest/copyRoots.cpp @@ -0,0 +1,46 @@ +/* + * DER decode test + */ +#include "testParams.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int copyRootsInit( + TestParams *testParams) +{ + /* nothing for now */ + return 0; +} + +int copyRootsTest(TestParams *testParams) +{ + for(unsigned loop=0; loopnumLoops; loop++) { + if(testParams->verbose) { + printf("derDecode thread %d: loop %d\n", + testParams->threadNum, loop); + } + else if(!testParams->quiet) { + printChar(testParams->progressChar); + } + + CFArrayRef theArray = NULL; + OSStatus ortn = SecTrustSettingsCopyQualifiedCerts(&CSSMOID_APPLE_TP_SSL, + "localhost", 10, // policyString + CSSM_KEYUSE_ENCRYPT, // wrong key use type but that's what ST passes + &theArray); + if(ortn) { + cssmPerror("SecTrustSettingsCopyQualifiedCerts", ortn); + return 1; + } + CFRelease(theArray); + } + return 0; +}