Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 446016
Collapse All | Expand All

(-)gnutls/library/functions.py (-133 / +1 lines)
Lines 4-10 Link Here
4
import sys
4
import sys
5
from ctypes import *
5
from ctypes import *
6
6
7
from gnutls.library import libgnutls, libgnutls_extra
7
from gnutls.library import libgnutls
8
from gnutls.library.types import *
8
from gnutls.library.types import *
9
9
10
10
Lines 121-134 Link Here
121
gnutls_certificate_get_peers.argtypes = [gnutls_session_t, POINTER(c_uint)]
121
gnutls_certificate_get_peers.argtypes = [gnutls_session_t, POINTER(c_uint)]
122
gnutls_certificate_get_peers.restype = POINTER(gnutls_datum_t)
122
gnutls_certificate_get_peers.restype = POINTER(gnutls_datum_t)
123
123
124
gnutls_certificate_get_x509_cas = libgnutls.gnutls_certificate_get_x509_cas
125
gnutls_certificate_get_x509_cas.argtypes = [gnutls_certificate_credentials_t, POINTER(POINTER(gnutls_x509_crt_t)), POINTER(c_uint)]
126
gnutls_certificate_get_x509_cas.restype = None
127
128
gnutls_certificate_get_x509_crls = libgnutls.gnutls_certificate_get_x509_crls
129
gnutls_certificate_get_x509_crls.argtypes = [gnutls_certificate_credentials_t, POINTER(POINTER(gnutls_x509_crl_t)), POINTER(c_uint)]
130
gnutls_certificate_get_x509_crls.restype = None
131
132
gnutls_certificate_send_x509_rdn_sequence = libgnutls.gnutls_certificate_send_x509_rdn_sequence
124
gnutls_certificate_send_x509_rdn_sequence = libgnutls.gnutls_certificate_send_x509_rdn_sequence
133
gnutls_certificate_send_x509_rdn_sequence.argtypes = [gnutls_session_t, c_int]
125
gnutls_certificate_send_x509_rdn_sequence.argtypes = [gnutls_session_t, c_int]
134
gnutls_certificate_send_x509_rdn_sequence.restype = None
126
gnutls_certificate_send_x509_rdn_sequence.restype = None
Lines 221-230 Link Here
221
gnutls_certificate_type_set_priority.argtypes = [gnutls_session_t, POINTER(c_int)]
213
gnutls_certificate_type_set_priority.argtypes = [gnutls_session_t, POINTER(c_int)]
222
gnutls_certificate_type_set_priority.restype = c_int
214
gnutls_certificate_type_set_priority.restype = c_int
223
215
224
gnutls_certificate_verify_peers = libgnutls.gnutls_certificate_verify_peers
225
gnutls_certificate_verify_peers.argtypes = [gnutls_session_t]
226
gnutls_certificate_verify_peers.restype = c_int
227
228
gnutls_certificate_verify_peers2 = libgnutls.gnutls_certificate_verify_peers2
216
gnutls_certificate_verify_peers2 = libgnutls.gnutls_certificate_verify_peers2
229
gnutls_certificate_verify_peers2.argtypes = [gnutls_session_t, POINTER(c_uint)]
217
gnutls_certificate_verify_peers2.argtypes = [gnutls_session_t, POINTER(c_uint)]
230
gnutls_certificate_verify_peers2.restype = c_int
218
gnutls_certificate_verify_peers2.restype = c_int
Lines 393-402 Link Here
393
gnutls_error_to_alert.argtypes = [c_int, POINTER(c_int)]
381
gnutls_error_to_alert.argtypes = [c_int, POINTER(c_int)]
394
gnutls_error_to_alert.restype = c_int
382
gnutls_error_to_alert.restype = c_int
395
383
396
gnutls_extra_check_version = libgnutls_extra.gnutls_extra_check_version
397
gnutls_extra_check_version.argtypes = [c_char_p]
398
gnutls_extra_check_version.restype = c_char_p
399
400
gnutls_fingerprint = libgnutls.gnutls_fingerprint
384
gnutls_fingerprint = libgnutls.gnutls_fingerprint
401
gnutls_fingerprint.argtypes = [gnutls_digest_algorithm_t, POINTER(gnutls_datum_t), c_void_p, POINTER(size_t)]
385
gnutls_fingerprint.argtypes = [gnutls_digest_algorithm_t, POINTER(gnutls_datum_t), c_void_p, POINTER(size_t)]
402
gnutls_fingerprint.restype = c_int
386
gnutls_fingerprint.restype = c_int
Lines 409-418 Link Here
409
gnutls_global_init.argtypes = []
393
gnutls_global_init.argtypes = []
410
gnutls_global_init.restype = c_int
394
gnutls_global_init.restype = c_int
411
395
412
gnutls_global_init_extra = libgnutls_extra.gnutls_global_init_extra
413
gnutls_global_init_extra.argtypes = []
414
gnutls_global_init_extra.restype = c_int
415
416
gnutls_global_set_log_function = libgnutls.gnutls_global_set_log_function
396
gnutls_global_set_log_function = libgnutls.gnutls_global_set_log_function
417
gnutls_global_set_log_function.argtypes = [gnutls_log_func]
397
gnutls_global_set_log_function.argtypes = [gnutls_log_func]
418
gnutls_global_set_log_function.restype = None
398
gnutls_global_set_log_function.restype = None
Lines 461-546 Link Here
461
gnutls_hex_encode.argtypes = [POINTER(gnutls_datum_t), c_char_p, POINTER(size_t)]
441
gnutls_hex_encode.argtypes = [POINTER(gnutls_datum_t), c_char_p, POINTER(size_t)]
462
gnutls_hex_encode.restype = c_int
442
gnutls_hex_encode.restype = c_int
463
443
464
gnutls_ia_allocate_client_credentials = libgnutls_extra.gnutls_ia_allocate_client_credentials
465
gnutls_ia_allocate_client_credentials.argtypes = [POINTER(gnutls_ia_client_credentials_t)]
466
gnutls_ia_allocate_client_credentials.restype = c_int
467
468
gnutls_ia_allocate_server_credentials = libgnutls_extra.gnutls_ia_allocate_server_credentials
469
gnutls_ia_allocate_server_credentials.argtypes = [POINTER(gnutls_ia_server_credentials_t)]
470
gnutls_ia_allocate_server_credentials.restype = c_int
471
472
gnutls_ia_enable = libgnutls_extra.gnutls_ia_enable
473
gnutls_ia_enable.argtypes = [gnutls_session_t, c_int]
474
gnutls_ia_enable.restype = None
475
476
gnutls_ia_endphase_send = libgnutls_extra.gnutls_ia_endphase_send
477
gnutls_ia_endphase_send.argtypes = [gnutls_session_t, c_int]
478
gnutls_ia_endphase_send.restype = c_int
479
480
gnutls_ia_extract_inner_secret = libgnutls_extra.gnutls_ia_extract_inner_secret
481
gnutls_ia_extract_inner_secret.argtypes = [gnutls_session_t, c_char_p]
482
gnutls_ia_extract_inner_secret.restype = None
483
484
gnutls_ia_free_client_credentials = libgnutls_extra.gnutls_ia_free_client_credentials
485
gnutls_ia_free_client_credentials.argtypes = [gnutls_ia_client_credentials_t]
486
gnutls_ia_free_client_credentials.restype = None
487
488
gnutls_ia_free_server_credentials = libgnutls_extra.gnutls_ia_free_server_credentials
489
gnutls_ia_free_server_credentials.argtypes = [gnutls_ia_server_credentials_t]
490
gnutls_ia_free_server_credentials.restype = None
491
492
gnutls_ia_generate_challenge = libgnutls_extra.gnutls_ia_generate_challenge
493
gnutls_ia_generate_challenge.argtypes = [gnutls_session_t, size_t, c_char_p]
494
gnutls_ia_generate_challenge.restype = c_int
495
496
gnutls_ia_get_client_avp_ptr = libgnutls_extra.gnutls_ia_get_client_avp_ptr
497
gnutls_ia_get_client_avp_ptr.argtypes = [gnutls_ia_client_credentials_t]
498
gnutls_ia_get_client_avp_ptr.restype = c_void_p
499
500
gnutls_ia_get_server_avp_ptr = libgnutls_extra.gnutls_ia_get_server_avp_ptr
501
gnutls_ia_get_server_avp_ptr.argtypes = [gnutls_ia_server_credentials_t]
502
gnutls_ia_get_server_avp_ptr.restype = c_void_p
503
504
gnutls_ia_handshake = libgnutls_extra.gnutls_ia_handshake
505
gnutls_ia_handshake.argtypes = [gnutls_session_t]
506
gnutls_ia_handshake.restype = c_int
507
508
gnutls_ia_handshake_p = libgnutls_extra.gnutls_ia_handshake_p
509
gnutls_ia_handshake_p.argtypes = [gnutls_session_t]
510
gnutls_ia_handshake_p.restype = c_int
511
512
gnutls_ia_permute_inner_secret = libgnutls_extra.gnutls_ia_permute_inner_secret
513
gnutls_ia_permute_inner_secret.argtypes = [gnutls_session_t, size_t, c_char_p]
514
gnutls_ia_permute_inner_secret.restype = c_int
515
516
gnutls_ia_recv = libgnutls_extra.gnutls_ia_recv
517
gnutls_ia_recv.argtypes = [gnutls_session_t, c_char_p, size_t]
518
gnutls_ia_recv.restype = ssize_t
519
520
gnutls_ia_send = libgnutls_extra.gnutls_ia_send
521
gnutls_ia_send.argtypes = [gnutls_session_t, c_char_p, size_t]
522
gnutls_ia_send.restype = ssize_t
523
524
gnutls_ia_set_client_avp_function = libgnutls_extra.gnutls_ia_set_client_avp_function
525
gnutls_ia_set_client_avp_function.argtypes = [gnutls_ia_client_credentials_t, gnutls_ia_avp_func]
526
gnutls_ia_set_client_avp_function.restype = None
527
528
gnutls_ia_set_client_avp_ptr = libgnutls_extra.gnutls_ia_set_client_avp_ptr
529
gnutls_ia_set_client_avp_ptr.argtypes = [gnutls_ia_client_credentials_t, c_void_p]
530
gnutls_ia_set_client_avp_ptr.restype = None
531
532
gnutls_ia_set_server_avp_function = libgnutls_extra.gnutls_ia_set_server_avp_function
533
gnutls_ia_set_server_avp_function.argtypes = [gnutls_ia_server_credentials_t, gnutls_ia_avp_func]
534
gnutls_ia_set_server_avp_function.restype = None
535
536
gnutls_ia_set_server_avp_ptr = libgnutls_extra.gnutls_ia_set_server_avp_ptr
537
gnutls_ia_set_server_avp_ptr.argtypes = [gnutls_ia_server_credentials_t, c_void_p]
538
gnutls_ia_set_server_avp_ptr.restype = None
539
540
gnutls_ia_verify_endphase = libgnutls_extra.gnutls_ia_verify_endphase
541
gnutls_ia_verify_endphase.argtypes = [gnutls_session_t, c_char_p]
542
gnutls_ia_verify_endphase.restype = c_int
543
544
gnutls_init = libgnutls.gnutls_init
444
gnutls_init = libgnutls.gnutls_init
545
gnutls_init.argtypes = [POINTER(gnutls_session_t), gnutls_connection_end_t]
445
gnutls_init.argtypes = [POINTER(gnutls_session_t), gnutls_connection_end_t]
546
gnutls_init.restype = c_int
446
gnutls_init.restype = c_int
Lines 733-742 Link Here
733
gnutls_psk_free_server_credentials.argtypes = [gnutls_psk_server_credentials_t]
633
gnutls_psk_free_server_credentials.argtypes = [gnutls_psk_server_credentials_t]
734
gnutls_psk_free_server_credentials.restype = None
634
gnutls_psk_free_server_credentials.restype = None
735
635
736
gnutls_psk_netconf_derive_key = libgnutls.gnutls_psk_netconf_derive_key
737
gnutls_psk_netconf_derive_key.argtypes = [c_char_p, c_char_p, c_char_p, POINTER(gnutls_datum_t)]
738
gnutls_psk_netconf_derive_key.restype = c_int
739
740
gnutls_psk_server_get_username = libgnutls.gnutls_psk_server_get_username
636
gnutls_psk_server_get_username = libgnutls.gnutls_psk_server_get_username
741
gnutls_psk_server_get_username.argtypes = [gnutls_session_t]
637
gnutls_psk_server_get_username.argtypes = [gnutls_session_t]
742
gnutls_psk_server_get_username.restype = c_char_p
638
gnutls_psk_server_get_username.restype = c_char_p
Lines 857-866 Link Here
857
gnutls_session_enable_compatibility_mode.argtypes = [gnutls_session_t]
753
gnutls_session_enable_compatibility_mode.argtypes = [gnutls_session_t]
858
gnutls_session_enable_compatibility_mode.restype = None
754
gnutls_session_enable_compatibility_mode.restype = None
859
755
860
gnutls_session_get_client_random = libgnutls.gnutls_session_get_client_random
861
gnutls_session_get_client_random.argtypes = [gnutls_session_t]
862
gnutls_session_get_client_random.restype = c_void_p
863
864
gnutls_session_get_data = libgnutls.gnutls_session_get_data
756
gnutls_session_get_data = libgnutls.gnutls_session_get_data
865
gnutls_session_get_data.argtypes = [gnutls_session_t, c_void_p, POINTER(size_t)]
757
gnutls_session_get_data.argtypes = [gnutls_session_t, c_void_p, POINTER(size_t)]
866
gnutls_session_get_data.restype = c_int
758
gnutls_session_get_data.restype = c_int
Lines 873-890 Link Here
873
gnutls_session_get_id.argtypes = [gnutls_session_t, c_void_p, POINTER(size_t)]
765
gnutls_session_get_id.argtypes = [gnutls_session_t, c_void_p, POINTER(size_t)]
874
gnutls_session_get_id.restype = c_int
766
gnutls_session_get_id.restype = c_int
875
767
876
gnutls_session_get_master_secret = libgnutls.gnutls_session_get_master_secret
877
gnutls_session_get_master_secret.argtypes = [gnutls_session_t]
878
gnutls_session_get_master_secret.restype = c_void_p
879
880
gnutls_session_get_ptr = libgnutls.gnutls_session_get_ptr
768
gnutls_session_get_ptr = libgnutls.gnutls_session_get_ptr
881
gnutls_session_get_ptr.argtypes = [gnutls_session_t]
769
gnutls_session_get_ptr.argtypes = [gnutls_session_t]
882
gnutls_session_get_ptr.restype = c_void_p
770
gnutls_session_get_ptr.restype = c_void_p
883
771
884
gnutls_session_get_server_random = libgnutls.gnutls_session_get_server_random
885
gnutls_session_get_server_random.argtypes = [gnutls_session_t]
886
gnutls_session_get_server_random.restype = c_void_p
887
888
gnutls_session_is_resumed = libgnutls.gnutls_session_is_resumed
772
gnutls_session_is_resumed = libgnutls.gnutls_session_is_resumed
889
gnutls_session_is_resumed.argtypes = [gnutls_session_t]
773
gnutls_session_is_resumed.argtypes = [gnutls_session_t]
890
gnutls_session_is_resumed.restype = c_int
774
gnutls_session_is_resumed.restype = c_int
Lines 905-914 Link Here
905
gnutls_set_default_priority.argtypes = [gnutls_session_t]
789
gnutls_set_default_priority.argtypes = [gnutls_session_t]
906
gnutls_set_default_priority.restype = c_int
790
gnutls_set_default_priority.restype = c_int
907
791
908
gnutls_sign_algorithm_get_name = libgnutls.gnutls_sign_algorithm_get_name
909
gnutls_sign_algorithm_get_name.argtypes = [gnutls_sign_algorithm_t]
910
gnutls_sign_algorithm_get_name.restype = c_char_p
911
912
gnutls_sign_callback_get = libgnutls.gnutls_sign_callback_get
792
gnutls_sign_callback_get = libgnutls.gnutls_sign_callback_get
913
gnutls_sign_callback_get.argtypes = [gnutls_session_t, POINTER(c_void_p)]
793
gnutls_sign_callback_get.argtypes = [gnutls_session_t, POINTER(c_void_p)]
914
gnutls_sign_callback_get.restype = gnutls_sign_func
794
gnutls_sign_callback_get.restype = gnutls_sign_func
Lines 937-950 Link Here
937
gnutls_transport_set_errno.argtypes = [gnutls_session_t, c_int]
817
gnutls_transport_set_errno.argtypes = [gnutls_session_t, c_int]
938
gnutls_transport_set_errno.restype = None
818
gnutls_transport_set_errno.restype = None
939
819
940
gnutls_transport_set_global_errno = libgnutls.gnutls_transport_set_global_errno
941
gnutls_transport_set_global_errno.argtypes = [c_int]
942
gnutls_transport_set_global_errno.restype = None
943
944
gnutls_transport_set_lowat = libgnutls.gnutls_transport_set_lowat
945
gnutls_transport_set_lowat.argtypes = [gnutls_session_t, c_int]
946
gnutls_transport_set_lowat.restype = None
947
948
gnutls_transport_set_ptr = libgnutls.gnutls_transport_set_ptr
820
gnutls_transport_set_ptr = libgnutls.gnutls_transport_set_ptr
949
gnutls_transport_set_ptr.argtypes = [gnutls_session_t, gnutls_transport_ptr_t]
821
gnutls_transport_set_ptr.argtypes = [gnutls_session_t, gnutls_transport_ptr_t]
950
gnutls_transport_set_ptr.restype = None
822
gnutls_transport_set_ptr.restype = None
Lines 1501-1510 Link Here
1501
gnutls_x509_privkey_sign_hash.argtypes = [gnutls_x509_privkey_t, POINTER(gnutls_datum_t), POINTER(gnutls_datum_t)]
1373
gnutls_x509_privkey_sign_hash.argtypes = [gnutls_x509_privkey_t, POINTER(gnutls_datum_t), POINTER(gnutls_datum_t)]
1502
gnutls_x509_privkey_sign_hash.restype = c_int
1374
gnutls_x509_privkey_sign_hash.restype = c_int
1503
1375
1504
gnutls_x509_privkey_verify_data = libgnutls.gnutls_x509_privkey_verify_data
1505
gnutls_x509_privkey_verify_data.argtypes = [gnutls_x509_privkey_t, c_uint, POINTER(gnutls_datum_t), POINTER(gnutls_datum_t)]
1506
gnutls_x509_privkey_verify_data.restype = c_int
1507
1508
gnutls_x509_rdn_get = libgnutls.gnutls_x509_rdn_get
1376
gnutls_x509_rdn_get = libgnutls.gnutls_x509_rdn_get
1509
gnutls_x509_rdn_get.argtypes = [POINTER(gnutls_datum_t), c_char_p, POINTER(size_t)]
1377
gnutls_x509_rdn_get.argtypes = [POINTER(gnutls_datum_t), c_char_p, POINTER(size_t)]
1510
gnutls_x509_rdn_get.restype = c_int
1378
gnutls_x509_rdn_get.restype = c_int
(-)gnutls/library/__init__.py (-7 / +5 lines)
Lines 53-58 Link Here
53
    else:
