-
Notifications
You must be signed in to change notification settings - Fork 21
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
InputStreamDecrypter read() is not InputStream compliant #10
Comments
spheroid
added a commit
to spheroid/tink-java
that referenced
this issue
Sep 5, 2023
Convert the read signed integer to unsigned before returning it, because it is the behavior defined in the InputStream interface. It also makes it possible to distinguish between errors and successful read operations. Fixes tink-crypto#10.
Thanks for finding this! Yes, this is an obvious bug. |
copybara-service bot
pushed a commit
that referenced
this issue
Sep 20, 2023
These test also show the issue reported in #10 InputStream.read should return a value in [0,255]: https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html#read-- PiperOrigin-RevId: 566966884 Change-Id: Iba00859942fc63483074d00a69acd3839cb98e0a
copybara-service bot
pushed a commit
that referenced
this issue
Sep 21, 2023
PiperOrigin-RevId: 567268571 Change-Id: Ie695bfd7094384535e394c6487200c65bdc558c6
tholenst
pushed a commit
to tink-crypto/tink
that referenced
this issue
Dec 4, 2023
These test also show the issue reported in tink-crypto/tink-java#10 InputStream.read should return a value in [0,255]: https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html#read-- PiperOrigin-RevId: 566966884
tholenst
pushed a commit
to tink-crypto/tink
that referenced
this issue
Dec 4, 2023
PiperOrigin-RevId: 567268571
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
InputStream.read()
spec states:The current
InputStreamDecrypter.read()
currently behaves incorrectly as it returns signed ints which both:The text was updated successfully, but these errors were encountered: