Check that WorkerAuthKms is not nil before trying to decrypt with it (#2205)

This commit is contained in:
Todd authored and GitHub committed 2022-06-15 16:26:08 -07:00
1 parent 60332b1847
commit 214ca9a668
1 file changed
+3
@@ -84,6 +84,9 @@ func (c Controller) v1WorkerAuthConfig(protos []string) (*tls.Config, *base.Work
if err := proto.Unmarshal(marshaledEncInfo, encInfo); err != nil {
return nil, nil, err
}
if isNil(c.conf.WorkerAuthKms) {
return nil, nil, errors.New("worker auth kms not set")
}
marshaledInfo, err := c.conf.WorkerAuthKms.Decrypt(context.Background(), encInfo)
if err != nil {
return nil, nil, err