Commit Graph

195 Commits

Author SHA1 Message Date
Dmitry Stogov
65741beb79 MFH: Improved ext/openssl
. Added support for OpenSSL digest functions
. Added support for OpenSSL cipher functions
. Added access to internal values of DSA, RSA and DH keys
2007-09-27 08:46:00 +00:00
Pierre Joye
e507b4c4ce - fix regression introduced with #42222 (thx to tony and mattias for the
head up)
2007-08-08 06:29:46 +00:00
Pierre Joye
455cd3d837 - #42222, forgot this one (thanks mattias) 2007-08-06 19:49:45 +00:00
Pierre Joye
bca0912296 - #42222, truncate the _default to the buffer size (was 200 since day #1, we don't need dynamic alloc here) 2007-08-06 19:11:20 +00:00
Dmitry Stogov
1ad841d53a mproced openssl_x509_parse() to return extensions in readable form 2007-07-11 12:18:14 +00:00
Dmitry Stogov
f765f73e5f Fixed memory leak 2007-07-11 07:36:12 +00:00
Dmitry Stogov
2821378c33 Fixed crash on non-string passphrase 2007-07-11 07:26:52 +00:00
Ilia Alshanetsky
e2b093bfcb Fixed a memory leak inside load_all_certs_file() 2007-06-19 22:09:49 +00:00
Pierre Joye
26e22f34fa - #41423. PHP assumes wrongly that certain ciphers are enabled in OpenSSL 2007-05-19 22:05:08 +00:00
Ilia Alshanetsky
f752fd4836 Fixed bug #41353 (crash in openssl_pkcs12_read() on invalid input). 2007-05-13 17:37:32 +00:00
Rob Richards
3530b8a2c6 fix win32 build 2007-04-05 18:08:42 +00:00
Antony Dovgal
90a277d0ce fix ZTS build 2007-04-05 07:10:07 +00:00
Pierre Joye
6e5875b025 - nuke c++ comments 2007-04-04 22:00:51 +00:00
Pierre Joye
d4fb0108bc - implement #39867, PKCS#12 support
- Fix possible multibyte issues issue in the add_assoc function
- add test for openssl_csr_get_subject
2007-04-04 21:24:01 +00:00
Marcus Boerger
50ea26760d - Avoid sprintf, even when checked copy'n'paste or changes lead to errors 2007-02-24 02:17:47 +00:00
Rob Richards
75fdefba0c MFH: fix accessing public key from x509 resource
add test
fix test under win32
2007-01-20 22:08:29 +00:00
Ilia Alshanetsky
8df326e003 Fixed bug #39394 (Missing check for older variants of openssl). 2007-01-07 18:38:22 +00:00
Sebastian Bergmann
4223aa4d5e MFH: Bump year. 2007-01-01 09:36:18 +00:00
Pierre Joye
c412409164 - MFH: #39217, serialNumber might be -1 when the value is too big 2006-11-15 23:28:06 +00:00
Antony Dovgal
268984b478 fix compile warning 2006-10-15 21:09:27 +00:00
Pierre Joye
fa8f1151aa - fix possible segfault (see test 004) always exists and returns NULL on
error
2006-10-09 00:04:11 +00:00
Nuno Lopes
e197ecd16e fix mem leak. hash keys dont need to be strdup'ed 2006-09-16 12:05:13 +00:00
Antony Dovgal
1a6cd5162e remove a leftover 2006-09-12 10:54:01 +00:00
Antony Dovgal
5c6f438319 implement feature request #38731 (openssl_pkey_new does not support DSA key generation)
patch by marci at balabit dot hu
2006-09-08 20:10:47 +00:00
Ilia Alshanetsky
7f2cf9b373 Fixed memory leaks in openssl test #004 2006-09-07 14:11:06 +00:00
Antony Dovgal
52d0f82dc3 MFH: init variables 2006-09-05 13:59:26 +00:00
Pierre Joye
532f577fe9 - add OPENSSL_VERSION_TEXT and OPENSSL_VERSION_NUMBER constants
- skip tests if openssl version < 0.9.7j (known to work)
2006-09-03 15:31:01 +00:00
Antony Dovgal
fb21b5d059 MFH: fix problem with mixed arguments accepted as zval* causing leaks/segfaults when converting to other types 2006-08-31 13:48:17 +00:00
Antony Dovgal
1dd6ee3f6d fix segfault/leak, add test 2006-08-30 21:51:08 +00:00
Antony Dovgal
1f138e7e01 MFH: fix segfault in openssl_seal(), add test 2006-08-30 20:50:04 +00:00
Antony Dovgal
efbb2a4838 fix #38486 (openssl extension does not build correctly) 2006-08-18 13:02:38 +00:00
Pierre Joye
8dc61360c6 - add openssl_csr_get_subject() and openssl_csr_get_public_key() 2006-08-15 20:27:22 +00:00
Pierre Joye
9a79a2f37c - add OPENSSL_KEYTYPE_EC constant
- openssl_pkey_get_details(), returns the key details
2006-08-15 00:38:05 +00:00
Ilia Alshanetsky
610b633096 Fixed compiler warning. 2006-07-31 03:41:20 +00:00
Pierre Joye
3786f956e6 - #36732, add req_extensions support to openssl_csr_new and _sign
(ben at psc dot edu)
- fix leaks in openssl_csr_new and sign
2006-07-31 00:33:42 +00:00
Pierre Joye
769174c2dc - #28382, add support for x509 extensions 2006-07-30 17:03:13 +00:00
Pierre Joye
5def392ce1 - 38261: openssl_x509_parse leaks with invalid certs 2006-07-30 16:26:20 +00:00
Pierre Joye
509761f96d - silent compiler warnings (signess) 2006-07-30 09:18:07 +00:00
Pierre Joye
3a75600dbb - MFH: make the test more obvious and add an explanation 2006-07-29 23:03:56 +00:00
Pierre Joye
3fe91ed83f - vi happiness++ 2006-07-29 22:52:49 +00:00
Pierre Joye
47db124cda - #38255, fails on array as well 2006-07-29 22:39:34 +00:00
Pierre Joye
46b3f37810 - fix leak when the key is not a valid key (like false or an array) 2006-07-29 22:10:50 +00:00
Wez Furlong
8f87235107 Add two new context options for ssl:
"capture_peer_cert" and "capture_peer_cert_chain"

If true, the peer certificate and peer certificate chain respectively will be
captured and made available in the ssl context variables "peer_certificate" and
"peer_certificate_chain" respectively.  The certificates are exposed as x509
certificate resources and can be inspected using the existing openssl extension
functions.

This allows applications to perform extended validation.
2006-04-30 23:43:46 +00:00
foobar
5bd93221a8 bump year and license version 2006-01-01 12:51:34 +00:00
foobar
3e669bc950 MFH: nuke php3 legacy 2005-12-06 02:28:41 +00:00
foobar
d69ab24f69 MFH: - Fixed bug #35381 (ssl library is not initialized properly) 2005-11-28 11:37:43 +00:00
foobar
9477097564 MFH: Nuked EOLs from error messages 2005-08-18 13:34:41 +00:00
foobar
23e671a51e - Bumber up year 2005-08-03 14:08:58 +00:00
Wez Furlong
efc6ccaa01 Add optional parameter to openssl_pkcs7_verify() which specifies the name
of a file that will be filled with the verified data, but with the signature
information stripped.

Patch by Marton Kenyeres, mkenyeres (at) konvergencia dot hu
2005-06-30 14:25:41 +00:00
foobar
b8ac8eeca6 - Never use Z_TYPE* macros on non-zvals. 2005-04-19 22:04:28 +00:00
Ilia Alshanetsky
8c38ac19bf Fixed possible usage of str without being initialized. 2005-03-15 00:27:52 +00:00
foobar
005b2d77bf - Fixed bug #18613 (Multiple OUs in x509 certificate not handled properly) 2005-03-14 21:00:03 +00:00
Wez Furlong
c8cc96e6fe Fix possible crash; patch by Kamesh Jayachandran 2004-10-27 11:07:26 +00:00
Wez Furlong
0a4127a610 Fix for Bug #29418 (double free when openssl_csr_new fails).
Also hook up MSHUTDOWN function which appears to have never been enabled.

