Commit Graph

70 Commits

Author SHA1 Message Date
twosee
88355dd338 Constify char * arguments of APIs
Closes GH-5676.
2020-06-08 10:38:45 +02:00
Máté Kocsis
21cfa03f17
Generate function entries for another batch of extensions
Closes GH-5352
2020-04-05 21:15:30 +02:00
Gabriel Caruso
5d6e923d46
Remove mention of PHP major version in Copyright headers
Closes GH-4732.
2019-09-25 14:51:43 +02:00
Peter Kokot
92ac598aab Remove local variables
This patch removes the so called local variables defined per
file basis for certain editors to properly show tab width, and
similar settings. These are mainly used by Vim and Emacs editors
yet with recent changes the once working definitions don't work
anymore in Vim without custom plugins or additional configuration.
Neither are these settings synced across the PHP code base.

A simpler and better approach is EditorConfig and fixing code
using some code style fixing tools in the future instead.

This patch also removes the so called modelines for Vim. Modelines
allow Vim editor specifically to set some editor configuration such as
syntax highlighting, indentation style and tab width to be set in the
first line or the last 5 lines per file basis. Since the php test
files have syntax highlighting already set in most editors properly and
EditorConfig takes care of the indentation settings, this patch removes
these as well for the Vim 6.0 and newer versions.

With the removal of local variables for certain editors such as
Emacs and Vim, the footer is also probably not needed anymore when
creating extensions using ext_skel.php script.

Additionally, Vim modelines for setting php syntax and some editor
settings has been removed from some *.phpt files.  All these are
mostly not relevant for phpt files neither work properly in the
middle of the file.
2019-02-03 21:03:00 +01:00
Zeev Suraski
0cf7de1c70 Remove yearly range from copyright notice 2019-01-30 11:03:12 +02:00
David Carlier
62c7432fa3 Refactor subset of openssl module.
Proposal to abstract a subset of the openssl module,
to be able to use two ways encryption outside of this context.
2019-01-14 19:38:26 +00:00
Ben Scholzen (DASPRiD)
ee939b70d3 Add openssl_x509_verify() function
This patch introduces a wrapper around OpenSSL's X509_verify() function.
2018-11-14 21:40:34 +01:00
Peter Kokot
8d3f8ca12a Remove unused Git attributes ident
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
2018-07-25 00:53:25 +02:00
Jakub Zelenka
a231860b02 Merge branch 'PHP-7.1' into PHP-7.2 2018-05-22 13:40:23 +01:00
Jakub Zelenka
68c3d09c2c Fix bug #76174 (openssl extension fails to build with LibreSSL 2.7) 2018-05-22 13:30:58 +01:00
Xinchen Hui
7a7ec01a49 year++ 2018-01-02 12:55:14 +08:00
Xinchen Hui
ccd4716ec7 year++ 2018-01-02 12:53:31 +08:00
Anatol Belski
e2b61eccb9 Followup on 0ec147d3 for another place
which requires also to move the macros into the header

(cherry picked from commit b7eb2c0604)
2017-07-24 16:33:12 +02:00
Anatol Belski
b7eb2c0604 Followup on 0ec147d3 for another place
which requires also to move the macros into the header
2017-07-24 16:24:04 +02:00
Jakub Zelenka
e657f0d3f2 Merge branch 'PHP-7.1' 2017-06-25 18:11:10 +01:00
Jakub Zelenka
0c707fcb10 Add OPENSSL_DONT_ZERO_PAD_KEY constant to prevent key padding
It fixes bug #71917 (openssl_open() returns junk on envelope < 16 bytes)
and bug #72362 (OpenSSL Blowfish encryption is incorrect for short
keys).
2017-06-25 18:08:50 +01:00
Jelle van der Waa
787a18a50a Add openssl_pkcs7_read and output P7B in openssl_pkcs7_verify
Add an optional argument to openssl_pkcs7_verify to save the P7B
structure which can contain extra CA intermediate certificates send
along with an S/MIME signed email.

Introduce a new function called openssl_pkcs7_read, which can read a
PKCS#7 structure passed as a string and returns by reference an array
with PEM certificates formatted as a string.
2017-06-22 20:36:23 +01:00
Sammy Kaye Powers
dac6c639bb Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
Sammy Kaye Powers
9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06:00
Jakub Zelenka
2ecce94756 Use opaque RSA, DSA and DH 2016-07-17 20:24:34 +01:00
Jakub Zelenka
f1de72293e Use opaque EVP_PKEY in php_openssl_is_private_key 2016-07-17 17:33:42 +01:00
Jakub Zelenka
84a291d4da Wrap pkey id and rsa getters 2016-07-17 17:33:42 +01:00
Jakub Zelenka
d5a148e237 Use and fix storing errors in openssl_x509_export_to_file
Also use persistent memory to prevent segfualt
2016-01-09 18:45:02 +00:00
Jakub Zelenka
1d111320b9 Add initial almost empty php_openssl_store_errors 2016-01-08 14:57:31 +00:00
Jakub Zelenka
e00ba47d40 Add global data for storing OpenSSL errors 2016-01-07 16:38:24 +00:00
Lior Kaplan
ed35de784f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Happy new year (Update copyright to 2016)
2016-01-01 19:48:25 +02:00
Lior Kaplan
49493a2dcf Happy new year (Update copyright to 2016) 2016-01-01 19:21:47 +02:00
Tjerk Meesters
03a670eaaa Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed #69882: OpenSSL error "key values mismatch" after openssl_pkcs12_read with extra certs
2015-06-26 06:03:29 +08:00
Tjerk Meesters
2ff3dafccf Fixed #69882: OpenSSL error "key values mismatch" after openssl_pkcs12_read with extra certs
Squashed commit of the following:

