Skip to content

Commit 4f177a6

Browse files
committed
fix(go-sdk): reject unknown report types in TCB validation
Add default case to validateTCB switch to reject unknown report types instead of silently passing. Unlike Rust's exhaustive match on the Report enum, Go's string-based switch would skip all checks for any new or unexpected report type.
1 parent 02a354f commit 4f177a6

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

sdk/go/ratls/ratls.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ func validateTCB(quote *dcap.Quote) error {
155155
if len(quote.Report.Attributes) > 0 && quote.Report.Attributes[0]&0x02 != 0 {
156156
return fmt.Errorf("debug mode is not allowed")
157157
}
158+
default:
159+
return fmt.Errorf("unknown report type: %s", quote.Report.Type)
158160
}
159161
return nil
160162
}

0 commit comments

Comments
 (0)