Skip to content
Snippets Groups Projects
Commit 6dd73947 authored by Benjamin Wenger's avatar Benjamin Wenger
Browse files

fixed use of EOL to be a semi colin as the fact terminator

parent 9a0b383e
No related branches found
No related tags found
No related merge requests found
...@@ -20,7 +20,7 @@ import ( ...@@ -20,7 +20,7 @@ import (
jww "github.com/spf13/jwalterweatherman" jww "github.com/spf13/jwalterweatherman"
) )
const eol = string(0x0a) const terminator = ";"
func RequestAuth(partner, me contact.Contact, message string, rng io.Reader, func RequestAuth(partner, me contact.Contact, message string, rng io.Reader,
storage *storage.Session, net interfaces.NetworkManager) error { storage *storage.Session, net interfaces.NetworkManager) error {
...@@ -46,8 +46,8 @@ func RequestAuth(partner, me contact.Contact, message string, rng io.Reader, ...@@ -46,8 +46,8 @@ func RequestAuth(partner, me contact.Contact, message string, rng io.Reader,
} }
// check that the message is properly formed // check that the message is properly formed
if strings.Contains(message, eol) { if strings.Contains(message, terminator) {
return errors.Errorf("Message cannot contain 'EOL'") return errors.Errorf("Message cannot contain '%s'", terminator)
} }
//lookup if an ongoing request is occurring //lookup if an ongoing request is occurring
...@@ -76,7 +76,7 @@ func RequestAuth(partner, me contact.Contact, message string, rng io.Reader, ...@@ -76,7 +76,7 @@ func RequestAuth(partner, me contact.Contact, message string, rng io.Reader,
//check the payload fits //check the payload fits
facts := me.Facts.Stringify() facts := me.Facts.Stringify()
msgPayload := facts + message + eol msgPayload := facts + message + terminator
msgPayloadBytes := []byte(msgPayload) msgPayloadBytes := []byte(msgPayload)
if len(msgPayloadBytes) > requestFmt.MsgPayloadLen() { if len(msgPayloadBytes) > requestFmt.MsgPayloadLen() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment