Skip to content

Commit

Permalink
Include tcb_type string "RT_INFO" in the RtAlias certticate template
Browse files Browse the repository at this point in the history
  • Loading branch information
rusty1968 authored and jhand2 committed Sep 12, 2024
1 parent 8d6f8d7 commit 0d5ad37
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
4 changes: 2 additions & 2 deletions test/tests/caliptra_integration_tests/smoke_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ fn smoke_test() {
.as_bytes()
.to_vec(),
},],
ty: None,
ty: Some(b"RT_INFO".to_vec()),
..Default::default()
}),
);
Expand Down Expand Up @@ -618,7 +618,7 @@ fn smoke_test() {
.as_bytes()
.to_vec(),
},],
ty: None,
ty: Some(b"RT_INFO".to_vec()),
..Default::default()
}),
);
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Certificate:
2.23.133.5.4.4:
0....................
2.23.133.5.4.1:
DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
X509v3 Subject Key Identifier:
44:44:44:44:44:44:44:44:44:44:44:44:44:44:44:44:44:44:44:44
X509v3 Authority Key Identifier:
Expand Down
25 changes: 13 additions & 12 deletions x509/build/rt_alias_cert_tbs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ impl RtAliasCertTbs {
const ISSUER_SN_OFFSET: usize = 89usize;
const TCB_INFO_RT_TCI_OFFSET: usize = 542usize;
const SERIAL_NUMBER_OFFSET: usize = 11usize;
const SUBJECT_KEY_ID_OFFSET: usize = 601usize;
const AUTHORITY_KEY_ID_OFFSET: usize = 634usize;
const SUBJECT_KEY_ID_OFFSET: usize = 610usize;
const AUTHORITY_KEY_ID_OFFSET: usize = 643usize;
const UEID_OFFSET: usize = 476usize;
const NOT_BEFORE_OFFSET: usize = 157usize;
const NOT_AFTER_OFFSET: usize = 174usize;
Expand All @@ -59,9 +59,9 @@ impl RtAliasCertTbs {
const NOT_BEFORE_LEN: usize = 15usize;
const NOT_AFTER_LEN: usize = 15usize;
const TCB_INFO_RT_SVN_LEN: usize = 1usize;
pub const TBS_TEMPLATE_LEN: usize = 654usize;
pub const TBS_TEMPLATE_LEN: usize = 663usize;
const TBS_TEMPLATE: [u8; Self::TBS_TEMPLATE_LEN] = [
48u8, 130u8, 2u8, 138u8, 160u8, 3u8, 2u8, 1u8, 2u8, 2u8, 20u8, 95u8, 95u8, 95u8, 95u8,
48u8, 130u8, 2u8, 147u8, 160u8, 3u8, 2u8, 1u8, 2u8, 2u8, 20u8, 95u8, 95u8, 95u8, 95u8,
95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8,
95u8, 48u8, 10u8, 6u8, 8u8, 42u8, 134u8, 72u8, 206u8, 61u8, 4u8, 3u8, 3u8, 48u8, 108u8,
49u8, 31u8, 48u8, 29u8, 6u8, 3u8, 85u8, 4u8, 3u8, 12u8, 22u8, 67u8, 97u8, 108u8, 105u8,
Expand Down Expand Up @@ -89,22 +89,23 @@ impl RtAliasCertTbs {
95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8,
95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8,
95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 163u8,
129u8, 233u8, 48u8, 129u8, 230u8, 48u8, 18u8, 6u8, 3u8, 85u8, 29u8, 19u8, 1u8, 1u8, 255u8,
129u8, 242u8, 48u8, 129u8, 239u8, 48u8, 18u8, 6u8, 3u8, 85u8, 29u8, 19u8, 1u8, 1u8, 255u8,
4u8, 8u8, 48u8, 6u8, 1u8, 1u8, 255u8, 2u8, 1u8, 2u8, 48u8, 14u8, 6u8, 3u8, 85u8, 29u8,
15u8, 1u8, 1u8, 255u8, 4u8, 4u8, 3u8, 2u8, 2u8, 132u8, 48u8, 31u8, 6u8, 6u8, 103u8, 129u8,
5u8, 5u8, 4u8, 4u8, 4u8, 21u8, 48u8, 19u8, 4u8, 17u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8,
95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 48u8, 95u8, 6u8, 6u8,
103u8, 129u8, 5u8, 5u8, 4u8, 1u8, 4u8, 85u8, 48u8, 83u8, 128u8, 8u8, 67u8, 97u8, 108u8,
95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 48u8, 104u8, 6u8, 6u8,
103u8, 129u8, 5u8, 5u8, 4u8, 1u8, 4u8, 94u8, 48u8, 92u8, 128u8, 8u8, 67u8, 97u8, 108u8,
105u8, 112u8, 116u8, 114u8, 97u8, 129u8, 2u8, 82u8, 84u8, 131u8, 2u8, 1u8, 95u8, 166u8,
63u8, 48u8, 61u8, 6u8, 9u8, 96u8, 134u8, 72u8, 1u8, 101u8, 3u8, 4u8, 2u8, 2u8, 4u8, 48u8,
95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8,
95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8,
95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8,
95u8, 95u8, 95u8, 48u8, 29u8, 6u8, 3u8, 85u8, 29u8, 14u8, 4u8, 22u8, 4u8, 20u8, 95u8, 95u8,
95u8, 95u8, 95u8, 137u8, 7u8, 82u8, 84u8, 95u8, 73u8, 78u8, 70u8, 79u8, 48u8, 29u8, 6u8,
3u8, 85u8, 29u8, 14u8, 4u8, 22u8, 4u8, 20u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8,
95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 48u8, 31u8,
6u8, 3u8, 85u8, 29u8, 35u8, 4u8, 24u8, 48u8, 22u8, 128u8, 20u8, 95u8, 95u8, 95u8, 95u8,
95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8,
95u8, 95u8, 95u8, 48u8, 31u8, 6u8, 3u8, 85u8, 29u8, 35u8, 4u8, 24u8, 48u8, 22u8, 128u8,
20u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8, 95u8,
95u8, 95u8, 95u8, 95u8, 95u8, 95u8,
95u8,
];
pub fn new(params: &RtAliasCertTbsParams) -> Self {
let mut template = Self {
Expand All @@ -125,7 +126,7 @@ impl RtAliasCertTbs {
fn apply(&mut self, params: &RtAliasCertTbsParams) {
#[inline(always)]
fn apply_slice<const OFFSET: usize, const LEN: usize>(
buf: &mut [u8; 654usize],
buf: &mut [u8; 663usize],
val: &[u8; LEN],
) {
buf[OFFSET..OFFSET + LEN].copy_from_slice(val);
Expand Down
2 changes: 1 addition & 1 deletion x509/build/x509.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ pub fn make_rt_dice_tcb_info_ext(svn: u8, fwids: &[FwidParam]) -> X509Extension
fwids: Some(asn1::SequenceOfWriter::new(&asn1_fwids)),
flags: None,
vendor_info: None,
tcb_type: None,
tcb_type: Some(b"RT_INFO"),
flags_mask: None,
};

Expand Down

0 comments on commit 0d5ad37

Please sign in to comment.