Ticket #266: sugar-266.patch

File sugar-266.patch, 2.5 KB (added by alsroot, 12 years ago)
  • extensions/deviceicon/network.py

    diff --git a/extensions/deviceicon/network.py b/extensions/deviceicon/network.py
    index 47864de..158decc 100644
    a b  
    1717
    1818from gettext import gettext as _
    1919import logging
    20 import sha
     20import hashlib
    2121import socket
    2222import struct
    2323
    class WirelessDeviceView(ToolButton): 
    295295        if 'Frequency' in properties:
    296296            self._frequency = properties['Frequency']
    297297
    298         sh = sha.new()
     298        sh = hashlib.sha1()
    299299        data = self._name + hex(self._flags)
    300300        sh.update(data)
    301301        h = hash(sh.digest())
  • src/jarabe/desktop/keydialog.py

    diff --git a/src/jarabe/desktop/keydialog.py b/src/jarabe/desktop/keydialog.py
    index f5995e6..93f07c4 100644
    a b  
    1414# along with this program; if not, write to the Free Software
    1515# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    1616
    17 import md5
     17import hashlib
    1818from gettext import gettext as _
    1919
    2020import gtk
    def hash_passphrase(passphrase): 
    5353    elif len(passphrase) < 64:
    5454        while len(passphrase) < 64:
    5555            passphrase += passphrase[:64 - len(passphrase)]
    56     passphrase = md5.new(passphrase).digest()
     56    passphrase = hashlib.md5(passphrase).digest()
    5757    return string_to_hex(passphrase)[:26]
    5858
    5959class CanceledKeyRequestError(dbus.DBusException):
  • src/jarabe/desktop/meshbox.py

    diff --git a/src/jarabe/desktop/meshbox.py b/src/jarabe/desktop/meshbox.py
    index a87a1f2..6f0b94a 100644
    a b  
    1616
    1717from gettext import gettext as _
    1818import logging
    19 import sha
     19import hashlib
    2020
    2121import dbus
    2222import hippo
    class AccessPointView(CanvasPulsingIcon): 
    169169        if 'Mode' in properties:
    170170            self._mode = properties['Mode']
    171171
    172         sh = sha.new()
     172        sh = hashlib.sha1()
    173173        data = self._name + hex(self._flags)
    174174        sh.update(data)
    175175        h = hash(sh.digest())
  • src/jarabe/model/owner.py

    diff --git a/src/jarabe/model/owner.py b/src/jarabe/model/owner.py
    index bdfd9a8..2075f08 100644
    a b class Owner(gobject.GObject): 
    6262            raise RuntimeError("invalid buddy icon")
    6363
    6464        # Get the icon's hash
    65         import md5
    66         digest = md5.new(self._icon).digest()
     65        import hashlib
     66        digest = hashlib.md5(self._icon).digest()
    6767        self._icon_hash = util.printable_hash(digest)
    6868
    6969        self._pservice = presenceservice.get_instance()