Skip to content

Commit

Permalink
fixes for paymentrequests and python3
Browse files Browse the repository at this point in the history
  • Loading branch information
ecdsa committed Aug 26, 2017
1 parent c3388d9 commit 4f516dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/paymentrequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@


try:
from . import paymentrequest_pb2 as pb2
from . import paymentrequest_pb2_py3 as pb2
except ImportError:
sys.exit("Error: could not find paymentrequest_pb2.py. Create it with 'protoc --proto_path=lib/ --python_out=lib/ lib/paymentrequest.proto'")

Expand Down Expand Up @@ -188,7 +188,7 @@ def verify_x509(self, paymntreq):
# verify the BIP70 signature
pubkey0 = rsakey.RSAKey(x.modulus, x.exponent)
sig = paymntreq.signature
paymntreq.signature = ''
paymntreq.signature = b''
s = paymntreq.SerializeToString()
sigBytes = bytearray(sig)
msgBytes = bytearray(s)
Expand Down Expand Up @@ -473,7 +473,7 @@ def set_paid(self, pr, txid):
def load(self, d):
for k, v in d.items():
try:
pr = bfh(PaymentRequest(v.get('hex')))
pr = PaymentRequest(bfh(v.get('hex')))
pr.tx = v.get('txid')
pr.requestor = v.get('requestor')
self.invoices[k] = pr
Expand Down
2 changes: 1 addition & 1 deletion lib/x509.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def get_issuer_keyID(self):
return self.AKI if self.AKI else repr(self.issuer)

def get_common_name(self):
return self.subject.get('2.5.4.3', 'unknown')
return self.subject.get('2.5.4.3', 'unknown').decode()

def get_signature(self):
return self.cert_sig_algo, self.signature, self.data
Expand Down

0 comments on commit 4f516dc

Please sign in to comment.