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

Added options to x509 tool #1696

Merged
merged 16 commits into from
Jul 15, 2024
Merged

Added options to x509 tool #1696

merged 16 commits into from
Jul 15, 2024

Conversation

ecdeye
Copy link
Contributor

@ecdeye ecdeye commented Jul 10, 2024

Description:

Contains initial implementation for OpenSSL x509 tool, options -in -out, -req, -signkey, -modulus, -days, -dates,
-checkend, -noout (x509.cc), as well as testing for option functionality and argument requirements (x509_test.cc)

Files expected to change

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.

@ecdeye ecdeye requested a review from a team as a code owner July 10, 2024 15:47
@codecov-commenter
Copy link

codecov-commenter commented Jul 10, 2024

Codecov Report

Attention: Patch coverage is 81.42292% with 47 lines in your changes missing coverage. Please review.

Project coverage is 78.27%. Comparing base (1fbf584) to head (0d38598).
Report is 2 commits behind head on main.

Files Patch % Lines
tool-openssl/x509.cc 70.44% 47 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1696      +/-   ##
==========================================
+ Coverage   78.22%   78.27%   +0.05%     
==========================================
  Files         571      571              
  Lines       95534    95739     +205     
  Branches    13701    13736      +35     
==========================================
+ Hits        74729    74941     +212     
  Misses      20195    20195              
+ Partials      610      603       -7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@samuel40791765 samuel40791765 left a comment

Choose a reason for hiding this comment

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

Great work and test coverage! Just a few minor comments here and there

tool-openssl/x509.cc Outdated Show resolved Hide resolved
tool-openssl/x509.cc Outdated Show resolved Hide resolved
tool-openssl/x509.cc Outdated Show resolved Hide resolved
tool-openssl/x509.cc Outdated Show resolved Hide resolved
tool-openssl/x509.cc Outdated Show resolved Hide resolved
tool-openssl/x509.cc Outdated Show resolved Hide resolved
tool-openssl/x509_test.cc Show resolved Hide resolved
tool-openssl/x509.cc Outdated Show resolved Hide resolved
tool-openssl/x509_test.cc Show resolved Hide resolved
tool-openssl/x509.cc Outdated Show resolved Hide resolved
tool-openssl/x509.cc Show resolved Hide resolved
tool-openssl/x509.cc Outdated Show resolved Hide resolved
tool-openssl/x509.cc Outdated Show resolved Hide resolved
tool-openssl/x509.cc Outdated Show resolved Hide resolved
tool-openssl/x509_test.cc Outdated Show resolved Hide resolved
}

// Test mutually exclusive options, required options, and required arugments
TEST(X509Test, MutuallyExclusiveOptionsTest) {
Copy link
Contributor

@samuel40791765 samuel40791765 Jul 12, 2024

Choose a reason for hiding this comment

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

Great test! It does seem like we can parameterize the args options here with TEST_P and C++ classes. It's just a potential improvement, but not really a priority. This might serve as a good example:

struct AeadCipherParams {
const char name[40];
const EVP_CIPHER *(*func)(void);
const char *test_vectors;
};
static const struct AeadCipherParams AeadCiphers[] = {
{"ChaCha20Poly1305", EVP_chacha20_poly1305, "chacha20_poly1305_tests.txt"},
{"AES_128_CCM_BLUETOOTH", EVP_aes_128_ccm, "aes_128_ccm_bluetooth_tests.txt"},
{"AES_128_CCM_BLUETOOTH_8", EVP_aes_128_ccm,
"aes_128_ccm_bluetooth_8_tests.txt"},
{"AES_128_CCM_Matter", EVP_aes_128_ccm, "aes_128_ccm_matter_tests.txt"},
};
class AeadCipherTest : public testing::TestWithParam<AeadCipherParams> {
public:
const EVP_CIPHER *getTestCipher() {
return GetParam().func();
}
};
INSTANTIATE_TEST_SUITE_P(All, AeadCipherTest, testing::ValuesIn(AeadCiphers),
[](const testing::TestParamInfo<AeadCipherParams> &params)
-> std::string { return params.param.name; });
TEST_P(AeadCipherTest, TestVector) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently trying to implement but errors preventing build. Will come back to this later

@ecdeye ecdeye merged commit 10f73d0 into aws:main Jul 15, 2024
103 checks passed
skmcgrail added a commit that referenced this pull request Aug 1, 2024
## What's Changed
* Added options to x509 tool by @ecdeye in
#1696
* Add support to detect Neoverse V2 cores by @andrewhop in
#1706
* Move OCSP functions for Ruby out of internal.h by @samuel40791765 in
#1704
* Add aes-256-xts to EVP_get_cipherbyname by @torben-hansen in
#1707
* Match using CMAKE_SYSTEM_PROCESSOR_LOWER by @justsmth in
#1709
* Update MySQL to 9.0.0 by @skmcgrail in
#1685
* [EC] Unify scalar multiplication for P-256/384/521 by @dkostic in
#1693
* Adds const qualifier to ciphertext parameter in EVP_PKEY_decapsulate
by @maddeleine in #1713
* Upstream merge 2024 06 24 by @nebeid in
#1661
* NIST SP 800-108r1-upd1: KDF Counter Implementation by @skmcgrail in
#1644
* Upstream merge 2024 07 09 by @nebeid in
#1694
* Design for support of HMAC precomputed keys by @fabrice102 in
#1574
* Fix for select point from table in ec_nistp scalar_mul by @dkostic in
#1719
* X509toolcomparison by @ecdeye in
#1714
* AWS-LC s2n-bignum update 2024-07-22 by @dkostic in
#1718
* Add OpenVPN to CI by @smittals2 in
#1705
* Lower required Go version, add CI test for specific version by
@andrewhop in #1717
* ec2-test-framework enhancements and graviton 4 testing by
@samuel40791765 in #1715
* sha + chacha: Move AArch64/X86-64 dispatching to C. by @justsmth in
#1625
* Show number of pruned ec2 instances in dashboard by @samuel40791765 in
#1728
* rsa and md5 tools by @ecdeye in
#1722
* FIPS 203 IPD update: ML-KEM-IPD-768 and ML-KEM-IPD-1024 by @jakemas in
#1724
* bump mysql CI to 9.0.1 by @samuel40791765 in
#1727
* Support utility OCSP request functions by @samuel40791765 in
#1708
* add support for OCSP_SINGLERESP functions by @samuel40791765 in
#1703
samuel40791765 pushed a commit to samuel40791765/aws-lc that referenced this pull request Aug 14, 2024
Description:

Contains initial implementation for OpenSSL x509 tool, options -in -out,
-req, -signkey, -modulus, -days, -dates,
-checkend, -noout (x509.cc), as well as testing for option functionality
and argument requirements (x509_test.cc)

_Files expected to change_

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.

(cherry picked from commit 10f73d0)
samuel40791765 pushed a commit that referenced this pull request Aug 15, 2024
Description:

Contains initial implementation for OpenSSL x509 tool, options -in -out,
-req, -signkey, -modulus, -days, -dates,
-checkend, -noout (x509.cc), as well as testing for option functionality
and argument requirements (x509_test.cc)

_Files expected to change_

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.

(cherry picked from commit 10f73d0)
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