Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix message signing and verifying #20

Merged
merged 2 commits into from
Mar 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jasvet.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ def ASv0(privkey, msg):

def ASv1CS(privkey, msg):
sig=ASv0(privkey, FormatText(msg))
r=BEGIN_MARKER+CLEARSIGN_MSG_TYPE_MARKER+DASHX5+RN+BITCOIN_ARMORY_COMMENT+RNRN
r=BEGIN_MARKER+CLEARSIGN_MSG_TYPE_MARKER+DASHX5+RN+BITCOIN_ARMORY_COMMENT+RN
r+=FormatText(msg)+RN
r+=ASCIIArmory(sig['signature'], BITCOIN_SIG_TYPE_MARKER)
return r
Expand Down
38 changes: 11 additions & 27 deletions ui/toolsDialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from qtdialogs import MIN_PASSWD_WIDTH, DlgPasswd3, createAddrBookButton,\
DlgUnlockWallet
from armoryengine.ArmoryUtils import isASCII
#from announcefetch import ANNOUNCE_SIGN_PUBKEY

class MessageSigningVerificationDialog(ArmoryDialog):

Expand Down Expand Up @@ -220,31 +219,16 @@ def clearFields(self):
self.lblSigResult.setText('')

def displayVerifiedBox(self, addrB58, messageString):
atihash160 = hash160(hex_to_binary(ANNOUNCE_SIGN_PUBKEY))
addrDisp = addrB58
if addrB58==hash160_to_addrStr(atihash160):
addrDisp = '<b>Armory Technologies, Inc.</b>'
if CLI_OPTIONS.testAnnounceCode:
ownerStr = tr("""
<font color="%s"><b>Armory Technologies, Inc.
(testing key)</b></font> has signed the following
block of text:<br>""") % htmlColor('TextGreen')
else:
ownerStr = tr("""
<font color="%s"><b>Armory Technologies, Inc.</b></font>
has signed the following block of text:<br>""") % \
htmlColor('TextGreen')
else:
ownerStr = tr("""
The owner of the following Bitcoin address...
<br>
<blockquote>
<font face="Courier" size=4 color="#000060"><b>%s</b></font>
</blockquote>
<br>
... has produced a <b><u>valid</u></b> signature for
the following message:<br>
""") % addrB58
ownerStr = tr("""
The owner of the following Bitcoin address...
<br>
<blockquote>
<font face="Courier" size=4 color="#000060"><b>%s</b></font>
</blockquote>
<br>
... has produced a <b><u>valid</u></b> signature for
the following message:<br>
""") % addrB58

if addrB58:
msg = messageString.replace('\r\n','\n')
Expand All @@ -264,7 +248,7 @@ def displayVerifiedBox(self, addrB58, messageString):
unless it is made
from a recognized address!""") % (ownerStr, msg, addrB58[:10]))
self.lblSigResult.setText(\
'<font color="green">Valid Signature by %s</font>' % addrDisp)
'<font color="green">Valid Signature by %s</font>' % addrB58)
else:
self.displayInvalidSignatureMessage()

Expand Down