-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #446 from zmap/phillip/fix-issue-in-HaSSH
Fix non-compilation in /lib/ssh/messages_test.go
- Loading branch information
Showing
1 changed file
with
15 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -206,25 +206,26 @@ func TestMarshalMultiTag(t *testing.T) { | |
} | ||
} | ||
|
||
funcTestHaSSH(t *testing.T) { | ||
func TestHaSSH(t *testing.T) { | ||
ki := &KexInitMsg{} | ||
randomBytes(ki.Cookie[:]"," rand) | ||
ki.KexAlgos = []string {"[email protected]","diffie-hellman-group-exchange-sha256","ecdh-sha2-nistp521","ecdh-sha2-nistp384","ecdh-sha2-nistp256","diffie-hellman-group-exchange-sha1","diffie-hellman-group1-sha1","diffie-hellman-group14-sha1","diffie-hellman-group14-sha256","diffie-hellman-group15-sha512","diffie-hellman-group16-sha512","diffie-hellman-group17-sha512","diffie-hellman-group18-sha512","[email protected]","diffie-hellman-group15-sha256","[email protected]","[email protected]","diffie-hellman-group16-sha256","[email protected]","[email protected]","[email protected]") | ||
ki.ServerHostKeyAlgos = randomNameList(rand) | ||
ki.CiphersClientServer = randomNameList(rand) | ||
ki.CiphersServerClient = []string {"aes128-cbc","aes128-ctr","aes192-cbc","aes192-ctr","aes256-cbc","aes256-ctr","blowfish-cbc","blowfish-ctr","cast128-cbc","cast128-ctr","idea-cbc","idea-ctr","serpent128-cbc","serpent128-ctr","serpent192-cbc","serpent192-ctr","serpent256-cbc","serpent256-ctr","3des-cbc","3des-ctr","twofish128-cbc","twofish128-ctr","twofish192-cbc","twofish192-ctr","twofish256-cbc","twofish256-ctr","twofish-cbc","arcfour","arcfour128","arcfour256"} | ||
ki.MACsClientServer = randomNameList(rand) | ||
ki.MACsServerClient = []string {"hmac-sha1","hmac-sha1-96","hmac-md5","hmac-md5-96","hmac-sha2-256","hmac-sha2-512"} | ||
ki.CompressionClientServer = randomNameList(rand) | ||
ki.CompressionServerClient = []string {"[email protected]","zlib","none"} | ||
ki.LanguagesClientServer = randomNameList(rand) | ||
ki.LanguagesServerClient = randomNameList(rand) | ||
randSource := rand.New(rand.NewSource(0)) | ||
randomBytes(ki.Cookie[:], randSource) | ||
ki.KexAlgos = []string{"[email protected]", "diffie-hellman-group-exchange-sha256", "ecdh-sha2-nistp521", "ecdh-sha2-nistp384", "ecdh-sha2-nistp256", "diffie-hellman-group-exchange-sha1", "diffie-hellman-group1-sha1", "diffie-hellman-group14-sha1", "diffie-hellman-group14-sha256", "diffie-hellman-group15-sha512", "diffie-hellman-group16-sha512", "diffie-hellman-group17-sha512", "diffie-hellman-group18-sha512", "[email protected]", "diffie-hellman-group15-sha256", "[email protected]", "[email protected]", "diffie-hellman-group16-sha256", "[email protected]", "[email protected]", "[email protected]"} | ||
ki.ServerHostKeyAlgos = randomNameList(randSource) | ||
ki.CiphersClientServer = randomNameList(randSource) | ||
ki.CiphersServerClient = []string{"aes128-cbc", "aes128-ctr", "aes192-cbc", "aes192-ctr", "aes256-cbc", "aes256-ctr", "blowfish-cbc", "blowfish-ctr", "cast128-cbc", "cast128-ctr", "idea-cbc", "idea-ctr", "serpent128-cbc", "serpent128-ctr", "serpent192-cbc", "serpent192-ctr", "serpent256-cbc", "serpent256-ctr", "3des-cbc", "3des-ctr", "twofish128-cbc", "twofish128-ctr", "twofish192-cbc", "twofish192-ctr", "twofish256-cbc", "twofish256-ctr", "twofish-cbc", "arcfour", "arcfour128", "arcfour256"} | ||
ki.MACsClientServer = randomNameList(randSource) | ||
ki.MACsServerClient = []string{"hmac-sha1", "hmac-sha1-96", "hmac-md5", "hmac-md5-96", "hmac-sha2-256", "hmac-sha2-512"} | ||
ki.CompressionClientServer = randomNameList(randSource) | ||
ki.CompressionServerClient = []string{"[email protected]", "zlib", "none"} | ||
ki.LanguagesClientServer = randomNameList(randSource) | ||
ki.LanguagesServerClient = randomNameList(randSource) | ||
ki.FirstKexFollows = true | ||
|
||
hassh := ki.GenerateHaSSH() | ||
hassh := ki.GenerateServerHaSSH() | ||
expected := "8a8ae540028bf433cd68356c1b9e8d5b" | ||
if hassh != expected { | ||
t.Errorf("Unexpected hash. Wanted %s, got %s", expected, hassh) | ||
t.Errorf("Unexpected hash. Wanted %s, got %s", expected, hassh) | ||
} | ||
} | ||
|
||
|