You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Interop+AppleCrypto+AppleCFErrorCryptographicException: The operation couldn't be completed. (OSStatus error -25293 - CSSM Exception: -2147416032 CSSMERR_CSP_OPERATION_AUTH_DENIED) #52766
I recent ran into the exception Interop+AppleCrypto+AppleCFErrorCryptographicException: The operation couldn't be completed. (OSStatus error -25293 - CSSM Exception: -2147416032 CSSMERR_CSP_OPERATION_AUTH_DENIED) and silent process crashing issues with a set of unit tests dealing with cryptography for a .NET Core project we are porting to .NET 5.
Short version:
macOS had decided dotnet was invalidly signed and was suppressing all keychain prompts. Uninstalling and reinstalling the dotnet sdk resolved the issue.
Long version:
Our project tooling scripts download a local copy of the dotnet sdk and uses that for building/packaging/etc of the project. When SDK version 5.0.203 was released, we updated the tooling the same day to start pulling in the new version. Around that time I started seeing failures in some local unit tests that dealt with cryptography.
They either silent failed due to the test process crashing:
Starting test execution, please wait...
Logging Vstest Diagnostics in file: /Users/dan/Projects/<removed>
A total of 1 test files matched the specified pattern.
The active test run was aborted. Reason: Test host process crashed
Test Run Aborted.
Or two were throwing a very specific exception:
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
Failed <removed>_EncryptAndDecrypt [137 ms]
Error Message:
Test method <removed>_EncryptAndDecrypt threw exception:
Interop+AppleCrypto+AppleCFErrorCryptographicException: The operation couldn’t be completed. (OSStatus error -25293 - CSSM Exception: -2147416032 CSSMERR_CSP_OPERATION_AUTH_DENIED)
Stack Trace:
at Interop.AppleCrypto.ProcessPrimitiveResponse(Int32 returnValue, SafeCFDataHandle cfData, SafeCFErrorHandle cfError, Span`1 destination, Int32& bytesWritten)
at Interop.AppleCrypto.TryRsaDecryptionPrimitive(SafeSecKeyRefHandle privateKey, ReadOnlySpan`1 source, Span`1 destination, Int32& bytesWritten)
at System.Security.Cryptography.RSAImplementation.RSASecurityTransforms.TryDecrypt(SafeSecKeyRefHandle privateKey, ReadOnlySpan`1 data, Span`1 destination, RSAEncryptionPadding padding, Int32& bytesWritten)
at System.Security.Cryptography.RSAImplementation.RSASecurityTransforms.Decrypt(Byte[] data, RSAEncryptionPadding padding)
Researching the error CSSMERR_CSP_OPERATION_AUTH_DENIED eventually led me to look the macOS console:
Which revealed that macOS was suppressing keychain prompt for invalidly signed client /Users/dan/Projects/<removed>/.dotnet/dotnet.
At this point I deleted the local copy of dotnet and let the tooling download a fresh copy. Afterwards the unit tests started passing again and the test process crashes stopped.
For the tests that were crashing, there was no exception or error code information reported. I attempted to use dotnet test --blame-crash but this is only available on Windows currently. Support for dotnet test --blame-crash for non windows platforms would be really helpful, especially in platform specific cases like this.
Thanks! /cc @vcsjones who suggested I open this issue.
Reacted by Frank Quednau, aaarichter and riot-mreinhardt
Note: I asked @DanRigby to post an issue here. while the immediate issue has been resolved, there might be room to improve when folks get in to this situation on MacOS. It's rather tricky to diagnose. This could be a better exception or documentation.
Due to lack of recent activity, this issue has been marked as a candidate for backlog cleanup. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will undo this process.
Closing per above, there haven't been other reports of this to my knowledge. If this is still a problem please feel free to re-open the issue or file a new issue.
Activity
vcsjones commentedon May 14, 2021
Note: I asked @DanRigby to post an issue here. while the immediate issue has been resolved, there might be room to improve when folks get in to this situation on MacOS. It's rather tricky to diagnose. This could be a better exception or documentation.
dotnet-policy-service commentedon Jan 2, 2026
Due to lack of recent activity, this issue has been marked as a candidate for backlog cleanup. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will undo this process.
This process is part of our issue cleanup automation.
vcsjones commentedon Jun 19, 2026
Closing per above, there haven't been other reports of this to my knowledge. If this is still a problem please feel free to re-open the issue or file a new issue.