Skip to content

Commit 3952cc1

Browse files
committed
X509: show empty strings as 00's
1 parent cb657c8 commit 3952cc1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

x509/asn1parse.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,11 @@ function make_printable($result, $i = 0)
304304
}
305305
break;
306306
case FILE_ASN1_TYPE_INTEGER:
307-
print_line($result['start'], $i, $length, $result['headerlength'], false, 'INTEGER', strtoupper($result['content']->toHex()));
307+
$value = $result['content']->toHex();
308+
if (empty($value)) {
309+
$value = '00';
310+
}
311+
print_line($result['start'], $i, $length, $result['headerlength'], false, 'INTEGER', strtoupper($value));
308312
break;
309313
case FILE_ASN1_TYPE_OBJECT_IDENTIFIER:
310314
print_line($result['start'], $i, $length, $result['headerlength'], false, 'OBJECT', strtr($result['content'], $oids));

0 commit comments

Comments
 (0)