From 8f173f0ab272a57a5c036589dcc19b8543026b3e Mon Sep 17 00:00:00 2001
From: Holger Nahrstaedt <holgernahrstaedt@gmx.de>
Date: Sun, 31 May 2020 22:43:50 +0200
Subject: [PATCH] Release 0.23.11

* replace asn1 by asn1crypto
---
 .travis.yml                              |  2 +-
 CHANGELOG.rst                            |  4 ++++
 appveyor.yml                             |  2 +-
 beem/cli.py                              |  2 +-
 beem/version.py                          |  2 +-
 beemapi/version.py                       |  2 +-
 beembase/version.py                      |  2 +-
 beemgraphenebase/unsignedtransactions.py | 30 ++++++++++--------------
 beemgraphenebase/version.py              |  2 +-
 requirements-test.txt                    |  2 +-
 setup.py                                 |  4 ++--
 11 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 854daffd..14b1c2ec 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 eac19922..a64c545b 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 e2736cc7..2174df75 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 546dab9b..d7ef2099 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 7a442f76..6788b518 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 7a442f76..6788b518 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 7a442f76..6788b518 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 f3eb933c..5511c0d6 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 7a442f76..6788b518 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 758a6273..fe27706e 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 1c1ae9b1..83a7359a 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"
 ]
 
 
-- 
GitLab