Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-55531

Reset plainBuffer before testing AES CBC decrypt with wrong key

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 5.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Security 2021-04-05
    • 50

      Right now, the AES-CBC unit test in `symmetric_crypto_test.cpp` does two things. First, it encrypts a plaintext string using the AES-CBC algorithm and a randomly generated key and checks that it can successfully decrypt that with the same key. Then, it generates a new key and attempts to decrypt the same ciphertext with that incorrect key. It expects that the decryption should either return an error or generate in an incorrect ciphertext. However, both of these checks use the same buffer to load in the decrypted data, which isn't reset in between. This buffer should be reset in order to ensure that the correctly-decrypted data isn't wrongly detected while decrypting with the wrong key. 

            Assignee:
            varun.ravichandran@mongodb.com Varun Ravichandran
            Reporter:
            varun.ravichandran@mongodb.com Varun Ravichandran
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: