Skip to content

Implement pkcs8 cli #2342

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

Open
wants to merge 63 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
47a16a8
Implement PKCS8 CLI command for AWS-LC
Apr 17, 2025
8705147
Fix build errors in pkcs8 CLI implementation
Apr 17, 2025
9d01ae4
Fix unused variable warning in pkcs8 implementation
Apr 17, 2025
462bd64
Fix password path handling in pkcs8 tests
Apr 17, 2025
84091f2
Use default PKCS#5v2 encryption algorithm
Apr 17, 2025
ad85e58
Fix PRF handling and key type support in pkcs8 CLI tool
Apr 17, 2025
969665d
Merge branch 'aws:main' into implement-pkcs8-cli
kingstjo Apr 18, 2025
fe370f1
fix comment styling
Apr 21, 2025
6ae84e6
Merge branch 'main' into implement-pkcs8-cli
kingstjo Apr 24, 2025
caa1d64
Update v2prf implementation to only accept hmacWithSHA1 in pkcs8.cc
Apr 24, 2025
bb6552f
feat(pkcs8): improve memory safety with smart pointers
Apr 24, 2025
562482a
Fix pkcs8.cc OpenSSL 1.1.1 compatibility for -v2 option default value
Apr 24, 2025
1f8f0b9
Improve PKCS8 comparison tests by adding cross-compatibility validation
Apr 25, 2025
eb62ec0
added trim for formatting
Apr 25, 2025
0299545
-v2 -v2prf are default options with -topk8 and -passin when not provi…
Apr 25, 2025
2b752e2
fixing pass prompt
Apr 25, 2025
32cbdf2
Fix decryption of PKCS#8 encrypted keys from OpenSSL 1.1.1
Apr 28, 2025
bf0524b
temporary decryption debugging
Apr 28, 2025
9dc4cb8
temp debug fixes
Apr 28, 2025
0f8f4db
detailed decryption debugging
Apr 28, 2025
4a26183
Add enhanced PBES2 debugging output for PKCS#8 decryption issues
Apr 28, 2025
9fb8f3f
Enhance PKCS8 tool for OpenSSL compatibility
kingstjo Apr 29, 2025
f0d230d
fixed missing newline char EOF
kingstjo Apr 29, 2025
2278744
tool-openssl: Enhance pkcs8 implementation with format options and pr…
kingstjo May 2, 2025
76a81f8
tool-openssl: Add DER format support to PKCS8 implementation
kingstjo May 2, 2025
6a40860
Fix pkcs8_test.cc build error by checking fgets() return value
kingstjo May 2, 2025
af5a7fd
Enhanced PKCS8 tool security improvements
kingstjo May 2, 2025
ae79ab1
Remove unused OpenSSLFree and OpenSSLPointer from internal.h
kingstjo May 2, 2025
4c576e6
Implement BIO security improvements for PKCS8 tool
kingstjo May 3, 2025
6375312
Refactor pkcs8.cc to reduce redundancy with internal.h
kingstjo May 3, 2025
3d11475
Improve PKCS8 CLI code quality and robustness
kingstjo May 6, 2025
f245993
Improve PKCS8 CLI password handling
kingstjo May 6, 2025
7866158
Simplify PKCS8 CLI code structure while preserving security
kingstjo May 6, 2025
5188f8f
Improve comment style in PKCS8 CLI implementation
kingstjo May 6, 2025
341acbb
Replace ScopedBIO wrapper class with direct bssl::UniquePtr<BIO> mana…
kingstjo May 6, 2025
51ba849
refactor(tool-openssl): Fix pkcs8 tool argument parsing
kingstjo May 6, 2025
5d86030
refactor: Move PKCS8-specific functions from internal.h to pkcs8.cc
kingstjo May 7, 2025
19b89ca
Consolidate duplicate functions between RSA and PKCS8 tests
kingstjo May 7, 2025
8e5e8da
Further consolidate code by removing remaining redundancies:
kingstjo May 7, 2025
61fa106
Update namespacing for PEM markers with more descriptive names:
kingstjo May 7, 2025
d6a5024
Consolidate error handling in pkcs8.cc
kingstjo May 7, 2025
36750d2
Fix format string vulnerability in pkcs8.cc by adding proper error ha…
kingstjo May 8, 2025
aff2e2d
Optimize pkcs8.cc: Add format validation helper and refactor topk8 pr…
kingstjo May 8, 2025
e7fd8d9
Enhance PKCS8 error handling with X-Macro pattern
kingstjo May 8, 2025
77f7580
Improve PKCS8 error handling by removing unused error codes
kingstjo May 8, 2025
c86b620
Simplify pkcs8.cc implementation while preserving security features
kingstjo May 9, 2025
205258b
Refactor pkcs8.cc to use library functions from pkcs8.h and pem.h
kingstjo May 9, 2025
edeac61
move struct into single point of usage
kingstjo May 12, 2025
92b4fc1
Improve pkcs8.cc validate_bio_size() function for better security and…
kingstjo May 12, 2025
224293a
Optimize password handling in pkcs8.cc by modifying in place instead …
kingstjo May 13, 2025
fd571d6
Merge branch 'main' into implement-pkcs8-cli
kingstjo May 13, 2025
6f200ed
fix(tests): Fix segmentation fault in PKCS8ToolEnvVarPasswordTest
kingstjo May 14, 2025
d064725
add brace surrounding execution code for conditional statements
kingstjo May 15, 2025
5b67fd6
Refactor pkcs8.cc to use consolidated error handling with goto err
kingstjo May 15, 2025
ae99941
pkcs8: Respect password args when -nocrypt is used
kingstjo May 15, 2025
2bb453e
add TODO for password prompt implementation for OpenSSL 1.1.1 parity
kingstjo May 15, 2025
491f94c
fix comments
kingstjo May 15, 2025
ed586cc
comments with file save
kingstjo May 15, 2025
1e0ebcf
refactor(tool-openssl): consolidate rsa_pkcs8_shared into test_util.h
kingstjo May 16, 2025
6dce6ff
revert over engineered encapsulation of rsa_test + pkcs8_test
kingstjo May 16, 2025
b011f6a
Move PKCS8-specific utilities from test_util.h to pkcs8_test.cc
kingstjo May 16, 2025
4489b3c
Initialize variables in pkcs8.cc and pkcs8_test.cc to avoid undefined…
kingstjo May 16, 2025
0a182c8
Replace goto err pattern with RAII using SensitiveString class in pkc…
kingstjo Jun 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tool-openssl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ add_executable(

crl.cc
dgst.cc
pkcs8.cc
rehash.cc
req.cc
rsa.cc
Expand Down Expand Up @@ -85,6 +86,8 @@ if(BUILD_TESTING)
crl_test.cc
dgst.cc
dgst_test.cc
pkcs8.cc
pkcs8_test.cc
rehash.cc
rehash_test.cc
req.cc
Expand Down
6 changes: 4 additions & 2 deletions tool-openssl/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
#ifndef INTERNAL_H
#define INTERNAL_H

#include "../tool/internal.h"
#include <openssl/digest.h>
#include <memory>
#include <string>
#include <vector>

#include "../tool/internal.h"
#if !defined(O_BINARY)
#define O_BINARY 0
#endif
Expand Down Expand Up @@ -40,6 +40,8 @@ bool SClientTool(const args_list_t &args);
bool VerifyTool(const args_list_t &args);
bool VersionTool(const args_list_t &args);
bool X509Tool(const args_list_t &args);
bool pkcs8Tool(const args_list_t &args);


// Req Tool Utilities
bssl::UniquePtr<X509_NAME> parse_subject_name(std::string &subject_string);
Expand Down
Loading
Loading