Skip to content

ssl: refactor SSLSocket#{peer_,}finished_message#1043

Merged
rhenium merged 1 commit intoruby:masterfrom
rhenium:ky/ssl-finished-avoid-alloca
Apr 29, 2026
Merged

ssl: refactor SSLSocket#{peer_,}finished_message#1043
rhenium merged 1 commit intoruby:masterfrom
rhenium:ky/ssl-finished-avoid-alloca

Conversation

@rhenium
Copy link
Copy Markdown
Member

@rhenium rhenium commented Apr 29, 2026

The variable-sized alloca makes me nervous, even though it turned out to be safe: the Finished message is 36 bytes long in SSL 3.0 and is usually smaller in newer protocol versions. However, the alloca is not actually needed since we can simply write into the String's content.

While at it, update the rdoc comment to clarify the difference of the two methods.

The variable-sized alloca makes me nervous, even though it turned out
to be safe: the Finished message is 36 bytes long in SSL 3.0 and is
usually smaller in newer protocol versions. However, the alloca is not
actually needed since we can simply write into the String's content.

While at it, update the rdoc comment to clarify the difference of the
two methods.
@rhenium rhenium merged commit bd11f68 into ruby:master Apr 29, 2026
47 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.

1 participant