ALT Linux Bugzilla
– Attachment 4421 Details for
Bug 23581
постоянные варнинги касательно md5 и sha
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
лекарство от ругани про MD5 и SHA1
pycrypto-hashlib.patch (text/plain), 1.99 KB, created by
dek
on 2010-06-03 02:21:37 MSD
(
hide
)
Description:
лекарство от ругани про MD5 и SHA1
Filename:
MIME Type:
Creator:
dek
Created:
2010-06-03 02:21:37 MSD
Size:
1.99 KB
patch
obsolete
>diff -uNr pycrypto-2.0.old/Hash/MD5.py pycrypto-2.0/Hash/MD5.py >--- pycrypto-2.0.old/Hash/MD5.py 2010-06-01 11:19:59.000000000 +0300 >+++ pycrypto-2.0/Hash/MD5.py 2010-06-01 11:35:45.000000000 +0300 >@@ -1,13 +1,21 @@ > > # Just use the MD5 module from the Python standard library >+# http://gitweb.pycrypto.org/?p=crypto/pycrypto-2.x.git;a=commitdiff;h=d2311689910240e425741a546576129f4c9735e2 >+__revision__ = "$Id" > >-__revision__ = "$Id: MD5.py,v 1.4 2002/07/11 14:31:19 akuchling Exp $" >+__all__ = ['new', 'digest_size'] > >-from md5 import * >- >-import md5 >-if hasattr(md5, 'digestsize'): >- digest_size = digestsize >- del digestsize >-del md5 >+try: >+ # The md5 module is deprecated in Python 2.6, so use hashlib when possible. >+ import hashlib >+ def new(data=""): >+ return hashlib.md5(data) >+ digest_size = new().digest_size >+except ImportError: >+ from md5 import * > >+ import md5 >+ if hasattr(md5, 'digestsize'): >+ digest_size = digestsize >+ del digestsize >+ del md5 >diff -uNr pycrypto-2.0.old/Hash/SHA.py pycrypto-2.0/Hash/SHA.py >--- pycrypto-2.0.old/Hash/SHA.py 2010-06-01 11:19:59.000000000 +0300 >+++ pycrypto-2.0/Hash/SHA.py 2010-06-01 11:35:37.000000000 +0300 >@@ -1,11 +1,21 @@ > > # Just use the SHA module from the Python standard library >+# http://gitweb.pycrypto.org/?p=crypto/pycrypto-2.x.git;a=commitdiff;h=d2311689910240e425741a546576129f4c9735e2 >+__revision__ = "$Id$" > >-__revision__ = "$Id: SHA.py,v 1.4 2002/07/11 14:31:19 akuchling Exp $" >+__all__ = ['new', 'digest_size'] > >-from sha import * >-import sha >-if hasattr(sha, 'digestsize'): >- digest_size = digestsize >- del digestsize >-del sha >+try: >+ # The md5 module is deprecated in Python 2.6, so use hashlib when possible. >+ import hashlib >+ def new(data=""): >+ return hashlib.sha1(data) >+ digest_size = new().digest_size >+ >+except ImportError: >+ from sha import * >+ import sha >+ if hasattr(sha, 'digestsize'): >+ digest_size = digestsize >+ del digestsize >+ del sha
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 23581
: 4421