Skip to content

Commit ed39971

Browse files
authored
fix(cmd): store correct CA verification status (#9554)
**Description** If `CheckSignatureFrom()` returns an error, the `verifiedCA` property of `certInfo` should be set to `"FAILED"`. However, currently `verifiedCA` is always set to `"PASSED"`, ignoring the result of `CheckSignatureFrom()`. This PR sets the correct status.
1 parent 6929c8e commit ed39971

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

dgraph/cmd/cert/info.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ func getFileInfo(file string) *certInfo {
8585
info.err = errors.Wrapf(err, "could not read parent cert")
8686
return &info
8787
}
88-
if err := cert.CheckSignatureFrom(parent); err != nil {
89-
info.verifiedCA = "FAILED"
88+
info.verifiedCA = "FAILED"
89+
if err := cert.CheckSignatureFrom(parent); err == nil {
90+
info.verifiedCA = "PASSED"
9091
}
91-
info.verifiedCA = "PASSED"
9292
}
9393

9494
case strings.HasSuffix(file, ".key"):

0 commit comments

Comments
 (0)