Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify the return value of s2n_cert_validation_callback #4478

Open
goatgoose opened this issue Mar 28, 2024 · 0 comments
Open

Clarify the return value of s2n_cert_validation_callback #4478

goatgoose opened this issue Mar 28, 2024 · 0 comments

Comments

@goatgoose
Copy link
Contributor

Problem:

The s2n_cert_validation_accept() and s2n_cert_validation_reject()APIs are used from within the s2n_cert_validation_callback to indicate whether the application cert validation checks have succeeded or failed. However, like most other s2n-tls callbacks, the callback can return -1 to indicate a failure from within the callback itself, which causes a S2N_ERR_CANCELED error.

The API documentation currently specifies that this API can return -1, but it doesn't specify what happens when the callback does this, and how this relates to the accept/reject APIs:

* @returns 0 on success, -1 on failure.

Solution:

Update the documentation to indicate what happens when s2n_cert_validation_callback indicates a failing return code.

We could consider updating the API documentation for s2n_cert_validation_callback to include this. However, since this applies to other callbacks as well, we could also consider adding a usage guide section about callbacks more generally and what happens when they return failing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants