Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-2913

[pymongocrypt] Add support for decrypting from a memoryview

    • Type: Icon: New Feature New Feature
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • pymongocrypt-1.1.2
    • Affects Version/s: None
    • Component/s: None
    • None

      FLE tests are failing after the changes in PYTHON-2899:

       [2021/09/20 15:56:28.606] Traceback (most recent call last):
       [2021/09/20 15:56:28.606]   File "C:\data\mci\0f05769948f553a4d7ec739c0049d806\src\pymongo\encryption.py", line 73, in _wrap_encryption_errors
       [2021/09/20 15:56:28.606]     yield
       [2021/09/20 15:56:28.606]   File "C:\data\mci\0f05769948f553a4d7ec739c0049d806\src\pymongo\encryption.py", line 335, in decrypt
       [2021/09/20 15:56:28.606]     return self._auto_encrypter.decrypt(response)
       [2021/09/20 15:56:28.606]   File "C:\data\mci\0f05769948f553a4d7ec739c0049d806\src\venv-encryption\lib\site-packages\pymongocrypt\auto_encrypter.py", line 55, in decrypt
       [2021/09/20 15:56:28.606]     with self.mongocrypt.decryption_context(response) as ctx:
       [2021/09/20 15:56:28.606]   File "C:\data\mci\0f05769948f553a4d7ec739c0049d806\src\venv-encryption\lib\site-packages\pymongocrypt\mongocrypt.py", line 243, in decryption_context
       [2021/09/20 15:56:28.606]     return DecryptionContext(self._create_context(), command)
       [2021/09/20 15:56:28.606]   File "C:\data\mci\0f05769948f553a4d7ec739c0049d806\src\venv-encryption\lib\site-packages\pymongocrypt\mongocrypt.py", line 405, in __init__
       [2021/09/20 15:56:28.606]     with MongoCryptBinaryIn(command) as binary:
       [2021/09/20 15:56:28.606]   File "C:\data\mci\0f05769948f553a4d7ec739c0049d806\src\venv-encryption\lib\site-packages\pymongocrypt\binary.py", line 85, in __init__
       [2021/09/20 15:56:28.606]     self.__copy = ffi.new("uint8_t[]", data)
       [2021/09/20 15:56:28.606]   File "C:\data\mci\0f05769948f553a4d7ec739c0049d806\src\venv-encryption\lib\site-packages\cffi\api.py", line 267, in new
       [2021/09/20 15:56:28.606]     return self._backend.newp(cdecl, init)
       [2021/09/20 15:56:28.606] TypeError: expected new array length or list/tuple/str, not memoryview
      

            Assignee:
            shane.harvey@mongodb.com Shane Harvey
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: