Skip to content

[autofix] Fix the ruby-master integration patch - #3895

Draft
acl-ci[bot] wants to merge 1 commit into
aws:mainfrom
crypto-alg:autofix/ruby-master
Draft

acl-ci[bot] wants to merge 1 commit into
aws:mainfrom
crypto-alg:autofix/ruby-master

Conversation

@acl-ci

@acl-ci acl-ci Bot commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

Context and motivation

The ruby integration job for master fails in its test stage. OpenSSL::TestSSL#test_io_like_eof_without_close_notify fails:

[OpenSSL::SSL::SSLError] exception expected, not #<EOFError: end of file reached>.

Two changes meet here. ruby/ruby@341a2193 (ruby/openssl "ssl: support IO-like objects as the underlying transport") adds a custom BIO_METHOD for IO-like transports, along with this test. The test expects AWS-LC to raise SSLError when 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 from BIO_eof() (BIO_CTRL_EOF). That PR states that custom BIOs that don't implement BIO_CTRL_EOF no longer get unexpected-EOF detection.

Description of changes

Report BIO_CTRL_EOF from Ruby's custom BIO when built against AWS-LC

When read_nonblock returns nil, Ruby's custom BIO sets BIO_FLAGS_IN_EOF in bio_bread0. Its bio_ctrl answers BIO_CTRL_EOF from that flag. Both are compiled only for OpenSSL 3.x, and the upstream comment says AWS-LC doesn't use BIO_eof(). AWS-LC reports OPENSSL_VERSION_NUMBER as 1.1.1, so with AWS-LC the BIO never reports EOF. After #3781, the zero read therefore comes back as SSL_ERROR_SYSCALL with an empty error queue, which Ruby turns into EOFError.

The master patch (ruby_patch/master/aws-lc-ruby.patch, which was empty) now also enables both preprocessor conditions under defined(OPENSSL_IS_AWSLC) and updates the comment. With this, AWS-LC sees the EOF and raises SSL_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-master CI jobs (ubuntu:24.04) with this change, and both exit 0. In each run, test/openssl and test/rubygems finish 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_EOF handling for AWS-LC in ext/openssl/ossl_ssl.c, and the local patch can be dropped once that lands.

Generated by autofix with bedrock/us.anthropic.claude-opus-5-5 at 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.

@acl-ci
acl-ci Bot requested a deployment to manual-approval December 5, 2026 16:59 Waiting
@acl-ci
acl-ci Bot requested a deployment to manual-approval December 5, 2026 16:59 Waiting
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.01%. Comparing base (5f092fe) to head (a7b1191).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch is waiting to be deployed

1 waiting deployment
manual-approval — a7b1191d Waiting Dec 5, 2026 by acl-ci[bot] via maintainer-approval #3600
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