Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Commit

Permalink
Test: check test results and response message
Browse files Browse the repository at this point in the history
Signed-off-by: xiaoyuxlu <[email protected]>
  • Loading branch information
xiaoyuxlu committed Aug 30, 2023
1 parent dffe861 commit 2d974dd
Show file tree
Hide file tree
Showing 10 changed files with 1,470 additions and 14 deletions.
2 changes: 2 additions & 0 deletions test/spdmlib-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ async-recursion = "1.0.4"
spin = { version = "0.9.8" }
executor = { path = "../../executor" }
pcidoe_transport = { path = "../../pcidoe_transport" }
byteorder = { version = "1.4" }
bit_field = "0.10.1"

[dev-dependencies]
env_logger = "*"
Expand Down
1 change: 1 addition & 0 deletions test/spdmlib-test/src/common/crypto_callback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,5 @@ fn fake_verify_cert_chain(_cert_chain: &[u8]) -> SpdmResult {
// Make sure this is the first test case running by `cargo test`
fn test_0_crypto_init() {
spdmlib::crypto::aead::register(FAKE_AEAD.clone());
spdmlib::crypto::rand::register(FAKE_RAND.clone());
}
3 changes: 2 additions & 1 deletion test/spdmlib-test/src/common/secret_callback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#![allow(unused_variables)]
use crate::common::util::get_test_key_directory;
use codec::{u24, Codec, Writer};
use ring::rand::SecureRandom;
use spdmlib::common::key_schedule::SpdmKeySchedule;
use spdmlib::config;
use spdmlib::crypto;
Expand Down Expand Up @@ -310,7 +311,7 @@ fn sign_ecdsa_asym_algo(
let signature = signature.as_ref();

let mut full_signature: [u8; SPDM_MAX_ASYM_KEY_SIZE] = [0u8; SPDM_MAX_ASYM_KEY_SIZE];
full_signature[..signature.len()].copy_from_slice(signature);
full_signature[..signature.len()].copy_from_slice(vec![0x5au8; signature.len()].as_slice());

Some(SpdmSignatureStruct {
data_size: signature.len() as u16,
Expand Down
Loading

0 comments on commit 2d974dd

Please sign in to comment.