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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
|
diff -up gnupg-1.3.2/gnupg.c.php54 gnupg-1.3.2/gnupg.c
--- gnupg-1.3.2/gnupg.c.php54 1970-01-01 10:13:08.000000000 +0100
+++ gnupg-1.3.2/gnupg.c 2012-05-06 09:36:28.377935185 +0200
@@ -18,6 +18,7 @@
#include "php.h"
#include "php_ini.h"
+#include "zend_exceptions.h"
#include "ext/standard/info.h"
#include "php_gnupg.h"
@@ -53,7 +54,7 @@ static zend_object_handlers gnupg_object
php_error_docref(NULL TSRMLS_CC, E_WARNING, (char*)error); \
break; \
case 2: \
- zend_throw_exception(zend_exception_get_default(), (char*) error, 0 TSRMLS_CC); \
+ zend_throw_exception(zend_exception_get_default(TSRMLS_C), (char*) error, 0 TSRMLS_CC); \
break; \
default: \
intern->errortxt = (char*)error; \
@@ -170,7 +171,9 @@ static void gnupg_obj_dtor(gnupg_object
/* {{{ objects_new */
zend_object_value gnupg_obj_new(zend_class_entry *class_type TSRMLS_DC){
gnupg_object *intern;
+#if PHP_VERSION_ID < 50400
zval *tmp;
+#endif
zend_object_value retval;
intern = emalloc(sizeof(gnupg_object));
@@ -179,7 +182,12 @@ zend_object_value gnupg_obj_new(zend_cla
ALLOC_HASHTABLE (intern->zo.properties);
zend_hash_init (intern->zo.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+
+#if PHP_VERSION_ID < 50400
zend_hash_copy (intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
+#else
+ object_properties_init( (zend_object*)intern, class_type );
+#endif
retval.handle = zend_objects_store_put(intern,NULL,(zend_objects_free_object_storage_t) gnupg_obj_dtor,NULL TSRMLS_CC);
retval.handlers = (zend_object_handlers *) & gnupg_object_handlers;
@@ -379,7 +387,7 @@ PHP_MINFO_FUNCTION(gnupg)
/* {{{ callback func for setting the passphrase */
gpgme_error_t passphrase_cb (gnupg_object *intern, const char *uid_hint, const char *passphrase_info,int last_was_bad, int fd TSRMLS_DC){
- char uid[16];
+ char uid[17];
int idx;
char *passphrase = NULL;
zval *return_value = NULL;
@@ -407,7 +415,7 @@ gpgme_error_t passphrase_cb (gnupg_objec
}
gpgme_error_t passphrase_decrypt_cb (gnupg_object *intern, const char *uid_hint, const char *passphrase_info,int last_was_bad, int fd TSRMLS_DC){
- char uid[16];
+ char uid[17];
int idx;
char *passphrase = NULL;
zval *return_value = NULL;
@@ -1244,7 +1252,6 @@ PHP_FUNCTION(gnupg_decryptverify){
gpgme_data_t in, out;
gpgme_decrypt_result_t decrypt_result;
gpgme_verify_result_t verify_result;
- gpgme_signature_t gpg_signatures;
GNUPG_GETOBJ();
@@ -1472,13 +1479,12 @@ PHP_FUNCTION(gnupg_gettrustlist){
/* {{{ proto array gnupg_listsignatures(string keyid) */
PHP_FUNCTION(gnupg_listsignatures){
char *keyid;
- char keyid_len;
+ int keyid_len;
zval *sub_arr;
zval *sig_arr;
gpgme_key_t gpgme_key;
- gpgme_subkey_t gpgme_subkey;
gpgme_user_id_t gpgme_userid;
gpgme_key_sig_t gpgme_signature;
diff -up gnupg-1.3.2/gnupg_keylistiterator.c.php54 gnupg-1.3.2/gnupg_keylistiterator.c
--- gnupg-1.3.2/gnupg_keylistiterator.c.php54 1970-01-01 10:13:08.000000000 +0100
+++ gnupg-1.3.2/gnupg_keylistiterator.c 2012-05-06 09:35:59.584823512 +0200
@@ -23,6 +23,7 @@
#include "php_ini.h"
#include "ext/standard/info.h"
#include "zend_interfaces.h"
+#include "zend_exceptions.h"
#include "php_gnupg.h"
#include "php_gnupg_keylistiterator.h"
@@ -148,7 +149,7 @@ PHP_METHOD(gnupg_keylistiterator,next){
gpgme_key_release(intern->gpgkey);
}
- if(intern->err = gpgme_op_keylist_next(intern->ctx, &intern->gpgkey)){
+ if((intern->err = gpgme_op_keylist_next(intern->ctx, &intern->gpgkey))){
gpgme_key_release(intern->gpgkey);
intern->gpgkey = NULL;
}
@@ -159,7 +160,7 @@ PHP_METHOD(gnupg_keylistiterator,rewind)
GNUPG_GET_ITERATOR();
if((intern->err = gpgme_op_keylist_start(intern->ctx, Z_STRVAL(intern->pattern), 0)) != GPG_ERR_NO_ERROR){
- zend_throw_exception(zend_exception_get_default(),gpg_strerror(intern->err),1 TSRMLS_CC);
+ zend_throw_exception(zend_exception_get_default(TSRMLS_C),gpg_strerror(intern->err),1 TSRMLS_CC);
}
if((intern->err = gpgme_op_keylist_next(intern->ctx, &intern->gpgkey))!=GPG_ERR_NO_ERROR){
RETURN_FALSE;
|