Security Update #6

Merged
raul merged 25 commits from testing into main 2024-05-17 08:00:14 +02:00
1 changed files with 23 additions and 1 deletions
Showing only changes of commit 015e1bb65f - Show all commits

View File

@ -7,6 +7,7 @@ package cmd
import (
"bufio"
"fmt"
"io"
"log"
"net"
"os"
@ -53,7 +54,28 @@ func Client() {
log.Fatalf("Error occurred reading from server while requesting name: %v\n", err)
}
fmt.Print(nameRequest)
sendName(conn)
test := make([]byte, 2048)
copy(test, "Password: ")
if nameRequest == string(test) {
pass, err := scanLine()
if err != nil {
log.Fatal(err)
}
conn.Write([]byte(pass))
nameRequest, err := receiveMessage(conn)
if err != nil {
if err != io.EOF {
log.Fatalf("Error occurred reading from server while requesting name: %v\n", err)
}
os.Exit(1)
}
fmt.Print(nameRequest)
sendName(conn)
} else {
sendName(conn)
}
GUI()
}