Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

manifest/manifest.in.cbor: Fixup BER encoding #108

Closed
wants to merge 1 commit into from

Conversation

alistair23
Copy link
Collaborator

This fixes 0ec1dca "manifest: BER encode the OID" by using the into_cow() function to get the output instead of the original to_der_vec().

The new diff to generate the OID is

diff --git a/src/main.rs b/src/main.rs
index 181ca0f..fd85724 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -8,6 +8,8 @@
 //! (which is generated from here) or the README
 //!

+use asn1_rs::oid;
+use asn1_rs::ToDer;
 use async_std::task;
 use clap::{Parser, Subcommand};
 use futures::future::join_all;
@@ -629,6 +631,10 @@ fn init_logger() {
 #[async_std::main]
 async fn main() -> Result<(), ()> {
     init_logger();
+
+    let oid = oid!(1.3.6 .1 .4 .1 .5127);
+    panic!("OID: {:x?}", oid.into_cow());
+
     let cli = Args::parse();

     let cntx_ptr = spdm::initialise_spdm_context();

Fixes: 0ec1dca "manifest: BER encode the OID"

This fixes 0ec1dca "manifest: BER encode the OID" by using the
`into_cow()` function to get the output instead of the original
`to_der_vec()`.

The new diff to generate the OID is

```diff
diff --git a/src/main.rs b/src/main.rs
index 181ca0f..fd85724 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -8,6 +8,8 @@
 //! (which is generated from here) or the README
 //!

+use asn1_rs::oid;
+use asn1_rs::ToDer;
 use async_std::task;
 use clap::{Parser, Subcommand};
 use futures::future::join_all;
@@ -629,6 +631,10 @@ fn init_logger() {
 #[async_std::main]
 async fn main() -> Result<(), ()> {
     init_logger();
+
+    let oid = oid!(1.3.6 .1 .4 .1 .5127);
+    panic!("OID: {:x?}", oid.into_cow());
+
     let cli = Args::parse();

     let cntx_ptr = spdm::initialise_spdm_context();
```

Fixes: 0ec1dca "manifest: BER encode the OID"
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
@alistair23 alistair23 closed this Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant