From 9ba8b126f0b38c913fa5760b669be459041e8925 Mon Sep 17 00:00:00 2001 From: matiaschapresto Date: Sun, 24 Mar 2024 14:35:35 +0100 Subject: [PATCH] add vencryp auth --- client_auth.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/client_auth.go b/client_auth.go index 4ae7be9..dbecf6b 100644 --- a/client_auth.go +++ b/client_auth.go @@ -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 } @@ -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] @@ -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 +}