Skip to content

Commit c009da4

Browse files
committed
fix signature generation and verification
Signed-off-by: leongross <leon.gross@9elements.com>
1 parent a8be79f commit c009da4

File tree

8 files changed

+39
-134
lines changed

8 files changed

+39
-134
lines changed

examples/certs/ca.cert.der

472 Bytes
Binary file not shown.
587 Bytes
Binary file not shown.
167 Bytes
Binary file not shown.

examples/certs/inter.cert.der

480 Bytes
Binary file not shown.

examples/platform/cert_store.rs

Lines changed: 19 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use p384::{
2424
};
2525
use zerocopy::FromBytes;
2626

27-
use super::certs::{STATIC_ATTESTATION_CERT, STATIC_ROOT_CA_CERT};
27+
use super::certs::{STATIC_END_CERT, STATIC_END_RESPONDER_KEY_DER, STATIC_INTER_CERT, STATIC_ROOT_CA_CERT};
2828
use spdm_lib::commands::challenge::MeasurementSummaryHashType;
2929
use spdm_lib::protocol::{
3030
algorithms::{AsymAlgo, ECC_P384_SIGNATURE_SIZE, SHA384_HASH_SIZE},
@@ -58,36 +58,22 @@ impl DemoCertStore {
5858
}
5959

6060
fn generate_certificate_chain() -> (Vec<u8>, SigningKey) {
61-
use crate::platform::certs::ATTESTATION_PRIVATE_KEY;
62-
63-
println!("🔧 DIRECT CERTIFICATE CHAIN - RAW CONCATENATION");
64-
65-
// SIMPLE APPROACH: Just concatenate Root CA + Attestation certificates
66-
// Let the SPDM library handle its own formatting
61+
// Concatenate Root CA + Intermediate + End-entity certificates
6762
let mut cert_chain = Vec::new();
6863
cert_chain.extend_from_slice(STATIC_ROOT_CA_CERT);
69-
cert_chain.extend_from_slice(STATIC_ATTESTATION_CERT);
70-
71-
println!(
72-
" ✅ Raw certificates: Root({}) + Attestation({})",
73-
STATIC_ROOT_CA_CERT.len(),
74-
STATIC_ATTESTATION_CERT.len()
75-
);
76-
println!(" Total length: {} bytes", cert_chain.len());
77-
println!(" Root starts: {:02x?}", &cert_chain[..4]);
78-
println!(
79-
" Attestation starts: {:02x?}",
80-
&cert_chain[STATIC_ROOT_CA_CERT.len()..STATIC_ROOT_CA_CERT.len() + 4]
81-
);
82-
83-
let secret_key = SecretKey::from_bytes(ATTESTATION_PRIVATE_KEY.into())
84-
.expect("Failed to parse secret key from static data");
85-
86-
let attestation_key = SigningKey::from(secret_key);
64+
cert_chain.extend_from_slice(STATIC_INTER_CERT);
65+
cert_chain.extend_from_slice(STATIC_END_CERT);
8766

88-
println!("🔑 Static attestation signing key loaded");
67+
// Parse the P-384 private key from SEC1 DER format.
68+
// SEC1 ECPrivateKey: SEQUENCE { version INTEGER, privateKey OCTET STRING(48), ... }
69+
// For a P-384 key with 2-byte length header: skip 8 bytes to reach the raw 48-byte scalar.
70+
let raw_key: &[u8; 48] = STATIC_END_RESPONDER_KEY_DER[8..56]
71+
.try_into()
72+
.expect("key DER too short");
73+
let secret_key = SecretKey::from_bytes(raw_key.into())
74+
.expect("Failed to parse end-entity private key");
8975

90-
(cert_chain, attestation_key)
76+
(cert_chain, SigningKey::from(secret_key))
9177
}
9278

9379
/// Extract the first certificate from a DER-encoded certificate chain
@@ -262,9 +248,9 @@ impl SpdmCertStore for DemoCertStore {
262248
fn test_signing() {
263249
use p384::ecdsa::signature::SignatureEncoding;
264250

265-
// Create a known private key
266-
let private_key_bytes = ATTESTATION_PRIVATE_KEY.to_vec();
267-
let secret_key = SecretKey::from_bytes((&private_key_bytes[..]).into()).unwrap();
251+
// Load private key from SEC1 DER (raw 48-byte scalar at offset 8)
252+
let raw_key: &[u8; 48] = STATIC_END_RESPONDER_KEY_DER[8..56].try_into().unwrap();
253+
let secret_key = SecretKey::from_bytes(raw_key.into()).unwrap();
268254
let signing_key = SigningKey::from(secret_key);
269255

270256
// Your input
@@ -295,9 +281,9 @@ fn debug_signing_verification() {
295281
let input_hex = "32ac91a55d17db5e537448789486c633ecba4cd49185d0933f3d6561573fb68931f88bef4dc6ef20602df7dbeb51086b";
296282
let input = hex::decode(input_hex).unwrap();
297283

298-
// Create signing key
299-
let private_key_bytes = ATTESTATION_PRIVATE_KEY.to_vec();
300-
let secret_key = SecretKey::from_bytes((&private_key_bytes[..]).into()).unwrap();
284+
// Load private key from SEC1 DER (raw 48-byte scalar at offset 8)
285+
let raw_key: &[u8; 48] = STATIC_END_RESPONDER_KEY_DER[8..56].try_into().unwrap();
286+
let secret_key = SecretKey::from_bytes(raw_key.into()).unwrap();
301287
let signing_key = SigningKey::from(secret_key);
302288

303289
// Get public key

examples/platform/certs.rs

Lines changed: 17 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -12,102 +12,23 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
//! Static X.509 certificates for SPDM platform implementations
15+
//! DMTF libspdm ECP384 test certificate chain for SPDM platform implementations.
1616
//!
17-
//! These certificates are generated by OpenSSL and known to work correctly
18-
//! with certificate verification. Generated on: September 25, 2025
19-
//!
20-
//!
21-
pub const ATTESTATION_PRIVATE_KEY: &[u8] = &[
22-
0xd5, 0x76, 0x17, 0x2e, 0xe3, 0x5f, 0x3e, 0x62, 0xb2, 0xbd, 0x0c, 0x5e, 0x7e, 0x6d, 0x8c, 0xe3,
23-
0xa6, 0x05, 0xfe, 0x27, 0x80, 0x17, 0x37, 0x85, 0x8b, 0x76, 0xa7, 0xd7, 0xfd, 0x8c, 0x0d, 0x26,
24-
0x28, 0x41, 0x7a, 0x8b, 0xb6, 0xbc, 0x17, 0x18, 0xc6, 0x9a, 0x10, 0x5c, 0x1e, 0xc8, 0x11, 0x70,
25-
];
17+
//! Certificates sourced from: spdm-emu/libspdm/unit_test/sample_key/ecp384/
18+
//! - ca.cert.der: root CA (matches examples/cert/ecp384_ca.cert.der used by the requester)
19+
//! - inter.cert.der: intermediate CA signed by the root
20+
//! - end_responder.cert.der: end-entity cert signed by the intermediate CA
21+
//! - end_responder.key.der: SEC1 DER-encoded P-384 private key for the end-entity cert
22+
23+
/// DMTF libspdm ECP384 root CA certificate (DER-encoded).
24+
/// This is the same cert as examples/cert/ecp384_ca.cert.der used by the requester.
25+
pub const STATIC_ROOT_CA_CERT: &[u8] = include_bytes!("../certs/ca.cert.der");
26+
27+
/// DMTF libspdm ECP384 intermediate CA certificate (DER-encoded).
28+
pub const STATIC_INTER_CERT: &[u8] = include_bytes!("../certs/inter.cert.der");
2629

27-
pub const STATIC_ROOT_CA_CERT: &[u8] = &[
28-
0x30, 0x82, 0x02, 0x5d, 0x30, 0x82, 0x01, 0xe3, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x14, 0x66,
29-
0xd4, 0x94, 0x26, 0x31, 0x59, 0xc1, 0x0e, 0xfe, 0xe2, 0xf1, 0x74, 0x8a, 0x4f, 0xb3, 0xd4, 0x13,
30-
0x66, 0x7f, 0x93, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x03, 0x30,
31-
0x6e, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x13,
32-
0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, 0x0a, 0x43, 0x61, 0x6c, 0x69, 0x66, 0x6f, 0x72,
33-
0x6e, 0x69, 0x61, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0c, 0x0d, 0x53, 0x61,
34-
0x6e, 0x20, 0x46, 0x72, 0x61, 0x6e, 0x63, 0x69, 0x73, 0x63, 0x6f, 0x31, 0x18, 0x30, 0x16, 0x06,
35-
0x03, 0x55, 0x04, 0x0a, 0x0c, 0x0f, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x52, 0x6f,
36-
0x6f, 0x74, 0x20, 0x43, 0x41, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x0f,
37-
0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x30,
38-
0x1e, 0x17, 0x0d, 0x32, 0x35, 0x30, 0x39, 0x32, 0x37, 0x30, 0x31, 0x32, 0x36, 0x34, 0x31, 0x5a,
39-
0x17, 0x0d, 0x33, 0x35, 0x30, 0x39, 0x32, 0x35, 0x30, 0x31, 0x32, 0x36, 0x34, 0x31, 0x5a, 0x30,
40-
0x6e, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x13,
41-
0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, 0x0a, 0x43, 0x61, 0x6c, 0x69, 0x66, 0x6f, 0x72,
42-
0x6e, 0x69, 0x61, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0c, 0x0d, 0x53, 0x61,
43-
0x6e, 0x20, 0x46, 0x72, 0x61, 0x6e, 0x63, 0x69, 0x73, 0x63, 0x6f, 0x31, 0x18, 0x30, 0x16, 0x06,
44-
0x03, 0x55, 0x04, 0x0a, 0x0c, 0x0f, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x52, 0x6f,
45-
0x6f, 0x74, 0x20, 0x43, 0x41, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x0f,
46-
0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x30,
47-
0x76, 0x30, 0x10, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x05, 0x2b, 0x81,
48-
0x04, 0x00, 0x22, 0x03, 0x62, 0x00, 0x04, 0xbd, 0x63, 0x0d, 0x67, 0x2e, 0x64, 0xa3, 0x55, 0x11,
49-
0x19, 0x9a, 0x1f, 0x66, 0x7c, 0xc5, 0x9c, 0x61, 0x62, 0x3d, 0x40, 0xb6, 0xe1, 0xff, 0x43, 0x7c,
50-
0x39, 0x27, 0xc8, 0xec, 0xe9, 0x12, 0x3a, 0xa8, 0xce, 0x53, 0x19, 0x06, 0xd1, 0xab, 0x4d, 0xd8,
51-
0x04, 0x36, 0xc2, 0xb8, 0x8d, 0xc1, 0x20, 0xe5, 0x0c, 0x34, 0x5e, 0x51, 0x8c, 0x73, 0x1f, 0x67,
52-
0xe9, 0xad, 0x64, 0x72, 0x58, 0x9c, 0x01, 0xb1, 0x38, 0xd6, 0x7b, 0xd0, 0xad, 0xf6, 0x44, 0xa9,
53-
0xa8, 0x16, 0xb6, 0x36, 0x10, 0xa8, 0xdc, 0x03, 0x35, 0x8f, 0x4f, 0xa7, 0x5d, 0x00, 0x0e, 0x78,
54-
0xd8, 0xee, 0x73, 0x8b, 0xfc, 0x07, 0x0a, 0xa3, 0x42, 0x30, 0x40, 0x30, 0x0f, 0x06, 0x03, 0x55,
55-
0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x0e, 0x06, 0x03,
56-
0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x01, 0x86, 0x30, 0x1d, 0x06, 0x03,
57-
0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x5a, 0xc3, 0x33, 0x0a, 0x3d, 0x7f, 0xe8, 0xc1, 0x4b,
58-
0x3d, 0xb8, 0x28, 0x80, 0xae, 0xb0, 0xfd, 0xab, 0x9d, 0x60, 0xaa, 0x30, 0x0a, 0x06, 0x08, 0x2a,
59-
0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x03, 0x03, 0x68, 0x00, 0x30, 0x65, 0x02, 0x31, 0x00, 0x92,
60-
0x51, 0x80, 0x7b, 0x10, 0xef, 0xb7, 0x03, 0x5a, 0xdb, 0x94, 0xca, 0x2f, 0x10, 0x32, 0xac, 0xa5,
61-
0xba, 0xcc, 0x9b, 0x24, 0xe0, 0xfc, 0xed, 0x95, 0xfb, 0x6d, 0x2e, 0x8e, 0xef, 0xfb, 0x52, 0xdf,
62-
0xf0, 0x29, 0x6f, 0xcf, 0x46, 0x49, 0xaf, 0xdf, 0x53, 0x2f, 0xc7, 0xc5, 0x5d, 0x71, 0xb1, 0x02,
63-
0x30, 0x68, 0x76, 0x6f, 0x7e, 0x02, 0xf7, 0x6f, 0xbf, 0x50, 0xfd, 0x50, 0xae, 0xc0, 0x48, 0xa9,
64-
0xd6, 0x97, 0x9e, 0x32, 0x69, 0x2d, 0x00, 0x94, 0xa4, 0x53, 0x6f, 0x9c, 0x24, 0x23, 0x6c, 0xa6,
65-
0x98, 0x16, 0x80, 0xe1, 0xe6, 0xc9, 0x39, 0x1a, 0x53, 0xd6, 0xb1, 0x54, 0x74, 0xad, 0x8d, 0x89,
66-
0xde,
67-
];
30+
/// DMTF libspdm ECP384 end-entity (responder) certificate (DER-encoded).
31+
pub const STATIC_END_CERT: &[u8] = include_bytes!("../certs/end_responder.cert.der");
6832

69-
pub const STATIC_ATTESTATION_CERT: &[u8] = &[
70-
0x30, 0x82, 0x02, 0xab, 0x30, 0x82, 0x02, 0x31, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x14, 0x45,
71-
0x7b, 0xc1, 0xae, 0x0b, 0xb9, 0x70, 0x17, 0x22, 0x64, 0xfb, 0xf2, 0xb7, 0xac, 0xf4, 0x3a, 0xaa,
72-
0xc0, 0x7c, 0x31, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x03, 0x30,
73-
0x6e, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x13,
74-
0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, 0x0a, 0x43, 0x61, 0x6c, 0x69, 0x66, 0x6f, 0x72,
75-
0x6e, 0x69, 0x61, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0c, 0x0d, 0x53, 0x61,
76-
0x6e, 0x20, 0x46, 0x72, 0x61, 0x6e, 0x63, 0x69, 0x73, 0x63, 0x6f, 0x31, 0x18, 0x30, 0x16, 0x06,
77-
0x03, 0x55, 0x04, 0x0a, 0x0c, 0x0f, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x52, 0x6f,
78-
0x6f, 0x74, 0x20, 0x43, 0x41, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x0f,
79-
0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x30,
80-
0x1e, 0x17, 0x0d, 0x32, 0x35, 0x30, 0x39, 0x32, 0x37, 0x30, 0x31, 0x32, 0x36, 0x34, 0x31, 0x5a,
81-
0x17, 0x0d, 0x33, 0x35, 0x30, 0x39, 0x32, 0x35, 0x30, 0x31, 0x32, 0x36, 0x34, 0x31, 0x5a, 0x30,
82-
0x7f, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x13,
83-
0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, 0x0a, 0x43, 0x61, 0x6c, 0x69, 0x66, 0x6f, 0x72,
84-
0x6e, 0x69, 0x61, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0c, 0x0d, 0x53, 0x61,
85-
0x6e, 0x20, 0x46, 0x72, 0x61, 0x6e, 0x63, 0x69, 0x73, 0x63, 0x6f, 0x31, 0x1d, 0x30, 0x1b, 0x06,
86-
0x03, 0x55, 0x04, 0x0a, 0x0c, 0x14, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x4f, 0x72,
87-
0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x31, 0x24, 0x30, 0x22, 0x06, 0x03,
88-
0x55, 0x04, 0x03, 0x0c, 0x1b, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
89-
0x20, 0x4b, 0x65, 0x79, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65,
90-
0x30, 0x76, 0x30, 0x10, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x05, 0x2b,
91-
0x81, 0x04, 0x00, 0x22, 0x03, 0x62, 0x00, 0x04, 0xd6, 0x09, 0x5e, 0x5f, 0xc4, 0x2d, 0xa7, 0xf6,
92-
0x9f, 0x8d, 0xdf, 0xc1, 0x9f, 0xd1, 0x20, 0xb8, 0x25, 0x1a, 0x9c, 0xbf, 0xf7, 0x61, 0x5e, 0xce,
93-
0xfd, 0x67, 0xff, 0x72, 0x3e, 0xbf, 0xe8, 0x21, 0xca, 0x2b, 0xc2, 0xba, 0x7b, 0x81, 0x17, 0x29,
94-
0xb3, 0x33, 0x13, 0xbc, 0x07, 0xaa, 0xe7, 0x45, 0x4e, 0xb5, 0xe2, 0x2f, 0x9f, 0xcf, 0x7b, 0x06,
95-
0x5e, 0x27, 0x3f, 0x15, 0x42, 0x1e, 0xd0, 0x16, 0xdb, 0x83, 0x1b, 0x9c, 0xef, 0xff, 0xf4, 0xe5,
96-
0x9a, 0xf1, 0x16, 0x58, 0x55, 0x3d, 0x14, 0x34, 0x76, 0x1a, 0x59, 0x01, 0x23, 0x11, 0x7b, 0x9f,
97-
0xc0, 0xa5, 0x4f, 0x96, 0x07, 0x73, 0xfc, 0x9b, 0xa3, 0x7f, 0x30, 0x7d, 0x30, 0x0c, 0x06, 0x03,
98-
0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x02, 0x30, 0x00, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d,
99-
0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x06, 0xc0, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d,
100-
0x25, 0x04, 0x16, 0x30, 0x14, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x03, 0x06,
101-
0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x04, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e,
102-
0x04, 0x16, 0x04, 0x14, 0xc9, 0x9a, 0xce, 0x7f, 0x7d, 0xc4, 0xa1, 0xb4, 0xac, 0x8d, 0x56, 0x39,
103-
0xdd, 0x44, 0x7f, 0x19, 0x50, 0x8a, 0xb3, 0x88, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04,
104-
0x18, 0x30, 0x16, 0x80, 0x14, 0x5a, 0xc3, 0x33, 0x0a, 0x3d, 0x7f, 0xe8, 0xc1, 0x4b, 0x3d, 0xb8,
105-
0x28, 0x80, 0xae, 0xb0, 0xfd, 0xab, 0x9d, 0x60, 0xaa, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48,
106-
0xce, 0x3d, 0x04, 0x03, 0x03, 0x03, 0x68, 0x00, 0x30, 0x65, 0x02, 0x30, 0x4d, 0x81, 0x2b, 0xf4,
107-
0xc1, 0x7a, 0x60, 0x37, 0xd7, 0x94, 0x3e, 0xdd, 0x86, 0x3e, 0xab, 0xd6, 0xfd, 0x59, 0x45, 0xee,
108-
0x2a, 0x4e, 0xa3, 0xa0, 0x38, 0xb0, 0x59, 0x5a, 0x75, 0xbf, 0x29, 0x35, 0x00, 0xa1, 0x44, 0x0d,
109-
0x00, 0xd0, 0x6b, 0xec, 0x54, 0x8d, 0xab, 0x60, 0x75, 0xdf, 0xa9, 0x68, 0x02, 0x31, 0x00, 0xa2,
110-
0x14, 0xe4, 0x0c, 0x4b, 0x27, 0xb5, 0xd4, 0xad, 0xa0, 0x53, 0x67, 0x24, 0x1b, 0x19, 0x3f, 0x00,
111-
0x88, 0x69, 0x0c, 0x30, 0xe8, 0x24, 0xd9, 0x11, 0xd3, 0x16, 0xb6, 0x0d, 0x54, 0x1d, 0x2a, 0x52,
112-
0xb8, 0xd7, 0x33, 0x57, 0x3f, 0xaf, 0xf9, 0x6a, 0x42, 0x8f, 0xe5, 0xd9, 0x15, 0x23, 0xbc,
113-
];
33+
/// SEC1 DER-encoded P-384 private key for the end-entity responder certificate.
34+
pub const STATIC_END_RESPONDER_KEY_DER: &[u8] = include_bytes!("../certs/end_responder.key.der");

examples/platform/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ pub use evidence::DemoEvidence;
3232
pub use socket_transport::SpdmSocketTransport;
3333
// Certificate constants available for examples that need them
3434
#[allow(unused_imports)]
35-
pub use certs::{ATTESTATION_PRIVATE_KEY, STATIC_ATTESTATION_CERT, STATIC_ROOT_CA_CERT};
35+
pub use certs::{STATIC_END_CERT, STATIC_END_RESPONDER_KEY_DER, STATIC_INTER_CERT, STATIC_ROOT_CA_CERT};

src/commands/algorithms/response.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,7 @@ fn process_negotiate_algorithms_request<'a>(
179179
.set_peer_algorithms(peer_algorithms);
180180

181181
// Append NEGOTIATE_ALGORITHMS to the transcript VCA context
182-
// ctx.append_message_to_transcript(req_payload, TranscriptContext::Vca)
183-
ctx.append_message_to_transcript(req_payload, TranscriptContext::M1)
182+
ctx.append_message_to_transcript(req_payload, TranscriptContext::Vca)
184183
}
185184

186185
fn generate_algorithms_response<'a>(
@@ -273,8 +272,7 @@ fn generate_algorithms_response<'a>(
273272
.map_err(|_| ctx.generate_error_response(rsp, ErrorCode::InvalidRequest, 0, None))?;
274273

275274
// Add the ALGORITHMS to the transcript VCA context
276-
// ctx.append_message_to_transcript(rsp, TranscriptContext::Vca)
277-
ctx.append_message_to_transcript(rsp, TranscriptContext::M1)
275+
ctx.append_message_to_transcript(rsp, TranscriptContext::Vca)
278276
}
279277

280278
fn encode_alg_struct_table(

0 commit comments

Comments
 (0)