diff --git a/libs/go/sia/agent/agent.go b/libs/go/sia/agent/agent.go index 9a01d1ef1ad..0b21d172d39 100644 --- a/libs/go/sia/agent/agent.go +++ b/libs/go/sia/agent/agent.go @@ -23,6 +23,7 @@ import ( "encoding/pem" "fmt" "log" + "math" "os" "os/exec" "os/signal" @@ -298,7 +299,7 @@ func registerSvc(svc options.Service, ztsUrl string, opts *options.Options) erro Hostname: zts.DomainName(hostname), Namespace: zts.SimpleName(opts.SpiffeNamespace), } - if svc.ExpiryTime > 0 { + if svc.ExpiryTime > 0 && svc.ExpiryTime <= math.MaxInt32 { expiryTime := int32(svc.ExpiryTime) info.ExpiryTime = &expiryTime } @@ -416,7 +417,7 @@ func refreshSvc(svc options.Service, ztsUrl string, opts *options.Options) error Hostname: zts.DomainName(hostname), Namespace: zts.SimpleName(opts.SpiffeNamespace), } - if svc.ExpiryTime > 0 { + if svc.ExpiryTime > 0 && svc.ExpiryTime <= math.MaxInt32 { expiryTime := int32(svc.ExpiryTime) info.ExpiryTime = &expiryTime } diff --git a/libs/go/sia/aws/agent/agent.go b/libs/go/sia/aws/agent/agent.go index 5e2179ef5cc..b5ee9444608 100644 --- a/libs/go/sia/aws/agent/agent.go +++ b/libs/go/sia/aws/agent/agent.go @@ -24,6 +24,7 @@ import ( "encoding/pem" "fmt" "log" + "math" "os" "os/exec" "os/signal" @@ -297,7 +298,7 @@ func registerSvc(svc options.Service, data *attestation.AttestationData, ztsUrl Hostname: zts.DomainName(hostname), Namespace: zts.SimpleName(opts.SpiffeNamespace), } - if svc.ExpiryTime > 0 { + if svc.ExpiryTime > 0 && svc.ExpiryTime <= math.MaxInt32 { expiryTime := int32(svc.ExpiryTime) info.ExpiryTime = &expiryTime } @@ -411,7 +412,7 @@ func refreshSvc(svc options.Service, data *attestation.AttestationData, ztsUrl s Hostname: zts.DomainName(hostname), Namespace: zts.SimpleName(opts.SpiffeNamespace), } - if svc.ExpiryTime > 0 { + if svc.ExpiryTime > 0 && svc.ExpiryTime <= math.MaxInt32 { expiryTime := int32(svc.ExpiryTime) info.ExpiryTime = &expiryTime }