Closed lyytinen closed 1 year ago
To clarify, here I was using the go implementation. It appears that other implementations can have different behavior so need to check those as well. Not sure if the standard leaves room for interpretation when dealing with empty content.
Addressed additional issues revealed when attempting to decrypt empty content created by the crypt4gh python module (or the GUI wrapper to be more specific).
Attempting to decrypt empty.go.txt.c4gh
causes Crypt4GHInputStream
to throw an ArrayIndexOutOfBoundsException.
Attempting to decrypt empty.python.txt.c4gh
causes Crypt4GHInputStream
to throw a NullPointerException.
This pull request now addresses both of these issues. In the end, I'm not sure if the implementations actually are different or if the difference can be explained by the fact that with the Go implementation I used the Crypt4GH keys and with Python I used the OpenSSL keys.
In anycase, accepting this change would solve a very concrete problem for me. I'm transferring millions of encrypted files between research environments and the files are produced by different teams using different tooling. It is therefore important that this library is interoperable with other implementations and that also empty files can be decrypted without issues.
Describe the pull request:
Pull request long description:
Given an empty file
empty.txt
, the following succeeds with the command-line utility:However, the
Crypt4GHInputStream
throws an exception when attempting to processempty.txt.c4gh
.Related issues:
Additional information: