Skip to content

System.Security.Cryptography.Rsa.Tests.EncryptDecrypt.Decrypt_Pkcs1_ErrorsForInvalidPadding(Byte[] data) #99369

Closed

Description

@lewing

Build Information

Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=591354
Build error leg or test failing: System.Security.Cryptography.Rsa.Tests.EncryptDecrypt_TrySpan.Decrypt_Pkcs1_ErrorsForInvalidPadding
Pull request: #99287

Error Message

Fill the error message using step by step known issues guidance.

{
  "ErrorMessage": "at System.Security.Cryptography.Rsa.Tests.EncryptDecrypt.Decrypt_Pkcs1_ErrorsForInvalidPadding(Byte[] data)",
  "ErrorPattern": "",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Known issue validation

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

Report

Build Definition Test Pull Request
591354 dotnet/runtime System.Security.Cryptography.Rsa.Tests.EncryptDecrypt_TrySpan.Decrypt_Pkcs1_ErrorsForInvalidPadding #99287
590185 dotnet/runtime System.Security.Cryptography.Rsa.Tests.EncryptDecrypt_Span.Decrypt_Pkcs1_ErrorsForInvalidPadding #99263

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
1 2 2

Activity

  1. added
    blocking-clean-ci
    Known Build Error
    on Mar 6, 2024
  2. ghost added
    untriaged
    on Mar 6, 2024
  3. ghost added
    in-pr
    on Mar 6, 2024
  4. bartonjs commented on Mar 6, 2024

    @bartonjs
    Member

    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.

  5. lewing commented on Mar 6, 2024

    @lewing
    MemberAuthor

    happened twice today

  6. vcsjones commented on Mar 6, 2024

    @vcsjones
    Member

    Clearly my test writing efforts would be better spent on buying lottery tickets.

  7. ghost removed
    in-pr
    on Mar 7, 2024
  8. ghost removed
    untriaged
    on Mar 7, 2024
  9. locked and limited conversation to collaborators on Apr 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Known Build Errorarea-System.Securityblocking-clean-ci

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions