mirror of
https://github.com/silenceper/wechat.git
synced 2026-11-16 05:12:03 +08:00
增加iv校验 (#482)
This commit is contained in:
1 parent
c021336a3c
commit
00b13cda0d
2 files changed
+19
No files matched your search
@@ -0,0 +1,15 @@
|
||||
package encryptor
|
||||
|
||||
import (
|
||||
"encoding/base64"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestGetCipherText_BadIV(t *testing.T) {
|
||||
keyData := base64.StdEncoding.EncodeToString([]byte("1234567890123456"))
|
||||
badData := base64.StdEncoding.EncodeToString([]byte("1"))
|
||||
_, err := GetCipherText(keyData, badData, badData)
|
||||
assert.Error(t, err)
|
||||
}
|
||||
Reference in new issue
Block a user