Skip to content

Commit

Permalink
Ignore white space in comparison.
Browse files Browse the repository at this point in the history
The file rng_current ends with a newline, which breaks the overly strict
string comparison.
  • Loading branch information
NullHypothesis committed Oct 24, 2024
1 parent b11aaed commit 1ad8c34
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/system/system_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"log"
"net"
"os"
"strings"
"syscall"
"unsafe"

Expand Down Expand Up @@ -98,7 +99,7 @@ func HasSecureRNG() bool {
return false
}
log.Printf("Have RNG: %s", haveRNG)
return string(haveRNG) == wantRNG
return strings.TrimSpace(string(haveRNG)) == wantRNG
}

// HasSecureKernelVersion checks if the system is running a kernel version that
Expand Down

0 comments on commit 1ad8c34

Please sign in to comment.