From d35a68f5be1ea8ae368e30fa0660650f82a02746 Mon Sep 17 00:00:00 2001 From: "C.W. Betts" Date: Mon, 7 Apr 2014 23:11:15 -0600 Subject: [PATCH] =?UTF-8?q?We=20are=20explicitly=20targeting=20Mac=20OS=20?= =?UTF-8?q?X=2010.6=20and=20later:=20We=20don=E2=80=99t=20need=20to=20chec?= =?UTF-8?q?k=20to=20see=20if=20some=20code=20signing=20functions=20are=20a?= =?UTF-8?q?vailable:=20they=20should=20be=20available=20already.=20TODO:?= =?UTF-8?q?=20check=20to=20see=20when=20xar=20was=20added.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SUBinaryDeltaCommon.m | 3 +-- SUCodeSigningVerifier.m | 16 +--------------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/SUBinaryDeltaCommon.m b/SUBinaryDeltaCommon.m index bd2d2607..cb7a373c 100644 --- a/SUBinaryDeltaCommon.m +++ b/SUBinaryDeltaCommon.m @@ -15,8 +15,7 @@ #include #include #include - -extern int xar_close(void*) __attribute__((weak_import)); +#include int binaryDeltaSupported(void) { diff --git a/SUCodeSigningVerifier.m b/SUCodeSigningVerifier.m index b066e0e6..67d3884c 100644 --- a/SUCodeSigningVerifier.m +++ b/SUCodeSigningVerifier.m @@ -7,25 +7,14 @@ // #include +#include #import "SUCodeSigningVerifier.h" #import "SULog.h" @implementation SUCodeSigningVerifier -extern OSStatus SecCodeCopySelf(SecCSFlags flags, SecCodeRef *self) __attribute__((weak_import)); - -extern OSStatus SecCodeCopyDesignatedRequirement(SecStaticCodeRef code, SecCSFlags flags, SecRequirementRef *requirement) __attribute__((weak_import)); - -extern OSStatus SecStaticCodeCreateWithPath(CFURLRef path, SecCSFlags flags, SecStaticCodeRef *staticCode) __attribute__((weak_import)); - -extern OSStatus SecStaticCodeCheckValidityWithErrors(SecStaticCodeRef staticCode, SecCSFlags flags, SecRequirementRef requirement, CFErrorRef *errors) __attribute__((weak_import)); - - + (BOOL)codeSignatureIsValidAtPath:(NSString *)destinationPath error:(NSError **)error { - // This API didn't exist prior to 10.6. - if (SecCodeCopySelf == NULL) return NO; - OSStatus result; SecRequirementRef requirement = NULL; SecStaticCodeRef staticCode = NULL; @@ -68,9 +57,6 @@ finally: + (BOOL)hostApplicationIsCodeSigned { - // This API didn't exist prior to 10.6. - if (SecCodeCopySelf == NULL) return NO; - OSStatus result; SecCodeRef hostCode = NULL; result = SecCodeCopySelf(kSecCSDefaultFlags, &hostCode);