Patch by Kamesh Jayachandran
2004-10-26 09:24:07 +00:00
Magnus M��tt�
17c77a54bf Add missing stream unregister for sslv2 and 3. 2004-09-13 18:30:30 +00:00
Wez Furlong
0bc0ccce2b Fix Bug #29296: add explicit sslv2 and sslv3 transports 2004-09-10 11:43:47 +00:00
Wez Furlong
e9920ede1f Fix bug #28096 - stream_socket_accept() on an SSL server socket doesn't
enable SSL on the accepted socket.

- Add cipher list context option
- Add helpful hint about why SSL server socket fails with mysterious
  error (eg: you need an SSL certificate for most ciphers).
2004-04-21 23:02:06 +00:00
Ilia Alshanetsky
0d0fffe98b Fixed compiler warnings. 2004-03-29 19:57:51 +00:00
Andi Gutmans
dbeb4158d2 - A belated happy holidays and PHP 5 2004-01-08 08:18:22 +00:00
Ilia Alshanetsky
cba426ca13 Fixed uninitialized usage of mdtype when unknown signature algorithm is
found.
2003-12-21 18:17:20 +00:00
Wez Furlong
eaf0942c8b Port liveness and SSL CA validation from 4.3 branch.
Make stream_select() work on ssl-enabled sockets again.
2003-11-27 17:40:16 +00:00
Wez Furlong
42ae98d7a2 Fix unintialized variable.
Patch by Joe Orton.
2003-10-13 11:43:14 +00:00
foobar
08effa1b04 Fixed typo. 2003-09-23 19:29:34 +00:00
Wez Furlong
fce7b92891 MFB 25614 "fix" 2003-09-23 16:05:52 +00:00
Ilia Alshanetsky
9c82b1fa75 Fixed compiler warnings. 2003-08-31 20:45:51 +00:00
Zeev Suraski
8767205afa Fix Win32 linkage problems 2003-08-31 12:41:53 +00:00
Zeev Suraski
538d58dd5f Use new infrastructure.
There are bound to be some messups, please report build/runtime bugs!
2003-08-03 17:44:39 +00:00
Stefan Roehrich
750635d131 Allow setting of the serial number. 2003-07-13 09:54:42 +00:00
Stefan Roehrich
80ee75f11e Fixed certificate version (counting begins with 0, so 2 means version 3). 2003-07-13 09:38:32 +00:00
James Cox
f68c7ff249 updating license information in the headers. 2003-06-10 20:04:29 +00:00
Ilia Alshanetsky
b19f3302eb MFB 2003-06-08 23:52:29 +00:00
Ilia Alshanetsky
c511cd2242 emalloc -> safe_emalloc 2003-04-28 22:42:22 +00:00
Wez Furlong
16dae2eba0 Fix const warning 2003-03-31 17:58:29 +00:00
Derick Rethans
07dd6f49ff - Typo and some whitespace 2003-03-30 22:29:22 +00:00
Derick Rethans
27496361d5 - Added optional parameter to openssl_sign() to specify the hashing
algorithm to use. (Patch by Scott <scott@planetscott.ca>)
@- Added optional parameter to openssl_sign() to specify the hashing
@  algorithm to use. (scott@planetscott.ca, Derick)
2003-03-30 22:25:23 +00:00
Wez Furlong
b66957c56a fix proto 2003-03-15 13:29:35 +00:00
David Hill
5c90216d2c 64-bit correction to variables passed to zend_parse_parameters
@64-bit correction to variables passed to zend_parse_parameters (Dave)
2003-03-06 23:07:28 +00:00
Ilia Alshanetsky
14bf872003 Fixed compiler warnings. 2003-02-28 17:26:28 +00:00
Wez Furlong
76ebaa6ee7 - Move https:// and ftps:// wrapper registration into the openssl module.
- Expose the http:// and ftp:// wrappers as PHPAPI
- Remove unused variables
2003-02-27 18:16:35 +00:00
Wez Furlong
fd61f69077 Another big commit (tm).
Main Changes:
- Implement a socket transport layer for use by all code that needs to open
  some kind of "special" socket for network or IPC.
