1
0
mirror of https://github.com/php/php-src.git synced 2026-04-26 17:38:14 +02:00
Files
archived-php-src/ext/openssl/tests/bug52093.phpt
T
Christoph M. Becker 58ca47a06f Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #52093: openssl_csr_sign truncates $serial
2021-07-01 15:46:07 +02:00

26 lines
648 B
PHP

--TEST--
Bug #52093 (openssl_csr_sign truncates $serial)
--EXTENSIONS--
openssl
--SKIPIF--
<?php
if (PHP_INT_SIZE !== 8) die("skip this test is for 64bit platforms only");
?>
--FILE--
<?php
$dn = array(
"countryName" => "BR",
"stateOrProvinceName" => "Rio Grande do Sul",
"localityName" => "Porto Alegre",
"commonName" => "Henrique do N. Angelo",
"emailAddress" => "hnangelo@php.net"
);
$privkey = openssl_pkey_new();
$csr = openssl_csr_new($dn, $privkey);
$cert = openssl_csr_sign($csr, null, $privkey, 365, [], PHP_INT_MAX);
var_dump(openssl_x509_parse($cert)['serialNumber']);
?>
--EXPECT--
string(19) "9223372036854775807"