1
1
Fork 0
mirror of https://github.com/schollz/croc.git synced 2025-10-11 05:11:06 +02:00

pake works between two clients

This commit is contained in:
Zack Scholl 2018-06-29 19:34:21 -07:00
parent f6751dadb9
commit 72e2d4d3d8
7 changed files with 124 additions and 108 deletions

View file

@ -9,15 +9,16 @@ import (
func main() {
var err error
role := flag.Int("role", 0, "role number")
passphrase := flag.String("code", "chou", "codephrase")
flag.Parse()
c := croc.Init()
if *role == -1 {
err = c.Relay()
} else if *role == 0 {
err = c.Send("foo")
err = c.Send("foo", *passphrase)
} else {
err = c.Receive()
err = c.Receive(*passphrase)
}
if err != nil {
panic(err)