aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tests/unit_x509.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/tests/unit_x509.cpp b/src/tests/unit_x509.cpp
index d983fd7db..d180e8ffc 100644
--- a/src/tests/unit_x509.cpp
+++ b/src/tests/unit_x509.cpp
@@ -990,6 +990,8 @@ Test::Result test_usage(const Botan::Private_Key& ca_key,
result.test_eq("key usage cRLSign not allowed",
user1_cert.allowed_usage(
Key_Constraints(Key_Constraints::DIGITAL_SIGNATURE | Key_Constraints::CRL_SIGN)), false);
+ result.test_eq("encryption is not allowed",
+ user1_cert.allowed_usage(Usage_Type::ENCRYPTION), false);
// cert only allows digitalSignature, so checking for only that should be ok
result.confirm("key usage digitalSignature allowed", user1_cert.allowed_usage(Key_Constraints::DIGITAL_SIGNATURE));
@@ -1014,6 +1016,9 @@ Test::Result test_usage(const Botan::Private_Key& ca_key,
result.confirm("key usage multiple cRLSign allowed", mult_usage_cert.allowed_usage(Key_Constraints::CRL_SIGN));
result.confirm("key usage multiple digitalSignature and cRLSign allowed", mult_usage_cert.allowed_usage(
Key_Constraints(Key_Constraints::DIGITAL_SIGNATURE | Key_Constraints::CRL_SIGN)));
+ result.test_eq("encryption is not allowed",
+ mult_usage_cert.allowed_usage(Usage_Type::ENCRYPTION), false);
+
opts.constraints = Key_Constraints::NO_CONSTRAINTS;
@@ -1027,6 +1032,7 @@ Test::Result test_usage(const Botan::Private_Key& ca_key,
// cert allows every usage
result.confirm("key usage digitalSignature allowed", no_usage_cert.allowed_usage(Key_Constraints::DIGITAL_SIGNATURE));
result.confirm("key usage cRLSign allowed", no_usage_cert.allowed_usage(Key_Constraints::CRL_SIGN));
+ result.confirm("key usage encryption allowed", no_usage_cert.allowed_usage(Usage_Type::ENCRYPTION));
if (sig_algo == "RSA")
{