2 * Copyright (c) 2015 Apple Inc. All Rights Reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
25 * SOSViewQueries.c - Implementation of a manifest caching views and children
28 #include <Security/SecureObjectSync/SOSViewQueries.h>
31 const CFStringRef kSOSViewiCloudBackupV0
= CFSTR("iCloudBackupV0");
32 const CFStringRef kSOSViewiTunesBackupV0
= CFSTR("iTunesBackupV0");
35 // orquery ::= (or andquery,...)
36 // andquery ::= (and attrquery, ...)
37 // attrquery ::= (attrname optail)
38 // optail ::= [ null | any | true | false | eq value... | neq value... ]
39 // attrname ::= string
40 // value ::= string | data | number | digest
41 // string ::= identifer
44 // hexdata ::= X' hexwords... '
45 // hexwords ::= hexdigit hexdigit
46 // hexdigit ::= [0-9A-F]
48 // Keychain Sync View Queries
49 const CFStringRef kSOSViewQueryKeychainV0
=
50 CFSTR("(and (class eq genp inet keys) (sync true) (pdmn ak ck dk aku cku dku) (tkid null) (vwht null) (any genpv6 inetv6 keysv6)");
51 const CFStringRef kSOSViewQueryKeychainV2
=
52 CFSTR("(and (class eq genp inet keys cert) (sync true) (pdmn ak ck dk aku cku dku) (vwht null) (all genpv8 ))");
54 // Backup View Queries
55 const CFStringRef kSOSViewQueryiCloudBackupV0
=
56 CFSTR("(and (class eq genp inet keys cert) (sync true) (pdmn ak ck dk aku cku dku) (tkid null) (vwht null))");
57 const CFStringRef kSOSViewQueryiCloudBackupV2
=
58 CFSTR("(and (class eq genp inet keys cert) (pdmn ak ck dk aku cku dku) (tkid null) (vwht null))");
59 const CFStringRef kSOSViewQueryiTunesBackupV0
=
60 CFSTR("(and (class eq genp inet keys cert) (pdmn ak ck dk aku cku dku) (tkid null) (vwht null))");
61 const CFStringRef kSOSViewQueryiTunesBackupV2
=
62 CFSTR("(and (class eq genp inet keys cert) (pdmn ak ck dk aku cku dku) (tkid null) (vwht null))");
64 // General View Queries
65 const CFStringRef kSOSViewQueryAppleTV
=
66 CFSTR("(and (class eq genp inet keys cert) (sync true) (pdmn ak ck dk aku cku dku) (vwht eq AppleTV))");
67 const CFStringRef kSOSViewQueryHomeKit
=
68 CFSTR("(and (class eq genp inet keys cert) (sync true) (pdmn ak ck dk aku cku dku) (vwht eq HomeKit))");
71 const CFStringRef kSOSViewQueryPCSMasterKey
=
72 CFSTR("(and (class eq genp inet keys cert) (sync true) (pdmn ak ck dk aku cku dku) (vwht eq PCS-MasterKey))");
73 const CFStringRef kSOSViewQueryPCSiCloudDrive
=
74 CFSTR("(and (class eq genp inet keys cert) (sync true) (pdmn ak ck dk aku cku dku) (vwht eq PCS-iCloudDrive))");
75 const CFStringRef kSOSViewQueryPCSPhotos
=
76 CFSTR("(and (class eq genp inet keys cert) (sync true) (pdmn ak ck dk aku cku dku) (vwht eq PCS-Photos))");
77 const CFStringRef kSOSViewQueryPCSCloudKit
=
78 CFSTR("(and (class eq genp inet keys cert) (sync true) (pdmn ak ck dk aku cku dku) (vwht eq PCS-CloudKit))");
79 const CFStringRef kSOSViewQueryPCSEscrow
=
80 CFSTR("(and (class eq genp inet keys cert) (sync true) (pdmn ak ck dk aku cku dku) (vwht eq PCS-Escrow))");
81 const CFStringRef kSOSViewQueryPCSFDE
=
82 CFSTR("(and (class eq genp inet keys cert) (sync true) (pdmn ak ck dk aku cku dku) (vwht eq PCS-FDE))");
83 const CFStringRef kSOSViewQueryPCSMailDrop
=
84 CFSTR("(and (class eq genp inet keys cert) (sync true) (pdmn ak ck dk aku cku dku) (vwht eq PCS-Maildrop))");
85 const CFStringRef kSOSViewQueryPCSiCloudBackup
=
86 CFSTR("(and (class eq genp inet keys cert) (sync true) (pdmn ak ck dk aku cku dku) (vwht eq PCS-Backup))");
87 const CFStringRef kSOSViewQueryPCSNotes
=
88 CFSTR("(and (class eq genp inet keys cert) (sync true) (pdmn ak ck dk aku cku dku) (vwht eq PCS-Notes))");
89 const CFStringRef kSOSViewQueryPCSiMessage
=
90 CFSTR("(and (class eq genp inet keys cert) (sync true) (pdmn ak ck dk aku cku dku) (vwht eq PCS-iMessage))");
91 const CFStringRef kSOSViewQueryPCSFeldspar
=
92 CFSTR("(and (class eq genp inet keys cert) (sync true) (pdmn ak ck dk aku cku dku) (vwht eq PCS-Feldspar))");