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

Rfc3161TimestampTokenInfo.GetNonce can throw #10484

Closed
omajid opened this issue Jan 25, 2021 · 0 comments · Fixed by NuGet/NuGet.Client#3866
Closed

Rfc3161TimestampTokenInfo.GetNonce can throw #10484

omajid opened this issue Jan 25, 2021 · 0 comments · Fixed by NuGet/NuGet.Client#3866
Assignees
Labels
Area:ErrorHandling warnings and errors/log messages & related error codes. Community PRs (and linked Issues) created by someone not in the NuGet team Functionality:SDK The NuGet client packages published to nuget.org Type:Bug

Comments

@omajid
Copy link

omajid commented Jan 25, 2021

Details about Problem

https://github.com/NuGet/NuGet.Client/blob/ebbb1a07f5f433485b6676689b7933db5074a151/src/NuGet.Core/NuGet.Packaging/Signing/Timestamp/Rfc3161TimestampTokenInfo.cs#L111

        public byte[] GetNonce()
        {
            var nonce = (byte[])Decoded.Nonce?.Clone();

            // Convert from big endian to little endian.
            Array.Reverse(nonce);

            return nonce;
        }

This method tries to handle Decoded.Nonce being null. But if it's null, it will throw in Array.Reverse.

NuGet product used (NuGet.exe | Visual Studio | MSBuild.exe | dotnet.exe): NuGet.Client code in the CLI

Product version: NuGet.Client repo commit ebbb1a07f5f433485b6676689b7933db5074a151

Worked before? If so, with which NuGet version:

Repro steps and/or sample project

Verbose Logs

@zivkan zivkan added Area:ErrorHandling warnings and errors/log messages & related error codes. Community PRs (and linked Issues) created by someone not in the NuGet team Functionality:SDK The NuGet client packages published to nuget.org Type:Bug labels Jan 29, 2021
@zivkan zivkan added this to the Sprint 183 - 2021.02.01 milestone Jan 29, 2021
@zivkan zivkan modified the milestones: Sprint 2021-02, Sprint 2021-03 Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area:ErrorHandling warnings and errors/log messages & related error codes. Community PRs (and linked Issues) created by someone not in the NuGet team Functionality:SDK The NuGet client packages published to nuget.org Type:Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants