]> Cypherpunks.ru repositories - govpn.git/commitdiff
Check that verifier is provided for client
authorSergey Matveev <stargrave@stargrave.org>
Sun, 31 Jan 2016 15:50:02 +0000 (18:50 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sun, 31 Jan 2016 15:50:02 +0000 (18:50 +0300)
Signed-off-by: Sergey Matveev <stargrave@stargrave.org>
src/cypherpunks.ru/govpn/cmd/govpn-client/main.go
src/cypherpunks.ru/govpn/verifier.go

index 8991462edd9b45a81c151373b16acd5daf26bfaa..10da96929ed6f6786c9e4b0000bb009b7e03ea10 100644 (file)
@@ -71,6 +71,9 @@ func main() {
                govpn.EGDInit(*egdPath)
        }
 
+       if *verifierRaw == "" {
+               log.Fatalln("No verifier specified")
+       }
        verifier, err := govpn.VerifierFromString(*verifierRaw)
        if err != nil {
                log.Fatalln(err)
index a452a50a84737231a2e0e3d28701dee10138bf23..15955e77a2cf65e35ab18172d638a677170a3200 100644 (file)
@@ -73,7 +73,7 @@ func (v *Verifier) PasswordApply(password string) *[ed25519.PrivateKeySize]byte
 // Parse either short or long verifier form.
 func VerifierFromString(input string) (*Verifier, error) {
        s := strings.Split(input, "$")
-       if !(len(s) != 4 || len(s) != 5) || s[1] != "argon2d" {
+       if len(s) < 4 || s[1] != "argon2d" {
                return nil, errors.New("Invalid verifier structure")
        }
        var m, t, p int