summaryrefslogtreecommitdiff
path: root/community-testing/python2-gnutls/gnutls3.patch
blob: 5110de2f217cad1b31cd3c18225d03548097b918 (plain)
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
diff -ru gnutls/library/functions.py gnutls.fixed/library/functions.py
--- gnutls/library/functions.py	2011-08-19 04:48:14.000000000 +0100
+++ gnutls.fixed/library/functions.py	2012-08-01 11:56:43.450975419 +0100
@@ -4,7 +4,7 @@
 import sys
 from ctypes import *
 
-from gnutls.library import libgnutls, libgnutls_extra
+from gnutls.library import libgnutls
 from gnutls.library.types import *
 
 
@@ -121,14 +121,6 @@
 gnutls_certificate_get_peers.argtypes = [gnutls_session_t, POINTER(c_uint)]
 gnutls_certificate_get_peers.restype = POINTER(gnutls_datum_t)
 
-gnutls_certificate_get_x509_cas = libgnutls.gnutls_certificate_get_x509_cas
-gnutls_certificate_get_x509_cas.argtypes = [gnutls_certificate_credentials_t, POINTER(POINTER(gnutls_x509_crt_t)), POINTER(c_uint)]
-gnutls_certificate_get_x509_cas.restype = None
-
-gnutls_certificate_get_x509_crls = libgnutls.gnutls_certificate_get_x509_crls
-gnutls_certificate_get_x509_crls.argtypes = [gnutls_certificate_credentials_t, POINTER(POINTER(gnutls_x509_crl_t)), POINTER(c_uint)]
-gnutls_certificate_get_x509_crls.restype = None
-
 gnutls_certificate_send_x509_rdn_sequence = libgnutls.gnutls_certificate_send_x509_rdn_sequence
 gnutls_certificate_send_x509_rdn_sequence.argtypes = [gnutls_session_t, c_int]
 gnutls_certificate_send_x509_rdn_sequence.restype = None
@@ -221,10 +213,6 @@
 gnutls_certificate_type_set_priority.argtypes = [gnutls_session_t, POINTER(c_int)]
 gnutls_certificate_type_set_priority.restype = c_int
 
-gnutls_certificate_verify_peers = libgnutls.gnutls_certificate_verify_peers
-gnutls_certificate_verify_peers.argtypes = [gnutls_session_t]
-gnutls_certificate_verify_peers.restype = c_int
-
 gnutls_certificate_verify_peers2 = libgnutls.gnutls_certificate_verify_peers2
 gnutls_certificate_verify_peers2.argtypes = [gnutls_session_t, POINTER(c_uint)]
 gnutls_certificate_verify_peers2.restype = c_int
@@ -393,10 +381,6 @@
 gnutls_error_to_alert.argtypes = [c_int, POINTER(c_int)]
 gnutls_error_to_alert.restype = c_int
 
-gnutls_extra_check_version = libgnutls_extra.gnutls_extra_check_version
-gnutls_extra_check_version.argtypes = [c_char_p]
-gnutls_extra_check_version.restype = c_char_p
-
 gnutls_fingerprint = libgnutls.gnutls_fingerprint
 gnutls_fingerprint.argtypes = [gnutls_digest_algorithm_t, POINTER(gnutls_datum_t), c_void_p, POINTER(size_t)]
 gnutls_fingerprint.restype = c_int
@@ -409,10 +393,6 @@
 gnutls_global_init.argtypes = []
 gnutls_global_init.restype = c_int
 
-gnutls_global_init_extra = libgnutls_extra.gnutls_global_init_extra
-gnutls_global_init_extra.argtypes = []
-gnutls_global_init_extra.restype = c_int
-
 gnutls_global_set_log_function = libgnutls.gnutls_global_set_log_function
 gnutls_global_set_log_function.argtypes = [gnutls_log_func]
 gnutls_global_set_log_function.restype = None
@@ -461,86 +441,6 @@
 gnutls_hex_encode.argtypes = [POINTER(gnutls_datum_t), c_char_p, POINTER(size_t)]
 gnutls_hex_encode.restype = c_int
 
