From a5b345ce8f4964bea1966c6be44ae5d29d353f5b Mon Sep 17 00:00:00 2001 From: Aaron Gable Date: Wed, 21 Aug 2024 10:07:19 -0700 Subject: [PATCH] Rename desc->description, prevent loopvar aliasing --- ca/ca.go | 6 +++--- cmd/pebble/main.go | 2 +- go.mod | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ca/ca.go b/ca/ca.go index febe5160..ec5c0cad 100644 --- a/ca/ca.go +++ b/ca/ca.go @@ -45,7 +45,7 @@ type chain struct { } type Profile struct { - Desc string + Description string ValidityPeriod time.Duration } @@ -286,7 +286,7 @@ func (ca *CAImpl) newCertificate(domains []string, ips []net.IP, key crypto.Publ } } - certNotAfter := certNotBefore.Add(time.Duration(prof.ValidityPeriod-1) * time.Second) + certNotAfter := certNotBefore.Add((prof.ValidityPeriod - 1) * time.Second) maxNotAfter := time.Date(9999, 12, 31, 0, 0, 0, 0, time.UTC) if certNotAfter.After(maxNotAfter) { certNotAfter = maxNotAfter @@ -525,7 +525,7 @@ func (ca *CAImpl) GetIntermediateKey(no int) *rsa.PrivateKey { func (ca *CAImpl) GetProfiles() map[string]string { res := make(map[string]string, len(ca.profiles)) for name, prof := range ca.profiles { - res[name] = prof.Desc + res[name] = prof.Description } return res } diff --git a/cmd/pebble/main.go b/cmd/pebble/main.go index 35671556..40e6e6f6 100644 --- a/cmd/pebble/main.go +++ b/cmd/pebble/main.go @@ -107,7 +107,7 @@ func main() { if len(profiles) == 0 { profiles = map[string]ca.Profile{ "default": { - Desc: "The default profile", + Description: "The default profile", ValidityPeriod: 0, // Will be overridden by the CA's default }, } diff --git a/go.mod b/go.mod index e0745451..251c2b75 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/letsencrypt/pebble/v2 -go 1.21 +go 1.22 require ( github.com/go-jose/go-jose/v4 v4.0.1