2 * Copyright (c) 2011-2014 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@
24 #include "SecAssessment.h"
26 #include "policyengine.h"
27 #include "xpcengine.h"
28 #include "csutilities.h"
30 #include <CoreFoundation/CFRuntime.h>
31 #include <CoreFoundation/CFBundlePriv.h>
32 #include <security_utilities/globalizer.h>
33 #include <security_utilities/unix++.h>
34 #include <security_utilities/cfmunge.h>
38 using namespace CodeSigning
;
41 static void esp_do_check(const char *op
, CFDictionaryRef dict
)
43 OSStatus result
= __esp_check_ns(op
, (void *)(CFDictionaryRef
)dict
);
45 MacOSError::throwMe(result
);
51 struct _SecAssessment
: private CFRuntimeBase
{
53 _SecAssessment(CFURLRef p
, AuthorityType typ
, CFDictionaryRef r
) : path(p
), type(typ
), result(r
) { }
55 CFCopyRef
<CFURLRef
> path
;
57 CFRef
<CFDictionaryRef
> result
;
60 static _SecAssessment
&ref(SecAssessmentRef r
)
61 { return *(_SecAssessment
*)r
; }
64 void *operator new (size_t size
)
66 return (void *)_CFRuntimeCreateInstance(NULL
, SecAssessmentGetTypeID(),
67 sizeof(_SecAssessment
) - sizeof(CFRuntimeBase
), NULL
);
70 static void finalize(CFTypeRef obj
)
71 { ((_SecAssessment
*)obj
)->~_SecAssessment(); }
74 typedef _SecAssessment SecAssessment
;
77 static const CFRuntimeClass assessmentClass
= {
79 "SecAssessment", // name
82 SecAssessment::finalize
, // finalize
90 static dispatch_once_t assessmentOnce
;
91 CFTypeID assessmentType
= _kCFRuntimeNotATypeID
;
93 CFTypeID
SecAssessmentGetTypeID()
95 dispatch_once(&assessmentOnce
, ^void() {
96 if ((assessmentType
= _CFRuntimeRegisterClass(&assessmentClass
)) == _kCFRuntimeNotATypeID
)
99 return assessmentType
;
104 // Common dictionary constants
106 CFStringRef kSecAssessmentContextKeyOperation
= CFSTR("operation");
107 CFStringRef kSecAssessmentOperationTypeExecute
= CFSTR("operation:execute");
108 CFStringRef kSecAssessmentOperationTypeInstall
= CFSTR("operation:install");
109 CFStringRef kSecAssessmentOperationTypeOpenDocument
= CFSTR("operation:lsopen");
113 // Read-only in-process access to the policy database
115 class ReadPolicy
: public PolicyDatabase
{
117 ReadPolicy() : PolicyDatabase(defaultDatabase
) { }
119 ModuleNexus
<ReadPolicy
> gDatabase
;
123 // An on-demand instance of the policy engine
125 ModuleNexus
<PolicyEngine
> gEngine
;
129 // Policy evaluation ("assessment") operations
131 CFStringRef kSecAssessmentContextKeyUTI
= CFSTR("context:uti");
133 CFStringRef kSecAssessmentContextKeyFeedback
= CFSTR("context:feedback");
134 CFStringRef kSecAssessmentFeedbackProgress
= CFSTR("feedback:progress");
135 CFStringRef kSecAssessmentFeedbackInfoCurrent
= CFSTR("current");
136 CFStringRef kSecAssessmentFeedbackInfoTotal
= CFSTR("total");
138 CFStringRef kSecAssessmentContextKeyPrimarySignature
= CFSTR("context:primary-signature");
140 CFStringRef kSecAssessmentAssessmentVerdict
= CFSTR("assessment:verdict");
141 CFStringRef kSecAssessmentAssessmentOriginator
= CFSTR("assessment:originator");
142 CFStringRef kSecAssessmentAssessmentAuthority
= CFSTR("assessment:authority");
143 CFStringRef kSecAssessmentAssessmentSource
= CFSTR("assessment:authority:source");
144 CFStringRef kSecAssessmentAssessmentAuthorityRow
= CFSTR("assessment:authority:row");
145 CFStringRef kSecAssessmentAssessmentAuthorityOverride
= CFSTR("assessment:authority:override");
146 CFStringRef kSecAssessmentAssessmentAuthorityOriginalVerdict
= CFSTR("assessment:authority:verdict");
147 CFStringRef kSecAssessmentAssessmentAuthorityFlags
= CFSTR("assessment:authority:flags");
148 CFStringRef kSecAssessmentAssessmentFromCache
= CFSTR("assessment:authority:cached");
149 CFStringRef kSecAssessmentAssessmentWeakSignature
= CFSTR("assessment:authority:weak");
150 CFStringRef kSecAssessmentAssessmentCodeSigningError
= CFSTR("assessment:cserror");
151 CFStringRef kSecAssessmentAssessmentNotarizationDate
= CFSTR("assessment:notarization-date");
153 CFStringRef kDisabledOverride
= CFSTR("security disabled");
155 SecAssessmentRef
SecAssessmentCreate(CFURLRef path
,
156 SecAssessmentFlags flags
,
157 CFDictionaryRef context
,
162 if (flags
& kSecAssessmentFlagAsynchronous
)
163 MacOSError::throwMe(errSecCSUnimplemented
);
165 AuthorityType type
= typeFor(context
, kAuthorityExecute
);
166 CFRef
<CFMutableDictionaryRef
> result
= makeCFMutableDictionary();
168 SYSPOLICY_ASSESS_API(cfString(path
).c_str(), int(type
), flags
);
171 if (__esp_enabled() && (flags
& kSecAssessmentFlagDirect
)) {
172 CFTemp
<CFDictionaryRef
> dict("{path=%O, flags=%d, context=%O, override=%d}", path
, flags
, context
, overrideAssessment());
173 esp_do_check("cs-assessment-evaluate", dict
);
176 if (flags
& kSecAssessmentFlagDirect
) {
177 // ask the engine right here to do its thing
178 SYSPOLICY_ASSESS_LOCAL();
179 gEngine().evaluate(path
, type
, flags
, context
, result
);
181 // relay the question to our daemon for consideration
182 SYSPOLICY_ASSESS_REMOTE();
183 xpcEngineAssess(path
, flags
, context
, result
);
185 } catch (CommonError
&error
) {
186 switch (error
.osStatus()) {
187 case CSSMERR_TP_CERT_REVOKED
:
190 if (!overrideAssessment(flags
))
191 throw; // let it go as an error
194 // record the error we would have returned
195 cfadd(result
, "{%O=#F,'assessment:error'=%d}}", kSecAssessmentAssessmentVerdict
, error
.osStatus());
197 // catch stray errors not conforming to the CommonError scheme
198 if (!overrideAssessment(flags
))
199 throw; // let it go as an error
200 cfadd(result
, "{%O=#F}", kSecAssessmentAssessmentVerdict
);
203 if (__esp_enabled() && (flags
& kSecAssessmentFlagDirect
)) {
204 CFTemp
<CFDictionaryRef
> dict("{path=%O, flags=%d, context=%O, override=%d, result=%O}", path
, flags
, context
, overrideAssessment(), (CFDictionaryRef
)result
);
205 __esp_notify_ns("cs-assessment-evaluate", (void *)(CFDictionaryRef
)dict
);
208 return new SecAssessment(path
, type
, result
.yield());
210 END_CSAPI_ERRORS1(NULL
)
214 static void traceResult(CFURLRef target
, MessageTrace
&trace
, std::string
&sanitized
)
216 static const char *interestingBundles
[] = {
223 "com.adobe.flashplayer.installmanager",
224 "com.adobe.Installers.Setup",
225 "com.adobe.PDApp.setup",
226 "com.bittorrent.uTorrent",
227 "com.divx.divx6formacinstaller",
228 "com.getdropbox.dropbox",
230 "com.Google.GoogleEarthPlugin.plugin",
231 "com.Google.GoogleEarthPlus",
233 "com.macpaw.CleanMyMac",
234 "com.microsoft.SilverlightInstaller",
235 "com.paragon-software.filesystems.NTFS.pkg",
236 "com.RealNetworks.RealPlayer",
238 "it.alfanet.squared5.MPEGStreamclip",
239 "org.mozilla.firefox",
245 string identifier
= "UNBUNDLED";
246 string version
= "UNKNOWN";
247 if (CFRef
<CFBundleRef
> bundle
= _CFBundleCreateUnique(NULL
, target
)) {
248 if (CFStringRef ident
= CFBundleGetIdentifier(bundle
))
249 identifier
= cfString(ident
);
250 if (CFStringRef vers
= CFStringRef(CFBundleGetValueForInfoDictionaryKey(bundle
, CFSTR("CFBundleShortVersionString"))))
251 version
= cfString(vers
);
254 CFRef
<CFURLRef
> url
= CFURLCopyAbsoluteURL(target
);
255 sanitized
= cfString(url
);
256 string::size_type rslash
= sanitized
.rfind('/');
257 if (rslash
!= string::npos
)
258 sanitized
= sanitized
.substr(rslash
+1);
259 bool keepFilename
= false;
260 for (const char **pfx
= interestingBundles
; *pfx
; pfx
++) {
261 size_t pfxlen
= strlen(*pfx
);
262 if (identifier
.compare(0, pfxlen
, *pfx
, pfxlen
) == 0)
263 if (pfxlen
== identifier
.size() || (*pfx
)[pfxlen
-1] == '.') {
269 string::size_type dot
= sanitized
.rfind('.');
270 if (dot
!= string::npos
)
271 sanitized
= sanitized
.substr(dot
);
273 sanitized
= "(none)";
276 trace
.add("signature2", "bundle:%s", identifier
.c_str());
277 trace
.add("signature3", "%s", sanitized
.c_str());
278 trace
.add("signature5", "%s", version
.c_str());
281 static void traceAssessment(SecAssessment
&assessment
, AuthorityType type
, CFDictionaryRef result
)
283 if (CFDictionaryGetValue(result
, CFSTR("assessment:remote")))
284 return; // just traced in syspolicyd
286 string authority
= "UNSPECIFIED";
287 bool overridden
= false;
288 bool old_overridden
= false;
289 if (CFDictionaryRef authdict
= CFDictionaryRef(CFDictionaryGetValue(result
, kSecAssessmentAssessmentAuthority
))) {
290 if (CFStringRef auth
= CFStringRef(CFDictionaryGetValue(authdict
, kSecAssessmentAssessmentSource
)))
291 authority
= cfString(auth
);
293 authority
= "no authority";
294 if (CFTypeRef override
= CFDictionaryGetValue(authdict
, kSecAssessmentAssessmentAuthorityOverride
))
295 if (CFEqual(override
, kDisabledOverride
)) {
296 old_overridden
= true;
297 if (CFDictionaryGetValue(authdict
, kSecAssessmentAssessmentAuthorityOriginalVerdict
) == kCFBooleanFalse
)
302 MessageTrace
trace("com.apple.security.assessment.outcome2", NULL
);
303 std::string sanitized
;
304 traceResult(assessment
.path
, trace
, sanitized
);
305 trace
.add("signature4", "%d", type
);
307 if (CFDictionaryGetValue(result
, kSecAssessmentAssessmentVerdict
) == kCFBooleanFalse
) {
308 trace
.add("signature", "denied:%s", authority
.c_str());
309 trace
.send("assessment denied for %s", sanitized
.c_str());
310 } else if (overridden
) { // would have failed except for override
311 trace
.add("signature", "defeated:%s", authority
.c_str());
312 trace
.send("assessment denied for %s but overridden", sanitized
.c_str());
313 } else if (old_overridden
) { // would have succeeded even without override
314 trace
.add("signature", "override:%s", authority
.c_str());
315 trace
.send("assessment granted for %s and overridden", sanitized
.c_str());
317 trace
.add("signature", "granted:%s", authority
.c_str());
318 trace
.send("assessment granted for %s by %s", sanitized
.c_str(), authority
.c_str());
322 static void traceUpdate(CFTypeRef target
, CFDictionaryRef context
, CFDictionaryRef result
)
324 // only trace add operations on URL targets
325 if (target
== NULL
|| CFGetTypeID(target
) != CFURLGetTypeID())
327 CFStringRef edit
= CFStringRef(CFDictionaryGetValue(context
, kSecAssessmentContextKeyUpdate
));
328 if (!CFEqual(edit
, kSecAssessmentUpdateOperationAdd
))
330 MessageTrace
trace("com.apple.security.assessment.update", NULL
);
331 std::string sanitized
;
332 traceResult(CFURLRef(target
), trace
, sanitized
);
333 trace
.send("added rule for %s", sanitized
.c_str());
338 // At present, CopyResult simply retrieves the result already formed by Create.
339 // In the future, this will be more lazy.
341 CFDictionaryRef
SecAssessmentCopyResult(SecAssessmentRef assessmentRef
,
342 SecAssessmentFlags flags
,
347 SecAssessment
&assessment
= SecAssessment::ref(assessmentRef
);
348 CFCopyRef
<CFDictionaryRef
> result
= assessment
.result
;
349 if (overrideAssessment(flags
)) {
350 // turn rejections into approvals, but note that we did that
351 CFTypeRef verdict
= CFDictionaryGetValue(result
, kSecAssessmentAssessmentVerdict
);
352 if (verdict
== kCFBooleanFalse
) {
353 CFRef
<CFMutableDictionaryRef
> adulterated
= makeCFMutableDictionary(result
.get());
354 CFDictionarySetValue(adulterated
, kSecAssessmentAssessmentVerdict
, kCFBooleanTrue
);
355 if (CFDictionaryRef authority
= CFDictionaryRef(CFDictionaryGetValue(adulterated
, kSecAssessmentAssessmentAuthority
))) {
356 CFRef
<CFMutableDictionaryRef
> authority2
= makeCFMutableDictionary(authority
);
357 CFDictionarySetValue(authority2
, kSecAssessmentAssessmentAuthorityOverride
, kDisabledOverride
);
358 CFDictionarySetValue(authority2
, kSecAssessmentAssessmentAuthorityOriginalVerdict
, verdict
);
359 CFDictionarySetValue(adulterated
, kSecAssessmentAssessmentAuthority
, authority2
);
361 cfadd(adulterated
, "{%O={%O=%O}}",
362 kSecAssessmentAssessmentAuthority
, kSecAssessmentAssessmentAuthorityOverride
, kDisabledOverride
);
364 result
= adulterated
.get();
367 traceAssessment(assessment
, assessment
.type
, result
);
368 return result
.yield();
370 END_CSAPI_ERRORS1(NULL
)
375 // Policy editing operations.
376 // These all make permanent changes to the system-wide authority records.
378 CFStringRef kSecAssessmentContextKeyUpdate
= CFSTR("update");
379 CFStringRef kSecAssessmentUpdateOperationAdd
= CFSTR("update:add");
380 CFStringRef kSecAssessmentUpdateOperationRemove
= CFSTR("update:remove");
381 CFStringRef kSecAssessmentUpdateOperationEnable
= CFSTR("update:enable");
382 CFStringRef kSecAssessmentUpdateOperationDisable
= CFSTR("update:disable");
383 CFStringRef kSecAssessmentUpdateOperationFind
= CFSTR("update:find");
385 CFStringRef kSecAssessmentUpdateKeyAuthorization
= CFSTR("update:authorization");
386 CFStringRef kSecAssessmentUpdateKeyPriority
= CFSTR("update:priority");
387 CFStringRef kSecAssessmentUpdateKeyLabel
= CFSTR("update:label");
388 CFStringRef kSecAssessmentUpdateKeyExpires
= CFSTR("update:expires");
389 CFStringRef kSecAssessmentUpdateKeyAllow
= CFSTR("update:allow");
390 CFStringRef kSecAssessmentUpdateKeyRemarks
= CFSTR("update:remarks");
392 CFStringRef kSecAssessmentUpdateKeyRow
= CFSTR("update:row");
393 CFStringRef kSecAssessmentUpdateKeyCount
= CFSTR("update:count");
394 CFStringRef kSecAssessmentUpdateKeyFound
= CFSTR("update:found");
396 CFStringRef kSecAssessmentRuleKeyID
= CFSTR("rule:id");
397 CFStringRef kSecAssessmentRuleKeyPriority
= CFSTR("rule:priority");
398 CFStringRef kSecAssessmentRuleKeyAllow
= CFSTR("rule:allow");
399 CFStringRef kSecAssessmentRuleKeyLabel
= CFSTR("rule:label");
400 CFStringRef kSecAssessmentRuleKeyRemarks
= CFSTR("rule:remarks");
401 CFStringRef kSecAssessmentRuleKeyRequirement
= CFSTR("rule:requirement");
402 CFStringRef kSecAssessmentRuleKeyType
= CFSTR("rule:type");
403 CFStringRef kSecAssessmentRuleKeyExpires
= CFSTR("rule:expires");
404 CFStringRef kSecAssessmentRuleKeyDisabled
= CFSTR("rule:disabled");
405 CFStringRef kSecAssessmentRuleKeyBookmark
= CFSTR("rule:bookmark");
408 Boolean
SecAssessmentUpdate(CFTypeRef target
,
409 SecAssessmentFlags flags
,
410 CFDictionaryRef context
,
413 if (CFDictionaryRef outcome
= SecAssessmentCopyUpdate(target
, flags
, context
, errors
)) {
421 CFDictionaryRef
SecAssessmentCopyUpdate(CFTypeRef target
,
422 SecAssessmentFlags flags
,
423 CFDictionaryRef context
,
428 CFDictionary
ctx(context
, errSecCSInvalidAttributeValues
);
429 CFRef
<CFDictionaryRef
> result
;
431 // make context exist and writable
432 CFRef
<CFMutableDictionaryRef
> mcontext
= context
? makeCFMutableDictionary(context
) : makeCFMutableDictionary();
434 if (CFDictionaryGetValue(mcontext
, kSecAssessmentUpdateKeyAuthorization
) == NULL
) {
435 // no authorization passed in. Make an empty one in this context
436 AuthorizationRef authorization
;
437 MacOSError::check(AuthorizationCreate(NULL
, NULL
, kAuthorizationFlagDefaults
, &authorization
));
438 AuthorizationExternalForm extform
;
439 MacOSError::check(AuthorizationMakeExternalForm(authorization
, &extform
));
440 CFDictionaryAddValue(mcontext
, kSecAssessmentUpdateKeyAuthorization
, CFTempData(&extform
, sizeof(extform
)));
441 if (!(flags
& kSecAssessmentFlagDirect
))
442 AuthorizationFree(authorization
, kAuthorizationFlagDefaults
);
445 if (flags
& kSecAssessmentFlagDirect
) {
446 if (__esp_enabled()) {
447 CFTemp
<CFDictionaryRef
> dict("{target=%O, flags=%d, context=%O}", target
, flags
, context
);
448 OSStatus esp_result
= __esp_check_ns("cs-assessment-update", (void *)(CFDictionaryRef
)dict
);
449 if (esp_result
!= noErr
)
453 // ask the engine right here to do its thing
454 result
= gEngine().update(target
, flags
, ctx
);
456 // relay the question to our daemon for consideration
457 result
= xpcEngineUpdate(target
, flags
, ctx
);
460 if (__esp_enabled() && (flags
& kSecAssessmentFlagDirect
)) {
461 CFTemp
<CFDictionaryRef
> dict("{target=%O, flags=%d, context=%O, outcome=%O}", target
, flags
, context
, (CFDictionaryRef
)result
);
462 __esp_notify_ns("cs-assessment-update", (void *)(CFDictionaryRef
)dict
);
465 traceUpdate(target
, context
, result
);
466 return result
.yield();
468 END_CSAPI_ERRORS1(NULL
)
472 updateAuthority(const char *authority
, bool enable
, CFErrorRef
*errors
)
474 CFStringRef updateValue
= enable
? kSecAssessmentUpdateOperationEnable
: kSecAssessmentUpdateOperationDisable
;
475 CFTemp
<CFDictionaryRef
> ctx("{%O=%s, %O=%O}", kSecAssessmentUpdateKeyLabel
, authority
, kSecAssessmentContextKeyUpdate
, updateValue
);
476 SecAssessmentUpdate(NULL
, kSecCSDefaultFlags
, ctx
, errors
);
481 // The fcntl of System Policies.
482 // For those very special requests.
484 Boolean
SecAssessmentControl(CFStringRef control
, void *arguments
, CFErrorRef
*errors
)
488 CFTemp
<CFDictionaryRef
> dict("{control=%O}", control
);
489 esp_do_check("cs-assessment-control", dict
);
491 if (CFEqual(control
, CFSTR("ui-enable"))) {
493 MessageTrace
trace("com.apple.security.assessment.state", "enable");
494 trace
.send("enable assessment outcomes");
496 } else if (CFEqual(control
, CFSTR("ui-disable"))) {
497 setAssessment(false);
498 MessageTrace
trace("com.apple.security.assessment.state", "disable");
499 trace
.send("disable assessment outcomes");
501 } else if (CFEqual(control
, CFSTR("ui-status"))) {
502 CFBooleanRef
&result
= *(CFBooleanRef
*)(arguments
);
503 if (overrideAssessment())
504 result
= kCFBooleanFalse
;
506 result
= kCFBooleanTrue
;
508 } else if (CFEqual(control
, CFSTR("ui-enable-devid"))) {
509 updateAuthority("Developer ID", true, errors
);
510 updateAuthority("Notarized Developer ID", true, errors
);
511 MessageTrace
trace("com.apple.security.assessment.state", "enable-devid");
512 trace
.send("enable Developer ID approval");
514 } else if (CFEqual(control
, CFSTR("ui-disable-devid"))) {
515 updateAuthority("Developer ID", false, errors
);
516 MessageTrace
trace("com.apple.security.assessment.state", "disable-devid");
517 trace
.send("disable Developer ID approval");
519 } else if (CFEqual(control
, CFSTR("ui-get-devid"))) {
520 xpcEngineCheckDevID((CFBooleanRef
*)(arguments
));
522 } else if (CFEqual(control
, CFSTR("ui-get-devid-local"))) {
523 CFBooleanRef
&result
= *(CFBooleanRef
*)(arguments
);
524 if (gEngine().value
<int>("SELECT disabled FROM authority WHERE label = 'Developer ID';", true))
525 result
= kCFBooleanFalse
;
527 result
= kCFBooleanTrue
;
529 } else if (CFEqual(control
, CFSTR("ui-enable-notarized"))) {
530 updateAuthority("Notarized Developer ID", true, errors
);
531 MessageTrace
trace("com.apple.security.assessment.state", "enable-notarized");
532 trace
.send("enable Notarized Developer ID approval");
534 } else if (CFEqual(control
, CFSTR("ui-disable-notarized"))) {
535 updateAuthority("Notarized Developer ID", false, errors
);
536 MessageTrace
trace("com.apple.security.assessment.state", "disable-notarized");
537 trace
.send("disable Notarized Developer ID approval");
539 } else if (CFEqual(control
, CFSTR("ui-get-notarized"))) {
540 xpcEngineCheckNotarized((CFBooleanRef
*)(arguments
));
542 } else if (CFEqual(control
, CFSTR("ui-get-notarized-local"))) {
543 CFBooleanRef
&result
= *(CFBooleanRef
*)(arguments
);
544 if (gEngine().value
<int>("SELECT disabled FROM authority WHERE label = 'Notarized Developer ID';", true))
545 result
= kCFBooleanFalse
;
547 result
= kCFBooleanTrue
;
549 } else if (CFEqual(control
, CFSTR("ui-record-reject"))) {
550 // send this through syspolicyd for update validation
551 xpcEngineRecord(CFDictionaryRef(arguments
));
553 } else if (CFEqual(control
, CFSTR("ui-record-reject-local"))) {
554 // perform the local operation (requires root)
555 gEngine().recordFailure(CFDictionaryRef(arguments
));
557 } else if (CFEqual(control
, CFSTR("ui-recall-reject"))) {
558 // no special privileges required for this, so read directly
559 CFDictionaryRef
&result
= *(CFDictionaryRef
*)(arguments
);
560 CFRef
<CFDataRef
> infoData
= cfLoadFile(lastRejectFile
);
562 result
= makeCFDictionaryFrom(infoData
);
566 } else if (CFEqual(control
, CFSTR("rearm-status"))) {
567 CFTimeInterval
&result
= *(CFTimeInterval
*)(arguments
);
568 if (!queryRearmTimer(result
))
572 MacOSError::throwMe(errSecCSInvalidAttributeValues
);
574 END_CSAPI_ERRORS1(false)
577 Boolean
SecAssessmentTicketRegister(CFDataRef ticketData
, CFErrorRef
*errors
)
581 xpcEngineTicketRegister(ticketData
);
584 END_CSAPI_ERRORS1(false)
587 Boolean
SecAssessmentRegisterPackageTicket(CFURLRef packageURL
, CFErrorRef
* errors
)
591 string path
= cfString(packageURL
);
592 Xar
xar(path
.c_str());
595 MacOSError::throwMe(errSecParam
);
598 xar
.registerStapledNotarization();
601 END_CSAPI_ERRORS1(false)
604 Boolean
SecAssessmentTicketLookup(CFDataRef hash
, SecCSDigestAlgorithm hashType
, SecAssessmentTicketFlags flags
, double *date
, CFErrorRef
*errors
)
608 xpcEngineTicketLookup(hash
, hashType
, flags
, date
);
611 END_CSAPI_ERRORS1(false)