@@ -75,6 +75,9 @@ func TestTdxQuote(t *testing.T) {
7575 0xeb , 0x74 , 0x6 , 0xa3 , 0x8d , 0x1e , 0xed , 0x31 , 0x3b , 0x98 , 0x7a , 0x46 , 0x7d , 0xac , 0xea , 0xd6 ,
7676 0xf0 , 0xc8 , 0x7a , 0x6d , 0x76 , 0x6c , 0x66 , 0xf6 , 0xf2 , 0x9f , 0x8a , 0xcb , 0x28 , 0x1f , 0x11 , 0x13 }
7777 sgxType := pcs .SGXTypeScalable
78+ smtEnabled := true
79+ dynamicPlatform := true
80+ cachedKeys := false
7881
7982 mknonce := func (front []byte ) []byte {
8083 result := make ([]byte , 64 )
@@ -143,7 +146,10 @@ func TestTdxQuote(t *testing.T) {
143146 EnableTdDebugCheck : true ,
144147 },
145148 PCKOptions : PCKOptions {
146- SgxType : & sgxType ,
149+ SgxType : & sgxType ,
150+ SMTEnabled : & smtEnabled ,
151+ DynamicPlatform : & dynamicPlatform ,
152+ CachedKeys : & cachedKeys ,
147153 },
148154 },
149155 },
@@ -308,6 +314,30 @@ func TestTdxQuote(t *testing.T) {
308314 },
309315 wantErr : "PCK extension SGXType" ,
310316 },
317+ {
318+ name : "Test incorrect SMTEnabled" ,
319+ quote : quote12345 ,
320+ opts : & Options {
321+ PCKOptions : PCKOptions {SMTEnabled : toPtr (false )},
322+ },
323+ wantErr : "PCK extension SMTEnabled" ,
324+ },
325+ {
326+ name : "Test incorrect DynamicPlatform" ,
327+ quote : quote12345 ,
328+ opts : & Options {
329+ PCKOptions : PCKOptions {DynamicPlatform : toPtr (false )},
330+ },
331+ wantErr : "PCK extension DynamicPlatform" ,
332+ },
333+ {
334+ name : "Test incorrect CachedKeys" ,
335+ quote : quote12345 ,
336+ opts : & Options {
337+ PCKOptions : PCKOptions {CachedKeys : toPtr (true )},
338+ },
339+ wantErr : "PCK extension CachedKeys" ,
340+ },
311341 }
312342
313343 for _ , tc := range tests {
@@ -317,3 +347,7 @@ func TestTdxQuote(t *testing.T) {
317347 }
318348 }
319349}
350+
351+ func toPtr [A any ](a A ) * A {
352+ return & a
353+ }
0 commit comments