Skip to content

Commit

Permalink
Add support for ID attestation to HID
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCutter committed Mar 4, 2024
1 parent 770e8cc commit fdd2b79
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 26 deletions.
4 changes: 3 additions & 1 deletion api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ func (p *Status) Print() string {
status.WriteString(fmt.Sprintf("IdentityCounter ............: %d\n", p.IdentityCounter))
if p.Witness != nil {
status.WriteString(fmt.Sprintf("Witness/Identity ...........: %v\n", p.Witness.Identity))
status.WriteString(fmt.Sprintf("Witness/IP .................: %v", p.Witness.IP))
status.WriteString(fmt.Sprintf("Witness/IP .................: %v\n", p.Witness.IP))
status.WriteString(fmt.Sprintf("Witness/AttestationKey .....: %v\n", p.Witness.IDAttestPublicKey))
status.WriteString(fmt.Sprintf("Witness/AttestedID .........:\n%v", p.Witness.AttestedID))
} else {
status.WriteString(fmt.Sprint("Witness ....................: <no status>"))
}
Expand Down
74 changes: 51 additions & 23 deletions api/api.pb.go

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

9 changes: 9 additions & 0 deletions api/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,15 @@ message WitnessStatus {
string Identity = 1;
// IP is a string representation of the witness applet's current IP address.
string IP = 2;
// IDAttestKey is the stable public key from this device, used to attest to all derived witness identities.
string IDAttestPublicKey = 3;
// AttestedID is a note-formatted signed attestation for the current witness identity.
// This attestation note contains:
// "ArmoredWitness ID attestation v1"
// <Device serial>
// <Witness identity counter in decimal>
// <Witness identity as a note verifier string>
string AttestedID = 4;
}

/*
Expand Down
4 changes: 4 additions & 0 deletions api/rpc/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ type WitnessStatus struct {
Identity string
// IP is the currently-assigned IP address of the witness applet.
IP string
// IDAttestPublicKey is the stable-derived use by this device to attest to witness IDs.
IDAttestPublicKey string
// AttestedID is a note formatted attestation for the current witness ID.
AttestedID string
}

// FirmwareUpdate represents a firmware update.
Expand Down
6 changes: 4 additions & 2 deletions trusted_os/ctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,10 @@ func getStatus() (s *api.Status) {
}
if witnessStatus != nil {
s.Witness = &api.WitnessStatus{
Identity: witnessStatus.Identity,
IP: witnessStatus.IP,
Identity: witnessStatus.Identity,
IP: witnessStatus.IP,
IDAttestPublicKey: witnessStatus.IDAttestPublicKey,
AttestedID: witnessStatus.AttestedID,
}
}

Expand Down

0 comments on commit fdd2b79

Please sign in to comment.