-gnutls_ia_allocate_client_credentials = libgnutls_extra.gnutls_ia_allocate_client_credentials
-gnutls_ia_allocate_client_credentials.argtypes = [POINTER(gnutls_ia_client_credentials_t)]
-gnutls_ia_allocate_client_credentials.restype = c_int
-
-gnutls_ia_allocate_server_credentials = libgnutls_extra.gnutls_ia_allocate_server_credentials
-gnutls_ia_allocate_server_credentials.argtypes = [POINTER(gnutls_ia_server_credentials_t)]
-gnutls_ia_allocate_server_credentials.restype = c_int
-
-gnutls_ia_enable = libgnutls_extra.gnutls_ia_enable
-gnutls_ia_enable.argtypes = [gnutls_session_t, c_int]
-gnutls_ia_enable.restype = None
-
-gnutls_ia_endphase_send = libgnutls_extra.gnutls_ia_endphase_send
-gnutls_ia_endphase_send.argtypes = [gnutls_session_t, c_int]
-gnutls_ia_endphase_send.restype = c_int
-
-gnutls_ia_extract_inner_secret = libgnutls_extra.gnutls_ia_extract_inner_secret
-gnutls_ia_extract_inner_secret.argtypes = [gnutls_session_t, c_char_p]
-gnutls_ia_extract_inner_secret.restype = None
-
-gnutls_ia_free_client_credentials = libgnutls_extra.gnutls_ia_free_client_credentials
-gnutls_ia_free_client_credentials.argtypes = [gnutls_ia_client_credentials_t]
-gnutls_ia_free_client_credentials.restype = None
-
-gnutls_ia_free_server_credentials = libgnutls_extra.gnutls_ia_free_server_credentials
-gnutls_ia_free_server_credentials.argtypes = [gnutls_ia_server_credentials_t]
-gnutls_ia_free_server_credentials.restype = None
-
-gnutls_ia_generate_challenge = libgnutls_extra.gnutls_ia_generate_challenge
-gnutls_ia_generate_challenge.argtypes = [gnutls_session_t, size_t, c_char_p]
-gnutls_ia_generate_challenge.restype = c_int
-
-gnutls_ia_get_client_avp_ptr = libgnutls_extra.gnutls_ia_get_client_avp_ptr
-gnutls_ia_get_client_avp_ptr.argtypes = [gnutls_ia_client_credentials_t]
-gnutls_ia_get_client_avp_ptr.restype = c_void_p
-
-gnutls_ia_get_server_avp_ptr = libgnutls_extra.gnutls_ia_get_server_avp_ptr
-gnutls_ia_get_server_avp_ptr.argtypes = [gnutls_ia_server_credentials_t]
-gnutls_ia_get_server_avp_ptr.restype = c_void_p
-
-gnutls_ia_handshake = libgnutls_extra.gnutls_ia_handshake
-gnutls_ia_handshake.argtypes = [gnutls_session_t]
-gnutls_ia_handshake.restype = c_int
-
-gnutls_ia_handshake_p = libgnutls_extra.gnutls_ia_handshake_p
-gnutls_ia_handshake_p.argtypes = [gnutls_session_t]
-gnutls_ia_handshake_p.restype = c_int
-
-gnutls_ia_permute_inner_secret = libgnutls_extra.gnutls_ia_permute_inner_secret
-gnutls_ia_permute_inner_secret.argtypes = [gnutls_session_t, size_t, c_char_p]
-gnutls_ia_permute_inner_secret.restype = c_int
-
-gnutls_ia_recv = libgnutls_extra.gnutls_ia_recv
-gnutls_ia_recv.argtypes = [gnutls_session_t, c_char_p, size_t]
-gnutls_ia_recv.restype = ssize_t
-
-gnutls_ia_send = libgnutls_extra.gnutls_ia_send
-gnutls_ia_send.argtypes = [gnutls_session_t, c_char_p, size_t]
-gnutls_ia_send.restype = ssize_t
-
-gnutls_ia_set_client_avp_function = libgnutls_extra.gnutls_ia_set_client_avp_function
-gnutls_ia_set_client_avp_function.argtypes = [gnutls_ia_client_credentials_t, gnutls_ia_avp_func]
-gnutls_ia_set_client_avp_function.restype = None
-
-gnutls_ia_set_client_avp_ptr = libgnutls_extra.gnutls_ia_set_client_avp_ptr
-gnutls_ia_set_client_avp_ptr.argtypes = [gnutls_ia_client_credentials_t, c_void_p]
-gnutls_ia_set_client_avp_ptr.restype = None
-
-gnutls_ia_set_server_avp_function = libgnutls_extra.gnutls_ia_set_server_avp_function
-gnutls_ia_set_server_avp_function.argtypes = [gnutls_ia_server_credentials_t, gnutls_ia_avp_func]
-gnutls_ia_set_server_avp_function.restype = None
-
-gnutls_ia_set_server_avp_ptr = libgnutls_extra.gnutls_ia_set_server_avp_ptr
-gnutls_ia_set_server_avp_ptr.argtypes = [gnutls_ia_server_credentials_t, c_void_p]
-gnutls_ia_set_server_avp_ptr.restype = None
-
-gnutls_ia_verify_endphase = libgnutls_extra.gnutls_ia_verify_endphase
-gnutls_ia_verify_endphase.argtypes = [gnutls_session_t, c_char_p]
-gnutls_ia_verify_endphase.restype = c_int
-
 gnutls_init = libgnutls.gnutls_init
 gnutls_init.argtypes = [POINTER(gnutls_session_t), gnutls_connection_end_t]
 gnutls_init.restype = c_int
