Skip to content

Commit 6a3ecdb

Browse files
committed
[hsmtool] Patch cryptoki
Add parallaxsecond/rust-cryptoki#116 to rust-cryptoki, allowing cryptoki to understand certificate objects on the NitroKey. Signed-off-by: Chris Frantz <[email protected]>
1 parent 24ddf5a commit 6a3ecdb

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

third_party/rust/BUILD

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ crates_vendor(
1717
)],
1818
"cryptoki": [crate.annotation(
1919
patch_args = ["-p2"],
20-
patches = ["@//third_party/rust/patches:cryptoki-vendor-defined-mechanism-type.patch"],
20+
patches = [
21+
"@//third_party/rust/patches:cryptoki-vendor-defined-mechanism-type.patch",
22+
"@//third_party/rust/patches:cryptoki-pr-116.patch",
23+
],
2124
)],
2225
"cryptoki-sys": [crate.annotation(
2326
additive_build_file_content = """

third_party/rust/crates/defs.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,6 +1038,7 @@ def crate_repositories():
10381038
"-p2",
10391039
],
10401040
patches = [
1041+
"@//third_party/rust/patches:cryptoki-pr-116.patch",
10411042
"@//third_party/rust/patches:cryptoki-vendor-defined-mechanism-type.patch",
10421043
],
10431044
sha256 = "7da58729f419780655e9b82f5c5e0c3eba3aab46ea48f610cc615b10d5baad53",
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/cryptoki/src/object.rs b/cryptoki/src/object.rs
2+
index 17f6c6d..7c7b94d 100644
3+
--- a/cryptoki/src/object.rs
4+
+++ b/cryptoki/src/object.rs
5+
@@ -343,7 +343,7 @@ impl TryFrom<CK_ATTRIBUTE_TYPE> for AttributeType {
6+
CKA_APPLICATION => Ok(AttributeType::Application),
7+
CKA_ATTR_TYPES => Ok(AttributeType::AttrTypes),
8+
CKA_BASE => Ok(AttributeType::Base),
9+
- CKA_CERTIFICATE_CATEGORY => Ok(AttributeType::CertificateType),
10+
+ CKA_CERTIFICATE_TYPE => Ok(AttributeType::CertificateType),
11+
CKA_CHECK_VALUE => Ok(AttributeType::CheckValue),
12+
CKA_CLASS => Ok(AttributeType::Class),
13+
CKA_COEFFICIENT => Ok(AttributeType::Coefficient),

0 commit comments

Comments
 (0)