-
Notifications
You must be signed in to change notification settings - Fork 143
Implement dgst CLI command #2638
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2638 +/- ##
==========================================
+ Coverage 78.81% 78.90% +0.08%
==========================================
Files 667 667
Lines 114088 114343 +255
Branches 16063 16107 +44
==========================================
+ Hits 89923 90225 +302
+ Misses 23390 23340 -50
- Partials 775 778 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
bool GetBoolArgument(bool *out, const std::string &arg_name, | ||
const ordered_args_map_t &args); | ||
|
||
bool GetExclusiveBoolArgument(std::string *out_arg, const argument_t *templates, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just curious on reasoning here. Why do we want to do exclusive bool arguments at the parsing layer, as opposed to for example writing a func at tool level to validate parsed options?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the supported digest suite is fairly large, I think that doing it the parsing layer makes more sense. Otherwise, we'd need to 1) maintain a list of supported digests (in addition to the arg templates), 2) parse the arguments a 2nd time to get the digest names, and 3) check for mutual exclusivity. Computationally, it's the same amount of work either way but doing it at the parsing layer is much cleaner.
And since we're already relying on the kExclusiveBooleanArgument
type for the parsing, might as well make it a util function rather than a one-off function in the digest tool. I thought it'd be useful in the future if we ever need to do handle multiple exclusive bool args again.
Issues:
Resolves #CryptoAlg-3383
Description of changes:
Re-implement dgst cli commands with the following options:
-binary
-sha256 (and a handful of other digest algorithms)
-sigopt
-passin
-sign
-out
-verify
-signature
-keyform
Call-outs:
Waiting for #2555 to implement
-passin
Testing:
How is this change tested (unit tests, fuzz tests, etc.)? Are there any testing steps to be verified by the reviewer?
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.