X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/c38e3ce98599a410a47dc10253faa4d5830f13b2..427c49bcad63d042b29ada2ac27e3dfc4845c779:/sec/SOSCircle/CKBridge/SOSCloudKeychainConstants.c?ds=inline diff --git a/sec/SOSCircle/CKBridge/SOSCloudKeychainConstants.c b/sec/SOSCircle/CKBridge/SOSCloudKeychainConstants.c new file mode 100644 index 00000000..291fb501 --- /dev/null +++ b/sec/SOSCircle/CKBridge/SOSCloudKeychainConstants.c @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2012 Apple Computer, Inc. All Rights Reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + This XPC service is essentially just a proxy to iCloud KVS, which exists since + the main security code cannot link against Foundation. + + See sendTSARequestWithXPC in tsaSupport.c for how to call the service + + The client of an XPC service does not get connection events, nor does it + need to deal with transactions. +*/ + +//------------------------------------------------------------------------------------------------ + + +#include +#include "SOSCloudKeychainConstants.h" + +const uint64_t kCKDXPCVersion = 1; + +// seems like launchd looks for the BundleIdentifier, not the name +const char *xpcServiceName = "com.apple.security.cloudkeychainproxy3"; //"CloudKeychainProxy"; + +const char *kMessageKeyOperation = "operation"; +const char *kMessageKeyKey = "key"; +const char *kMessageKeyValue = "value"; +const char *kMessageKeyError = "error"; +const char *kMessageKeyVersion = "version"; +const char *kMessageKeyGetNewKeysOnly = "GetNewKeysOnly"; +const char *kMessageKeyKeysToGet = "KeysToGet"; +const char *kMessageKeyKeysRequireFirstUnlock = "KeysRequireFirstUnlock"; +const char *kMessageKeyKeysRequiresUnlocked = "KeysRequiresUnlocked"; +const char *kMessageKeyClientIdentifier = "ClientIdentifier"; +const char *kMessageKeyNotificationFlags = "NotificationFlags"; + +const char *kMessageOperationItemChanged = "ItemChanged"; + +const char *kOperationClearStore = "ClearStore"; +const char *kOperationSynchronize = "Synchronize"; +const char *kOperationSynchronizeAndWait = "SynchronizeAndWait"; + +const char *kOperationPUTDictionary = "PUTDictionary"; +const char *kOperationGETv2 = "GETv2"; +const char *kOperationRemoveObjectForKey = "RemoveObjectForKey"; + +const char *kOperationRegisterKeysAndGet = "RegisterKeysAndGet"; +const char *kOperationUnregisterKeys = "UnregisterKeys"; + +const char *kOperationUILocalNotification = "UILocalNotification"; + +const char *kOperationSetParams = "SetParams"; +const char *kOperationRequestSyncWithAllPeers = "requestSyncWithAllPeers"; + +const CFStringRef kParamCallbackMethod = CFSTR("CallbackMethod"); +const CFStringRef kParamCallbackMethodSecurityd = CFSTR("CallbackMethodSecurityd"); +const CFStringRef kParamCallbackMethodXPC = CFSTR("CallbackMethodXPC"); + +/* + The values for the KVS notification and KVS Store ID must be identical to the values + in syncdefaultsd (SYDApplication.m). The notification string is used in two places: + it is in our launchd plist (com.apple.security.cloudkeychainproxy.plist) as the + LaunchEvents/com.apple.notifyd.matching key and is examined in code in the stream event handler. + + The KVS Store ID (_SYDRemotePreferencesStoreIdentifierKey in SYDApplication.m) must + be in the entitlements. The bundle identifier is (com.apple.security.cloudkeychainproxy3) + is used by installInfoForBundleIdentifiers in SYDApplication.m and is used to look up our + daemon to figure out what store to use, etc. +*/ + +const char * const kCloudKeychainStorechangeChangeNotification = "com.apple.security.cloudkeychainproxy.kvstorechange3"; // was "com.apple.security.cloudkeychain.kvstorechange" for seeds + +const char *kNotifyTokenForceUpdate = "com.apple.security.cloudkeychain.forceupdate";