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

Fix usage & error reporting in SSL programs #7844

Merged
merged 4 commits into from
Oct 26, 2023

Conversation

mpg
Copy link
Contributor

@mpg mpg commented Jun 27, 2023

Description

  • Allow calling without arguments again
  • Add explicit "help" and "help_ciphersuites" parameters
  • Add info about what went wrong in case of usage errors

This is mostly trying to improve on things which have been annoying me regularly. (I've already written the part about reporting what exactly went wrong more that once locally.) The goal is not for everything to be perfect, just better than the status quo.

PR checklist

mpg added 3 commits June 26, 2023 11:28
Signed-off-by: Manuel Pégourié-Gonnard <[email protected]>
All options have reasonable default so the programs don't need arguments
to do something useful.

It is widely accepted for programs that can work without arguments need
not insist on the user passing arguments, see 'ls', 'wc', 'sort', 'more'
and any number of POSIX utilities that all work without arguments.

It is also the historical behaviour of those programs, and something
relied one by at least a few team members.

Signed-off-by: Manuel Pégourié-Gonnard <[email protected]>
Every now and then, I see of these programs failing with a super-long
usage message that gives no clue as to what went wrong. (Recently it
happened with a test case in ssl-opt.sh with a fairly long command line
that was entirely correct, except some options were not valid in this
config - the test should have been skipped but wasn't due to some other
bug. It took me longer to figure out than it should have, and could have
if the program had simply reported which param was not recognized.)

Also, have an explicit "help" command, separate "help_ciphersuites", and
have default usage message that's not multiple screens long.

Signed-off-by: Manuel Pégourié-Gonnard <[email protected]>
@mpg mpg added needs-review Every commit must be reviewed by at least two team members, needs-reviewer This PR needs someone to pick it up for review size-s Estimated task size: small (~2d) priority-medium Medium priority - this can be reviewed as time permits labels Jun 27, 2023
@mpg mpg self-assigned this Jun 27, 2023
@gowthamsk-arm gowthamsk-arm self-requested a review July 5, 2023 15:35
@gowthamsk-arm
Copy link
Contributor

The error reporting looks clean now, and identifying the issue is much easier. Thanks :)

Copy link
Contributor

@gowthamsk-arm gowthamsk-arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The external CI jobs seem to have some issues.

Copy link
Contributor

@gilles-peskine-arm gilles-peskine-arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks for pushing this through!

@gilles-peskine-arm
Copy link
Contributor

I've pushed a merge of the target branch to get fresh CI results.

Copy link
Contributor

@gilles-peskine-arm gilles-peskine-arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hereby assert that the commit I pushed to this branch is a merge of the target branch. This can easily be checked on GitHub.

@gilles-peskine-arm gilles-peskine-arm added approved Design and code approved - may be waiting for CI or backports needs-backports Backports are missing or are pending review and approval. and removed needs-review Every commit must be reviewed by at least two team members, needs-reviewer This PR needs someone to pick it up for review labels Oct 9, 2023
@gilles-peskine-arm gilles-peskine-arm added this pull request to the merge queue Oct 25, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 25, 2023
@gilles-peskine-arm gilles-peskine-arm added this pull request to the merge queue Oct 26, 2023
Merged via the queue into Mbed-TLS:development with commit 5d055f8 Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Design and code approved - may be waiting for CI or backports needs-backports Backports are missing or are pending review and approval. priority-medium Medium priority - this can be reviewed as time permits size-s Estimated task size: small (~2d)
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants