[pypy-svn] r77909 - in pypy/branch/fast-forward/pypy: module/_hashlib rlib

afa at codespeak.net afa at codespeak.net
Thu Oct 14 12:04:09 CEST 2010


Author: afa
Date: Thu Oct 14 12:04:07 2010
New Revision: 77909

Modified:
   pypy/branch/fast-forward/pypy/module/_hashlib/__init__.py
   pypy/branch/fast-forward/pypy/rlib/ropenssl.py
Log:
"OpenSSL_add_all_digests()" is neeeded to call other hashlib functions,
difficult to test because CPython does it already in the same process.


Modified: pypy/branch/fast-forward/pypy/module/_hashlib/__init__.py
==============================================================================
--- pypy/branch/fast-forward/pypy/module/_hashlib/__init__.py	(original)
+++ pypy/branch/fast-forward/pypy/module/_hashlib/__init__.py	Thu Oct 14 12:04:07 2010
@@ -13,3 +13,7 @@
 
     for name in algorithms:
         interpleveldefs[name] = 'interp_hashlib.new_%s' % (name,)
+
+    def startup(self, space):
+        from pypy.rlib.ropenssl import init_digests
+        init_digests()

Modified: pypy/branch/fast-forward/pypy/rlib/ropenssl.py
==============================================================================
--- pypy/branch/fast-forward/pypy/rlib/ropenssl.py	(original)
+++ pypy/branch/fast-forward/pypy/rlib/ropenssl.py	Thu Oct 14 12:04:07 2010
@@ -128,6 +128,8 @@
 EVP_MD_CTX = rffi.COpaquePtr('EVP_MD_CTX', compilation_info=eci)
 EVP_MD     = rffi.COpaquePtr('EVP_MD')
 
+OpenSSL_add_all_digests = external(
+    'OpenSSL_add_all_digests', [], lltype.Void)
 EVP_get_digestbyname = external(
     'EVP_get_digestbyname',
     [rffi.CCHARP], EVP_MD)
@@ -149,3 +151,5 @@
     libssl_SSL_load_error_strings()
     libssl_SSL_library_init()
 
+def init_digests():
+    OpenSSL_add_all_digests()



More information about the Pypy-commit mailing list