-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use ROS<byte> instead of byte[] where it makes sense on S.S.C.Cose #66741
Conversation
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
Tagging subscribers to this area: @dotnet/area-system-security, @vcsjones Issue DetailsFor v1 of the library we shipped with many methods receiving Contributes to #62600 MVP+1.
|
src/libraries/System.Security.Cryptography.Cose/ref/System.Security.Cryptography.Cose.cs
Outdated
Show resolved
Hide resolved
...aries/System.Security.Cryptography.Cose/src/System/Security/Cryptography/Cose/CoseMessage.cs
Outdated
Show resolved
Hide resolved
.../System.Security.Cryptography.Cose/src/System/Security/Cryptography/Cose/CoseSign1Message.cs
Show resolved
Hide resolved
src/libraries/System.Security.Cryptography.Cose/ref/System.Security.Cryptography.Cose.cs
Show resolved
Hide resolved
...ies/System.Security.Cryptography.Cose/src/System/Security/Cryptography/Cose/CoseHeaderMap.cs
Outdated
Show resolved
Hide resolved
...ies/System.Security.Cryptography.Cose/src/System/Security/Cryptography/Cose/CoseHeaderMap.cs
Outdated
Show resolved
Hide resolved
.../System.Security.Cryptography.Cose/src/System/Security/Cryptography/Cose/CoseSign1Message.cs
Outdated
Show resolved
Hide resolved
.../System.Security.Cryptography.Cose/src/System/Security/Cryptography/Cose/CoseSign1Message.cs
Outdated
Show resolved
Hide resolved
.../System.Security.Cryptography.Cose/src/System/Security/Cryptography/Cose/CoseSign1Message.cs
Show resolved
Hide resolved
.../System.Security.Cryptography.Cose/src/System/Security/Cryptography/Cose/CoseSign1Message.cs
Show resolved
Hide resolved
// we rent a bigger buffer if that's the case. | ||
if (buffer.Length < expectedToBeSignedSize) | ||
{ | ||
rentedToBeSignedBuffer = ArrayPool<byte>.Shared.Rent(expectedToBeSignedSize); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to see this rent go away and us be able to create the TBS with non-contiguous memory (and hashed using IncrementalHash).
But I expect that'll be forced upon us when we add support for Stream-based detached content; so it's OK for now.
.../System.Security.Cryptography.Cose/src/System/Security/Cryptography/Cose/CoseSign1Message.cs
Outdated
Show resolved
Hide resolved
.../System.Security.Cryptography.Cose/src/System/Security/Cryptography/Cose/CoseSign1Message.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Security.Cryptography.Cose/tests/CoseHeaderMapTests.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Security.Cryptography.Cose/tests/CoseSign1MessageTests.Sign.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Security.Cryptography.Cose/tests/CoseSign1MessageTests.Sign.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Security.Cryptography.Cose/tests/CoseSign1MessageTests.Sign.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Security.Cryptography/src/Microsoft/Win32/SafeHandles/NCryptSafeHandles.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Security.Cryptography.Cose/tests/CoseTestHelpers.cs
Outdated
Show resolved
Hide resolved
.../System.Security.Cryptography.Cose/src/System/Security/Cryptography/Cose/CoseSign1Message.cs
Outdated
Show resolved
Hide resolved
.../System.Security.Cryptography.Cose/src/System/Security/Cryptography/Cose/CoseSign1Message.cs
Outdated
Show resolved
Hide resolved
* Add comment describing reusability of encoded protected headers * Cache toBeSigned
src/libraries/System.Security.Cryptography.Cose/tests/CoseSign1MessageTests.Verify.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Security.Cryptography.Cose/tests/CoseSign1MessageTests.Verify.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Security.Cryptography.Cose/tests/CoseSign1MessageTests.Verify.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Security.Cryptography.Cose/tests/CoseSign1MessageTests.Verify.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Security.Cryptography.Cose/tests/CoseSign1MessageTests.Verify.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Security.Cryptography.Cose/tests/CoseSign1MessageTests.Sign.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the remaining items are minor and limited to the tests. Please fix them, but I don't need to see any followup.
For v1 of the library we shipped with many methods receiving
byte[]
as argument, this was due to defer of thought of where we should properly useReadOnlySpan<byte>
andReadOnlyMemory<byte>
.This PR should also be a place for further discussion of Span vs Memory usage in the APIs and their interaction with System,Formats.Cbor APIs.
Contributes to #62600 MVP+1.