Skip to content

Commit

Permalink
Problem: cyrptoconditions dependency updated because of vulnerability (
Browse files Browse the repository at this point in the history
…#2494)

* Problem: cyrptoconditions dependency updated because of vulnerability CVE-2018-10903

* update cc to ~=0.7.2

* Fix test using b58encode

* Fixing some more tests failing because of base58 update
  • Loading branch information
muawiakh authored and ttmc committed Sep 3, 2018
1 parent 80b6881 commit 8e55b11
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions bigchaindb/common/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def to_dict(self):
"""
try:
fulfillment = self.fulfillment.serialize_uri()
except (TypeError, AttributeError, ASN1EncodeError):
except (TypeError, AttributeError, ASN1EncodeError, ASN1DecodeError):
fulfillment = _fulfillment_to_details(self.fulfillment)

try:
Expand Down Expand Up @@ -161,7 +161,7 @@ def _fulfillment_to_details(fulfillment):
if fulfillment.type_name == 'ed25519-sha-256':
return {
'type': 'ed25519-sha-256',
'public_key': base58.b58encode(fulfillment.public_key),
'public_key': base58.b58encode(fulfillment.public_key).decode(),
}

if fulfillment.type_name == 'threshold-sha-256':
Expand Down
2 changes: 1 addition & 1 deletion bigchaindb/upsert_validator/validator_election.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def transfer(cls, tx_signers, recipients, metadata=None, asset=None):

@classmethod
def to_public_key(cls, election_id):
return base58.b58encode(bytes.fromhex(election_id))
return base58.b58encode(bytes.fromhex(election_id)).decode()

@classmethod
def count_votes(cls, election_pk, transactions, getter=getattr):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def check_setuptools_features():
# TODO Consider not installing the db drivers, or putting them in extras.
'pymongo~=3.6',
'pysha3~=1.0.2',
'cryptoconditions~=0.6.0.dev',
'cryptoconditions~=0.7.2',
'python-rapidjson~=0.6.0',
'logstats~=0.2.1',
'flask>=0.10.1',
Expand Down
4 changes: 2 additions & 2 deletions tests/common/test_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def test_output_serialization(user_Ed25519, user_pub):
'uri': user_Ed25519.condition_uri,
'details': {
'type': 'ed25519-sha-256',
'public_key': b58encode(user_Ed25519.public_key),
'public_key': b58encode(user_Ed25519.public_key).decode(),
},
},
'public_keys': [user_pub],
Expand All @@ -114,7 +114,7 @@ def test_output_deserialization(user_Ed25519, user_pub):
'uri': user_Ed25519.condition_uri,
'details': {
'type': 'ed25519-sha-256',
'public_key': b58encode(user_Ed25519.public_key),
'public_key': b58encode(user_Ed25519.public_key).decode(),
},
},
'public_keys': [user_pub],
Expand Down

0 comments on commit 8e55b11

Please sign in to comment.