diff options
author | siddharth ravikumar <s@ricketyspace.net> | 2022-11-11 12:18:47 -0500 |
---|---|---|
committer | siddharth ravikumar <s@ricketyspace.net> | 2022-11-11 12:18:47 -0500 |
commit | 23b6e50fbdab5d2b3625c35421b9e60a20ea87fd (patch) | |
tree | a2b78d944ddc850a0f64483bfe49b2c4755e0347 /challenge/c34.go | |
parent | 7fc0eea5e7cba009f3f2b2359f4ecb9ee0002b88 (diff) |
challenge: fix go vet warnings
Diffstat (limited to 'challenge/c34.go')
-rw-r--r-- | challenge/c34.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/challenge/c34.go b/challenge/c34.go index 7377e20..5a209bb 100644 --- a/challenge/c34.go +++ b/challenge/c34.go @@ -128,18 +128,18 @@ func C34(args []string) { // Try to read DH paramters from packet. params := lib.StrSplitAt('+', packet) if len(params) != 3 { - 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"} } // Parse client's DH public key. cPub, ok := new(big.Int).SetString(lib.StripSpaceChars(params[2]), 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. @@ -237,7 +237,7 @@ func C34(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+pub. @@ -257,7 +257,7 @@ func C34(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. @@ -330,13 +330,13 @@ func C34(args []string) { // Try to read DH paramters from packet. params := lib.StrSplitAt('+', packet) if len(params) != 3 { - 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 } @@ -353,7 +353,7 @@ func C34(args []string) { // Make DH packet: p+g+p pub, ok := new(big.Int).SetString(lib.StripSpaceChars(p), 16) if !ok { - return conn, lib.CPError{"Unable to parse p"} + return conn, lib.CPError{Err: "Unable to parse p"} } packet := fmt.Sprintf("%v+%v+%v", p, g, pub) |