Skip to content

Commit

Permalink
Remove usage of old curves
Browse files Browse the repository at this point in the history
  • Loading branch information
Bram van den Heuvel committed Jun 3, 2017
1 parent ed5edfe commit fbadf82
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 16 deletions.
2 changes: 1 addition & 1 deletion community.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def create_community(cls, dispersy, my_member, *args, **kargs):
assert my_member.public_key, my_member.database_id
assert my_member.private_key, my_member.database_id
assert isInIOThread()
master = dispersy.get_new_member(u"high")
master = dispersy.get_new_member(u"curve25519")

# new community instance
community = cls.init_community(dispersy, master, my_member, *args, **kargs)
Expand Down
7 changes: 1 addition & 6 deletions conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
from struct import pack, unpack_from, Struct
import logging

from M2Crypto.EC import ECError

from .authentication import Authentication, NoAuthentication, MemberAuthentication, DoubleMemberAuthentication
from .bloomfilter import BloomFilter
from .candidate import Candidate
Expand Down Expand Up @@ -1075,10 +1073,7 @@ def _decode_member_authentication(self, placeholder):
member_id = data[offset:offset + 20]
offset += 20

try:
member = self._community.get_member(mid=member_id)
except ECError:
raise DropPacket("Invalid member authentication")
member = self._community.get_member(mid=member_id)

# If signatures and verification are enabled, verify that the signature matches the member sha1 identifier
if member:
Expand Down
3 changes: 0 additions & 3 deletions crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
_STRUCT_L = Struct(">L")


# Add custom curves, not provided by M2Crypto
_CURVES = dict()
_CURVES.update({u'curve25519': (None, "libnacl")})

Expand Down Expand Up @@ -151,13 +150,11 @@ def key_from_private_bin(self, string):
"Get the EC from a public/private keypair stored in a binary format."
if string.startswith("LibNaCLSK:"):
return LibNaCLSK(string[10:])
return M2CryptoSK(keystring=string)

def key_from_public_bin(self, string):
"Get the EC from a public key in binary format."
if string.startswith("LibNaCLPK:"):
return LibNaCLPK(string[10:])
return M2CryptoPK(keystring=string)

def get_signature_length(self, ec):
"""
Expand Down
6 changes: 0 additions & 6 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ Installing Dependencies
* python 2.7 (Dispersy runs only on python 2.7 because of twisted)
* twisted
* netifaces
* M2Crypto
* Libsodium
* PyCrypto

Expand All @@ -43,7 +42,6 @@ Apt-get
sudo apt-get install python-twisted
sudo apt-get install python-netifaces
sudo apt-get install python-m2crypto
sudo apt-get install libsodium-dev
pip install pycrypto
Expand All @@ -61,7 +59,6 @@ Yum
sudo yum install epel-release
pip install twisted
sudo yum install python-netifaces
pip install M2Crypto
sudo yum install libsodium-devel
pip install pycrypto
Expand All @@ -81,7 +78,6 @@ Check if you have the 32 bits version of python or the 64 bits version. You can
pip install twisted
pip install netifaces
pip install --egg M2CryptoWin32
Microsoft Visual C++ Compiler for Python 2.7
http://aka.ms/vcpython27
Expand All @@ -99,7 +95,6 @@ http://aka.ms/vcpython27
pip install twisted
pip install netifaces
pip install --egg M2CryptoWin64
Download the latest msvc version of libsodium from https://download.libsodium.org/libsodium/releases/
Extract libsodium.dll from LIBSODIUM_ROOT\x64\Release\v140\dynamic\ on your harddrive and add that directory to your path
Expand All @@ -114,7 +109,6 @@ Mac
pip install twisted
pip install netifaces
pip install M2Crypto
brew install libsodium
pip install pycrypto
Expand Down

0 comments on commit fbadf82

Please sign in to comment.