Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions client_auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (p *PasswordAuth) Handshake(c net.Conn) error {

crypted, err := p.encrypt(p.Password, randomValue)

if (err != nil) {
if err != nil {
return err
}

Expand Down Expand Up @@ -97,7 +97,7 @@ func (p *PasswordAuth) reverseBits(b byte) byte {
}

func (p *PasswordAuth) encrypt(key string, bytes []byte) ([]byte, error) {
keyBytes := []byte{0,0,0,0,0,0,0,0}
keyBytes := []byte{0, 0, 0, 0, 0, 0, 0, 0}

if len(key) > 8 {
key = key[:8]
Expand All @@ -122,3 +122,14 @@ func (p *PasswordAuth) encrypt(key string, bytes []byte) ([]byte, error) {

return crypted, nil
}

type VencryptAuth struct {
}

func (*VencryptAuth) SecurityType() uint8 {
return 19
}

func (*VencryptAuth) Handshake(net.Conn) error {
return nil
}