(t *testing.T)
| 627 | } |
| 628 | |
| 629 | func TestAuthFastSHA256PasswordRSAWithKey(t *testing.T) { |
| 630 | conn, mc := newRWMockConn(1) |
| 631 | mc.cfg.User = "root" |
| 632 | mc.cfg.Passwd = "secret" |
| 633 | mc.cfg.pubKey = testPubKeyRSA |
| 634 | |
| 635 | authData := []byte{6, 81, 96, 114, 14, 42, 50, 30, 76, 47, 1, 95, 126, 81, |
| 636 | 62, 94, 83, 80, 52, 85} |
| 637 | plugin := "sha256_password" |
| 638 | |
| 639 | // Send Client Authentication Packet |
| 640 | authResp, err := mc.auth(authData, plugin) |
| 641 | if err != nil { |
| 642 | t.Fatal(err) |
| 643 | } |
| 644 | err = mc.writeHandshakeResponsePacket(authResp, plugin) |
| 645 | if err != nil { |
| 646 | t.Fatal(err) |
| 647 | } |
| 648 | |
| 649 | // auth response (OK) |
| 650 | conn.data = []byte{7, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0} |
| 651 | conn.maxReads = 1 |
| 652 | |
| 653 | // Handle response to auth packet |
| 654 | if err := mc.handleAuthResult(authData, plugin); err != nil { |
| 655 | t.Errorf("got error: %v", err) |
| 656 | } |
| 657 | } |
| 658 | |
| 659 | func TestAuthFastSHA256PasswordSecure(t *testing.T) { |
| 660 | conn, mc := newRWMockConn(1) |
nothing calls this directly
no test coverage detected