cvs: php4 /ext/openssl openssl.c php_openssl.h

From: Date: Tue, 11 Sep 2001 00:03:57 +0000
Subject: cvs: php4 /ext/openssl openssl.c php_openssl.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-7388@lists.php.net to get a copy of this message
wez Mon Sep 10 20:03:57 2001 EDT Modified files: /php4/ext/openssl openssl.c php_openssl.h Log: Arrrgghh! Fix munched file. # Dunno how that happened. Index: php4/ext/openssl/openssl.c diff -u php4/ext/openssl/openssl.c:1.28 php4/ext/openssl/openssl.c:1.29 --- php4/ext/openssl/openssl.c:1.28 Mon Sep 10 19:57:09 2001 +++ php4/ext/openssl/openssl.c Mon Sep 10 20:03:57 2001 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: openssl.c,v 1.28 2001/09/10 23:57:09 wez Exp $ */ +/* $Id: openssl.c,v 1.29 2001/09/11 00:03:57 wez Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -1799,66 +1799,22 @@ /* {{{ proto int openssl_pkey_get_private(string key [, string passphrase]) Get private key */ PHP_FUNCTION(openssl_pkey_get_private) -======= -/* {{{ proto resource openssl_x509_read(mixed cert) - Read X.509 certificate */ -PHP_FUNCTION(openssl_x509_read) { zval *cert; - X509 *x509; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &cert) == FAILURE) - return; - - return_value->type = IS_RESOURCE; - x509 = php_openssl_x509_from_zval(&cert, 1, &Z_LVAL_P(return_value) TSRMLS_CC); - - if (x509 == NULL) { - zend_error(E_WARNING, "%s() supplied parameter cannot be coerced into an X509 certificate!", get_active_function_name(TSRMLS_C)); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto void openssl_free_x509(resource x509) - Free X.509 certificate */ -PHP_FUNCTION(openssl_x509_free) -{ - zval *x509; - X509 *cert; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &x509) == FAILURE) - return; - - ZEND_FETCH_RESOURCE(cert, X509 *, &x509, -1, "OpenSSL X.509", le_x509); - zend_list_delete(Z_LVAL_P(x509)); -} -/* }}} */ - -/* {{{ setup_verify - * calist is an array containing file and directory names. create a - * certificate store and add those certs to it for use in verification. -*/ -static X509_STORE * setup_verify(zval * calist TSRMLS_DC) -{ -{ EVP_PKEY *pkey; - zval * key; char * passphrase = ""; - int passphrase_len; + long passphrase_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|s", &key, &passphrase, &passphrase_len) == FAILURE) + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|s", &cert, &passphrase, &passphrase_len) == FAILURE) return; Z_TYPE_P(return_value) = IS_RESOURCE; - pkey = php_openssl_evp_from_zval(&key, 0, passphrase, 1, &Z_LVAL_P(return_value) TSRMLS_CC); + pkey = php_openssl_evp_from_zval(&cert, 0, NULL, 1, &Z_LVAL_P(return_value) TSRMLS_CC); if (pkey == NULL) { - zend_error(E_WARNING, "%s(): unable to coerce arg to a private key", get_active_function_name(TSRMLS_C)); RETURN_FALSE; } } -/* }}} */ /* }}} */ Index: php4/ext/openssl/php_openssl.h diff -u php4/ext/openssl/php_openssl.h:1.7 php4/ext/openssl/php_openssl.h:1.8 --- php4/ext/openssl/php_openssl.h:1.7 Fri May 4 19:42:10 2001 +++ php4/ext/openssl/php_openssl.h Mon Sep 10 20:03:57 2001 @@ -13,10 +13,11 @@ | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Stig Venaas <venaas@php.net> | + | Wez Furlong <wez@thebrainroom.com | +----------------------------------------------------------------------+ */ -/* $Id: php_openssl.h,v 1.7 2001/05/04 23:42:10 wez Exp $ */ +/* $Id: php_openssl.h,v 1.8 2001/09/11 00:03:57 wez Exp $ */ #ifndef PHP_OPENSSL_H #define PHP_OPENSSL_H @@ -28,11 +29,13 @@ PHP_MINIT_FUNCTION(openssl); PHP_MSHUTDOWN_FUNCTION(openssl); PHP_MINFO_FUNCTION(openssl); -PHP_FUNCTION(openssl_get_privatekey); -PHP_FUNCTION(openssl_get_publickey); -PHP_FUNCTION(openssl_free_key); -PHP_FUNCTION(openssl_x509_read); -PHP_FUNCTION(openssl_x509_free); + +PHP_FUNCTION(openssl_pkey_get_private); +PHP_FUNCTION(openssl_pkey_get_public); +PHP_FUNCTION(openssl_pkey_free); +PHP_FUNCTION(openssl_pkey_new); +PHP_FUNCTION(openssl_pkey_export); + PHP_FUNCTION(openssl_sign); PHP_FUNCTION(openssl_verify); PHP_FUNCTION(openssl_seal); @@ -48,8 +51,16 @@ PHP_FUNCTION(openssl_pkcs7_encrypt); PHP_FUNCTION(openssl_error_string); + +PHP_FUNCTION(openssl_x509_read); +PHP_FUNCTION(openssl_x509_free); PHP_FUNCTION(openssl_x509_parse); PHP_FUNCTION(openssl_x509_checkpurpose); +PHP_FUNCTION(openssl_x509_export); +PHP_FUNCTION(openssl_x509_check_private_key); +PHP_FUNCTION(openssl_csr_new); +PHP_FUNCTION(openssl_csr_export); +PHP_FUNCTION(openssl_csr_sign); #else

« previous php.cvs (#7388) next »