53
    else:
54
        raise RuntimeError('cannot find lib%s on this system' % name)
54
        raise RuntimeError('cannot find lib%s on this system' % name)
55
55
56
def do_nothing(*args, **kwargs):
57
    pass
58
56
59
57
def initialize_gcrypt():
60
def initialize_gcrypt():
58
    from ctypes import c_void_p
61
    from ctypes import c_void_p
Lines 104-110 Link Here
104
        libgcrypt = load_library(name='gcrypt', version=11)
107
        libgcrypt = load_library(name='gcrypt', version=11)
105
        gcry_control = libgcrypt.gcry_control
108
        gcry_control = libgcrypt.gcry_control
106
    else:
109
    else:
107
        gcry_control = libgnutls.gcry_control
110
        gcry_control = do_nothing
108
111
109
    gcry_control(GCRYCTL_SET_THREAD_CBS, c_void_p(gcrypt_thread_callbacks_ptr))
112
    gcry_control(GCRYCTL_SET_THREAD_CBS, c_void_p(gcrypt_thread_callbacks_ptr))
110
    if system == 'cygwin':
113
    if system == 'cygwin':
Lines 117-128 Link Here
117
120
118
121
119
122
120
libgnutls = load_library(name='gnutls', version=26)
123
libgnutls = load_library(name='gnutls', version=28)
121
libgnutls_extra = load_library(name='gnutls-extra', version=26)
122
124
123
initialize_gcrypt()
125
initialize_gcrypt()
124
libgnutls.gnutls_global_init()
126
libgnutls.gnutls_global_init()
125
libgnutls_extra.gnutls_global_init_extra()
126
127
127
128
128
from gnutls.library import constants
129
from gnutls.library import constants
Lines 136-144 Link Here
136
if functions.gnutls_check_version(__need_version__) is None:
137
if functions.gnutls_check_version(__need_version__) is None:
137
    version = functions.gnutls_check_version(None)
138
    version = functions.gnutls_check_version(None)
138
    raise RuntimeError("Found GNUTLS library version %s, but at least version %s is required" % (version, __need_version__))
139
    raise RuntimeError("Found GNUTLS library version %s, but at least version %s is required" % (version, __need_version__))
139
if functions.gnutls_extra_check_version(__need_version__) is None:
140
    version = functions.gnutls_extra_check_version(None)
141
    raise RuntimeError("Found GNUTLS extra library version %s, but at least version %s is required" % (version, __need_version__))
142
140
143
141
144
del get_system_name, library_locations, load_library, initialize_gcrypt
142
del get_system_name, library_locations, load_library, initialize_gcrypt

Return to bug 446016