-
Notifications
You must be signed in to change notification settings - Fork 151
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.
### Description of changes: Prepare v1.62.0 release #### What's Changed * nginx now supports AWS-LC by @samuel40791765 in #2714 * Fix tests that assume X25519 will be negotiated by @alexw91 in #2682 * Fixing a bug in ML-DSA poly_uniform function by @dkostic in #2721 * Migrate integration omnibus by @skmcgrail in #2715 * Delete util/bot directory by @justsmth in #2723 * Don't ignore CMAKE_C_FLAGS w/ MSVC by @justsmth in #2722 * Bump urllib3 from 2.2.3 to 2.5.0 in /tests/ci by @dependabot[bot] in #2551 * Type fix in mldsa by @manastasova in #2308 * Centralize password handling tool-openssl by @kingstjo in #2555 * crypto/pem: replace strncmp with CRYPTO_memcmp to fix -Wstring-compare error by @R3hankhan123 in #2724 * Implement dgst CLI command by @nhatnghiho in #2638 * Add ASN.1 decoding for ML-KEM private keys as seeds by @jakemas in #2707 * Implement genrsa command by @kingstjo in #2535 * Move udiv and sencond tweak calculations to when needed by @nebeid in #2726 * Add null check on RSA key checks by @samuel40791765 in #2727 * Implement workaround for FORTIFY_SOURCE warning with jitterentropy by @skmcgrail in #2728 * Implement coverity suggestions by @skmcgrail in #2730 * Add minimal EC CLI tool implementation by @kingstjo in #2640 * Adding pkeyutl tool to the CLI by @smittals2 in #2575 * Add CI dimensions for legacy AVX512 flags by @smittals2 in #2732 * Fix Libwebsockets CI by @smittals2 in #2737 * Add option ENABLE_SOURCE_MODIFICATION by @justsmth in #2739 * Simple script to build/run tests by @justsmth in #2736 * Add build-time option to opt-out of CPU Jitter Entropy by @torben-hansen in #2733 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.
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
-passinTesting:
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.