]> git.saurik.com Git - apple/security.git/blobdiff - OSX/libsecurity_codesigning/lib/cs.h
Security-58286.20.16.tar.gz
[apple/security.git] / OSX / libsecurity_codesigning / lib / cs.h
index 9e40ac8e1baed2378a295494c8146c07500dd32e..4e360e9182371b8ced33cf844fd9a9c55e65c39a 100644 (file)
@@ -41,6 +41,7 @@
 #include <security_utilities/errors.h>
 #include <security_utilities/sqlite++.h>
 #include <security_utilities/cfutilities.h>
+#include <security_utilities/logging.h>
 
 
 namespace Security {
@@ -74,6 +75,11 @@ extern ModuleNexus<CFObjects> gCFObjects;
 
 OSStatus dbError(const SQLite3::Error &err);
 
+// Embedded platform does not have this function so skip the conversion
+#if TARGET_OS_IPHONE
+#define SecKeychainErrFromOSStatus(status) (status)
+#endif
+
 
 //
 // Code Signing API brackets
@@ -92,7 +98,7 @@ OSStatus dbError(const SQLite3::Error &err);
     catch (const SQLite3::Error &err) { return dbError(err); } \
     catch (const CommonError &err) { return SecKeychainErrFromOSStatus(err.osStatus()); } \
     catch (const std::bad_alloc &) { return errSecAllocate; } \
-    catch (...) { return errSecCSInternalError; } \
+    catch (...) { Syslog::notice("unknown exception in CSAPI"); return errSecCSInternalError; } \
        return errSecSuccess;
        
 #define END_CSAPI_ERRORS \
@@ -107,7 +113,7 @@ OSStatus dbError(const SQLite3::Error &err);
     catch (const SQLite3::Error &err) { return CSError::cfError(errors, dbError(err)); } \
     catch (const CommonError &err) { return CSError::cfError(errors, SecKeychainErrFromOSStatus(err.osStatus())); } \
     catch (const std::bad_alloc &) { return CSError::cfError(errors, errSecAllocate); } \
-    catch (...) { return CSError::cfError(errors, errSecCSInternalError); } \
+    catch (...) { Syslog::notice("unknown exception in CSAPI"); return CSError::cfError(errors, errSecCSInternalError); } \
        return errSecSuccess;
        
 #define END_CSAPI1(bad)    } catch (...) { return bad; }
@@ -125,7 +131,7 @@ OSStatus dbError(const SQLite3::Error &err);
     catch (const SQLite3::Error &err) { CSError::cfError(errors, dbError(err)); } \
     catch (const CommonError &err) { CSError::cfError(errors, SecKeychainErrFromOSStatus(err.osStatus())); } \
     catch (const std::bad_alloc &) { CSError::cfError(errors, errSecAllocate); } \
-    catch (...) { CSError::cfError(errors, errSecCSInternalError); } \
+    catch (...) { Syslog::notice("unknown exception in CSAPI"); CSError::cfError(errors, errSecCSInternalError); } \
        return bad;