Skip to content

Commit

Permalink
ASN1: fix for malformed ASN1 strings
Browse files Browse the repository at this point in the history
  • Loading branch information
terrafrost committed Mar 2, 2020
1 parent 935fa40 commit fc0832a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions phpseclib/File/ASN1.php
Expand Up @@ -577,6 +577,10 @@ function _decode_ber($encoded, $start = 0, $encoded_pos = 0)
*/
function asn1map($decoded, $mapping, $special = array())
{
if (!is_array($decoded)) {
return false;
}

if (isset($mapping['explicit']) && is_array($decoded['content'])) {
$decoded = $decoded['content'][0];
}
Expand Down

1 comment on commit fc0832a

@terrafrost
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes #1456

Please sign in to comment.