/
patch-to-php-5.2.6-with-openssl-1.0.0.txt
68 lines (62 loc) · 2.32 KB
/
patch-to-php-5.2.6-with-openssl-1.0.0.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
--- php-5.2.6-orig/ext/openssl/openssl.c 2008-04-07 19:44:03.000000000 +0900
+++ php-5.2.6/ext/openssl/openssl.c 2011-01-09 15:52:34.000000000 +0900
@@ -55,7 +55,9 @@
#define OPENSSL_ALGO_SHA1 1
#define OPENSSL_ALGO_MD5 2
#define OPENSSL_ALGO_MD4 3
+#ifdef HAVE_OPENSSL_MD2_H
#define OPENSSL_ALGO_MD2 4
+#endif
#define DEBUG_SMIME 0
@@ -226,8 +228,13 @@
static char default_ssl_conf_filename[MAXPATHLEN];
struct php_x509_request { /* {{{ */
- LHASH * global_config; /* Global SSL config */
- LHASH * req_config; /* SSL config for this request */
+#if OPENSSL_VERSION_NUMBER >= 0x10000002L
+ LHASH_OF(CONF_VALUE) * global_config; /* Global SSL config */
+ LHASH_OF(CONF_VALUE) * req_config; /* SSL config for this request */
+#else
+ LHASH * global_config; /* Global SSL config */
+ LHASH * req_config; /* SSL config for this request */
+#endif
const EVP_MD * md_alg;
const EVP_MD * digest;
char * section_name,
@@ -403,12 +410,11 @@
}
/* }}} */
-static inline int php_openssl_config_check_syntax(
- const char * section_label,
- const char * config_filename,
- const char * section,
- LHASH * config TSRMLS_DC
- ) /* {{{ */
+#if OPENSSL_VERSION_NUMBER >= 0x10000002L
+static inline int php_openssl_config_check_syntax(const char * section_label, const char * config_filename, const char * section, LHASH_OF(CONF_VALUE) * config TSRMLS_DC) /* {{{ */
+#else
+static inline int php_openssl_config_check_syntax(const char * section_label, const char * config_filename, const char * section, LHASH * config TSRMLS_DC) /* {{{ */
+#endif
{
X509V3_CTX ctx;
@@ -638,9 +644,11 @@
case OPENSSL_ALGO_MD4:
mdtype = (EVP_MD *) EVP_md4();
break;
+#ifdef HAVE_OPENSSL_MD2_H
case OPENSSL_ALGO_MD2:
mdtype = (EVP_MD *) EVP_md2();
break;
+#endif
default:
return NULL;
break;
@@ -691,7 +699,9 @@
REGISTER_LONG_CONSTANT("OPENSSL_ALGO_SHA1", OPENSSL_ALGO_SHA1, CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("OPENSSL_ALGO_MD5", OPENSSL_ALGO_MD5, CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("OPENSSL_ALGO_MD4", OPENSSL_ALGO_MD4, CONST_CS|CONST_PERSISTENT);
+#ifdef HAVE_OPENSSL_MD2_H
REGISTER_LONG_CONSTANT("OPENSSL_ALGO_MD2", OPENSSL_ALGO_MD2, CONST_CS|CONST_PERSISTENT);
+#endif
/* flags for S/MIME */
REGISTER_LONG_CONSTANT("PKCS7_DETACHED", PKCS7_DETACHED, CONST_CS|CONST_PERSISTENT);