-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'\0\' is not correctly handled #526
Comments
Here is a shorter test case: ?- Xs = "\x0\". Xs = []. Expected: |
This issue is linked to this one. |
Ah yes, this is already filed, thank you a lot! I'm closing this issue. Normally, zero-bytes are very rare, but a major problem is that they easily arise during encryption. For instance, the following query should never succeed (since the length of the cipher text does not match the plain text), but now actually succeeds: ?- repeat, crypto_n_random_bytes(32, Key), crypto_n_random_bytes(12, IV), PlainText = "a", crypto_data_encrypt(PlainText, 'chacha20-poly1305', Key, IV, CipherText, []), \+ same_length(PlainText, CipherText). This means that we cannot reliably use the symmetric encryption facilities as long as this issue is present. |
For a test case, please create a file with two bytes:
Confirm the content (two bytes, in hex:
00 01
) with:However, the following unexpectedly succeeds:
Expected: Failure, on the grounds that the file contains 2 bytes.
For comparison, the following works as intended:
yielding:
The text was updated successfully, but these errors were encountered: