@@ -72,10 +72,10 @@ var (
7272 // TCBStructVersion1 is the version of the TCB structure for Turin
7373 TCBStructVersion1 = uint8 (1 )
7474
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 )
7979
8080 authorityKeyOid = asn1 .ObjectIdentifier ([]int {2 , 5 , 29 , 35 })
8181 // 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
393393func kdsOidMapToExtensions (exts map [kdsOID ]* pkix.Extension ) (* Extensions , error ) {
394394 var (
395395 result Extensions
396- hwIdLen int
396+ hwIDLen int
397397 )
398398
399399 if err := asn1U8 (exts [kdsStructVersion ], "StructVersion" , & result .StructVersion ); err != nil {
@@ -404,15 +404,15 @@ func kdsOidMapToExtensions(exts map[kdsOID]*pkix.Extension) (*Extensions, error)
404404 }
405405 switch result .StructVersion {
406406 case TCBStructVersion0 :
407- hwIdLen = int (TCBHwIdLenVersion0 )
407+ hwIDLen = int (TCBHwIDLenVersion0 )
408408 case TCBStructVersion1 :
409- hwIdLen = int (TCBHwIdLenVersion1 )
409+ hwIDLen = int (TCBHwIDLenVersion1 )
410410 default :
411411 return nil , fmt .Errorf ("unsupported TCB structVersion %d" , result .StructVersion )
412412 }
413413 hwidExt , ok := exts [kdsHwid ]
414414 if ok {
415- octet , err := asn1OctetString (hwidExt , "HWID" , hwIdLen )
415+ octet , err := asn1OctetString (hwidExt , "HWID" , hwIDLen )
416416 if err != nil {
417417 return nil , err
418418 }
@@ -509,7 +509,7 @@ func VcekCertificateExtensions(cert *x509.Certificate) (*Extensions, error) {
509509 if exts .CspID != "" {
510510 return nil , fmt .Errorf ("unexpected CSP_ID in VCEK certificate: %s" , exts .CspID )
511511 }
512- if len (exts .HWID ) != int (TCBHwIdLenVersion0 ) && len (exts .HWID ) != int (TCBHwIdLenVersion1 ) {
512+ if len (exts .HWID ) != int (TCBHwIDLenVersion0 ) && len (exts .HWID ) != int (TCBHwIDLenVersion1 ) {
513513 return nil , fmt .Errorf ("missing HWID extension for VCEK certificate" )
514514 }
515515 return exts , nil
@@ -599,7 +599,7 @@ func VCEKCertURL(productLine string, hwid []byte, tcb TCBVersion) string {
599599 parts := DecomposeTCBVersion (tcb )
600600 switch parts .Version {
601601 case TCBStructVersion1 :
602- hwidv1 := hwid [0 :TCBHwIdLenVersion1 ]
602+ hwidv1 := hwid [0 :TCBHwIDLenVersion1 ]
603603 return fmt .Sprintf ("%s/%s?blSPL=%d&teeSPL=%d&snpSPL=%d&ucodeSPL=%d&fmcSPL=%d" ,
604604 productBaseURL (abi .VcekReportSigner , productLine ),
605605 hex .EncodeToString (hwidv1 ),
0 commit comments