commit a64c1d9bc4
Author: Tomasz Sawicki <falundir@gmail.com>
Date:   Wed Jun 24 08:49:37 2015 +0200

    Fix #69882: OpenSSL error "key values mismatch" after openssl_pkcs12_read with extra certs

    The "key values mismatch" error is triggered in openssl_pkcs12_read by
    PKCS12_parse, because it uses X509_check_private_key to separate main
    certificate (which corresponds to private key) from extra certificates.
    Extra certificates usually comes first (p12 contents are reversed as
    stack) and X509_check_private_key triggers X509_R_KEY_VALUES_MISMATCH
    error.
    The fix pops "key values mismatch" error from OpenSSL error stack for
    each extra certificate if there are any.
2015-06-26 05:33:28 +08:00
Anatol Belski
19360f386e cleanup mod version macros, round 3 2015-03-23 20:54:55 +01:00
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +08:00
Xinchen Hui
0579e8278d bump year 2015-01-15 23:26:37 +08:00
Johannes Schlüter
d0cb715373 s/PHP 5/PHP 7/ 2014-09-19 18:33:14 +02:00
Daniel Lowrey
27849c998a Refactor + reorganize openssl files
- All streams-related code now lives in xp_ssl.c. Previously
  stream code was split across both openssl.c and xp_ssl.c
- Folded superfluous php_openssl_structs.h into xp_ssl.c
- Server-specific options now set on SSL_CTX instead of SSL
- Deprecate SNI_server_name ctx option
- Miscellaneous refactoring
2014-03-05 10:03:11 -07:00
Daniel Lowrey
b6edbd5897 Mitigate client-initiated SSL renegotiation DoS 2014-02-21 06:31:56 -07:00
Daniel Lowrey
df6bfe3be2 Add openssl_get_cert_locations() function 2014-02-20 17:10:06 -07:00
Xinchen Hui
c081ce628f Bump year 2014-01-03 11:08:10 +08:00
Tjerk Meesters
2bfc5a253b Renamed to be more descriptive of what it does 2013-09-23 00:51:17 +08:00
datibbaw
b8f9a20286 added openssl_x509_digest(), output is binary sha1 2013-09-20 15:04:52 +08:00
jas-
8f56ac8401 Address feature request #38917 for native SPKAC (HTML5 keygen element) support 2013-05-06 16:36:06 -06:00
Xinchen Hui
a666285bc2 Happy New Year 2013-01-01 16:37:09 +08:00
Scott MacVicar
b481ebae55 Rename openssl_pkcs5_pbkdf2_hmac() to something that doesn't sound like a spell.
Summary:
Stas pointed out that this is named pretty poorly. Go for openssl_pbkdf2()
2012-06-11 12:38:54 -07:00
Scott MacVicar
f4847efc5d Add PBKDF2 support via openssl()
Summary:
No easy way to put these in the hash extension since we don't really support optional
parameters to certain algorithms. Implemented in openssl for now since it has it already
and is pretty stable.

Only SHA1 is confirmed to work as an algorithm but openssl has a parameter so it can be
changed in the future.

Will backport to 5.4 potentially with Stas' approval.

Test Plan:
Ran newly added tests which came from RFC 6070
2012-06-11 00:24:44 -07:00
Felipe Pena
4e19825281 - Year++ 2012-01-01 13:15:04 +00:00
Scott MacVicar
30f19bd524 Allow management of your own padding in openssl_encrypt/decrypt.
For using mcrypt / openssl interchangeabley managing your own padding is the only solution.
2011-05-20 18:56:13 +00:00
Felipe Pena
0203cc3d44 - Year++ 2011-01-01 02:17:06 +00:00
Sebastian Bergmann
9ba1e81665 sed -i "s#1997-2009#1997-2010#g" **/*.c **/*.h **/*.php 2010-01-03 09:23:27 +00:00
Sebastian Bergmann
08659c2dcd MFH: Bump copyright year, 3 of 3. 2008-12-31 11:15:49 +00:00
Sebastian Bergmann
d1dded8751 MFH: Bump copyright year, 2 of 2. 2007-12-31 07:17:19 +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