php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #38917
Patch spki.patch revision 2011-12-22 10:41 UTC by jason dot gerfen at gmail dot com
revision 2011-12-21 20:31 UTC by jason dot gerfen at gmail dot com
revision 2011-12-21 16:09 UTC by jason dot gerfen at gmail dot com
revision 2011-12-21 03:48 UTC by jason dot gerfen at gmail dot com
revision 2011-12-21 03:26 UTC by jason dot gerfen at gmail dot com
revision 2011-12-19 17:58 UTC by jason dot gerfen at gmail dot com
revision 2011-12-19 17:53 UTC by jason dot gerfen at gmail dot com
revision 2011-12-19 14:36 UTC by jason dot gerfen at gmail dot com
revision 2011-12-14 11:38 UTC by jason dot gerfen at gmail dot com
revision 2011-12-13 16:55 UTC by jason dot gerfen at gmail dot com
revision 2011-12-08 10:57 UTC by jason dot gerfen at gmail dot com
revision 2011-12-06 21:02 UTC by jason dot gerfen at gmail dot com
revision 2011-12-06 11:35 UTC by jason dot gerfen at gmail dot com
revision 2011-12-06 11:29 UTC by jason dot gerfen at gmail dot com

Patch spki.patch for OpenSSL related Bug #38917

Patch version 2011-12-21 03:48 UTC

Return to Bug #38917 | Download this patch
Patch Revisions: 2011-12-22 10:41 UTC | 2011-12-21 20:31 UTC | 2011-12-21 16:09 UTC | 2011-12-21 03:48 UTC | 2011-12-21 03:26 UTC | 2011-12-19 17:58 UTC | 2011-12-19 17:53 UTC | 2011-12-19 14:36 UTC | 2011-12-14 11:38 UTC | 2011-12-13 16:55 UTC | 2011-12-08 10:57 UTC | 2011-12-06 21:02 UTC | 2011-12-06 11:35 UTC | 2011-12-06 11:29 UTC

