Skip to content
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

GH-618: Fix reading an OpenSshCertificate from a Buffer #619

Merged
merged 1 commit into from
Oct 7, 2024

Conversation

tomaswolf
Copy link
Member

Buffer.getBytesConsumed() is broken. It'll return wrong data for buffers created on a slice of an array not starting at zero. Using it in OpenSSHCertPublicKeyParser will return data before the raw certificate in the buffer if that raw certificate is not the first thing in the buffer.

Fix this by adding a Buffer.getBytesConsumed(int from) method, and use that in OpenSSHCertPublicKeyParser.

Fixes #618.

Buffer.getBytesConsumed() is broken. It'll return wrong data for buffers
created on a slice of an array not starting at zero. Using it in
OpenSSHCertPublicKeyParser will return data before the raw certificate
in the buffer if that raw certificate is not the first thing in the
buffer.

Fix this by adding a Buffer.getBytesConsumed(int from) method, and use
that in OpenSSHCertPublicKeyParser.

Bug: apache#618
@tomaswolf tomaswolf merged commit dfa9b06 into apache:master Oct 7, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reading OpenSshCertificates from a buffer is broken.
1 participant