X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/866f8763175ff60e4fa455b92b5eb660a12fe6c7..refs/heads/master:/OSX/libsecurity_utilities/lib/errors.cpp diff --git a/OSX/libsecurity_utilities/lib/errors.cpp b/OSX/libsecurity_utilities/lib/errors.cpp index 9ecda042..5072da2f 100644 --- a/OSX/libsecurity_utilities/lib/errors.cpp +++ b/OSX/libsecurity_utilities/lib/errors.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -59,7 +60,7 @@ CommonError::CommonError(const CommonError &source) strlcpy(whatBuffer, source.whatBuffer, whatBufferSize); } -CommonError::~CommonError() throw () +CommonError::~CommonError() _NOEXCEPT { } @@ -134,7 +135,7 @@ UnixError::UnixError(int err, bool suppresslogging) : error(err) } } -const char *UnixError::what() const throw () +const char *UnixError::what() const _NOEXCEPT { return whatBuffer; } @@ -164,11 +165,17 @@ MacOSError::MacOSError(int err) : error(err) 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 _NOEXCEPT { return whatBuffer; } @@ -192,6 +199,12 @@ int MacOSError::unixError() const 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); } @@ -206,7 +219,7 @@ CFError::CFError() LogBacktrace(); } -const char *CFError::what() const throw () +const char *CFError::what() const _NOEXCEPT { return "CoreFoundation error"; } OSStatus CFError::osStatus() const