From 7aa536a07e0c4c7871f942f21d3908b22dc57f47 Mon Sep 17 00:00:00 2001 From: sergey-shandar Date: Thu, 22 Aug 2024 22:57:19 -0700 Subject: [PATCH] ASN.1 --- blockset-lib/src/asn1.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/blockset-lib/src/asn1.rs b/blockset-lib/src/asn1.rs index a5e826ec..0eda8fc2 100644 --- a/blockset-lib/src/asn1.rs +++ b/blockset-lib/src/asn1.rs @@ -47,6 +47,7 @@ impl Any { match self { Any::Bool(v) => f(v), Any::Integer(v) => f(v), + Any::ObjectIdentifier(v) => f(v), _ => todo!(), } } @@ -67,6 +68,7 @@ impl Any { match tag { bool::TAG => Any::Bool(f(a)), i128::TAG => Any::Integer(f(a)), + ObjectIdentifier::TAG => Any::ObjectIdentifier(f(a)), _ => todo!(), } } else { @@ -259,6 +261,14 @@ mod test { Any::Integer(i128::MIN + 1), &[2, 16, 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], ); + any_f( + Any::ObjectIdentifier(ObjectIdentifier { + a0: 2, + a1: 0, + a2: [1, 235].cast(), + }), + &[6, 4, 80, 1, 0x81, 0x6b], + ); } #[wasm_bindgen_test]