-
Notifications
You must be signed in to change notification settings - Fork 5.5k
104080 custom rsapss salt length #119255
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
base: main
Are you sure you want to change the base?
104080 custom rsapss salt length #119255
Changes from 2 commits
e0b1dae
05ed28b
21135d5
d705126
3c6288c
4d3bd37
d19d017
20be62b
c0d0ce0
81432d5
a016382
9cde2fa
a6dd48a
71325e3
e2407be
7b65140
623199c
b14906e
9dcb4ea
fee0f09
a386bac
430a846
e0eb704
dd64636
d97581c
e99f10d
f066e97
de11a87
79bb2de
6e64ad1
aeab113
d70ef9b
76065fe
28f4371
a990025
03d9b9a
e374a19
f5459a1
099ac2a
e3fac63
d579770
90beb1c
24b6691
4b292d3
966b17a
0264ed5
0c65d90
30ff8ef
d335e43
f9fb07e
89d94bf
3dc7da6
92f2c97
bf6072c
35a3dec
f6869a5
ed35977
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -79,15 +79,15 @@ public static void PssPaddingSaltLengths(int saltLengthToTest) | |
| AsnReader rootSequence = asnReader.ReadSequence(); | ||
| Assert.Equal("1.2.840.113549.1.1.10", rootSequence.ReadObjectIdentifier()); // Make sure it's RSASSA-PSS | ||
| AsnReader pssStructure = rootSequence.ReadSequence(); | ||
| pssStructure.ReadEncodedValue(); // Ignore the hash algorithm OID | ||
| pssStructure.ReadEncodedValue(); // Ignore the mask generation function OID | ||
| ReadOnlyMemory<byte> hashAlgorithm = pssStructure.ReadEncodedValue(); // Ignore the hash algorithm OID | ||
| ReadOnlyMemory<byte> mgf = pssStructure.ReadEncodedValue(); // Ignore the mask generation function OID | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The previous feedback was that the hashAlgorithm and mgf values needed to be verified. You have now captured them into locals, but I don't see you verifying that they're the expected values. Again, the purpose is to make sure that we're writing down a confirming/correct block when a custom PSS size is specified, and I don't see any other test doing that.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was interrupted last time I worked on this, so I committed early. I'll fix this next time together with the remaining open issues. |
||
| Asn1Tag saltTag = new Asn1Tag(TagClass.ContextSpecific, 2, true); | ||
|
|
||
| if (pssStructure.HasData && pssStructure.PeekTag().HasSameClassAndValue(saltTag)) | ||
| { | ||
| var saltEntry = pssStructure.ReadSequence(saltTag); | ||
| var actualSaltLength = saltEntry.ReadInteger(); | ||
| var expectedSaltLength = saltLengthToTest switch | ||
| AsnReader saltEntry = pssStructure.ReadSequence(saltTag); | ||
| Numerics.BigInteger actualSaltLength = saltEntry.ReadInteger(); | ||
| int expectedSaltLength = saltLengthToTest switch | ||
| { | ||
| RSASignaturePadding.PssSaltLengthIsHashLength => 32, | ||
| RSASignaturePadding.PssSaltLengthMax => 222, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.