Fix some vet warnings

pull/1593/head
Alex Gaynor 2017-08-27 10:58:31 -04:00
parent 91debf833f
commit 07e8b8443c
2 changed files with 5 additions and 2 deletions

View File

@ -312,7 +312,7 @@ func readLengthPrefixedSlice(data []byte) ([]byte, []byte, bool) {
return data[2+length:], data[2 : 2+length], false
}
func extractSCTLogId(sct []byte) []byte {
func extractSCTLogID(sct []byte) []byte {
// The structure of an SCT is {Version, LogID, ...}, where Version is a
// Uint8, and LogID is a fixed length array of a SHA256 digest.
if len(sct) < 1+sha256.Size {
@ -340,7 +340,7 @@ func extractSCTLogIDs(sctExtension []byte) [][]byte {
if e {
return nil
}
logID := extractSCTLogId(sct)
logID := extractSCTLogID(sct)
if logID == nil {
continue
}

View File

@ -329,6 +329,9 @@ func freshOCSP(resp *ocsp.Response) bool {
return time.Now().Before(refreshTime)
}
// UpdateSCTs refreshes the list of truested CT logs, and if they've changed,
// checks each certificate to see if it needs new SCTs, and if so, fetches
// them.
func UpdateSCTs(existingLogs []ctLog) []ctLog {
newLogs, err := getTrustedCTLogs()
if err != nil {