X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=library%2Fasn1.php;h=ac14a5b16f3790110aea92ef829e201ac192c4d7;hb=85875fc07f9a859d0796adc48bc124c489a486dc;hp=713978e8c19f8dc7c08b7a4834715c333700ce18;hpb=5edee3c4d1f84c07c1c54775072601188075a542;p=friendica.git diff --git a/library/asn1.php b/library/asn1.php index 713978e8c1..ac14a5b16f 100644 --- a/library/asn1.php +++ b/library/asn1.php @@ -4,6 +4,7 @@ // Attribution: http://www.krisbailey.com // license: unknown // modified: Mike Macgrivin mike@macgirvin.com 6-oct-2010 to support Salmon auto-discovery +// modified: Tobias Diekershoff 28-jul-2016 adding an intval in line 162 to make PHP7 happy // from openssl public keys @@ -159,7 +160,7 @@ class ASN_BASE { } $length = $tempLength; } - $data = substr($string, $p, $length); + $data = substr($string, $p, intval($length)); $parsed[] = self::parseASNData($type, $data, $level, $maxLevels); $p = $p + $length; } @@ -187,7 +188,6 @@ class ASN_BASE { return new ASN_BOOLEAN((bool)$data); case ASN_INTEGER: return new ASN_INTEGER(strtr(base64_encode($data),'+/','-_')); -// return new ASN_INTEGER(ord($data)); case ASN_BIT_STR: return new ASN_BIT_STR(self::parseASNString($data, $level+1, $maxLevels)); case ASN_OCTET_STR: @@ -290,9 +290,3 @@ class ASN_BASE { } - -function accum($s) { - $result = strtr(base64_encode($s),'+/=','-_,'); - return $result; -} -