Skip to content

Commit

Permalink
Expose BastionID via witnessctl (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCutter authored May 24, 2024
1 parent be79295 commit bdd4b0b
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 31 deletions.
7 changes: 5 additions & 2 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,13 @@ func (p *Status) Print() string {
if p.Witness != nil {
status.WriteString(fmt.Sprintf("Witness/Identity ...........: %v\n", p.Witness.Identity))
status.WriteString(fmt.Sprintf("Witness/IP .................: %v\n", p.Witness.IP))
status.WriteString(fmt.Sprintf("Witness/AttestationKey .....: %v", p.Witness.IDAttestPublicKey))
status.WriteString(fmt.Sprintf("Witness/AttestationKey .....: %v\n", p.Witness.IDAttestPublicKey))
status.WriteString(fmt.Sprintf("Witness/AttestedIdentity ...: [below]\n\n%v\n", p.Witness.AttestedID))
status.WriteString(fmt.Sprintf("Witness/AttestedBastionID ..: [below]\n\n%v\n", p.Witness.AttestedBastionID))
} else {
status.WriteString(fmt.Sprint("Witness ....................: <no status>"))
status.WriteString(fmt.Sprint("Witness ....................: <no status>\n"))
}
status.WriteString("----------------------------------------------------------- Trusted OS ----")

return status.String()
}
74 changes: 45 additions & 29 deletions api/api.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions api/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ message WitnessStatus {
// <Witness identity counter in decimal>
// <Witness identity as a note verifier string>
string AttestedID = 4;
// AttestedBastionID is a note-formatted signed attestation for the witness' BastionID.
// This attestation note contains:
// "ArmoredWitness BastionID attestation v1"
// <Device serial>
// <Bastion identity counter in decimal>
// <Bastion ID as ASCII hex>
string AttestedBastionID = 5;
}

/*
Expand Down
2 changes: 2 additions & 0 deletions api/rpc/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ type WitnessStatus struct {
IDAttestPublicKey string
// AttestedID is a note formatted attestation for the current witness ID.
AttestedID string
// AttestedBastionID is a note formatted attestation for the current Bastion ID.
AttestedBastionID string
}

// FirmwareUpdate represents a firmware update.
Expand Down
1 change: 1 addition & 0 deletions trusted_os/ctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ func getStatus() (s *api.Status) {
IP: witnessStatus.IP,
IDAttestPublicKey: witnessStatus.IDAttestPublicKey,
AttestedID: witnessStatus.AttestedID,
AttestedBastionID: witnessStatus.AttestedBastionID,
}
}

Expand Down

0 comments on commit bdd4b0b

Please sign in to comment.