fix a dumb bug caused by err shadow which prevented pubkey loading from working

master
Ted Unangst 5 years ago
parent 87652edbc6
commit b63031da52

@ -1433,7 +1433,6 @@ func ingestpubkey(origin string, obj junk.Junk) {
if err != nil {
log.Printf("error saving key: %s", err)
}
return
}
func ingestboxes(origin string, obj junk.Junk) {

@ -2,6 +2,8 @@ changelog
-- next
+ Fix bug preventing import of keys
-- 0.8.2
++ Import command to preserve those embarssassing old posts from Twitter.

@ -594,15 +594,17 @@ var zaggies = cache.New(cache.Options{Filler: func(keyname string) (*rsa.PublicK
allinjest(originate(keyname), j)
row = stmtGetXonker.QueryRow(keyname, "pubkey")
err = row.Scan(&data)
}
if err == nil {
_, key, err := httpsig.DecodeKey(data)
if err != nil {
log.Printf("error decoding %s pubkey: %s", keyname, err)
log.Printf("key not found after ingesting")
return nil, true
}
return key, true
}
return nil, true
_, key, err := httpsig.DecodeKey(data)
if err != nil {
log.Printf("error decoding %s pubkey: %s", keyname, err)
return nil, true
}
return key, true
}, Limit: 512})
func zaggy(keyname string) *rsa.PublicKey {

Loading…
Cancel
Save