From 224398773fb2ec777f632aaded2264620b68f3ea Mon Sep 17 00:00:00 2001 From: Mohammad Alawaji Date: Thu, 15 Aug 2024 18:14:34 +0300 Subject: [PATCH] Fix error throwing logic --- pkcs11/src/backend/key.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkcs11/src/backend/key.rs b/pkcs11/src/backend/key.rs index 6b698923..6e9d756d 100644 --- a/pkcs11/src/backend/key.rs +++ b/pkcs11/src/backend/key.rs @@ -205,7 +205,7 @@ pub fn create_key_from_template( let key_class = if let Some(ref key_class) = parsed.key_class { let key_class = *key_class; - if key_class == ObjectKind::Other && key_class == ObjectKind::PublicKey { + if key_class == ObjectKind::Other || key_class == ObjectKind::PublicKey { return Err(Error::ObjectClassNotSupported); } key_class