]> git.saurik.com Git - apple/security.git/blobdiff - OSX/libsecurity_utilities/lib/errors.cpp
Security-59306.120.7.tar.gz
[apple/security.git] / OSX / libsecurity_utilities / lib / errors.cpp
index 9ecda04228dbf9be0adf3458b4f376480dc8eaf7..e715b11d3e93756c5903ddc5702c96319a2b034b 100644 (file)
@@ -32,6 +32,7 @@
 #include <typeinfo>
 #include <stdio.h>
 #include <Security/SecBase.h>
 #include <typeinfo>
 #include <stdio.h>
 #include <Security/SecBase.h>
+#include <Security/CSCommon.h>
 #include <execinfo.h>
 #include <cxxabi.h>
 
 #include <execinfo.h>
 #include <cxxabi.h>
 
@@ -164,8 +165,14 @@ MacOSError::MacOSError(int err) : error(err)
     SECURITY_EXCEPTION_THROW_OSSTATUS(this, err);
 
     snprintf(whatBuffer, whatBufferSize, "MacOS error: %d", this->error);
     SECURITY_EXCEPTION_THROW_OSSTATUS(this, err);
 
     snprintf(whatBuffer, whatBufferSize, "MacOS error: %d", this->error);
-    secnotice("security_exception", "%s", what());
-    LogBacktrace();
+    switch (err) {
+        case errSecCSReqFailed:
+            // This 'error' isn't an actual error and doesn't warrant being logged.
+            break;
+        default:
+            secnotice("security_exception", "%s", what());
+            LogBacktrace();
+    }
 }
 
 const char *MacOSError::what() const throw ()
 }
 
 const char *MacOSError::what() const throw ()
@@ -192,6 +199,12 @@ int MacOSError::unixError() const
 void MacOSError::throwMe(int error)
 { throw MacOSError(error); }
 
 void MacOSError::throwMe(int error)
 { throw MacOSError(error); }
 
+void MacOSError::throwMe(int error, char const *message, ...)
+{
+    // Ignoring the message for now, will do something with it later.
+    throw MacOSError(error);
+}
+
 MacOSError MacOSError::make(int error)
 { return MacOSError(error); }
 
 MacOSError MacOSError::make(int error)
 { return MacOSError(error); }