Skip to content

hmac: allocate OpenSSL objects in #initialize{,_copy} - #1135

Merged
rhenium merged 2 commits into
ruby:masterfrom
rhenium:ky/hmac-alloc-in-initialize
Oct 29, 2026
Merged

rhenium merged 2 commits into
ruby:masterfrom
rhenium:ky/hmac-alloc-in-initialize

Conversation

@rhenium

@rhenium rhenium commented Oct 29, 2026

Copy link
Copy Markdown
Member

Allocate EVP_MD_CTX in OpenSSL::HMAC#initialize and #initialize_copy instead of .allocate. #1046 made similar changes to several other classes, but overlooked HMAC.

This fixes crash in OpenSSL::HMAC.allocate.reset.

Fixes #1134

Allocate EVP_MD_CTX in OpenSSL::HMAC#initialize and #initialize_copy
instead of .allocate. <ruby#1046>
made similar changes to several other classes, but overlooked HMAC.

This fixes crash in OpenSSL::HMAC.allocate.reset.

Fixes ruby#1134
Commit 5f10428 (ocsp: allocate OpenSSL objects in #initialize{,
_copy}, 2025-12-07) forgot to add this line.
@rhenium
rhenium force-pushed the ky/hmac-alloc-in-initialize branch from 19122e6 to 787afbf Compare October 29, 2026 16:28
@rhenium
rhenium merged commit b5b19fd into ruby:master Oct 29, 2026
47 of 48 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.

OpenSSL::HMAC.allocate.reset segfaults, and re-initializing with a new key keeps the old one

1 participant