#include <unistd.h>
#include <time.h>
#include <sys/param.h>
-#include "test/testenv.h"
+#include "regressions/test/testenv.h"
#include "utilities/SecCFRelease.h"
#include "keychain_regressions.h"
}
}
+static void PrintStringToMatchRelease(CFStringRef CF_CONSUMED nameStr)
+{
+ PrintStringToMatch(nameStr);
+ CFReleaseNull(nameStr);
+}
+
static void PrintSecCertificate(SecCertificateRef certificate)
{
CFTypeRef results = NULL;
if (debug) {
PrintStringToMatch(nameStr);
- PrintStringToMatch(CFCopyDescription(validOnDate));
+ PrintStringToMatchRelease(CFCopyDescription(validOnDate));
}
OSStatus status = SecItemCopyMatching(query, &results);
CFTypeRef results = NULL;
if (debug) {
PrintStringToMatch(emailAddr);
- PrintStringToMatch(CFCopyDescription(kSecPolicyAppleSMIME));
- PrintStringToMatch(CFCopyDescription(validOnDate));
+ PrintStringToMatchRelease(CFCopyDescription(kSecPolicyAppleSMIME));
+ PrintStringToMatchRelease(CFCopyDescription(validOnDate));
}
OSStatus status = SecItemCopyMatching(query, &results);
if (debug) {
PrintStringToMatch(emailAddr);
- PrintStringToMatch(CFCopyDescription(validOnDate));
+ PrintStringToMatchRelease(CFCopyDescription(validOnDate));
}
status = SecItemCopyMatching(query, (CFTypeRef*)&validatedCertificate);
&kCFTypeDictionaryKeyCallBacks,
&kCFTypeDictionaryValueCallBacks);
- if (debug) PrintStringToMatch(CFCopyDescription(policyIdentifier));
+ if (debug) PrintStringToMatchRelease(CFCopyDescription(policyIdentifier));
status = SecItemCopyMatching(query, &results);
CFTypeRef results = NULL;
if (debug) {
PrintStringToMatch(nameStr);
- PrintStringToMatch(CFCopyDescription(validOnDate));
+ PrintStringToMatchRelease(CFCopyDescription(validOnDate));
}
OSStatus status = SecItemCopyMatching(query, &results);
if (debug) {
PrintStringToMatch(emailAddr);
- PrintStringToMatch(CFCopyDescription(validOnDate));
+ PrintStringToMatchRelease(CFCopyDescription(validOnDate));
}
status = SecItemCopyMatching(query, (CFTypeRef*)&validatedIdentity);
// look up identity by policy, want first result as a CFDictionary of attributes (should find "Test SSL User" identity)
result += FindIdentityByPolicy(keychain, sslPolicy, kSecReturnAttributes, kSecMatchLimitOne, 1, noErr);
+ CFReleaseNull(sslPolicy);
// look up identity by policy, expect errSecItemNotFound error (this assumes no code signing identity is present!)
result += FindIdentityByPolicy(keychain, codeSigningPolicy, kSecReturnRef, kSecMatchLimitOne, 0, errSecItemNotFound);
+ CFReleaseNull(codeSigningPolicy);
// -------------------------
// test kSecMatchValidOnDate