]> Cypherpunks.ru repositories - govpn.git/commitdiff
Check that verifier with public key is provided for verifying
authorSergey Matveev <stargrave@stargrave.org>
Fri, 13 Nov 2015 22:02:39 +0000 (01:02 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Fri, 13 Nov 2015 22:02:39 +0000 (01:02 +0300)
Signed-off-by: Sergey Matveev <stargrave@stargrave.org>
src/govpn/cmd/govpn-verifier/main.go

index 1757e1e183976a6e16b36dbb3c6cf21373689b0e..97c43339d2eb24eb0868cadec4f19006131b8119 100644 (file)
@@ -55,6 +55,9 @@ func main() {
        if err != nil {
                log.Fatalln("Can not decode verifier", err)
        }
+       if v.Pub == nil {
+               log.Fatalln("Verifier does not contain public key")
+       }
        pub := *v.Pub
        v.PasswordApply(govpn.StringFromFile(*keyPath))
        fmt.Println(subtle.ConstantTimeCompare(v.Pub[:], pub[:]) == 1)