Skip to content

Fix error return values for no-op UI_xxx stub functions#3025

Merged
justsmth merged 1 commit into
aws:mainfrom
justsmth:fix-ui-return-values
Feb 26, 2026
Merged

Fix error return values for no-op UI_xxx stub functions#3025
justsmth merged 1 commit into
aws:mainfrom
justsmth:fix-ui-return-values

Conversation

@justsmth
Copy link
Copy Markdown
Contributor

Description of changes:

AWS-LC provides no-op stub implementations of several OpenSSL UI_xxx functions to allow compilation of projects that reference them for non-essential operations. These stubs always fail at runtime since the UI API is unsupported.

Previously, UI_add_input_string, UI_add_verify_string, UI_add_info_string, and UI_process all returned 0. In OpenSSL's UI API, -1 indicates failure:

  • UI_add_input_string, UI_add_verify_string, and UI_add_info_string all delegate to general_allocate_string(), which returns a positive index on success and -1 on error.
  • UI_process returns 0 on success and -1 on error.

In practice, callers should already be checking the NULL return from UI_new and never reaching these functions. This change simply corrects the return values to be consistent with the OpenSSL API contract, and updates the corresponding header documentation to match.

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.

@justsmth justsmth requested a review from a team as a code owner February 20, 2026 19:01
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.34%. Comparing base (167015c) to head (a2d714a).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
crypto/ui/ui.c 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3025      +/-   ##
==========================================
+ Coverage   78.32%   78.34%   +0.01%     
==========================================
  Files         689      689              
  Lines      121007   121010       +3     
  Branches    16994    16992       -2     
==========================================
+ Hits        94783    94807      +24     
+ Misses      25330    25306      -24     
- Partials      894      897       +3     

☔ View full report in Codecov by Sentry.
📢 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.

@justsmth justsmth merged commit e5a3653 into aws:main Feb 26, 2026
470 of 482 checks passed
@justsmth justsmth deleted the fix-ui-return-values branch February 26, 2026 20:09
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.

5 participants