]> git.saurik.com Git - apple/security.git/blobdiff - Security/libsecurity_codesigning/lib/SecTask.c
Security-57031.30.12.tar.gz
[apple/security.git] / Security / libsecurity_codesigning / lib / SecTask.c
index f3a36d2a6b69a3076be064674afb74ea2859c5c8..581fa91ee54e065ea2ec637e934a4a9ebf081e6c 100644 (file)
@@ -290,3 +290,11 @@ CFDictionaryRef SecTaskCopyValuesForEntitlements(SecTaskRef task, CFArrayRef ent
 
        return values;
 }
 
        return values;
 }
+
+Boolean SecTaskEntitlementsValidated(SecTaskRef task) {
+    // TODO: Cache the result
+    uint32_t csflags = 0;
+    const uint32_t mask = CS_VALID | CS_KILL | CS_ENTITLEMENTS_VALIDATED;
+    int rc = csops_task(task, CS_OPS_STATUS, &csflags, sizeof(csflags));
+    return rc != -1 && ((csflags & mask) == mask);
+}