@@ -72,10 +72,10 @@ var (
72
72
// TCBStructVersion1 is the version of the TCB structure for Turin
73
73
TCBStructVersion1 = uint8 (1 )
74
74
75
- // TCBHwIdLenVersion0 is the length of the hwID extension for TCB structVersion 0
76
- TCBHwIdLenVersion0 = uint8 (64 )
77
- // TCBHwIdLenVersion1 is the length of the hwID extension for TCB structVersion 1
78
- TCBHwIdLenVersion1 = uint8 (8 )
75
+ // TCBHwIDLenVersion0 is the length of the hwID extension for TCB structVersion 0
76
+ TCBHwIDLenVersion0 = uint8 (64 )
77
+ // TCBHwIDLenVersion1 is the length of the hwID extension for TCB structVersion 1
78
+ TCBHwIDLenVersion1 = uint8 (8 )
79
79
80
80
authorityKeyOid = asn1 .ObjectIdentifier ([]int {2 , 5 , 29 , 35 })
81
81
// Short forms of the asn1 Object identifiers to use in map lookups, since []int are invalid key
@@ -393,7 +393,7 @@ func asn1OctetString(ext *pkix.Extension, field string, size int) ([]byte, error
393
393
func kdsOidMapToExtensions (exts map [kdsOID ]* pkix.Extension ) (* Extensions , error ) {
394
394
var (
395
395
result Extensions
396
- hwIdLen int
396
+ hwIDLen int
397
397
)
398
398
399
399
if err := asn1U8 (exts [kdsStructVersion ], "StructVersion" , & result .StructVersion ); err != nil {
@@ -404,15 +404,15 @@ func kdsOidMapToExtensions(exts map[kdsOID]*pkix.Extension) (*Extensions, error)
404
404
}
405
405
switch result .StructVersion {
406
406
case TCBStructVersion0 :
407
- hwIdLen = int (TCBHwIdLenVersion0 )
407
+ hwIDLen = int (TCBHwIDLenVersion0 )
408
408
case TCBStructVersion1 :
409
- hwIdLen = int (TCBHwIdLenVersion1 )
409
+ hwIDLen = int (TCBHwIDLenVersion1 )
410
410
default :
411
411
return nil , fmt .Errorf ("unsupported TCB structVersion %d" , result .StructVersion )
412
412
}
413
413
hwidExt , ok := exts [kdsHwid ]
414
414
if ok {
415
- octet , err := asn1OctetString (hwidExt , "HWID" , hwIdLen )
415
+ octet , err := asn1OctetString (hwidExt , "HWID" , hwIDLen )
416
416
if err != nil {
417
417
return nil , err
418
418
}
@@ -509,7 +509,7 @@ func VcekCertificateExtensions(cert *x509.Certificate) (*Extensions, error) {
509
509
if exts .CspID != "" {
510
510
return nil , fmt .Errorf ("unexpected CSP_ID in VCEK certificate: %s" , exts .CspID )
511
511
}
512
- if len (exts .HWID ) != int (TCBHwIdLenVersion0 ) && len (exts .HWID ) != int (TCBHwIdLenVersion1 ) {
512
+ if len (exts .HWID ) != int (TCBHwIDLenVersion0 ) && len (exts .HWID ) != int (TCBHwIDLenVersion1 ) {
513
513
return nil , fmt .Errorf ("missing HWID extension for VCEK certificate" )
514
514
}
515
515
return exts , nil
@@ -599,7 +599,7 @@ func VCEKCertURL(productLine string, hwid []byte, tcb TCBVersion) string {
599
599
parts := DecomposeTCBVersion (tcb )
600
600
switch parts .Version {
601
601
case TCBStructVersion1 :
602
- hwidv1 := hwid [0 :TCBHwIdLenVersion1 ]
602
+ hwidv1 := hwid [0 :TCBHwIDLenVersion1 ]
603
603
return fmt .Sprintf ("%s/%s?blSPL=%d&teeSPL=%d&snpSPL=%d&ucodeSPL=%d&fmcSPL=%d" ,
604
604
productBaseURL (abi .VcekReportSigner , productLine ),
605
605
hex .EncodeToString (hwidv1 ),
0 commit comments