@@ -733,10 +633,6 @@
 gnutls_psk_free_server_credentials.argtypes = [gnutls_psk_server_credentials_t]
 gnutls_psk_free_server_credentials.restype = None
 
-gnutls_psk_netconf_derive_key = libgnutls.gnutls_psk_netconf_derive_key
-gnutls_psk_netconf_derive_key.argtypes = [c_char_p, c_char_p, c_char_p, POINTER(gnutls_datum_t)]
-gnutls_psk_netconf_derive_key.restype = c_int
-
 gnutls_psk_server_get_username = libgnutls.gnutls_psk_server_get_username
 gnutls_psk_server_get_username.argtypes = [gnutls_session_t]
 gnutls_psk_server_get_username.restype = c_char_p
@@ -857,10 +753,6 @@
 gnutls_session_enable_compatibility_mode.argtypes = [gnutls_session_t]
 gnutls_session_enable_compatibility_mode.restype = None
 
-gnutls_session_get_client_random = libgnutls.gnutls_session_get_client_random
-gnutls_session_get_client_random.argtypes = [gnutls_session_t]
-gnutls_session_get_client_random.restype = c_void_p
-
 gnutls_session_get_data = libgnutls.gnutls_session_get_data
 gnutls_session_get_data.argtypes = [gnutls_session_t, c_void_p, POINTER(size_t)]
 gnutls_session_get_data.restype = c_int
@@ -873,18 +765,10 @@
 gnutls_session_get_id.argtypes = [gnutls_session_t, c_void_p, POINTER(size_t)]
 gnutls_session_get_id.restype = c_int
 
-gnutls_session_get_master_secret = libgnutls.gnutls_session_get_master_secret
-gnutls_session_get_master_secret.argtypes = [gnutls_session_t]
-gnutls_session_get_master_secret.restype = c_void_p
-
 gnutls_session_get_ptr = libgnutls.gnutls_session_get_ptr
 gnutls_session_get_ptr.argtypes = [gnutls_session_t]
 gnutls_session_get_ptr.restype = c_void_p
 
-gnutls_session_get_server_random = libgnutls.gnutls_session_get_server_random
-gnutls_session_get_server_random.argtypes = [gnutls_session_t]
-gnutls_session_get_server_random.restype = c_void_p
-
 gnutls_session_is_resumed = libgnutls.gnutls_session_is_resumed
 gnutls_session_is_resumed.argtypes = [gnutls_session_t]
 gnutls_session_is_resumed.restype = c_int
@@ -905,10 +789,6 @@
 gnutls_set_default_priority.argtypes = [gnutls_session_t]
 gnutls_set_default_priority.restype = c_int
 
