Skip to content
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

Address a few TODOs on S.S.C.Cose. #66641

Merged
merged 2 commits into from
Mar 16, 2022
Merged

Address a few TODOs on S.S.C.Cose. #66641

merged 2 commits into from
Mar 16, 2022

Conversation

jozkee
Copy link
Member

@jozkee jozkee commented Mar 15, 2022

Follow up on #64461 TODOs:

Unaddressed TODOs: Re-evaluate places where we should use Span/Memory/byte[] & Add stream support for content.
They will be addressed in separates PRs respectively.

@dotnet-issue-labeler
Copy link

Note regarding the new-api-needs-documentation label:

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.

@ghost
Copy link

ghost commented Mar 15, 2022

Tagging subscribers to this area: @dotnet/area-system-security, @vcsjones
See info in area-owners.md if you want to be subscribed.

Issue Details

Follow up on #64461 TODOs:

Unaddressed TODOs: Re-evaluate places where we should use Span/Memory/byte[] & Add stream support for content.
They will be addressed in separates PRs respectively.

Author: Jozkee
Assignees: Jozkee
Labels:

area-System.Security

Milestone: 7.0.0

=> throw new CryptographicException(SR.Format(SR.Sign1UnknownCoseAlgorithm, alg));

internal static void ThrowCborNegativeIntegerNotSupported(ulong alg) // Cbor Negative Integer Representation is too big.
=> throw new CryptographicException(SR.Format(SR.Sign1UnknownCoseAlgorithm, BigInteger.MinusOne - new BigInteger(alg)));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are called from only one place, that's not generic, and doesn't appear to be super perf-critical. Why create throw helpers?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ThrowIfNotSupported already existed in this helper type and I wanted to keep validations centralized for future reference.

@jozkee jozkee merged commit a5f3f96 into dotnet:main Mar 16, 2022
@jozkee jozkee deleted the cose_todos branch March 16, 2022 06:48
radekdoulik pushed a commit to radekdoulik/runtime that referenced this pull request Mar 30, 2022
* Make HeaderMaps optionals

* Improve handling of integers larger/smaller than int32 in Alg header
@ghost ghost locked as resolved and limited conversation to collaborators Apr 15, 2022
@bartonjs bartonjs added cryptographic-docs-impact needs-further-triage Issue has been initially triaged, but needs deeper consideration or reconsideration labels Aug 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Security needs-further-triage Issue has been initially triaged, but needs deeper consideration or reconsideration new-api-needs-documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants