Skip to content

Commit

Permalink
删除断点
Browse files Browse the repository at this point in the history
  • Loading branch information
SiZhe committed Sep 20, 2018
1 parent 4c777af commit 667548b
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/crypto/pkcs7Encoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,9 @@ public function encrypt($text, $corpid)

public function decrypt($encrypted, $corpid)
{

try {
$iv = substr($this->key, 0, 16);
$decrypted = openssl_decrypt($encrypted, 'AES-256-CBC', substr($this->key, 0, 32), OPENSSL_ZERO_PADDING, $iv);

} catch (\Exception $e) {
return array(ErrorCode::$DecryptAESError, null);
}
Expand All @@ -74,10 +72,8 @@ public function decrypt($encrypted, $corpid)

$pkc_encoder = new PKCS7Encoder;
$result = $pkc_encoder->decode($decrypted);
dd($result);
if (strlen($result) < 16)
return "";

$content = substr($result, 16, strlen($result));
$len_list = unpack("N", substr($content, 0, 4));
$xml_len = $len_list[1];
Expand Down

0 comments on commit 667548b

Please sign in to comment.