Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: mssim wireshark friendly #339

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions tpmutil/mssim/mssim.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,15 @@ func (c *Conn) Write(b []byte) (int, error) {
buff.WriteByte(0)
// size of the command
binary.Write(buff, binary.BigEndian, uint32(len(b)))
// raw command
buff.Write(b)

if _, err := buff.WriteTo(c.conn); err != nil {
return 0, fmt.Errorf("write MS simulator command: %v", err)
}
// The raw command is transmitted separately. Easy to analyze in wireshark.
// https://github.com/google/go-tpm/pull/339
if _, err := c.conn.Write(b); err != nil {
jclab-joseph marked this conversation as resolved.
Show resolved Hide resolved
return 0, fmt.Errorf("write MS simulator command: %v", err)
}
return len(b), nil
}

Expand Down