Skip to content

Commit

Permalink
Disable GPG watchers if keyring is not found (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlofjard authored Feb 26, 2023
1 parent a2161c4 commit 89b0e7b
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,17 @@ func main() {
go notifier.SetupStdoutNotifier(notifiers)
}

requestGPGCheck := make(chan bool)
go detector.CheckGPGOnRequest(requestGPGCheck, notifiers)

go detector.WatchU2F(notifiers)
go detector.WatchHMAC(notifiers)
go detector.WatchGPG(gpgPubringPath, requestGPGCheck)
go detector.WatchSSH(requestGPGCheck, exits)

if _, err := os.Stat(gpgPubringPath); err == nil {
requestGPGCheck := make(chan bool)
go detector.CheckGPGOnRequest(requestGPGCheck, notifiers)
go detector.WatchGPG(gpgPubringPath, requestGPGCheck)
go detector.WatchSSH(requestGPGCheck, exits)
} else {
log.Debugf("'%v' could not be found. Disabling GPG and SSH watchers.", gpgPubringPath)
}
wait := make(chan bool)
<-wait
}
Expand Down

0 comments on commit 89b0e7b

Please sign in to comment.