This commit is contained in:
suyl
2021-08-17 15:24:58 +08:00
parent 635bfc39fe
commit 1cc6a905c4

View File

@@ -250,9 +250,13 @@ func (c *DingTalkCrypto) GetDecryptMsg(signature, timestamp, nonce, secretMsg st
if len(decode) < aes.BlockSize {
return "", errors.New("ERROR: 密文太短")
}
fmt.Println("c", c)
fmt.Println("c.Block", c.Block)
fmt.Println("c.BKey", c.BKey)
fmt.Println("c.c.Block.BlockSize()", c.Block.BlockSize())
fmt.Println("c.BKey[:c.Block.BlockSize()]", c.BKey[:c.Block.BlockSize()])
blockMode := cipher.NewCBCDecrypter(c.Block, c.BKey[:c.Block.BlockSize()])
plantText := make([]byte, len(decode))
blockMode.CryptBlocks(plantText, decode)
plantText = pkCS7UnPadding(plantText)
size := binary.BigEndian.Uint32(plantText[16:20])