Przeglądaj źródła

fix aes-256-cfb iv length

Darien Raymond 9 lat temu
rodzic
commit
dd96b4eee7
1 zmienionych plików z 2 dodań i 1 usunięć
  1. 2 1
      proxy/shadowsocks/config.go

+ 2 - 1
proxy/shadowsocks/config.go

@@ -4,6 +4,7 @@ import (
 	"bytes"
 	"crypto/cipher"
 	"crypto/md5"
+
 	"v2ray.com/core/common/crypto"
 	"v2ray.com/core/common/errors"
 	"v2ray.com/core/common/protocol"
@@ -73,7 +74,7 @@ func (v *AesCfb) KeySize() int {
 }
 
 func (v *AesCfb) IVSize() int {
-	return 16
+	return v.KeyBytes
 }
 
 func (v *AesCfb) NewEncodingStream(key []byte, iv []byte) (cipher.Stream, error) {