Skip to content

Commit

Permalink
encode simopen selection nonces in base64
Browse files Browse the repository at this point in the history
  • Loading branch information
vyzo authored and aarshkshah1992 committed Jan 12, 2021
1 parent ef959da commit b087b1b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package multistream
import (
"bytes"
"crypto/rand"
"encoding/base64"
"errors"
"io"
"math/big"
Expand Down Expand Up @@ -168,7 +169,7 @@ again:

werrCh := make(chan error, 1)
go func() {
myselect := []byte("select:" + string(mynonce))
myselect := []byte("select:" + base64.StdEncoding.EncodeToString(mynonce))
err := delimWriteBuffered(rwc, myselect)
werrCh <- err
}()
Expand All @@ -192,7 +193,10 @@ again:
return "", false, err
}

peernonce := []byte(peerselect[7:])
peernonce, err := base64.StdEncoding.DecodeString(peerselect[7:])
if err != nil {
return "", false, err
}

var mybig, peerbig big.Int
var iamserver bool
Expand Down

0 comments on commit b087b1b

Please sign in to comment.