You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Build: 🔎https://dev.azure.com/dnceng-public/public/_build/results?buildId=591354 Error message validated:[at System.Security.Cryptography.Rsa.Tests.EncryptDecrypt.Decrypt_Pkcs1_ErrorsForInvalidPadding(Byte[] data)] Result validation: ✅ Known issue matched with the provided build. Validation performed at: 3/6/2024 6:01:33 PM UTC
I think this might be a one in a million failure... and we can probably delete the test because it's probably covered by tests added since that one.
Jeremy rambling about probability
OK, for a completely random input; the odds of a successful PKCS1 decryption are
First byte == 0x00: 1/256 (0.4%)
Second byte == 0x02: 1/256
Bytes [2] through [10] not being 0: POWER(255/256, 8) (~97%)
There's a 0x00 beyond [10]. 1 - POWER(255/256, len - 10).
This is a RSA2048 key, so len is 256, so len-10 is 246, so that comes out to about 62%
9.14e-6
Invert that to get the 1-in-a number: 109385
That's for random. This is for derived. That changes the probability to... something. "What are the odds that modpow(x, n, d) and modpow(y, n, d) are both PKCS1-conforming when y2038 = ~x2038, y2037 = ~x2037, ... y2031 = ~x2031; otherwise yi = xi, and modpow(x, n, d) is pkcs-conforming?" Shrug, say one in a million, move on.
Bonus points to anyone who can actually work that out.
Activity
bartonjs commentedon Mar 6, 2024
I think this might be a one in a million failure... and we can probably delete the test because it's probably covered by tests added since that one.
Jeremy rambling about probability
OK, for a completely random input; the odds of a successful PKCS1 decryption are
That's for random. This is for derived. That changes the probability to... something. "What are the odds that modpow(x, n, d) and modpow(y, n, d) are both PKCS1-conforming when y2038 = ~x2038, y2037 = ~x2037, ... y2031 = ~x2031; otherwise yi = xi, and modpow(x, n, d) is pkcs-conforming?" Shrug, say one in a million, move on.
Bonus points to anyone who can actually work that out.
lewing commentedon Mar 6, 2024
happened twice today
vcsjones commentedon Mar 6, 2024
Clearly my test writing efforts would be better spent on buying lottery tickets.