Skip to content

Commit

Permalink
Removed non-necessary RSA7680 key generation tests
Browse files Browse the repository at this point in the history
Signed-off-by: AssemblyJohn <[email protected]>
  • Loading branch information
AssemblyJohn committed May 2, 2024
1 parent 5972419 commit ccc1c0d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 23 deletions.
2 changes: 1 addition & 1 deletion include/evse_security/crypto/interface/crypto_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ enum class CryptoKeyType {
EC_secp384r1, // P-384, ~equiv to rsa 7680
RSA_TPM20, // Default TPM RSA, only option allowed for TPM (universal support), 2048 bits
RSA_3072, // Default RSA. Protection lifetime: ~2030
RSA_7680, // Protection lifetime: >2031
RSA_7680, // Protection lifetime: >2031. Very long generation time 8-40s on 16 core PC
};

enum class KeyValidationResult {
Expand Down
6 changes: 3 additions & 3 deletions lib/evse_security/evse_security.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ EvseSecurity::get_installed_certificates(const std::vector<CertificateType>& cer
certificate_chains.push_back(certificate_hash_data_chain);
}
}
} catch(const CertificateLoadException& e) {
} catch (const CertificateLoadException& e) {
EVLOG_error << "Could not load installed leaf certificates: " << e.what();
}
}
Expand Down Expand Up @@ -671,7 +671,7 @@ int EvseSecurity::get_count_of_installed_certificates(const std::vector<Certific
try {
X509CertificateBundle ca_bundle(unique_dir, EncodingFormat::PEM);
count += ca_bundle.get_certificate_count();
} catch(const CertificateLoadException& e) {
} catch (const CertificateLoadException& e) {
EVLOG_error << "Could not load bundle for certificate count: " << e.what();
}
}
Expand All @@ -685,7 +685,7 @@ int EvseSecurity::get_count_of_installed_certificates(const std::vector<Certific
try {
X509CertificateBundle leaf_bundle(leaf_dir, EncodingFormat::PEM);
count += leaf_bundle.get_certificate_count();
} catch(const CertificateLoadException& e) {
} catch (const CertificateLoadException& e) {
EVLOG_error << "Could not load bundle for certificate count: " << e.what();
}
}
Expand Down
9 changes: 0 additions & 9 deletions tests/openssl_supplier_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,6 @@ TEST_F(OpenSSLSupplierTest, generate_key_RSA_3072) {
ASSERT_TRUE(res);
}

TEST_F(OpenSSLSupplierTest, generate_key_RSA_7680) {
KeyGenerationInfo info = {
CryptoKeyType::RSA_7680, false, std::nullopt, std::nullopt, std::nullopt,
};
KeyHandle_ptr key;
auto res = OpenSSLSupplier::generate_key(info, key);
ASSERT_TRUE(res);
}

TEST_F(OpenSSLSupplierTest, generate_key_EC_prime256v1) {
KeyGenerationInfo info = {
CryptoKeyType::EC_prime256v1, false, std::nullopt, std::nullopt, std::nullopt,
Expand Down
10 changes: 0 additions & 10 deletions tests/openssl_supplier_test_tpm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,6 @@ TEST_F(OpenSSLSupplierTpmTest, generate_key_RSA_3072) {
ASSERT_TRUE(res);
}

TEST_F(OpenSSLSupplierTpmTest, generate_key_RSA_7680) {
KeyGenerationInfo info = {
CryptoKeyType::RSA_7680, true, std::nullopt, std::nullopt, std::nullopt,
};
KeyHandle_ptr key;
auto res = OpenSSLSupplier::generate_key(info, key);
// not commonly supported by TPMs
ASSERT_FALSE(res);
}

TEST_F(OpenSSLSupplierTpmTest, generate_key_EC_prime256v1) {
KeyGenerationInfo info = {
CryptoKeyType::EC_prime256v1, true, std::nullopt, std::nullopt, std::nullopt,
Expand Down

0 comments on commit ccc1c0d

Please sign in to comment.