Skip to content

Commit 08589d4

Browse files
authored
Merge pull request #59 from TheManticoreProject/Improved-error-handling-of-CustomKeyInformationVolumeType
[enhancement] Improved error handling of CustomKeyInformationVolumeType
2 parents e6e60c2 + 97fd890 commit 08589d4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

windows/keycredentiallink/key/customkeyinformation/CustomKeyInformationVolumeType.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ func (vt CustomKeyInformationVolumeType) Unmarshal(data []byte) (int, error) {
4444

4545
vt = CustomKeyInformationVolumeType(data[0])
4646

47+
if vt != CustomKeyInformationVolumeType_None && vt != CustomKeyInformationVolumeType_OSV && vt != CustomKeyInformationVolumeType_FDV && vt != CustomKeyInformationVolumeType_RDV {
48+
return 0, fmt.Errorf("invalid CustomKeyInformationVolumeType: %d", vt)
49+
}
50+
4751
return 1, nil
4852
}
4953

0 commit comments

Comments
 (0)