Repository navigation
[autofix] Fix the ruby-master integration patch - #3895
Draft
acl-ci[bot] wants to merge 1 commit into
Draft
acl-ci[bot] wants to merge 1 commit into
acl-ci[bot] wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3895 +/- ##
==========================================
+ Coverage 78.98% 79.01% +0.03%
==========================================
Files 715 715
Lines 135400 135400
Branches 19532 19533 +1
==========================================
+ Hits 106939 106981 +42
+ Misses 27416 27377 -39
+ Partials 1045 1042 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch is waiting to be deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context and motivation
The
rubyintegration job formasterfails in its test stage.OpenSSL::TestSSL#test_io_like_eof_without_close_notifyfails:Two changes meet here. ruby/ruby@341a2193 (ruby/openssl "ssl: support IO-like objects as the underlying transport") adds a custom
BIO_METHODfor IO-like transports, along with this test. The test expects AWS-LC to raiseSSLErrorwhen the peer closes without sending close_notify. Then AWS-LC commit 005590e ("Require BIO-reported EOF before failing TLS reads", #3781) changed TLS reads to work like OpenSSL 3. A zero read now counts as an unexpected EOF only when the BIO also returns true fromBIO_eof()(BIO_CTRL_EOF). That PR states that custom BIOs that don't implementBIO_CTRL_EOFno longer get unexpected-EOF detection.Description of changes
Report
BIO_CTRL_EOFfrom Ruby's custom BIO when built against AWS-LCWhen
read_nonblockreturns nil, Ruby's custom BIO setsBIO_FLAGS_IN_EOFinbio_bread0. Itsbio_ctrlanswersBIO_CTRL_EOFfrom that flag. Both are compiled only for OpenSSL 3.x, and the upstream comment says AWS-LC doesn't useBIO_eof(). AWS-LC reportsOPENSSL_VERSION_NUMBERas 1.1.1, so with AWS-LC the BIO never reports EOF. After #3781, the zero read therefore comes back asSSL_ERROR_SYSCALLwith an empty error queue, which Ruby turns intoEOFError.The
masterpatch (ruby_patch/master/aws-lc-ruby.patch, which was empty) now also enables both preprocessor conditions underdefined(OPENSSL_IS_AWSLC)and updates the comment. With this, AWS-LC sees the EOF and raisesSSL_R_UNEXPECTED_EOF_WHILE_READING, as it does for socket BIOs. The runner already applies this patch file, so it is unchanged. The patch applies cleanly with no offset or fuzz.Testing
I replayed both failed
ruby-masterCI jobs (ubuntu:24.04) with this change, and both exit 0. In each run,test/opensslandtest/rubygemsfinish with 0 failures and 0 errors.Review considerations
This works around a change in AWS-LC's own behavior, so the same Ruby source fails against any AWS-LC that includes #3781. The real fix belongs upstream in ruby/openssl: enable the
BIO_CTRL_EOFhandling for AWS-LC inext/openssl/ossl_ssl.c, and the local patch can be dropped once that lands.Generated by autofix with
bedrock/us.anthropic.claude-opus-5-5at 2026-12-05 16:57 UTC in https://github.com/aws/aws-lc/actions/runs/47543343562.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.