]> git.saurik.com Git - apple/security.git/blob - OSX/sec/Security/Regressions/secitem/si-82-token-ag.c
Security-58286.200.222.tar.gz
[apple/security.git] / OSX / sec / Security / Regressions / secitem / si-82-token-ag.c
1 //
2 // si-82-token-ag.c
3 // Copyright (c) 2013-2014 Apple Inc. All Rights Reserved.
4 //
5 //
6
7 #include <CoreFoundation/CoreFoundation.h>
8 #include <Security/SecItem.h>
9 #include <Security/SecItemPriv.h>
10 #include <Security/SecBase.h>
11 #include <utilities/array_size.h>
12 #include <utilities/SecCFWrappers.h>
13
14 #include "Security_regressions.h"
15
16 static void tests(void) {
17 CFMutableDictionaryRef dict = CFDictionaryCreateMutable(NULL, 0, NULL, NULL);
18 CFDictionaryAddValue(dict, kSecClass, kSecClassGenericPassword);
19 CFDictionaryAddValue(dict, kSecAttrService, CFSTR("test"));
20 CFDictionaryAddValue(dict, kSecAttrAccessGroup, kSecAttrAccessGroupToken);
21
22 is_status(SecItemAdd(dict, NULL), errSecMissingEntitlement);
23 is_status(SecItemCopyMatching(dict, NULL), errSecItemNotFound);
24
25 CFRelease(dict);
26 }
27
28 int si_82_token_ag(int argc, char *const *argv) {
29
30 plan_tests(2);
31 tests();
32 return 0;
33 }