- Extensions can register (and override) transports.
- Implement ftruncate() on streams via the ioctl-alike option interface.
- Implement mmap() on streams via the ioctl-alike option interface.
- Implement generic crypto API via the ioctl-alike option interface.
  (currently only supports OpenSSL, but could support other SSL toolkits,
  and other crypto transport protocols).

Impact:
- tcp sockets can be overloaded by the openssl capable sockets at runtime,
  removing the link-time requirement for ssl:// and https:// sockets and
  streams.
- checking stream types using PHP_STREAM_IS_SOCKET is deprecated, since
  there are now a range of possible socket-type streams.

Working towards:
- socket servers using the new transport layer
- mmap support under win32
- Cleaner code.

# I will be updating the win32 build to add the new files shortly
# after this commit.
2003-02-27 17:43:38 +00:00
Wez Furlong
79c046d8a8 Add additional optional parameter to openssl_pkcs7_encrypt to specify the
cipher.  The cipher can be one of the constants listed below.

Based on a patch from:
stefan at cuba dot ionum dot ch

 	OPENSSL_CIPHER_RC2_40,   (the default)
 	OPENSSL_CIPHER_RC2_128,
 	OPENSSL_CIPHER_RC2_64,
 	OPENSSL_CIPHER_DES,
 	OPENSSL_CIPHER_3DES,

proto bool openssl_pkcs7_encrypt(string infile, string outfile,
   mixed recipcerts, array headers [, long flags [, long cipher]])
2003-02-10 09:49:31 +00:00
Ilia Alshanetsky
31a3135014 Fixed bug #21986 (openssl test failure). 2003-01-31 22:15:56 +00:00
Ilia Alshanetsky
e2868b5788 Removed pointless memory allocation checks. 2003-01-18 19:41:56 +00:00
Ilia Alshanetsky
5f36ce398e CS fixes. 2003-01-04 23:31:55 +00:00
Ilia Alshanetsky
f65e8488d7 Fixed a small memory leak when a NULL variable is passed to
openssl_csr_sign() as the first argument.
2003-01-02 21:18:59 +00:00
Sebastian Bergmann
b506f5c8f8 Bump year. 2002-12-31 16:08:15 +00:00
Marcus Boerger
95c701d328 MFB: ZTS fix by Ilia 2002-12-13 09:17:04 +00:00
Marcus Boerger
c2078cdabf php_error -> php_error_docref conversion fix (noticed by derick) 2002-12-12 14:12:42 +00:00
Wez Furlong
1ef74a4f79 Patch for #20936 (openssl: public key handling was broken).
Thanks to <jeroen@derks.it> for the patch.
2002-12-12 13:42:23 +00:00
Marcus Boerger
835c4dedbb typeconversion is needed here for cygwin 2002-12-12 12:18:44 +00:00
Ilia Alshanetsky
08e020a870 ZTS fix. 2002-12-11 07:29:51 +00:00
Ilia Alshanetsky
533d3273bd Fix ZTS build 2002-12-11 02:30:00 +00:00
Wez Furlong
9746be4779 use php_error_docref and tidy up some WS/coding standards. 2002-12-10 22:18:58 +00:00
Ilia Alshanetsky
cc85828811 Fixed bug #19935. Made OpenSSL file system operations abide by safe_mode
& open_basedir restrictions.
2002-11-10 05:19:40 +00:00
Wez Furlong
0c7a386b3e correct proto 2002-08-10 20:19:49 +00:00
foobar
36fbe5c933 Fixed bug: #18295. e_os.h is not supposed to be included.. 2002-07-12 21:46:36 +00:00
foobar
ce379abfbd Fixed bug: #17751 (typo) 2002-06-13 19:41:25 +00:00
Wez Furlong
7ae1630a97 proto tweak 2002-05-17 12:42:40 +00:00
Wez Furlong
3a68052828 Fix for #16885 2002-05-01 08:22:17 +00:00
Wez Furlong
f571438d7a Probable fix for #16940. 2002-05-01 07:50:13 +00:00