-gnutls_sign_algorithm_get_name = libgnutls.gnutls_sign_algorithm_get_name
-gnutls_sign_algorithm_get_name.argtypes = [gnutls_sign_algorithm_t]
-gnutls_sign_algorithm_get_name.restype = c_char_p
-
 gnutls_sign_callback_get = libgnutls.gnutls_sign_callback_get
 gnutls_sign_callback_get.argtypes = [gnutls_session_t, POINTER(c_void_p)]
 gnutls_sign_callback_get.restype = gnutls_sign_func
@@ -937,14 +817,6 @@
 gnutls_transport_set_errno.argtypes = [gnutls_session_t, c_int]
 gnutls_transport_set_errno.restype = None
 
-gnutls_transport_set_global_errno = libgnutls.gnutls_transport_set_global_errno
-gnutls_transport_set_global_errno.argtypes = [c_int]
-gnutls_transport_set_global_errno.restype = None
-
-gnutls_transport_set_lowat = libgnutls.gnutls_transport_set_lowat
-gnutls_transport_set_lowat.argtypes = [gnutls_session_t, c_int]
-gnutls_transport_set_lowat.restype = None
-
 gnutls_transport_set_ptr = libgnutls.gnutls_transport_set_ptr
 gnutls_transport_set_ptr.argtypes = [gnutls_session_t, gnutls_transport_ptr_t]
 gnutls_transport_set_ptr.restype = None
@@ -1501,10 +1373,6 @@
 gnutls_x509_privkey_sign_hash.argtypes = [gnutls_x509_privkey_t, POINTER(gnutls_datum_t), POINTER(gnutls_datum_t)]
 gnutls_x509_privkey_sign_hash.restype = c_int
 
-gnutls_x509_privkey_verify_data = libgnutls.gnutls_x509_privkey_verify_data
-gnutls_x509_privkey_verify_data.argtypes = [gnutls_x509_privkey_t, c_uint, POINTER(gnutls_datum_t), POINTER(gnutls_datum_t)]
-gnutls_x509_privkey_verify_data.restype = c_int
-
 gnutls_x509_rdn_get = libgnutls.gnutls_x509_rdn_get
 gnutls_x509_rdn_get.argtypes = [POINTER(gnutls_datum_t), c_char_p, POINTER(size_t)]
 gnutls_x509_rdn_get.restype = c_int
diff -ru gnutls/library/__init__.py gnutls.fixed/library/__init__.py
--- gnutls/library/__init__.py	2011-11-11 17:23:49.000000000 +0000
+++ gnutls.fixed/library/__init__.py	2012-08-01 11:57:42.284290997 +0100
@@ -53,6 +53,9 @@
     else:
         raise RuntimeError('cannot find lib%s on this system' % name)
 
+def do_nothing(*args, **kwargs):
+    pass
+
 
 def initialize_gcrypt():
     from ctypes import c_void_p
@@ -104,7 +107,7 @@
         libgcrypt = load_library(name='gcrypt', version=11)
         gcry_control = libgcrypt.gcry_control
     else:
-        gcry_control = libgnutls.gcry_control
+        gcry_control = do_nothing
 
     gcry_control(GCRYCTL_SET_THREAD_CBS, c_void_p(gcrypt_thread_callbacks_ptr))
     if system == 'cygwin':
@@ -117,12 +120,10 @@
 
 
 
-libgnutls = load_library(name='gnutls', version=26)
-libgnutls_extra = load_library(name='gnutls-extra', version=26)
+libgnutls = load_library(name='gnutls', version=28)
 
 initialize_gcrypt()
 libgnutls.gnutls_global_init()
-libgnutls_extra.gnutls_global_init_extra()
 
 
 from gnutls.library import constants
@@ -136,9 +137,6 @@
 if functions.gnutls_check_version(__need_version__) is None:
     version = functions.gnutls_check_version(None)
     raise RuntimeError("Found GNUTLS library version %s, but at least version %s is required" % (version, __need_version__))
-if functions.gnutls_extra_check_version(__need_version__) is None:
-    version = functions.gnutls_extra_check_version(None)
-    raise RuntimeError("Found GNUTLS extra library version %s, but at least version %s is required" % (version, __need_version__))
 
 
 del get_system_name, library_locations, load_library, initialize_gcrypt