]> Cypherpunks.ru repositories - govpn.git/commitdiff
No need in constant time comparison in CLI utility
authorSergey Matveev <stargrave@stargrave.org>
Wed, 13 Jan 2016 19:33:48 +0000 (22:33 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Wed, 13 Jan 2016 19:33:48 +0000 (22:33 +0300)
Signed-off-by: Sergey Matveev <stargrave@stargrave.org>
src/govpn/cmd/govpn-verifier/main.go

index a7c16f0bbe37971cb1f0e47da8c25ff92a192bc8..876d9a53cedb37e36e59f846d1a6a9edc208c650 100644 (file)
@@ -20,7 +20,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 package main
 
 import (
-       "crypto/subtle"
+       "bytes"
        "flag"
        "fmt"
        "log"
@@ -63,5 +63,5 @@ func main() {
        }
        pub := *v.Pub
        v.PasswordApply(govpn.StringFromFile(*keyPath))
-       fmt.Println(subtle.ConstantTimeCompare(v.Pub[:], pub[:]) == 1)
+       fmt.Println(bytes.Equal(v.Pub[:], pub[:]))
 }