From ce34a25e66f2b95739a53186a8b0b3c9efe232bf Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Mon, 6 Feb 2017 13:49:03 +0100 Subject: [PATCH] fix build break --- proxy/vmess/encoding/auth.go | 4 ++-- transport/internet/kcp/crypt.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/proxy/vmess/encoding/auth.go b/proxy/vmess/encoding/auth.go index 610c2157e..92ad550c6 100644 --- a/proxy/vmess/encoding/auth.go +++ b/proxy/vmess/encoding/auth.go @@ -2,9 +2,9 @@ package encoding import ( "crypto/md5" + "errors" "hash/fnv" - "v2ray.com/core/common/crypto" "v2ray.com/core/common/serial" ) @@ -58,7 +58,7 @@ func (v *FnvAuthenticator) Seal(dst, nonce, plaintext, additionalData []byte) [] // Open implements AEAD.Open(). func (v *FnvAuthenticator) Open(dst, nonce, ciphertext, additionalData []byte) ([]byte, error) { if serial.BytesToUint32(ciphertext[:4]) != Authenticate(ciphertext[4:]) { - return dst, crypto.ErrAuthenticationFailed + return dst, errors.New("VMess|FNV: Invalid authentication.") } return append(dst, ciphertext[4:]...), nil } diff --git a/transport/internet/kcp/crypt.go b/transport/internet/kcp/crypt.go index 7f5f4e2ed..0abc80154 100644 --- a/transport/internet/kcp/crypt.go +++ b/transport/internet/kcp/crypt.go @@ -2,9 +2,9 @@ package kcp import ( "crypto/cipher" + "errors" "hash/fnv" - "v2ray.com/core/common/crypto" "v2ray.com/core/common/serial" ) @@ -64,12 +64,12 @@ func (v *SimpleAuthenticator) Open(dst, nonce, cipherText, extra []byte) ([]byte fnvHash := fnv.New32a() fnvHash.Write(dst[4:]) if serial.BytesToUint32(dst[:4]) != fnvHash.Sum32() { - return nil, crypto.ErrAuthenticationFailed + return nil, errors.New("KCP:SimpleAuthenticator: Invalid auth.") } length := serial.BytesToUint16(dst[4:6]) if len(dst)-6 != int(length) { - return nil, crypto.ErrAuthenticationFailed + return nil, errors.New("KCP:SimpleAuthenticator: Invalid auth.") } return dst[6:], nil