Merge pull request #196 from Atheros1/master

Correct ECDSA verify
This commit is contained in:
Jonathan Warren 2013-06-07 12:47:46 -07:00
commit d86e473995
4 changed files with 15 additions and 7 deletions

View File

@ -1,5 +1,5 @@
APP=pybitmessage APP=pybitmessage
VERSION=0.3.2 VERSION=0.3.3
DEST_SHARE=$(DESTDIR)/usr/share DEST_SHARE=$(DESTDIR)/usr/share
DEST_APP=$(DEST_SHARE)/$(APP) DEST_APP=$(DEST_SHARE)/$(APP)

View File

@ -8,7 +8,7 @@
APP=pybitmessage APP=pybitmessage
PREV_VERSION=0.3.2 PREV_VERSION=0.3.2
VERSION=0.3.2 VERSION=0.3.3
ARCH_TYPE=all ARCH_TYPE=all
#update version numbers automatically - so you don't have to #update version numbers automatically - so you don't have to

View File

@ -650,7 +650,9 @@ class receiveDataThread(threading.Thread):
readPosition += signatureLengthLength readPosition += signatureLengthLength
signature = data[readPosition:readPosition+signatureLength] signature = data[readPosition:readPosition+signatureLength]
try: try:
highlevelcrypto.verify(data[12:readPositionAtBottomOfMessage],signature,sendersPubSigningKey.encode('hex')) if not highlevelcrypto.verify(data[12:readPositionAtBottomOfMessage],signature,sendersPubSigningKey.encode('hex')):
print 'ECDSA verify failed'
return
print 'ECDSA verify passed' print 'ECDSA verify passed'
except Exception, err: except Exception, err:
print 'ECDSA verify failed', err print 'ECDSA verify failed', err
@ -783,7 +785,9 @@ class receiveDataThread(threading.Thread):
readPosition += signatureLengthLength readPosition += signatureLengthLength
signature = decryptedData[readPosition:readPosition+signatureLength] signature = decryptedData[readPosition:readPosition+signatureLength]
try: try:
highlevelcrypto.verify(decryptedData[:readPositionAtBottomOfMessage],signature,sendersPubSigningKey.encode('hex')) if not highlevelcrypto.verify(decryptedData[:readPositionAtBottomOfMessage],signature,sendersPubSigningKey.encode('hex')):
print 'ECDSA verify failed'
return
print 'ECDSA verify passed' print 'ECDSA verify passed'
except Exception, err: except Exception, err:
print 'ECDSA verify failed', err print 'ECDSA verify failed', err
@ -1024,7 +1028,9 @@ class receiveDataThread(threading.Thread):
readPosition += signatureLengthLength readPosition += signatureLengthLength
signature = decryptedData[readPosition:readPosition+signatureLength] signature = decryptedData[readPosition:readPosition+signatureLength]
try: try:
highlevelcrypto.verify(decryptedData[:positionOfBottomOfAckData],signature,pubSigningKey.encode('hex')) if not highlevelcrypto.verify(decryptedData[:positionOfBottomOfAckData],signature,pubSigningKey.encode('hex')):
print 'ECDSA verify failed'
return
print 'ECDSA verify passed' print 'ECDSA verify passed'
except Exception, err: except Exception, err:
print 'ECDSA verify failed', err print 'ECDSA verify failed', err
@ -1340,7 +1346,9 @@ class receiveDataThread(threading.Thread):
signatureLength, signatureLengthLength = decodeVarint(data[readPosition:readPosition+10]) signatureLength, signatureLengthLength = decodeVarint(data[readPosition:readPosition+10])
signature = data[readPosition:readPosition+signatureLengthLength] signature = data[readPosition:readPosition+signatureLengthLength]
try: try:
highlevelcrypto.verify(data[8:readPosition],signature,publicSigningKey.encode('hex')) if not highlevelcrypto.verify(data[8:readPosition],signature,publicSigningKey.encode('hex')):
print 'ECDSA verify failed (within processpubkey)'
return
print 'ECDSA verify passed (within processpubkey)' print 'ECDSA verify passed (within processpubkey)'
except Exception, err: except Exception, err:
print 'ECDSA verify failed (within processpubkey)', err print 'ECDSA verify failed (within processpubkey)', err

View File

@ -1,4 +1,4 @@
softwareVersion = '0.3.211' softwareVersion = '0.3.3'
import threading import threading
import sys import sys