Developer: jason.gerfen@gmail.com



   #else
   
   #define phpext_openssl_ptr NULL
  --- php-5.3.8/ext/openssl/tests/026.phpt	1969-12-31 17:00:00.000000000 -0700
 +++ php-5.3.8/ext/openssl/tests/026.phpt	2011-12-20 20:07:55.175870169 -0700
 @@ -0,0 +1,202 @@
 +++ php-5.3.8/ext/openssl/tests/026.phpt	2011-12-20 20:35:03.448513959 -0700
 @@ -0,0 +1,204 @@
  +--TEST--
  +openssl_spki_new(), openssl_spki_verify(), openssl_spki_export(), openssl_spki_export_challenge(), openssl_spki_details()
  +--SKIPIF--
  +<?php


  +echo "Verifying SPKAC using defaults\n";
  +if (!function_exists("openssl_spki_verify"))
  + die("openssl_spki_verify() does not exist\n");
  +
 +$x = openssl_spki_verify(preg_replace("/SPKAC=/", "", $spki));
 +if ($x === false)
 +$a = openssl_spki_verify(preg_replace("/SPKAC=/", "", $spki));
 +if ($a === false)
  + die("could not verify spkac\n");
  +
  +echo "Exporting challenge using defaults\n";
  +if (!function_exists("openssl_spki_export_challenge"))
  + die("openssl_spki_export_challenge() does not exist\n");
  +
 +$y = openssl_spki_export_challenge(preg_replace("/SPKAC=/", "", $spki));
 +if ($y !== "sample_challenge_string")
 +$b = openssl_spki_export_challenge(preg_replace("/SPKAC=/", "", $spki));
 +if ($b !== "sample_challenge_string")
  + die("could not verify challenge string from spkac\n");
  +
  +echo "Exporting public key from SPKAC using defaults\n";
  +if (!function_exists("openssl_spki_export"))
  + die("openssl_spki_export() does not exist\n");
  +
 +$z = openssl_spki_export(preg_replace("/SPKAC=/", '', $spki));
 +if ($z === "")
 +$c = openssl_spki_export(preg_replace("/SPKAC=/", '', $spki));
 +if ($c === "")
  + die("could not export public key from spkac\n");
  +
  +echo "Generating details of SPKAC structure using defaults\n";
  +if (!function_exists("openssl_spki_details"))
  + die("openssl_spki_details() does not exist\n");
  +
 +$w = openssl_spki_details(preg_replace('/SPKAC=/', '', $spki));
 +if ($w === "")
 +$d = openssl_spki_details(preg_replace('/SPKAC=/', '', $spki));
 +if ($d === "")
  + die("could not obtain details from spkac\n");
  +
 +echo "Creating new SPKAC using md5 signature\n";
 +if (!function_exists("openssl_spki_new"))
 + die("openssl_spki_new() does not exist\n");
 +
 +$spki = openssl_spki_new($key, "sample_challenge_string");
 +unset($spki, $a, $b, $c, $d);
 +
 +$spki = openssl_spki_new($key, "sample_challenge_string", "md5");
  +if ($spki === false)
  + die("could not create spkac\n");
 +
 +
  +echo "Verifying SPKAC using md5 signature\n";
 +if (!function_exists("openssl_spki_verify"))
 + die("openssl_spki_verify() does not exist\n");
 +
 +$x = openssl_spki_verify(preg_replace("/SPKAC=/", "", $spki));
 +if ($x === false)
 + die("could not verify spkac\n");
 +if (!function_exists("openssl_spki_verify"))
 + die("openssl_spki_verify() does not exist\n");
 +
 +$a = openssl_spki_verify(preg_replace("/SPKAC=/", "", $spki));
 +if ($a === false)
 + die("could not verify spkac\n");
  +
  +echo "Exporting challenge using md5 signature\n";
  +if (!function_exists("openssl_spki_export_challenge"))
  + die("openssl_spki_export_challenge() does not exist\n");
  +
 +$y = openssl_spki_export_challenge(preg_replace("/SPKAC=/", "", $spki));
 +if ($y !== "sample_challenge_string")
 +$b = openssl_spki_export_challenge(preg_replace("/SPKAC=/", "", $spki));
 +if ($b !== "sample_challenge_string")
  + die("could not verify challenge string from spkac\n");
  +
  +echo "Exporting public key from SPKAC using md5 signature\n";
  +if (!function_exists("openssl_spki_export"))
  + die("openssl_spki_export() does not exist\n");
  +
 +$z = openssl_spki_export(preg_replace("/SPKAC=/", '', $spki));
 +if ($z === "")
 +$c = openssl_spki_export(preg_replace("/SPKAC=/", '', $spki));
 +if ($c === "")
  + die("could not export public key from spkac\n");
  +
  +echo "Generating details of SPKAC structure using md5 signature\n";
 +if (!function_exists("openssl_spki_details"))
 + die("openssl_spki_details() does not exist\n");
 +
 +$w = openssl_spki_details(preg_replace('/SPKAC=/', '', $spki));
 +if ($w === "")
 +if (!function_exists("openssl_spki_details"))
 + die("openssl_spki_details() does not exist\n");
 +
 +$d = openssl_spki_details(preg_replace('/SPKAC=/', '', $spki));
 +if ($d === "")
  + die("could not obtain details from spkac\n");
 +
 +
 +unset($spki, $a, $b, $c, $d);
 +
  +echo "Creating new SPKAC using sha1 signature\n";
 +if (!function_exists("openssl_spki_new"))
 + die("openssl_spki_new() does not exist\n");
 +
 +$spki = openssl_spki_new($key, "sample_challenge_string");
 +if (!function_exists("openssl_spki_new"))
 + die("openssl_spki_new() does not exist\n");
 +
 +$spki = openssl_spki_new($key, "sample_challenge_string", "sha1");
  +if ($spki === false)
  + die("could not create spkac\n");
  +
  +echo "Verifying SPKAC using sha1 signature\n";
  +if (!function_exists("openssl_spki_verify"))
  + die("openssl_spki_verify() does not exist\n");
 +
 +$x = openssl_spki_verify(preg_replace("/SPKAC=/", "", $spki));
 +if ($x === false)
 + die("could not verify spkac\n");
 +
 +$a = openssl_spki_verify(preg_replace("/SPKAC=/", "", $spki));
 +if ($a === false)
 + die("could not verify spkac\n");
  +
  +echo "Exporting challenge using sha1 signature\n";
  +if (!function_exists("openssl_spki_export_challenge"))
  + die("openssl_spki_export_challenge() does not exist\n");
  +
 +$y = openssl_spki_export_challenge(preg_replace("/SPKAC=/", "", $spki));
 +if ($y !== "sample_challenge_string")
 +$b = openssl_spki_export_challenge(preg_replace("/SPKAC=/", "", $spki));
 +if ($b !== "sample_challenge_string")
  + die("could not verify challenge string from spkac\n");
  +
  +echo "Exporting public key from SPKAC using sha1 signature\n";
  +if (!function_exists("openssl_spki_export"))
  + die("openssl_spki_export() does not exist\n");
  +
 +$z = openssl_spki_export(preg_replace("/SPKAC=/", '', $spki));
 +if ($z === "")
 +$c = openssl_spki_export(preg_replace("/SPKAC=/", '', $spki));
 +if ($c === "")
  + die("could not export public key from spkac\n");
  +
  +echo "Generating details of SPKAC structure using sha1 signature\n";
  +if (!function_exists("openssl_spki_details"))
  + die("openssl_spki_details() does not exist\n");
  +
 +$w = openssl_spki_details(preg_replace('/SPKAC=/', '', $spki));
 +if ($w === "")
 +$d = openssl_spki_details(preg_replace('/SPKAC=/', '', $spki));
 +if ($d === "")
  + die("could not obtain details from spkac\n");
 +
 +unset($spki, $a, $b, $c, $d);
  +
  +echo "Creating new SPKAC using sha512 signature\n";
  +if (!function_exists("openssl_spki_new"))
  + die("openssl_spki_new() does not exist\n");
  +
 +$spki = openssl_spki_new($key, "sample_challenge_string");
 +$spki = openssl_spki_new($key, "sample_challenge_string", "sha512");
  +if ($spki === false)
  + die("could not create spkac\n");
  +
  +echo "Verifying SPKAC using sha512 signature\n";
  +if (!function_exists("openssl_spki_verify"))
  + die("openssl_spki_verify() does not exist\n");
  +
 +$x = openssl_spki_verify(preg_replace("/SPKAC=/", "", $spki));
 +if ($x === false)
 +$a = openssl_spki_verify(preg_replace("/SPKAC=/", "", $spki));
 +if ($a === false)
  + die("could not verify spkac\n");
  +
  +echo "Exporting challenge using sha512 signature\n";
  +if (!function_exists("openssl_spki_export_challenge"))
  + die("openssl_spki_export_challenge() does not exist\n");
  +
 +$y = openssl_spki_export_challenge(preg_replace("/SPKAC=/", "", $spki));
 +if ($y !== "sample_challenge_string")
 +$b = openssl_spki_export_challenge(preg_replace("/SPKAC=/", "", $spki));
 +if ($b !== "sample_challenge_string")
  + die("could not verify challenge string from spkac\n");
  +
  +echo "Exporting public key from SPKAC using sha512 signature\n";
  +if (!function_exists("openssl_spki_export"))
  + die("openssl_spki_export() does not exist\n");
  +
 +$z = openssl_spki_export(preg_replace("/SPKAC=/", '', $spki));
 +if ($z === "")
 +$c = openssl_spki_export(preg_replace("/SPKAC=/", '', $spki));
 +if ($c === "")
  + die("could not export public key from spkac\n");
  +
  +echo "Generating details of SPKAC structure using sha512 signature\n";
  +if (!function_exists("openssl_spki_details"))
  + die("openssl_spki_details() does not exist\n");
  +
 +$w = openssl_spki_details(preg_replace('/SPKAC=/', '', $spki));
 +if ($w === "")
 +$d = openssl_spki_details(preg_replace('/SPKAC=/', '', $spki));
 +if ($d === "")
  + die("could not obtain details from spkac\n");
  +
  +echo "OK!\n";
  +


  +Exporting public key from SPKAC using sha512 signature
  +Generating details of SPKAC structure using sha512 signature
  +OK!
  --- php-5.3.8/ext/openssl/openssl.c	2011-07-25 05:42:53.000000000 -0600
 +++ php-5.3.8-patched/ext/openssl/openssl.c	2011-12-20 20:09:36.720600685 -0700
 +++ php-5.3.8/ext/openssl/openssl.c	2011-12-20 20:09:36.720600685 -0700
  @@ -372,11 +372,40 @@
       ZEND_ARG_INFO(0, length)
       ZEND_ARG_INFO(1, result_is_strong)
   ZEND_END_ARG_INFO()
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Mar 22 20:01:27 2019 UTC