Newsgroup: it.comp.www.php
Titolo: Aggiornamento OpenSSL non rilevato

Ho installato le nuove librerie OpenSSL per Windows.
Ho riavviato Apache ma in phpinfo() tutti riferimenti sono alla versione 
  0.9.8k mentre sul sistema sono installate solo librerie 0.9.8l.
Perchï¿œ?

elefa ha scritto:

apache/bin
devi cambiare quelle
mi provi un pezzo di codice ? con ssl
<?
if(empty($appl['APPL'])){
header("Location: http://".$_SERVER['SERVER_NAME']);
exit;
}
         if(in_array($POST['algo'], array("OPENSSL_ALGO_SHA1",
               "OPENSSL_ALGO_MD5",
               "OPENSSL_ALGO_MD4",
               "OPENSSL_ALGO_MD2",
               "OPENSSL_ALGO_DSS1"))){
               $algo = $POST['algo'];
         }else{
               $algo = "OPENSSL_ALGO_MD5";
         }
if(in_array($POST['keys'],
array("512","1024","1536","2048","3072","4096","4608","6656","8192"))){
               $key = (int) $POST['keys'];
}else{
               $key = (int) 4096;
}
if($POST['pv0']===$POST['pv1']){
    $pass = $POST['pv0'];
}else{
    echo "{\"pass\": \"false\"}";
}
$ssl_configargs = array(
"digest_alg" => $algo,
"private_key_bits" => $key,
"basicConstraints" => "critical,CA:true",
"keyUsage" => "cRLSign, keyCertSign",
"nsCertType" => "sslCA, emailCA",
'x509_extensions' => 'v3_ca',
'req_extensions'   => 'v3_req'
);
$dn = array("countryName" => $POST['natio'],
"stateOrProvinceName" => $POST['countr'],
"localityName" => $POST['prv'],
"organizationName" => $POST['dat'],
"organizationalUnitName" => $POST['unit'],
"commonName" => $POST['dat'] ,
"emailAddress" => $POST['mail']);
$numberofdays = $POST['yars'] * 365;
$pkey = openssl_pkey_new( $ssl_configargs );
$csr = openssl_csr_new( $dn, $privkey, $ssl_configargs );
$sscert = openssl_csr_sign( $csr, null, $privkey, $numberofdays );
openssl_csr_export( $csr, $csrout );
openssl_x509_export( $sscert, $certout );
$detail = openssl_x509_parse ($certout);
$res = openssl_get_publickey($certout);
echo $source = 'vbebvuwebvuwebvuwv zbg 54 g54gb 43z g34zg
b43zgbz43bghrbg 2zg254 zgh87hg5 hg78 vh742 8h25 7vht54 v7hg7v54 hv8 v7h
4mhg754v8 h4587v hg457 vhg78 vhg v7gh5374gh47ghweurgh475hguregh475n 54gh
4 vgh74 vgh 8g2h528ghv 24gh v745hv g87vh4g28 vh2847';
openssl_public_encrypt($source,$crypttext,$res);
echo $crypttext;
openssl_private_decrypt($crypttext,$plain, $privkey);
echo "<br>";
echo $plain;
echo "<br>";
$f = true;
if($plain!==$source){
   echo '{"certificate":"false"}';
   $f = false;
}

Solo disabilitando la prima condizione:
Warning: openssl_csr_new() [function.openssl-csr-new]: dn: 
add_entry_by_NID 14 -> (failed) in C:\www\prova.php on line 58
Warning: openssl_csr_sign() [function.openssl-csr-sign]: cannot get CSR 
from parameter 1 in C:\www\prova.php on line 59
Warning: openssl_csr_export() expects parameter 1 to be resource, 
boolean given in C:\www\prova.php on line 61
Warning: openssl_x509_export() [function.openssl-x509-export]: cannot 
get cert from parameter 1 in C:\www\prova.php on line 62
xxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxx xxxxxxxxxxxxxxxxx
Warning: openssl_public_encrypt() [function.openssl-public-encrypt]: key 
parameter is not a valid public key in C:\www\prova.php on line 72
Warning: openssl_private_decrypt() [function.openssl-private-decrypt]: 
key parameter is not a valid private key in C:\www\prova.php on line 74
{"certificate":"false"}