From 9cacb382ade2104e5e6b6f943172bea5b2687fac Mon Sep 17 00:00:00 2001 From: Petre Eftime Date: Thu, 14 Apr 2022 10:41:46 +0000 Subject: [PATCH 1/2] nsm-lib: re-add missing exports from aws-nitro-enclaves-nsm-api This fixes the issue that cbindgen does not export the ErrorCode and Digest enums. Signed-off-by: Petre Eftime --- nsm-lib/cbindgen.toml | 2 +- nsm-lib/src/lib.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/nsm-lib/cbindgen.toml b/nsm-lib/cbindgen.toml index 5fd4c32..4ae549d 100644 --- a/nsm-lib/cbindgen.toml +++ b/nsm-lib/cbindgen.toml @@ -12,7 +12,7 @@ include_guard = "NSM_LIB_H" [parse] parse_deps = true -include = ["nsm-io"] +include = ["aws-nitro-enclaves-nsm-api"] [enum] rename_variants = "QualifiedScreamingSnakeCase" diff --git a/nsm-lib/src/lib.rs b/nsm-lib/src/lib.rs index d23777a0..494f15d 100644 --- a/nsm-lib/src/lib.rs +++ b/nsm-lib/src/lib.rs @@ -8,7 +8,8 @@ //! This module implements wrappers over the NSM Rust API which enable //! access to the API for non-Rust callers (ex.: C/C++ etc.). -use aws_nitro_enclaves_nsm_api::api::{Digest, ErrorCode, Request, Response}; +pub use aws_nitro_enclaves_nsm_api::api::{Digest, ErrorCode}; +use aws_nitro_enclaves_nsm_api::api::{Request, Response}; use aws_nitro_enclaves_nsm_api::driver::{nsm_exit, nsm_init, nsm_process_request}; use serde_bytes::ByteBuf; use std::ptr::copy_nonoverlapping; From 0e2882c4843bc0308a04dfcadafc623534557cb6 Mon Sep 17 00:00:00 2001 From: Petre Eftime Date: Thu, 14 Apr 2022 10:40:53 +0000 Subject: [PATCH 2/2] nsm-lib: update cbindgen Signed-off-by: Petre Eftime --- nsm-lib/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nsm-lib/Cargo.toml b/nsm-lib/Cargo.toml index 724eb53..acdec9b 100644 --- a/nsm-lib/Cargo.toml +++ b/nsm-lib/Cargo.toml @@ -10,7 +10,7 @@ aws-nitro-enclaves-nsm-api = { path = "../" } serde_bytes = "0.11" [build-dependencies] -cbindgen = { version = "0.15", default-features = false } +cbindgen = { version = "0.21", default-features = false } [lib] name = "nsm"