feat: udmk4和网元配置yaml测试函数

This commit is contained in:
TsMask
2024-08-01 15:52:57 +08:00
parent 8eeb38c59a
commit 7bb802cc26
2 changed files with 233 additions and 3 deletions

View File

@@ -6,7 +6,7 @@ import (
"testing"
)
// 加密
// UDM K4加密
func encrypt(origData, key []byte) ([]byte, error) {
if len(origData) < 1 || len(key) < 1 {
return nil, errors.New("wrong data or key")
@@ -36,11 +36,11 @@ func TestEncrypt(t *testing.T) {
// ki := []byte{0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef}
// 0123456789abcdef0123456789abcdef
// 密码
// k4 password
key := []byte{0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34}
// 1234123412341234
// 要加密的ki
// k4 crypt ki
ki := []byte{0x80, 0x5D, 0xAD, 0xC6, 0xE8, 0xA5, 0x4A, 0x0D, 0x59, 0xD6, 0x22, 0xC7, 0xA0, 0x4D, 0x08, 0xE0}
// 805DADC6E8A54A0D59D622C7A04D08E0