{"action":"opened","issue":{"url":"https://api.github.com/repos/dotnet/corefx/issues/31648","repository_url":"https://api.github.com/repos/dotnet/corefx","labels_url":"https://api.github.com/repos/dotnet/corefx/issues/31648/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/31648/comments","events_url":"https://api.github.com/repos/dotnet/corefx/issues/31648/events","html_url":"https://github.com/dotnet/corefx/issues/31648","id":348698034,"node_id":"MDU6SXNzdWUzNDg2OTgwMzQ=","number":31648,"title":"System.Security: Incorrect interop signature for DsaSign (OpenSSL)","user":{"login":"filipnavara","id":1764393,"node_id":"MDQ6VXNlcjE3NjQzOTM=","avatar_url":"https://avatars3.githubusercontent.com/u/1764393?v=4","gravatar_id":"","url":"https://api.github.com/users/filipnavara","html_url":"https://github.com/filipnavara","followers_url":"https://api.github.com/users/filipnavara/followers","following_url":"https://api.github.com/users/filipnavara/following{/other_user}","gists_url":"https://api.github.com/users/filipnavara/gists{/gist_id}","starred_url":"https://api.github.com/users/filipnavara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/filipnavara/subscriptions","organizations_url":"https://api.github.com/users/filipnavara/orgs","repos_url":"https://api.github.com/users/filipnavara/repos","events_url":"https://api.github.com/users/filipnavara/events{/privacy}","received_events_url":"https://api.github.com/users/filipnavara/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-08T12:09:26Z","updated_at":"2018-08-08T12:09:26Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"The current code uses the following signature:\r\n\r\n```c#\r\n        internal static bool DsaSign(SafeDsaHandle dsa, ReadOnlySpan<byte> hash, int hashLength, ReadOnlySpan<byte> refSignature, out int outSignatureLength) =>\r\n            DsaSign(dsa, ref MemoryMarshal.GetReference(hash), hashLength, ref MemoryMarshal.GetReference(refSignature), out outSignatureLength);\r\n```\r\n\r\nHowever, the `refSignature` parameter is output one, so I believe it should be declared as `Span<byte>`:\r\n\r\n```c#\r\n        internal static bool DsaSign(SafeDsaHandle dsa, ReadOnlySpan<byte> hash, int hashLength, Span<byte> refSignature, out int outSignatureLength) =>\r\n            DsaSign(dsa, ref MemoryMarshal.GetReference(hash), hashLength, ref MemoryMarshal.GetReference(refSignature), out outSignatureLength);\r\n```\r\n\r\nI'm still trying to figure out why `DsaSign` crashes on my machine when running the unit tests for System.Security.Cryptography.OpenSsl, so if anyone more savvy could check the interop code around it I would be very grateful. `DSASignVerify_[Array/Stream/Span].PublicKey_CannotSign` tests all get to the `DsaSign` interop call and then crash with SIGSEGV. This is on macOS Mojave DP 4, OpenSSL 1.0.2o_2 (Homebrew)."}}
{"actor":{"display_login":"filipnavara"}}