Skip to content

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

Merged
tomaswolf merged 1 commit into
apache:masterfrom
tomaswolf:gh-618
Oct 7, 2024
Merged

GH-618: Fix reading an OpenSshCertificate from a Buffer#619
tomaswolf merged 1 commit into
apache:masterfrom
tomaswolf:gh-618

Conversation

@tomaswolf
Copy link
Copy Markdown
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
@tomaswolf tomaswolf deleted the gh-618 branch April 25, 2025 15:34
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