build(deps): bump github.com/nats-io/nats-server/v2

Bumps [github.com/nats-io/nats-server/v2](https://github.com/nats-io/nats-server) from 2.11.3 to 2.11.4.
- [Release notes](https://github.com/nats-io/nats-server/releases)
- [Changelog](https://github.com/nats-io/nats-server/blob/main/.goreleaser.yml)
- [Commits](https://github.com/nats-io/nats-server/compare/v2.11.3...v2.11.4)

---
updated-dependencies:
- dependency-name: github.com/nats-io/nats-server/v2
  dependency-version: 2.11.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
dependabot[bot]
2025-05-22 15:00:24 +00:00
committed by GitHub
parent a4678fe007
commit 1ba4513328
18 changed files with 399 additions and 199 deletions
+1
View File
@@ -447,6 +447,7 @@ const (
CmdClear tpmutil.Command = 0x00000126
CmdHierarchyChangeAuth tpmutil.Command = 0x00000129
CmdDefineSpace tpmutil.Command = 0x0000012A
CmdPCRAllocate tpmutil.Command = 0x0000012B
CmdCreatePrimary tpmutil.Command = 0x00000131
CmdIncrementNVCounter tpmutil.Command = 0x00000134
CmdWriteNV tpmutil.Command = 0x00000137
+32 -4
View File
@@ -51,6 +51,10 @@ func encodeTPMLPCRSelection(sel ...PCRSelection) ([]byte, error) {
return tpmutil.Pack(uint32(0))
}
if len(sel) == 1 && len(sel[0].PCRs) == 0 && sel[0].Hash == 0 {
return tpmutil.Pack(uint32(0))
}
// PCR selection is a variable-size bitmask, where position of a set bit is
// the selected PCR index.
// Size of the bitmask in bytes is pre-pended. It should be at least
@@ -61,10 +65,6 @@ func encodeTPMLPCRSelection(sel ...PCRSelection) ([]byte, error) {
// 00000011 00000000 00000001 00000100
var retBytes []byte
for _, s := range sel {
if len(s.PCRs) == 0 {
return tpmutil.Pack(uint32(0))
}
ts := tpmsPCRSelection{
Hash: s.Hash,
Size: sizeOfPCRSelect,
@@ -1153,6 +1153,34 @@ func Clear(rw io.ReadWriter, handle tpmutil.Handle, auth AuthCommand) error {
return err
}
func encodePCRAllocate(handle tpmutil.Handle, auth AuthCommand, pcrSelection []PCRSelection) ([]byte, error) {
ah, err := tpmutil.Pack(handle)
if err != nil {
return nil, err
}
authEncoded, err := encodeAuthArea(auth)
if err != nil {
return nil, err
}
pcrEncoded, err := encodeTPMLPCRSelection(pcrSelection...)
if err != nil {
return nil, err
}
return concat(ah, authEncoded, pcrEncoded)
}
// PCRAllocate sets the desired PCR allocation of PCR and algorithms.
// The changes take effect once the TPM is restarted.
func PCRAllocate(rw io.ReadWriter, handle tpmutil.Handle, auth AuthCommand, pcrSelection []PCRSelection) error {
Cmd, err := encodePCRAllocate(handle, auth, pcrSelection)
if err != nil {
return err
}
_, err = runCommand(rw, TagSessions, CmdPCRAllocate, tpmutil.RawBytes(Cmd))
return err
}
func encodeHierarchyChangeAuth(handle tpmutil.Handle, auth AuthCommand, newAuth string) ([]byte, error) {
ah, err := tpmutil.Pack(handle)
if err != nil {