Use default digestalg='sha256' in highlevelcrypto.sign()

This commit is contained in:
Dmitri Bogomolov 2019-11-18 14:47:16 +02:00
parent 280095b08f
commit 8684d647a3
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13

View File

@ -2,8 +2,8 @@
High level cryptographic functions based on `.pyelliptic` OpenSSL bindings. High level cryptographic functions based on `.pyelliptic` OpenSSL bindings.
.. note:: .. note::
Upstream pyelliptic was upgraded from SHA1 to SHA256 for signing. Upstream pyelliptic was upgraded from SHA1 to SHA256 for signing. We must
We must upgrade PyBitmessage gracefully. `upgrade PyBitmessage gracefully. <https://github.com/Bitmessage/PyBitmessage/issues/953>`_
`More discussion. <https://github.com/yann2192/pyelliptic/issues/32>`_ `More discussion. <https://github.com/yann2192/pyelliptic/issues/32>`_
""" """
@ -68,7 +68,7 @@ def sign(msg, hexPrivkey):
"digestalg" setting "digestalg" setting
""" """
digestAlg = BMConfigParser().safeGet( digestAlg = BMConfigParser().safeGet(
'bitmessagesettings', 'digestalg', 'sha1') 'bitmessagesettings', 'digestalg', 'sha256')
if digestAlg == "sha1": if digestAlg == "sha1":
# SHA1, this will eventually be deprecated # SHA1, this will eventually be deprecated
return makeCryptor(hexPrivkey).sign( return makeCryptor(hexPrivkey).sign(