Commit: 2bfc5a253b4ee76f9930692f2d088371c38dd65f Author: Tjerk Meesters <datib...@php.net> Mon, 23 Sep 2013 00:51:17 +0800 Parents: 521a5c956800115f0be008e0581878e4303a5118 Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2bfc5a253b4ee76f9930692f2d088371c38dd65f Log: Renamed to be more descriptive of what it does Changed paths: M ext/openssl/openssl.c M ext/openssl/php_openssl.h D ext/openssl/tests/openssl_x509_digest.phpt A ext/openssl/tests/openssl_x509_fingerprint.phpt Diff: diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 9685dac..9da10fc 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -129,7 +129,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_x509_export, 0, 0, 2) ZEND_ARG_INFO(0, notext) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_x509_digest, 0, 0, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_x509_fingerprint, 0, 0, 1) ZEND_ARG_INFO(0, x509) ZEND_ARG_INFO(0, method) ZEND_ARG_INFO(0, raw_output) @@ -449,7 +449,7 @@ const zend_function_entry openssl_functions[] = { PHP_FE(openssl_x509_checkpurpose, arginfo_openssl_x509_checkpurpose) PHP_FE(openssl_x509_check_private_key, arginfo_openssl_x509_check_private_key) PHP_FE(openssl_x509_export, arginfo_openssl_x509_export) - PHP_FE(openssl_x509_digest, arginfo_openssl_x509_digest) + PHP_FE(openssl_x509_fingerprint, arginfo_openssl_x509_fingerprint) PHP_FE(openssl_x509_export_to_file, arginfo_openssl_x509_export_to_file) /* PKCS12 funcs */ @@ -1672,7 +1672,7 @@ PHP_FUNCTION(openssl_x509_export) } /* }}} */ -PHP_FUNCTION(openssl_x509_digest) +PHP_FUNCTION(openssl_x509_fingerprint) { X509 *cert; zval **zcert; diff --git a/ext/openssl/php_openssl.h b/ext/openssl/php_openssl.h index 4f0ac14..a06e43d 100644 --- a/ext/openssl/php_openssl.h +++ b/ext/openssl/php_openssl.h @@ -66,7 +66,7 @@ PHP_FUNCTION(openssl_x509_free); PHP_FUNCTION(openssl_x509_parse); PHP_FUNCTION(openssl_x509_checkpurpose); PHP_FUNCTION(openssl_x509_export); -PHP_FUNCTION(openssl_x509_digest); +PHP_FUNCTION(openssl_x509_fingerprint); PHP_FUNCTION(openssl_x509_export_to_file); PHP_FUNCTION(openssl_x509_check_private_key); diff --git a/ext/openssl/tests/openssl_x509_digest.phpt b/ext/openssl/tests/openssl_x509_digest.phpt deleted file mode 100644 index fde4280..0000000 --- a/ext/openssl/tests/openssl_x509_digest.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -Testing openssl_x509_digest() ---SKIPIF-- -<?php -if (!extension_loaded("openssl")) die("skip"); -?> ---FILE-- -<?php - -$cert = "file://" . dirname(__FILE__) . "/cert.crt"; - -echo "** Testing with no parameters **\n"; -var_dump(openssl_x509_digest()); - -echo "** Testing default functionality **\n"; -var_dump(openssl_x509_digest($cert)); - -echo "** Testing hash method md5 **\n"; -var_dump(openssl_x509_digest($cert, 'md5')); - -echo "**Testing raw output md5 **\n"; -var_dump(bin2hex(openssl_x509_digest($cert, 'md5', true))); - -echo "** Testing bad certification **\n"; -var_dump(openssl_x509_digest('123')); -echo "** Testing bad hash method **\n"; -var_dump(openssl_x509_digest($cert, 'xx45')); ---EXPECTF-- -** Testing with no parameters ** - -Warning: openssl_x509_digest() expects at least 1 parameter, 0 given in %s on line %d -NULL -** Testing default functionality ** -string(40) "6e6fd1ea10a5a23071d61c728ee9b40df6dbc33c" -** Testing hash method md5 ** -string(32) "ac77008e172897e06c0b065294487a67" -**Testing raw output md5 ** -string(32) "ac77008e172897e06c0b065294487a67" -** Testing bad certification ** - -Warning: openssl_x509_digest(): cannot get cert from parameter 1 in %s on line %d -bool(false) -** Testing bad hash method ** - -Warning: openssl_x509_digest(): Unknown signature algorithm in %s on line %d -bool(false) - diff --git a/ext/openssl/tests/openssl_x509_fingerprint.phpt b/ext/openssl/tests/openssl_x509_fingerprint.phpt new file mode 100644 index 0000000..6cd464a --- /dev/null +++ b/ext/openssl/tests/openssl_x509_fingerprint.phpt @@ -0,0 +1,47 @@ +--TEST-- +Testing openssl_x509_fingerprint() +--SKIPIF-- +<?php +if (!extension_loaded("openssl")) die("skip"); +?> +--FILE-- +<?php + +$cert = "file://" . dirname(__FILE__) . "/cert.crt"; + +echo "** Testing with no parameters **\n"; +var_dump(openssl_x509_fingerprint()); + +echo "** Testing default functionality **\n"; +var_dump(openssl_x509_fingerprint($cert)); + +echo "** Testing hash method md5 **\n"; +var_dump(openssl_x509_fingerprint($cert, 'md5')); + +echo "**Testing raw output md5 **\n"; +var_dump(bin2hex(openssl_x509_fingerprint($cert, 'md5', true))); + +echo "** Testing bad certification **\n"; +var_dump(openssl_x509_fingerprint('123')); +echo "** Testing bad hash method **\n"; +var_dump(openssl_x509_fingerprint($cert, 'xx45')); +--EXPECTF-- +** Testing with no parameters ** + +Warning: openssl_x509_fingerprint() expects at least 1 parameter, 0 given in %s on line %d +NULL +** Testing default functionality ** +string(40) "6e6fd1ea10a5a23071d61c728ee9b40df6dbc33c" +** Testing hash method md5 ** +string(32) "ac77008e172897e06c0b065294487a67" +**Testing raw output md5 ** +string(32) "ac77008e172897e06c0b065294487a67" +** Testing bad certification ** + +Warning: openssl_x509_fingerprint(): cannot get cert from parameter 1 in %s on line %d +bool(false) +** Testing bad hash method ** + +Warning: openssl_x509_fingerprint(): Unknown signature algorithm in %s on line %d +bool(false) + -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php