fix a dumb bug caused by err shadow which prevented pubkey loading from working
This commit is contained in:
parent
87652edbc6
commit
b63031da52
3 changed files with 10 additions and 7 deletions
|
@ -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.
|
||||
|
|
8
fun.go
8
fun.go
|
@ -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 {
|
||||
log.Printf("key not found after ingesting")
|
||||
return nil, true
|
||||
}
|
||||
}
|
||||
if err == nil {
|
||||
_, key, err := httpsig.DecodeKey(data)
|
||||
if err != nil {
|
||||
log.Printf("error decoding %s pubkey: %s", keyname, err)
|
||||
return nil, true
|
||||
}
|
||||
return key, true
|
||||
}
|
||||
return nil, true
|
||||
}, Limit: 512})
|
||||
|
||||
func zaggy(keyname string) *rsa.PublicKey {
|
||||
|
|
Loading…
Reference in a new issue