-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat(kas): Partial implementation EC384 and EC521 support in KAS #883
Commits on Jun 13, 2024
-
Implement EC384 and EC521 support in KAS
Enabled EC384 and EC521 support in KAS and added relevant unit tests. The config file now supports the new EC384 and EC521 key types. Also, test keys for both types have been generated and added.
Configuration menu - View commit details
-
Copy full SHA for e450da6 - Browse repository at this point
Copy the full SHA e450da6View commit details -
Update error message and refactor key configurations
Improved the clarity of an error message in the "NewOpenTDFServer" method. Refactored key configurations in the dev and example YAML files to differentiate between multiple elliptic curve securities. Also made updates to various scripts to generate and handle these keys suitably.
Configuration menu - View commit details
-
Copy full SHA for 5ea5c63 - Browse repository at this point
Copy the full SHA 5ea5c63View commit details -
Refactor key generation and error handling in publicKey.go
This commit includes the refactoring of the publicKey.go file for better error handling and support for different algorithms. The log messages have been updated to provide clearer context upon failure of key generation methods for both EC and RSA algorithms. Also, changes were made to the init-temp-keys.cmd script to correct the path of the generated keys.
Configuration menu - View commit details
-
Copy full SHA for c4ff770 - Browse repository at this point
Copy the full SHA c4ff770View commit details -
Update error handling for unknown key algorithm
The code was updated to address an issue where an unknown key algorithm could be passed to the publicKey functions. It now properly catches this event and logs an error message. The additional condition checks if the algorithm is not RSA in addition to being non-empty, helping prevent potential configuration errors.
Configuration menu - View commit details
-
Copy full SHA for c420ec2 - Browse repository at this point
Copy the full SHA c420ec2View commit details -
Update init-temp-keys script execution in GitHub workflow
This commit modifies the execution of the `init-temp-keys.sh` script in `.github/workflows/checks.yaml` file. The change includes passing '--output ./keys/' argument to the script to dictate where the keys will be stored. This specifies the directory for the keys and enhances organization.
Configuration menu - View commit details
-
Copy full SHA for f3a1d72 - Browse repository at this point
Copy the full SHA f3a1d72View commit details -
Update paths for key files and init-temp-keys script
Updated the paths for secp256r1, secp384r1, and secp521r1 key files in the opentdf-dev.yaml file, removing the '/keys/' prefix. Also modified the path in the init-temp-keys.sh command within checks.yaml. This adjustment accommodates a change in file structure and ensures consistent script execution.
Configuration menu - View commit details
-
Copy full SHA for 3c7533b - Browse repository at this point
Copy the full SHA 3c7533bView commit details -
Refactor symmetric key generation for improved security
This commit includes modifications to symmetric key generation in the crypto provider. Now, GenerateNanoTDFSymmetricKey requires a keyID in addition to ephemeralPublicKeyBytes. This change allows for better security features as the encryption processes are enhanced. Minor changes such as comments added to the decrypt file and an adjustment to test output validation were also implemented.
Configuration menu - View commit details
-
Copy full SHA for c15ea61 - Browse repository at this point
Copy the full SHA c15ea61View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2d51e2e - Browse repository at this point
Copy the full SHA 2d51e2eView commit details -
Configuration menu - View commit details
-
Copy full SHA for f0ac2aa - Browse repository at this point
Copy the full SHA f0ac2aaView commit details -
Configuration menu - View commit details
-
Copy full SHA for cd86859 - Browse repository at this point
Copy the full SHA cd86859View commit details -
Remove attributes.swagger.json from the policy docs
The attributes.swagger.json file in the policy documentation was deleted. It was located in the docs/openapi/policy/attributes directory. This file contains the OpenAPI specification for attribute related services. The commit message should reflect the elimination of this detailed specification file.
Configuration menu - View commit details
-
Copy full SHA for 570a604 - Browse repository at this point
Copy the full SHA 570a604View commit details -
Refactor curve name retrieval in NanoTDFHeader
The if-else constructs in the GetCurveName() method of the NanoTDFHeader struct in nanotdf.go have been refactored to a switch-case statement for better readability. Also, the invocation to retrieve the public key algorithm has been updated to use req.GetAlgorithm rather than directly accessing the property.
Configuration menu - View commit details
-
Copy full SHA for 87ef2c1 - Browse repository at this point
Copy the full SHA 87ef2c1View commit details -
Add support for secp256k1 and modify logging level
Added secp256k1 to the ECCMode in nanotdf.go. Also, the logging level for the 'kas public key algorithm' has been downgraded from Info to Debug to reflect its utilization better and reduce log volume in non-debug scenarios.
Configuration menu - View commit details
-
Copy full SHA for 0c9952e - Browse repository at this point
Copy the full SHA 0c9952eView commit details -
Remove unnecessary constants and refactor ECCurve
The kNanoTDFGMACLength constant and ErrInternal error constant were removed as they were not being used. The unnecessary ECCurve fetching code was also removed, now ECCurve is fetched directly from the header. The CryptoProvider now generates keys based on this directly fetched ECCurve.
Configuration menu - View commit details
-
Copy full SHA for c013d32 - Browse repository at this point
Copy the full SHA c013d32View commit details -
Update EC algorithms in public key handling
The public key handling process has been updated to accommodate three different elliptic curve algorithms: EC256R1, EC384R1 and EC512R1. The tests have also been adjusted to ensure these changes function as expected. Algorithm constants in the crypto provider code file have also been updated to reflect these changes in public key handling.
Configuration menu - View commit details
-
Copy full SHA for e03db4c - Browse repository at this point
Copy the full SHA e03db4cView commit details -
Refactor cryptoProvider configuration in YAML files
The cryptoProvider configuration in both opentdf-dev.yaml and opentdf-example.yaml files has been refactored. The rsa and ec field structure has now been replaced with a simpler, streamlined `keys` field, which should enhance readability and maintainability of these configurations.
Configuration menu - View commit details
-
Copy full SHA for dab6073 - Browse repository at this point
Copy the full SHA dab6073View commit details -
Add EC key generation to init-temp-keys scripts
Updated both the .cmd and .sh versions of the init-temp-keys scripts to include the generation of elliptic curve (EC) keys with prime256v1 curve. Now, alongside RSA and secp256r1 key pairs, the scripts also generate prime256v1 EC key pairs.
Configuration menu - View commit details
-
Copy full SHA for 6b1fc14 - Browse repository at this point
Copy the full SHA 6b1fc14View commit details -
Update encryption functionality and refactor options
The encryption functionality has been updated to allow for more options, such as the nano format and ability to disable storing key identifiers in TDF KAOs. The encrypt command has also been refactored for conciseness and clarity. Code for token endpoint during client creation is removed, and new options have been added to address the nanoTDF format and managing key identifiers.
Configuration menu - View commit details
-
Copy full SHA for b6cc539 - Browse repository at this point
Copy the full SHA b6cc539View commit details
Commits on Jun 14, 2024
-
Add new encryption keys to YAML files
New encryption keys have been added to both `opentdf-dev.yaml` and `opentdf-example.yaml` files. The keys are of elliptic curve cryptographic type with identifiers e2 and e3, corresponding to different security levels.
Configuration menu - View commit details
-
Copy full SHA for 6e44006 - Browse repository at this point
Copy the full SHA 6e44006View commit details -
Correct algorithm name and simplify code
The algorithm name was incorrectly spelled as 'AlgorithmECP512R1' instead of 'AlgorithmECP521R1'. This incorrect spelling was fixed across multiple files. Also, the redundant code in publicKey.go and standard_crypto.go where ecPublicKeyPem was retrieved separately for each algorithm was consolidated into one single case handling multiple algorithms, making the code more concise and readable.
Configuration menu - View commit details
-
Copy full SHA for 109968b - Browse repository at this point
Copy the full SHA 109968bView commit details -
Refactor crypto provider methods and tests
Simplified the "publicKey.go" code by handling all elliptic curve digital signature algorithm cases together. Also, amended the ECCertificate and ECPublicKey methods in the crypto provider to take an additional 'curveName' parameter. These changes are reflected in the accompanying tests as well.
Configuration menu - View commit details
-
Copy full SHA for 41ffd92 - Browse repository at this point
Copy the full SHA 41ffd92View commit details -
Add new keys to opentdf-dev.yaml
Three new keys, e2 with ec:secp384r1, e3 with ec:secp521r1, and a legacy e2 key, and a legacy e3 key have been added to the configuration file. These keys enhance the algorithm compatibility and secure communications with the legacy system.
Configuration menu - View commit details
-
Copy full SHA for ae70bba - Browse repository at this point
Copy the full SHA ae70bbaView commit details -
Add new key ids and change ECCMode in encrypt.go
Two new key ids have been added to the tdf-roundtrips.bats file. Also, in the encrypt.go file, the ECCMode was changed from ECCModeSecp521r1 to ECCModeSecp256r1. This commit introduces these modifications to improve security and performance.
Configuration menu - View commit details
-
Copy full SHA for 39eb5c3 - Browse repository at this point
Copy the full SHA 39eb5c3View commit details -
Add new public key endpoint in service-start bats test
A new endpoint for the ec384 public key has been added in the service-start bats test. This endpoint checks if the output is a public key, verifies it's an EC
Configuration menu - View commit details
-
Copy full SHA for d411aa8 - Browse repository at this point
Copy the full SHA d411aa8View commit details -
Add support for secp384r1 and secp521r1 algorithms
The code has been updated in the 'tdf-roundtrips.bats' test file to include support for secp384r1 and secp521r1 algorithms. New kids have been added along with their respective private key and cert file details. This should allow more flexibility for testing purposes.
Configuration menu - View commit details
-
Copy full SHA for ad2f99c - Browse repository at this point
Copy the full SHA ad2f99cView commit details -
Disable decryption step in tdf-roundtrips test
Temporarily disable the decrypt command in tdf-roundtrips test due to a bug reported in issue #900. This change also modifies the paths of the r2 key pair to match the kas-private.pem and kas-cert.pem paths, eliminating the previously separate r2 keys.
Configuration menu - View commit details
-
Copy full SHA for 43ff918 - Browse repository at this point
Copy the full SHA 43ff918View commit details -
Refactor algorithm assignment in getECPublicKey function
The selected encryption algorithm assignment has been changed from a bunch of if-else conditions to a switch case statement within the getECPublicKey function. This change contributes to more readable and maintainable code. Also, comments are included to indicate the corresponding algorithm.
Configuration menu - View commit details
-
Copy full SHA for d631c68 - Browse repository at this point
Copy the full SHA d631c68View commit details -
Add support for ECCModeSecp256k1 in nanotdf.go
This commit updates the case switch in the nanotdf.go file to include support for ocrypto.ECCModeSecp256k1. Although this encryption algorithm is currently not supported, it now has a corresponding switch case.
Configuration menu - View commit details
-
Copy full SHA for 9c65c5c - Browse repository at this point
Copy the full SHA 9c65c5cView commit details
Commits on Jun 17, 2024
-
Add error handling for unsupported or unknown algorithms
In the SDK, error logging and returning has been implemented for the cases when an unsupported algorithm (ec:secp256k1) or any unknown algorithm is used. This will aid in better fault detection and diagnosis.
Configuration menu - View commit details
-
Copy full SHA for a7bfe0e - Browse repository at this point
Copy the full SHA a7bfe0eView commit details -
Enable decryption in tdf-roundtrips test
The decryption steps in the tdf-roundtrips bats test were commented out, and have been enabled again. In addition, the decrypt function was updated to accommodate both TDF and Nano files. It now attempts to decrypt both file types instead of returning an error when the file is not a TDF file.
Configuration menu - View commit details
-
Copy full SHA for 42ffcbe - Browse repository at this point
Copy the full SHA 42ffcbeView commit details -
Remove specific message comparison from decrypt.go
The change removes the specific comparison of the output buffer content with "Hello Virtru" in the decrypt command. Instead, it just prints the content of the output buffer directly, making it more universally applicable.
Configuration menu - View commit details
-
Copy full SHA for 416ad7c - Browse repository at this point
Copy the full SHA 416ad7cView commit details -
Convert output buffer to string in decrypt command
The decryption command previously printed output directly from the buffer. This commit changes that and converts the output buffer to a string before printing. This may improve readability and consistency across the application.
Configuration menu - View commit details
-
Copy full SHA for 843cc8e - Browse repository at this point
Copy the full SHA 843cc8eView commit details -
Remove warning message and adjust print method in decrypt.go
Removed the warning message in the 'tdf-roundtrips.bats' test file which is no longer relevant. Also, in 'decrypt.go', replaced the 'cmd.Println' method with the 'fmt.Println' method to print the output string. This change is meant to simplify and standardize the print methods across the codebase.
Configuration menu - View commit details
-
Copy full SHA for d96accc - Browse repository at this point
Copy the full SHA d96acccView commit details -
Configuration menu - View commit details
-
Copy full SHA for e786271 - Browse repository at this point
Copy the full SHA e786271View commit details
Commits on Jun 18, 2024
-
Update function signatures in hsm.go
The function signatures for GenerateEphemeralKasKeys, ECPublicKey, and ECCertificate in hsm.go have been updated. The functions now accept an additional parameter, though it's currently unused. This change provides better flexibility for future adjustments or enhancements of these functions.
Configuration menu - View commit details
-
Copy full SHA for a83cbc6 - Browse repository at this point
Copy the full SHA a83cbc6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 544dd51 - Browse repository at this point
Copy the full SHA 544dd51View commit details
Commits on Jun 20, 2024
-
Update test/tdf-roundtrips.bats
Co-authored-by: Dave Mihalcik <dmihalcik@virtru.com>
Configuration menu - View commit details
-
Copy full SHA for a17ebbc - Browse repository at this point
Copy the full SHA a17ebbcView commit details
Commits on Jun 21, 2024
-
Merge remote-tracking branch 'refs/remotes/origin/main' into 881-supp…
…ort-additional-elliptic-curves # Conflicts: # docs/openapi/policy/attributes/attributes.swagger.json # docs/openapi/policy/namespaces/namespaces.swagger.json
Configuration menu - View commit details
-
Copy full SHA for 389f220 - Browse repository at this point
Copy the full SHA 389f220View commit details
Commits on Jun 24, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 57e5f8e - Browse repository at this point
Copy the full SHA 57e5f8eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 71ecaf0 - Browse repository at this point
Copy the full SHA 71ecaf0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2f5d945 - Browse repository at this point
Copy the full SHA 2f5d945View commit details
Commits on Jul 10, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 779ee2b - Browse repository at this point
Copy the full SHA 779ee2bView commit details
Commits on Jul 11, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 3781f2e - Browse repository at this point
Copy the full SHA 3781f2eView commit details