Skip to content

Commit

Permalink
FMC Alias CSR test
Browse files Browse the repository at this point in the history
  • Loading branch information
rusty1968 committed Dec 12, 2024
1 parent 9205150 commit 0fd389b
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 3 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Certificate Request:
Data:
Version: 1 (0x0)
Subject: CN=Caliptra 1.0 FMC Alias/serialNumber=65F6BB3FAE445D0D0DB36F3DC84999B60B059CF63D3E25FE00C47B239857F3BB
Subject Public Key Info:
Public Key Algorithm: id-ecPublicKey
Public-Key: (384 bit)
pub:
04:cb:0e:91:9a:d7:5f:9e:02:f2:39:8a:28:a9:3f:
6d:f3:01:36:37:c8:5c:d3:26:26:77:71:88:93:5c:
6c:e8:3a:c5:c4:bb:df:05:db:15:c1:38:97:f0:f5:
ca:e3:44:76:b4:e8:c5:b8:28:b9:82:8d:11:db:ca:
79:92:4f:8c:1b:09:37:cb:d2:f5:3c:47:b9:dd:26:
78:5b:d5:d8:11:96:52:6f:b7:d7:31:8f:9a:9f:e1:
cf:9d:95:b0:64:d5:39
ASN1 OID: secp384r1
NIST CURVE: P-384
Attributes:
Requested Extensions:
X509v3 Basic Constraints: critical
CA:TRUE, pathlen:5
X509v3 Key Usage: critical
Certificate Sign
2.23.133.5.4.4:
0....................
Signature Algorithm: ecdsa-with-SHA384
Signature Value:
30:65:02:31:00:cf:f3:d2:d8:30:86:5a:f7:f9:d4:3d:63:d3:
eb:c2:1e:16:f5:d1:3b:1e:98:38:ca:3d:8f:da:ed:9d:44:8f:
d5:f6:41:35:73:8a:14:05:91:63:17:58:94:4f:56:df:ea:02:
30:4f:db:4a:2e:26:f2:aa:ec:74:41:e4:7e:c2:6a:c5:07:e9:
b3:50:52:bb:5c:68:4b:83:ea:07:33:09:84:0b:a1:b9:8a:9f:
d8:57:73:b0:3b:76:62:f3:4e:7f:32:9f:4f
13 changes: 10 additions & 3 deletions runtime/tests/runtime_integration_tests/test_get_fmc_alias_csr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,17 @@ fn test_get_fmc_alias_csr() {
);
assert_ne!(0, get_fmc_alias_csr_resp.data_size);

let csr_bytes = &get_fmc_alias_csr_resp.data[..get_fmc_alias_csr_resp.data_size as usize];
assert_ne!([0; 512], csr_bytes);
let csr_der = &get_fmc_alias_csr_resp.data[..get_fmc_alias_csr_resp.data_size as usize];
assert_ne!([0; 512], csr_der);


let csr = openssl::x509::X509Req::from_der(&csr_der).unwrap();
let csr_txt = String::from_utf8(csr.to_text().unwrap()).unwrap();

// To update the CSR testdata:
std::fs::write("tests/runtime_integration_tests/test_data/fmc_alias_csr.txt", &csr_txt).unwrap();
std::fs::write("tests/runtime_integration_tests/test_data/fmc_alias_csr.der", &csr_der).unwrap();

assert!(X509Req::from_der(csr_bytes).is_ok());
}

#[test]
Expand Down

0 comments on commit 0fd389b

Please sign in to comment.