Skip to content

Commit

Permalink
Handle public key errors
Browse files Browse the repository at this point in the history
  • Loading branch information
buger committed Jun 26, 2018
1 parent 422bc53 commit 1b0e45b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions certs/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,12 @@ func (c *CertificateManager) ListPublicKeys(keyIDs []string) (out []string) {
}

block, _ := pem.Decode(rawKey)
if block == nil {
c.logger.Error("Can't parse public key:", id)
out = append(out, "")
continue
}

fingerprint := HexSHA256(block.Bytes)
c.cache.Set("pub-"+id, fingerprint, cache.DefaultExpiration)
out = append(out, fingerprint)
Expand Down

0 comments on commit 1b0e45b

Please sign in to comment.