4 * Open default keychain; get status to actually instatiate the thing; release.
6 #include "testParams.h"
10 #include <Security/Security.h>
12 /* for malloc debug */
15 /* for tracking down KC crasher */
16 #define ABORT_ON_ERROR 1
18 int kcStatusInit(TestParams
*testParams
)
24 int kcStatus(TestParams
*testParams
)
29 SecKeychainStatus kcStatus
;
31 for(loopNum
=0; loopNum
<testParams
->numLoops
; loopNum
++) {
32 if(testParams
->verbose
) {
33 printf("kcStatus loop %d\n", loopNum
);
35 else if(!testParams
->quiet
) {
36 printChar(testParams
->progressChar
);
39 ortn
= SecKeychainCopyDefault(&kcRef
);
41 cssmPerror("SecKeychainCopyDefault", ortn
);
49 ortn
= SecKeychainGetStatus(kcRef
, &kcStatus
);
51 cssmPerror("SecKeychainGetStatus", ortn
);
52 printf("***HEY! A keychain obtained via SecKeychainCopyDefault() resulted\n");
53 printf(" in a failed SecKeychainGetStatus()! You really need to fix this!\n");
54 printf("kcRef %p\n", kcRef
);
57 ortn
= SecKeychainGetPath(kcRef
, &len
, path
);
59 cssmPerror("SecKeychainGetPath", ortn
);
62 printf("kc path %s\n", path
);
76 printf("Hit CR to continue: ");