Skip to content

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

Merged
justsmth merged 1 commit intoaws: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 intoaws: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.

Loading
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