summaryrefslogtreecommitdiffstats
path: root/challenge/c35.go
diff options
context:
space:
mode:
authorsiddharth ravikumar <s@ricketyspace.net>2022-11-11 12:18:47 -0500
committersiddharth ravikumar <s@ricketyspace.net>2022-11-11 12:18:47 -0500
commit23b6e50fbdab5d2b3625c35421b9e60a20ea87fd (patch)
treea2b78d944ddc850a0f64483bfe49b2c4755e0347 /challenge/c35.go
parent7fc0eea5e7cba009f3f2b2359f4ecb9ee0002b88 (diff)
challenge: fix go vet warnings
Diffstat (limited to 'challenge/c35.go')
-rw-r--r--challenge/c35.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/challenge/c35.go b/challenge/c35.go
index a99b4c0..9710e7e 100644
--- a/challenge/c35.go
+++ b/challenge/c35.go
@@ -135,13 +135,13 @@ func C35(args []string) {
// Try to read DH paramters from packet.
params := lib.StrSplitAt('+', packet)
if len(params) != 2 {
- return nil, lib.CPError{"DH paramters invalid"}
+ return nil, lib.CPError{Err: "DH paramters invalid"}
}
// Try make DH for this client connection.
dh, ok := lib.NewDH(params[0], params[1])
if !ok {
- return nil, lib.CPError{"DH initialization failed"}
+ return nil, lib.CPError{Err: "DH initialization failed"}
}
// Send ACK to client.
@@ -158,7 +158,7 @@ func C35(args []string) {
// Parse client's DH public key.
cPub, ok := new(big.Int).SetString(lib.StripSpaceChars(packet), 10)
if !ok {
- return nil, lib.CPError{"DH public key invalid"}
+ return nil, lib.CPError{Err: "DH public key invalid"}
}
// Send server's DH public key for this connection.
@@ -256,7 +256,7 @@ func C35(args []string) {
g := "2"
dh, ok := lib.NewDH(p, g)
if !ok {
- return conn, nil, lib.CPError{"DH initialization failed"}
+ return conn, nil, lib.CPError{Err: "DH initialization failed"}
}
// Make DH packet: p+g
@@ -273,7 +273,7 @@ func C35(args []string) {
// Remove newline character.
spacket = spacket[:len(spacket)-1]
if spacket != "ACK" {
- return conn, nil, lib.CPError{"ACK failed"}
+ return conn, nil, lib.CPError{Err: "ACK failed"}
}
// Send DH public key to server.
@@ -290,7 +290,7 @@ func C35(args []string) {
// Parse server's DH public key.
sPub, ok := new(big.Int).SetString(lib.StripSpaceChars(spacket), 10)
if !ok {
- return conn, nil, lib.CPError{"Server's DH key invalid"}
+ return conn, nil, lib.CPError{Err: "Server's DH key invalid"}
}
// Return server connection and DH session key.
@@ -363,13 +363,13 @@ func C35(args []string) {
// Try to read DH paramters from packet.
params := lib.StrSplitAt('+', packet)
if len(params) != 2 {
- return []string{}, lib.CPError{"DH paramters invalid"}
+ return []string{}, lib.CPError{Err: "DH paramters invalid"}
}
// Try make a DH from params.
_, ok := lib.NewDH(params[0], params[1])
if !ok {
- return []string{}, lib.CPError{"DH initialization failed"}
+ return []string{}, lib.CPError{Err: "DH initialization failed"}
}
return params, nil
}
@@ -410,7 +410,7 @@ func C35(args []string) {
// Initialize DH.
dh, ok := lib.NewDH(p, g)
if !ok {
- return conn, nil, lib.CPError{"DH initialization failed"}
+ return conn, nil, lib.CPError{Err: "DH initialization failed"}
}
// Make DH packet: p+g
@@ -427,7 +427,7 @@ func C35(args []string) {
// Remove newline character.
spacket = spacket[:len(spacket)-1]
if spacket != "ACK" {
- return conn, nil, lib.CPError{"ACK failed"}
+ return conn, nil, lib.CPError{Err: "ACK failed"}
}
// Send DH public key to server.
@@ -444,7 +444,7 @@ func C35(args []string) {
// Parse server's DH public key.
sPub, ok := new(big.Int).SetString(lib.StripSpaceChars(spacket), 10)
if !ok {
- return conn, nil, lib.CPError{"Server's DH key invalid"}
+ return conn, nil, lib.CPError{Err: "Server's DH key invalid"}
}
// Return server connection and server's DH public key.