diff --git a/.travis.yml b/.travis.yml index 854daffd74482d3c26afbf1ebd97574a634c8aa9..14b1c2ec4e0bc7df515637a597dec0f0c909810f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -54,7 +54,7 @@ before_install: - pip install --upgrade wheel # Set numpy version first, other packages link against it - pip install six nose coverage codecov pytest pytest-cov coveralls codacy-coverage parameterized secp256k1prp cryptography scrypt - - pip install pycryptodomex pyyaml appdirs pylibscrypt tox diff_match_patch asn1 + - pip install pycryptodomex pyyaml appdirs pylibscrypt tox diff_match_patch asn1crypto - pip install ecdsa requests future websocket-client pytz six Click events prettytable click_shell script: diff --git a/CHANGELOG.rst b/CHANGELOG.rst index eac199227c49e0767822c33396d7df26d84e079b..a64c545b23c972e948a6ad52186e70b2da3a9476 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,5 +1,9 @@ Changelog ========= +0.23.11 +------- +* replace asn1 by asn1crypto + 0.23.10 ------- * get_node_answer_time added to NodeList diff --git a/appveyor.yml b/appveyor.yml index e2736cc7f5ce5499877d0afaaa25e406f0f94fe4..2174df757646209060979801e2bf9222adaf7ad0 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -52,7 +52,7 @@ install: - cmd: conda install --yes conda-build setuptools pip parameterized cryptography - cmd: conda install --yes pycryptodomex pyyaml pytest pytest-mock coverage mock appdirs pylibscrypt pywin32 - cmd: pip install scrypt -U -- cmd: conda install --yes ecdsa requests future websocket-client pytz six Click events prettytable pyinstaller click-shell asn1 +- cmd: conda install --yes ecdsa requests future websocket-client pytz six Click events prettytable pyinstaller click-shell asn1crypto build_script: diff --git a/beem/cli.py b/beem/cli.py index 546dab9b720fc9e73884e9d458ec41b85113d1a8..d7ef2099815575e978b4ddc110e2889ef6b302d7 100644 --- a/beem/cli.py +++ b/beem/cli.py @@ -780,7 +780,7 @@ def keygen(import_word_list, strength, passphrase, path, network, role, account_ t.add_row(["Key role", role]) t.add_row(["path", path]) pubkey = ledgertx.ledgertx.get_pubkey(path, request_screen_approval=False) - aprove_key = PrettyTable(["Approve %s Key" % r]) + aprove_key = PrettyTable(["Approve %s Key" % role]) aprove_key.align = "l" aprove_key.add_row([format(pubkey, "STM")]) print(aprove_key) diff --git a/beem/version.py b/beem/version.py index 7a442f7636b29fa4a76caba619c8ca7bdc1d1fbd..6788b51818eec29ec0e6ba23ee56c5d0a94c6aa7 100644 --- a/beem/version.py +++ b/beem/version.py @@ -1,2 +1,2 @@ """THIS FILE IS GENERATED FROM beem SETUP.PY.""" -version = '0.23.10' +version = '0.23.11' diff --git a/beemapi/version.py b/beemapi/version.py index 7a442f7636b29fa4a76caba619c8ca7bdc1d1fbd..6788b51818eec29ec0e6ba23ee56c5d0a94c6aa7 100644 --- a/beemapi/version.py +++ b/beemapi/version.py @@ -1,2 +1,2 @@ """THIS FILE IS GENERATED FROM beem SETUP.PY.""" -version = '0.23.10' +version = '0.23.11' diff --git a/beembase/version.py b/beembase/version.py index 7a442f7636b29fa4a76caba619c8ca7bdc1d1fbd..6788b51818eec29ec0e6ba23ee56c5d0a94c6aa7 100644 --- a/beembase/version.py +++ b/beembase/version.py @@ -1,2 +1,2 @@ """THIS FILE IS GENERATED FROM beem SETUP.PY.""" -version = '0.23.10' +version = '0.23.11' diff --git a/beemgraphenebase/unsignedtransactions.py b/beemgraphenebase/unsignedtransactions.py index f3eb933c446f81fffe07bf978945989197602942..5511c0d65fe9ebd13c39efce0df2ef03ab3f1547 100644 --- a/beemgraphenebase/unsignedtransactions.py +++ b/beemgraphenebase/unsignedtransactions.py @@ -8,7 +8,7 @@ import ecdsa import hashlib from binascii import hexlify, unhexlify from collections import OrderedDict -import asn1 +from asn1crypto.core import OctetString import struct from future.utils import python_2_unicode_compatible from collections import OrderedDict @@ -72,23 +72,22 @@ class GrapheneObjectASN1(object): if self.data is None: return py23_bytes() b = b"" - encoder = asn1.Encoder() - encoder.start() + output = b"" for name, value in list(self.data.items()): if name == "operations": for operation in value: if isinstance(value, string_types): b = py23_bytes(operation, 'utf-8') else: - b = py23_bytes(operation) - encoder.write(b, asn1.Numbers.OctetString) + b = py23_bytes(operation) + output += OctetString(b).dump() elif name != "signatures": if isinstance(value, string_types): b = py23_bytes(value, 'utf-8') else: - b = py23_bytes(value) - encoder.write(b, asn1.Numbers.OctetString) - return encoder.output() + b = py23_bytes(value) + output += OctetString(b).dump() + return output def __json__(self): if self.data is None: @@ -220,25 +219,22 @@ class Unsigned_Transaction(GrapheneObjectASN1): # Get message to sign # bytes(self) will give the wire formated data according to # GrapheneObject and the data given in __init__() - encoder = asn1.Encoder() - encoder.start() - encoder.write(unhexlify(self.chainid), asn1.Numbers.OctetString) + self.message = OctetString(unhexlify(self.chainid)).dump() for name, value in list(self.data.items()): if name == "operations": for operation in value: if isinstance(value, string_types): b = py23_bytes(operation, 'utf-8') else: - b = py23_bytes(operation) - encoder.write(b, asn1.Numbers.OctetString) + b = py23_bytes(operation) + self.message += OctetString(b).dump() elif name != "signatures": if isinstance(value, string_types): b = py23_bytes(value, 'utf-8') else: - b = py23_bytes(value) - encoder.write(b, asn1.Numbers.OctetString) - - self.message = encoder.output() + b = py23_bytes(value) + self.message += OctetString(b).dump() + self.digest = hashlib.sha256(self.message).digest() # restore signatures diff --git a/beemgraphenebase/version.py b/beemgraphenebase/version.py index 7a442f7636b29fa4a76caba619c8ca7bdc1d1fbd..6788b51818eec29ec0e6ba23ee56c5d0a94c6aa7 100644 --- a/beemgraphenebase/version.py +++ b/beemgraphenebase/version.py @@ -1,2 +1,2 @@ """THIS FILE IS GENERATED FROM beem SETUP.PY.""" -version = '0.23.10' +version = '0.23.11' diff --git a/requirements-test.txt b/requirements-test.txt index 758a627376d81b12bda3cf0af68e5e4af31c1a1a..fe27706e732a16f237f10fd9c286c17e3b28df6a 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -30,4 +30,4 @@ codacy-coverage virtualenv codecov diff_match_patch -asn1 \ No newline at end of file +asn1crypto \ No newline at end of file diff --git a/setup.py b/setup.py index 1c1ae9b174a87967c82fd40ad1b838815b65b279..83a7359ae192108454f1bee6d35d1bd1d9b90842 100755 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ except LookupError: ascii = codecs.lookup('ascii') codecs.register(lambda name, enc=ascii: {True: enc}.get(name == 'mbcs')) -VERSION = '0.23.10' +VERSION = '0.23.11' tests_require = ['mock >= 2.0.0', 'pytest', 'pytest-mock', 'parameterized'] @@ -36,7 +36,7 @@ requires = [ "prettytable", "pyyaml>=5.1", "diff_match_patch", - "asn1" + "asn1crypto" ]