[PYTHON-CRYPTO] m2crypto beta release

Matt Rodriguez MKRodriguez at LBL.GOV
Mon Jun 5 21:46:24 CEST 2006


I did some quick QA on the beta release of m2crypto, I found a few 
problems but overall I think the quality of the project has improved 
significantly over the last few months.

1. test_ssl.py is not working for me. The problem is the unittests for 
the SSLClientTestCase. All of these tests fail with a Connection refused 
error. I haven't looked into
this any deeper than this, because I'm just doing some preliminary 
checks right now. The rest of the unittests work flawlessly for me.

2. There still are a bunch of compiler warnings. These just need to go 
away before the final release. I've noticed that SWIG-1.3.24 generates 
code that
produces compiler warnings, these warnings go away in SWIG 1.3.25. I 
know I suggested that we should make 1.3.24 a requirement, but I would 
say that we should
probably just require 1.3.25. We should have a simple check in the 
setup.py script to ensure that we are using an appropriate version of 
SWIG. Below you'll find the
compiler warnings that we need to get rid of.

3. I ran valgrind on all of the unittest files except, test_ssl, 
test_ssl_win, and alltests, I found some leaks in test_x509, but I 
suspect that it is the issue is how the tests are
written, and not any underlying problem in the toolkit. Below you'll 
find the valgrind output

This is just a cursory ananlysis of the beta release.

Cheers,
Matt Rodriguez

Here is the valgrind output.

OK
==8740==
==8740== Syscall param write(buf) points to uninitialised byte(s)
==8740== at 0x1BAFE543: __write_nocancel (in /lib/tls/libc-2.3.5.so)
==8740== by 0x1BAAF1BE: _IO_file_write@@GLIBC_2.1 (in 
/lib/tls/libc-2.3.5.so)
==8740== by 0x1BAADBC4: new_do_write (in /lib/tls/libc-2.3.5.so)
==8740== by 0x1BAADCDE: _IO_do_write@@GLIBC_2.1 (in /lib/tls/libc-2.3.5.so)
==8740== by 0x1BAAD3E9: _IO_file_close_it@@GLIBC_2.1 (in 
/lib/tls/libc-2.3.5.so)
==8740== by 0x1BAA394A: fclose@@GLIBC_2.1 (in /lib/tls/libc-2.3.5.so)
==8740== by 0x1BFA4437: RAND_write_file (in /usr/lib/libcrypto.so.0.9.7)
==8740== by 0xDACCBB17: ???
==8740== Address 0x1C172000 is not stack'd, malloc'd or (recently) free'd
==8740==
==8740== Invalid read of size 4
==8740== at 0x1B96377F: PyObject_Free (in /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B95F911: PyDict_Clear (in /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B9AD005: PyImport_Cleanup (in /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B9B7F30: Py_Finalize (in /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B9BE12D: Py_Main (in /usr/lib/libpython2.4.so.1.0)
==8740== by 0x80485F9: main (in /usr/bin/python2.4)
==8740== Address 0x1BCC3010 is 0 bytes after a block of size 72 free'd
==8740== at 0x1B9003C3: free (in /usr/lib/valgrind/vgpreload_memcheck.so)
==8740== by 0x1BF51CEC: CRYPTO_free (in /usr/lib/libcrypto.so.0.9.7)
==8740==
==8740== Invalid read of size 4
==8740== at 0x1B96377F: PyObject_Free (in /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B9AC821: _PyImport_Fini (in /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B9B7F35: Py_Finalize (in /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B9BE12D: Py_Main (in /usr/lib/libpython2.4.so.1.0)
==8740== by 0x80485F9: main (in /usr/bin/python2.4)
==8740== Address 0x1BBBA010 is 1392 bytes inside a block of size 1536 free'd
==8740== at 0x1B9003C3: free (in /usr/lib/valgrind/vgpreload_memcheck.so)
==8740== by 0x1B9637A0: PyObject_Free (in /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B95CF67: (within /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B95CF3E: (within /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B9AC83A: _PyImport_Fini (in /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B9B7F35: Py_Finalize (in /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B9BE12D: Py_Main (in /usr/lib/libpython2.4.so.1.0)
==8740== by 0x80485F9: main (in /usr/bin/python2.4)
==8740==
==8740== Invalid read of size 4
==8740== at 0x1B96377F: PyObject_Free (in /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B9517B6: PyInt_Fini (in /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B9B7F84: Py_Finalize (in /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B9BE12D: Py_Main (in /usr/lib/libpython2.4.so.1.0)
==8740== by 0x80485F9: main (in /usr/bin/python2.4)
==8740== Address 0x1BBE8010 is not stack'd, malloc'd or (recently) free'd
==8740==
==8740== Invalid read of size 4
==8740== at 0x1B96377F: PyObject_Free (in /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B982EE4: _PyUnicodeUCS4_Fini (in 
/usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B9B7F8E: Py_Finalize (in /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B9BE12D: Py_Main (in /usr/lib/libpython2.4.so.1.0)
==8740== by 0x80485F9: main (in /usr/bin/python2.4)
==8740== Address 0x1BCCA010 is 944 bytes inside a block of size 965 free'd
==8740== at 0x1B9003C3: free (in /usr/lib/valgrind/vgpreload_memcheck.so)
==8740== by 0x1B9637A0: PyObject_Free (in /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B966EE6: (within /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B95CF3E: (within /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B93BD9E: (within /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B96F683: (within /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B93BDAC: (within /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B96F683: (within /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B93BDAC: (within /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B96F683: (within /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B95CF3E: (within /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B9B51ED: PyInterpreterState_Clear (in 
/usr/lib/libpython2.4.so.1.0)
==8740==
==8740== Invalid read of size 4
==8740== at 0x1B96377F: PyObject_Free (in /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B93097E: PyGrammar_RemoveAccelerators (in 
/usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B9B7F9C: Py_Finalize (in /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B9BE12D: Py_Main (in /usr/lib/libpython2.4.so.1.0)
==8740== by 0x80485F9: main (in /usr/bin/python2.4)
==8740== Address 0x1BBEB010 is 904 bytes inside a block of size 1536 free'd
==8740== at 0x1B9003C3: free (in /usr/lib/valgrind/vgpreload_memcheck.so)
==8740== by 0x1B9637A0: PyObject_Free (in /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B95CF67: (within /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B93BD9E: (within /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B96F683: (within /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B93BDAC: (within /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B95C8C8: (within /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B95CC0A: PyDict_SetItem (in /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B9607B9: _PyModule_Clear (in /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B9ACEDC: PyImport_Cleanup (in /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B9B7F30: Py_Finalize (in /usr/lib/libpython2.4.so.1.0)
==8740== by 0x1B9BE12D: Py_Main (in /usr/lib/libpython2.4.so.1.0)
==8740==
==8740== ERROR SUMMARY: 2951762 errors from 321 contexts (suppressed: 
117 from 5)
==8740== malloc/free: in use at exit: 1873288 bytes in 2319 blocks.
==8740== malloc/free: 17970 allocs, 15651 frees, 5371657 bytes allocated.
==8740== For counts of detected errors, rerun with: -v
==8740== searching for pointers to 2319 not-freed blocks.
==8740== checked 2413164 bytes.
==8740==
==8740==
==8740== 559 (44 direct, 515 indirect) bytes in 3 blocks are definitely 
lost in loss record 17 of 31
==8740== at 0x1B8FF8A6: malloc (in /usr/lib/valgrind/vgpreload_memcheck.so)
==8740== by 0x1BF514AB: (within /usr/lib/libcrypto.so.0.9.7)
==8740==
==8740== LEAK SUMMARY:
==8740== definitely lost: 44 bytes in 3 blocks.
==8740== indirectly lost: 515 bytes in 10 blocks.
==8740== possibly lost: 0 bytes in 0 blocks.
==8740== still reachable: 1872729 bytes in 2306 blocks.
==8740== suppressed: 0 bytes in 0 blocks.
==8740== Reachable blocks (those to which a pointer was found) are not 
shown.
==8740== To see them, rerun with: --show-reachable=yes

Compiler Warnings:

SWIG/_m2crypto_wrap.c: In function ‘rand_pseudo_bytes’:
SWIG/_m2crypto_wrap.c:3444: warning: pointer targets in passing argument 
1 of ‘PyString_FromStringAndSize’ differ in signedness
SWIG/_m2crypto_wrap.c: In function ‘hmac’:
SWIG/_m2crypto_wrap.c:3606: warning: pointer targets in passing argument 
7 of ‘HMAC’ differ in signedness
SWIG/_m2crypto_wrap.c: In function ‘bytes_to_key’:
SWIG/_m2crypto_wrap.c:3646: warning: pointer targets in passing argument 
1 of ‘PyString_FromStringAndSize’ differ in signedness
SWIG/_m2crypto_wrap.c: In function ‘sign_final’:
SWIG/_m2crypto_wrap.c:3718: warning: pointer targets in passing argument 
1 of ‘PyString_FromStringAndSize’ differ in signedness
SWIG/_m2crypto_wrap.c: In function ‘pkey_as_der’:
SWIG/_m2crypto_wrap.c:3784: warning: pointer targets in passing argument 
1 of ‘PyString_FromStringAndSize’ differ in signedness
SWIG/_m2crypto_wrap.c: In function ‘AES_crypt’:
SWIG/_m2crypto_wrap.c:3860: warning: pointer targets in passing argument 
1 of ‘PyString_FromStringAndSize’ differ in signedness
SWIG/_m2crypto_wrap.c: In function ‘dsa_sign_asn1’:
SWIG/_m2crypto_wrap.c:4673: warning: pointer targets in passing argument 
5 of ‘DSA_sign’ differ in signedness
SWIG/_m2crypto_wrap.c: In function ‘x509_name_set_by_nid’:
SWIG/_m2crypto_wrap.c:5316: warning: pointer targets in passing argument 
4 of ‘X509_NAME_add_entry_by_NID’ differ in signedness
SWIG/_m2crypto_wrap.c: In function ‘x509_name_add_entry_by_txt’:
SWIG/_m2crypto_wrap.c:5321: warning: pointer targets in passing argument 
2 of ‘X509_NAME_add_entry_by_txt’ differ in signedness
SWIG/_m2crypto_wrap.c:5321: warning: pointer targets in passing argument 
4 of ‘X509_NAME_add_entry_by_txt’ differ in signedness
SWIG/_m2crypto_wrap.c: In function ‘util_string_to_hex’:
SWIG/_m2crypto_wrap.c:5715: warning: pointer targets in passing argument 
1 of ‘PyString_FromStringAndSize’ differ in signedness



More information about the python-crypto mailing list