Skip to content

Commit 29ff8de

Browse files
author
Niels Möller
committed
Display SHA512 digest when signer app is loaded
1 parent 7e193bc commit 29ff8de

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

cmd/tkey-ssh-agent/apps.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ func ListApps() []EmbeddedApp {
4141
list := []EmbeddedApp{
4242
{
4343
name: "tkey-device-signer 1.0.2",
44-
digest: embeddedAppDigest(appBinaryPreCastor),
44+
digest: AppDigest(appBinaryPreCastor),
4545
},
4646
{
4747
name: "tkey-device-signer castor-alpha-1",
48-
digest: embeddedAppDigest(appBinaryCastor),
48+
digest: AppDigest(appBinaryCastor),
4949
},
5050
}
5151

@@ -69,7 +69,7 @@ func GetApp(pid uint8) ([]byte, error) {
6969
return nil, ErrNotFound
7070
}
7171

72-
func embeddedAppDigest(bin []byte) string {
72+
func AppDigest(bin []byte) string {
7373
digest := sha512.Sum512(bin)
7474
return hex.EncodeToString(digest[:])
7575
}

cmd/tkey-ssh-agent/signer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ func (s *Signer) loadApp(devApp []byte, udi tkeyclient.UDI) error {
195195
}
196196
}
197197

198-
le.Printf("Loading signer app...\n")
198+
le.Printf("Loading signer app...\nSHA512: %s\n", AppDigest(devApp))
199199
if err := s.tk.LoadApp(devApp, secret); err != nil {
200200
return fmt.Errorf("LoadApp: %w", err)
201201
}

0 commit comments

Comments
 (0)