Changeset 2574 for TI12-security/branches
- Timestamp:
- 11/06/07 15:59:54 (14 years ago)
- Location:
- TI12-security/branches/Dependencies/m2crypto
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TI12-security/branches/Dependencies/m2crypto/SWIG/_m2crypto.py
r2172 r2574 1 # This file was created automatically by SWIG 1.3. 29.1 # This file was created automatically by SWIG 1.3.30. 2 2 # Don't modify this file, modify the SWIG interface instead. 3 3 # This file is compatible with both classic and new-style classes. … … 6 6 import new 7 7 new_instancemethod = new.instancemethod 8 try: 9 _swig_property = property 10 except NameError: 11 pass # Python < 2.2 doesn't have 'property'. 8 12 def _swig_setattr_nondynamic(self,class_type,name,value,static=1): 9 13 if (name == "thisown"): return self.this.own(value) -
TI12-security/branches/Dependencies/m2crypto/SWIG/_m2crypto_wrap.c
r2172 r2574 1 1 /* ---------------------------------------------------------------------------- 2 2 * This file was automatically generated by SWIG (http://www.swig.org). 3 * Version 1.3. 293 * Version 1.3.30 4 4 * 5 5 * This file is not intended to be easily readable and contains a number of … … 104 104 105 105 /* Deal with Microsoft's attempt at deprecating C standard runtime functions */ 106 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) 106 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) 107 107 # define _CRT_SECURE_NO_DEPRECATE 108 108 #endif … … 121 121 /* This should only be incremented when either the layout of swig_type_info changes, 122 122 or for whatever reason, the runtime changes incompatibly */ 123 #define SWIG_RUNTIME_VERSION " 2"123 #define SWIG_RUNTIME_VERSION "3" 124 124 125 125 /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ … … 698 698 699 699 700 /* Python.h has to appear first */701 #include <Python.h>702 700 703 701 /* Add PyOS_snprintf for old Pythons */ … … 778 776 return result; 779 777 } 778 #endif 779 780 /* Py_ssize_t for old Pythons */ 781 #if PY_VERSION_HEX < 0x02050000 782 typedef int Py_ssize_t; 780 783 #endif 781 784 … … 1173 1176 _SWIG_Py_None(void) 1174 1177 { 1175 PyObject *none = Py_BuildValue( "");1178 PyObject *none = Py_BuildValue((char*)""); 1176 1179 Py_DECREF(none); 1177 1180 return none; … … 2032 2035 2033 2036 /* here we get the method pointer for callbacks */ 2034 c har *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);2037 const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); 2035 2038 const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; 2036 2039 if (desc) { … … 2153 2156 } 2154 2157 #endif 2155 dict = PyObject_GetAttrString(inst, "__dict__");2158 dict = PyObject_GetAttrString(inst, (char*)"__dict__"); 2156 2159 PyDict_SetItem(dict, SWIG_This(), swig_this); 2157 2160 Py_DECREF(dict); … … 2294 2297 /* The python cached type query */ 2295 2298 SWIGRUNTIME PyObject * 2296 SWIG_Python_TypeCache( ) {2299 SWIG_Python_TypeCache(void) { 2297 2300 static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New(); 2298 2301 return cache; … … 2502 2505 #if (PY_VERSION_HEX <= 0x02000000) 2503 2506 # if !defined(SWIG_PYTHON_CLASSIC) 2504 # error "This python version requires to use swigwith the '-classic' option"2507 # error "This python version requires swig to be run with the '-classic' option" 2505 2508 # endif 2506 2509 #endif … … 2513 2516 #define SWIG_name "__m2crypto" 2514 2517 2515 #define SWIGVERSION 0x010329 2518 #define SWIGVERSION 0x010330 2519 #define SWIG_VERSION SWIGVERSION 2516 2520 2517 2521 … … 2536 2540 2537 2541 SWIGINTERN swig_type_info* 2538 SWIG_pchar_descriptor( )2542 SWIG_pchar_descriptor(void) 2539 2543 { 2540 2544 static int init = 0; … … 3180 3184 { 3181 3185 if (PyString_Check(obj)) { 3182 char *cstr; int len;3186 char *cstr; Py_ssize_t len; 3183 3187 PyString_AsStringAndSize(obj, &cstr, &len); 3184 3188 if (cptr) { … … 6334 6338 arg1 = (unsigned long)(val1); 6335 6339 result = (char *)ERR_lib_error_string(arg1); 6336 resultobj = SWIG_FromCharPtr( result);6340 resultobj = SWIG_FromCharPtr((const char *)result); 6337 6341 return resultobj; 6338 6342 fail: … … 6356 6360 arg1 = (unsigned long)(val1); 6357 6361 result = (char *)ERR_func_error_string(arg1); 6358 resultobj = SWIG_FromCharPtr( result);6362 resultobj = SWIG_FromCharPtr((const char *)result); 6359 6363 return resultobj; 6360 6364 fail: … … 6378 6382 arg1 = (unsigned long)(val1); 6379 6383 result = (char *)ERR_reason_error_string(arg1); 6380 resultobj = SWIG_FromCharPtr( result);6384 resultobj = SWIG_FromCharPtr((const char *)result); 6381 6385 return resultobj; 6382 6386 fail: … … 6602 6606 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_new_file" "', argument " "1"" of type '" "char const *""'"); 6603 6607 } 6604 arg1 = buf1;6608 arg1 = (char *)(buf1); 6605 6609 res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); 6606 6610 if (!SWIG_IsOK(res2)) { 6607 6611 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "bio_new_file" "', argument " "2"" of type '" "char const *""'"); 6608 6612 } 6609 arg2 = buf2;6613 arg2 = (char *)(buf2); 6610 6614 result = (BIO *)BIO_new_file((char const *)arg1,(char const *)arg2); 6611 6615 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO, 0 | 0 ); … … 7585 7589 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rand_load_file" "', argument " "1"" of type '" "char const *""'"); 7586 7590 } 7587 arg1 = buf1;7591 arg1 = (char *)(buf1); 7588 7592 ecode2 = SWIG_AsVal_long(obj1, &val2); 7589 7593 if (!SWIG_IsOK(ecode2)) { … … 7618 7622 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rand_save_file" "', argument " "1"" of type '" "char const *""'"); 7619 7623 } 7620 arg1 = buf1;7624 arg1 = (char *)(buf1); 7621 7625 result = (int)RAND_write_file((char const *)arg1); 7622 7626 { … … 8516 8520 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "pkey_assign" "', argument " "3"" of type '" "char *""'"); 8517 8521 } 8518 arg3 = buf3;8522 arg3 = (char *)(buf3); 8519 8523 { 8520 8524 if (!arg1) { … … 12381 12385 } 12382 12386 result = (char *)SSL_get_version((SSL const *)arg1); 12383 resultobj = SWIG_FromCharPtr( result);12387 resultobj = SWIG_FromCharPtr((const char *)result); 12384 12388 return resultobj; 12385 12389 fail: … … 12447 12451 } 12448 12452 result = (char *)SSL_state_string((SSL const *)arg1); 12449 resultobj = SWIG_FromCharPtr( result);12453 resultobj = SWIG_FromCharPtr((const char *)result); 12450 12454 return resultobj; 12451 12455 fail: … … 12474 12478 } 12475 12479 result = (char *)SSL_state_string_long((SSL const *)arg1); 12476 resultobj = SWIG_FromCharPtr( result);12480 resultobj = SWIG_FromCharPtr((const char *)result); 12477 12481 return resultobj; 12478 12482 fail: … … 12496 12500 arg1 = (int)(val1); 12497 12501 result = (char *)SSL_alert_type_string(arg1); 12498 resultobj = SWIG_FromCharPtr( result);12502 resultobj = SWIG_FromCharPtr((const char *)result); 12499 12503 return resultobj; 12500 12504 fail: … … 12518 12522 arg1 = (int)(val1); 12519 12523 result = (char *)SSL_alert_type_string_long(arg1); 12520 resultobj = SWIG_FromCharPtr( result);12524 resultobj = SWIG_FromCharPtr((const char *)result); 12521 12525 return resultobj; 12522 12526 fail: … … 12540 12544 arg1 = (int)(val1); 12541 12545 result = (char *)SSL_alert_desc_string(arg1); 12542 resultobj = SWIG_FromCharPtr( result);12546 resultobj = SWIG_FromCharPtr((const char *)result); 12543 12547 return resultobj; 12544 12548 fail: … … 12562 12566 arg1 = (int)(val1); 12563 12567 result = (char *)SSL_alert_desc_string_long(arg1); 12564 resultobj = SWIG_FromCharPtr( result);12568 resultobj = SWIG_FromCharPtr((const char *)result); 12565 12569 return resultobj; 12566 12570 fail: … … 12787 12791 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_set_cipher_list" "', argument " "2"" of type '" "char const *""'"); 12788 12792 } 12789 arg2 = buf2;12793 arg2 = (char *)(buf2); 12790 12794 { 12791 12795 if (!arg1) { … … 13629 13633 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_set_cipher_list" "', argument " "2"" of type '" "char const *""'"); 13630 13634 } 13631 arg2 = buf2;13635 arg2 = (char *)(buf2); 13632 13636 { 13633 13637 if (!arg1) { … … 13677 13681 } 13678 13682 result = (char *)SSL_get_cipher_list((SSL const *)arg1,arg2); 13679 resultobj = SWIG_FromCharPtr( result);13683 resultobj = SWIG_FromCharPtr((const char *)result); 13680 13684 return resultobj; 13681 13685 fail: … … 13704 13708 } 13705 13709 result = (char *)SSL_CIPHER_get_name((SSL_CIPHER const *)arg1); 13706 resultobj = SWIG_FromCharPtr( result);13710 resultobj = SWIG_FromCharPtr((const char *)result); 13707 13711 return resultobj; 13708 13712 fail: … … 13731 13735 } 13732 13736 result = (char *)SSL_CIPHER_get_version((SSL_CIPHER const *)arg1); 13733 resultobj = SWIG_FromCharPtr( result);13737 resultobj = SWIG_FromCharPtr((const char *)result); 13734 13738 return resultobj; 13735 13739 fail: … … 14047 14051 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_use_cert" "', argument " "2"" of type '" "char *""'"); 14048 14052 } 14049 arg2 = buf2;14053 arg2 = (char *)(buf2); 14050 14054 { 14051 14055 if (!arg1) { … … 14089 14093 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_use_cert_chain" "', argument " "2"" of type '" "char *""'"); 14090 14094 } 14091 arg2 = buf2;14095 arg2 = (char *)(buf2); 14092 14096 { 14093 14097 if (!arg1) { … … 14131 14135 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_use_privkey" "', argument " "2"" of type '" "char *""'"); 14132 14136 } 14133 arg2 = buf2;14137 arg2 = (char *)(buf2); 14134 14138 { 14135 14139 if (!arg1) { … … 14202 14206 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_set_client_CA_list_from_file" "', argument " "2"" of type '" "char const *""'"); 14203 14207 } 14204 arg2 = buf2;14208 arg2 = (char *)(buf2); 14205 14209 { 14206 14210 if (!arg1) { … … 14567 14571 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_load_verify_locations" "', argument " "2"" of type '" "char const *""'"); 14568 14572 } 14569 arg2 = buf2;14573 arg2 = (char *)(buf2); 14570 14574 res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); 14571 14575 if (!SWIG_IsOK(res3)) { 14572 14576 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ssl_ctx_load_verify_locations" "', argument " "3"" of type '" "char const *""'"); 14573 14577 } 14574 arg3 = buf3;14578 arg3 = (char *)(buf3); 14575 14579 { 14576 14580 if (!arg1) { … … 14767 14771 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_set_client_CA_list_from_file" "', argument " "2"" of type '" "char const *""'"); 14768 14772 } 14769 arg2 = buf2;14773 arg2 = (char *)(buf2); 14770 14774 { 14771 14775 if (!arg1) { … … 16219 16223 arg1 = (long)(val1); 16220 16224 result = (char *)X509_verify_cert_error_string(arg1); 16221 resultobj = SWIG_FromCharPtr( result);16225 resultobj = SWIG_FromCharPtr((const char *)result); 16222 16226 return resultobj; 16223 16227 fail: … … 18405 18409 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_name_add_entry_by_txt" "', argument " "2"" of type '" "char *""'"); 18406 18410 } 18407 arg2 = buf2;18411 arg2 = (char *)(buf2); 18408 18412 ecode3 = SWIG_AsVal_int(obj2, &val3); 18409 18413 if (!SWIG_IsOK(ecode3)) { … … 18415 18419 SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "x509_name_add_entry_by_txt" "', argument " "4"" of type '" "char *""'"); 18416 18420 } 18417 arg4 = buf4;18421 arg4 = (char *)(buf4); 18418 18422 ecode5 = SWIG_AsVal_int(obj4, &val5); 18419 18423 if (!SWIG_IsOK(ecode5)) { … … 18584 18588 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_store_load_locations" "', argument " "2"" of type '" "char const *""'"); 18585 18589 } 18586 arg2 = buf2;18590 arg2 = (char *)(buf2); 18587 18591 result = (int)x509_store_load_locations(arg1,(char const *)arg2); 18588 18592 { … … 18830 18834 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_name_entry_create_by_txt" "', argument " "2"" of type '" "char *""'"); 18831 18835 } 18832 arg2 = buf2;18836 arg2 = (char *)(buf2); 18833 18837 ecode3 = SWIG_AsVal_int(obj2, &val3); 18834 18838 if (!SWIG_IsOK(ecode3)) { … … 18928 18932 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "x509v3_ext_conf" "', argument " "3"" of type '" "char *""'"); 18929 18933 } 18930 arg3 = buf3;18934 arg3 = (char *)(buf3); 18931 18935 res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4); 18932 18936 if (!SWIG_IsOK(res4)) { 18933 18937 SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "x509v3_ext_conf" "', argument " "4"" of type '" "char *""'"); 18934 18938 } 18935 arg4 = buf4;18939 arg4 = (char *)(buf4); 18936 18940 result = (X509_EXTENSION *)x509v3_ext_conf(arg1,arg2,arg3,arg4); 18937 18941 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_EXTENSION, 0 | 0 ); … … 19251 19255 } 19252 19256 result = (char *)x509_name_oneline(arg1); 19253 resultobj = SWIG_FromCharPtr( result);19257 resultobj = SWIG_FromCharPtr((const char *)result); 19254 19258 { 19255 19259 if (result != NULL) … … 19321 19325 SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "asn1_object_create" "', argument " "4"" of type '" "char const *""'"); 19322 19326 } 19323 arg4 = buf4;19327 arg4 = (char *)(buf4); 19324 19328 res5 = SWIG_AsCharPtrAndSize(obj4, &buf5, NULL, &alloc5); 19325 19329 if (!SWIG_IsOK(res5)) { 19326 19330 SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "asn1_object_create" "', argument " "5"" of type '" "char const *""'"); 19327 19331 } 19328 arg5 = buf5;19332 arg5 = (char *)(buf5); 19329 19333 result = (ASN1_OBJECT *)ASN1_OBJECT_create(arg1,arg2,arg3,(char const *)arg4,(char const *)arg5); 19330 19334 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ASN1_OBJECT, 0 | 0 ); … … 19804 19808 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "asn1_utctime_set_string" "', argument " "2"" of type '" "char const *""'"); 19805 19809 } 19806 arg2 = buf2;19810 arg2 = (char *)(buf2); 19807 19811 { 19808 19812 if (!arg1) { … … 20914 20918 } 20915 20919 result = (char *)pkcs7_type_sn(arg1); 20916 resultobj = SWIG_FromCharPtr( result);20920 resultobj = SWIG_FromCharPtr((const char *)result); 20917 20921 return resultobj; 20918 20922 fail: … … 22550 22554 * 22551 22555 * The generated swig_type_info structures are assigned staticly to an initial 22552 * array. We just loop th ough that array, and handle each type individually.22556 * array. We just loop through that array, and handle each type individually. 22553 22557 * First we lookup if this type has been already loaded, and if so, use the 22554 22558 * loaded structure instead of the generated one. Then we have to fill in the … … 22588 22592 #endif 22589 22593 22594 22590 22595 SWIGRUNTIME void 22591 22596 SWIG_InitializeModule(void *clientdata) { 22592 22597 size_t i; 22593 swig_module_info *module_head ;22594 static int init_run = 0;22598 swig_module_info *module_head, *iter; 22599 int found; 22595 22600 22596 22601 clientdata = clientdata; 22597 22602 22598 if (init_run) return; 22599 init_run = 1; 22600 22601 /* Initialize the swig_module */ 22602 swig_module.type_initial = swig_type_initial; 22603 swig_module.cast_initial = swig_cast_initial; 22603 /* check to see if the circular list has been setup, if not, set it up */ 22604 if (swig_module.next==0) { 22605 /* Initialize the swig_module */ 22606 swig_module.type_initial = swig_type_initial; 22607 swig_module.cast_initial = swig_cast_initial; 22608 swig_module.next = &swig_module; 22609 } 22604 22610 22605 22611 /* Try and load any already created modules */ 22606 22612 module_head = SWIG_GetModule(clientdata); 22607 if (module_head) { 22613 if (!module_head) { 22614 /* This is the first module loaded for this interpreter */ 22615 /* so set the swig module into the interpreter */ 22616 SWIG_SetModule(clientdata, &swig_module); 22617 module_head = &swig_module; 22618 } else { 22619 /* the interpreter has loaded a SWIG module, but has it loaded this one? */ 22620 found=0; 22621 iter=module_head; 22622 do { 22623 if (iter==&swig_module) { 22624 found=1; 22625 break; 22626 } 22627 iter=iter->next; 22628 } while (iter!= module_head); 22629 22630 /* if the is found in the list, then all is done and we may leave */ 22631 if (found) return; 22632 /* otherwise we must add out module into the list */ 22608 22633 swig_module.next = module_head->next; 22609 22634 module_head->next = &swig_module; 22610 } else {22611 /* This is the first module loaded */22612 swig_module.next = &swig_module;22613 SWIG_SetModule(clientdata, &swig_module);22614 22635 } 22615 22636 … … 22924 22945 22925 22946 SWIGINTERN PyObject * 22926 SWIG_globals( ) {22947 SWIG_globals(void) { 22927 22948 static PyObject *_SWIG_globals = 0; 22928 22949 if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink(); … … 22969 22990 size_t i; 22970 22991 for (i = 0; methods[i].ml_name; ++i) { 22971 c har *c = methods[i].ml_doc;22992 const char *c = methods[i].ml_doc; 22972 22993 if (c && (c = strstr(c, "swig_ptr: "))) { 22973 22994 int j; 22974 22995 swig_const_info *ci = 0; 22975 c har *name = c + 10;22996 const char *name = c + 10; 22976 22997 for (j = 0; const_table[j].type; ++j) { 22977 22998 if (strncmp(const_table[j].name, name, -
TI12-security/branches/Dependencies/m2crypto/setup.py
r2250 r2574 11 11 12 12 import os, sys 13 from setuptools import setup 13 try: 14 from setuptools import setup 15 except ImportError: 16 from distutils.core import setup 17 14 18 from distutils.core import Extension 15 19 from distutils.command import build_ext … … 18 22 import optparse 19 23 20 # 24 21 25 class _M2CryptoBuildExt(build_ext.build_ext): 22 26 '''Specialization of build_ext to enable swig_opts to inherit any … … 27 31 def initialize_options(self): 28 32 '''Overload to enable custom openssl settings to be picked up''' 33 29 34 build_ext.build_ext.initialize_options(self) 30 35 … … 37 42 self.libraries = ['ssl', 'crypto'] 38 43 self.openssl = '/usr' 39 40 if sys.platform == 'cygwin':41 # Cygwin SHOULD work (there's code in distutils), but42 # if one first starts a Windows command prompt, then bash,43 # the distutils code does not seem to work. If you start44 # Cygwin directly, then it would work even without this change.45 # Someday distutils will be fixed and this won't be needed.46 self.library_dirs = [os.path.join(self.openssl, 'bin')]47 48 self.include_dirs = [os.path.join(os.getcwd(), 'SWIG')]49 44 50 45 … … 52 47 '''Overloaded build_ext implementation to append custom openssl 53 48 include file and library linking options''' 49 54 50 build_ext.build_ext.finalize_options(self) 55 51 … … 60 56 [opensslIncludeDir]] 61 57 62 self.include_dirs += [os.path.join(self.openssl, opensslIncludeDir)] 58 self.include_dirs += [os.path.join(self.openssl, opensslIncludeDir), 59 os.path.join(os.getcwd(), 'SWIG')] 60 61 if sys.platform == 'cygwin': 62 # Cygwin SHOULD work (there's code in distutils), but 63 # if one first starts a Windows command prompt, then bash, 64 # the distutils code does not seem to work. If you start 65 # Cygwin directly, then it would work even without this change. 66 # Someday distutils will be fixed and this won't be needed. 67 self.library_dirs += [os.path.join(self.openssl, 'bin')] 68 63 69 self.library_dirs += [os.path.join(self.openssl, opensslLibraryDir)] 64 70
Note: See TracChangeset
for help on using the changeset viewer.