Changing PGP Key Fingerprint to use KeyIdShortString

This commit is contained in:
Sarah Jamie Lewis 2016-06-05 19:52:56 -07:00
parent b87ec44b3c
commit fea4c84b0b
1 changed files with 2 additions and 5 deletions

View File

@ -1,7 +1,6 @@
package scans package scans
import ( import (
"fmt"
"github.com/s-rah/onionscan/report" "github.com/s-rah/onionscan/report"
"golang.org/x/crypto/openpgp" "golang.org/x/crypto/openpgp"
"log" "log"
@ -31,10 +30,8 @@ func (cs *PGPContentScan) ScanContent(content string, report *report.OnionScanRe
for identity = range keys[0].Identities { for identity = range keys[0].Identities {
break break
} }
var fingerprint string log.Printf("\tFound PGP Key fingerprint: %s belonging to %s", keys[0].Subkeys[0].PublicKey.KeyIdShortString(), identity)
fingerprint = fmt.Sprintf("%X", keys[0].Subkeys[0].PublicKey.Fingerprint)
log.Printf("\tFound PGP Key fingerprint: %s belonging to %s", fingerprint, identity)
report.AddPGPKey(keyString, identity, fingerprint) report.AddPGPKey(keyString, identity, keys[0].Subkeys[0].PublicKey.KeyIdShortString())
} }
} }