diff --git a/lib/paymentrequest.py b/lib/paymentrequest.py index 7b9247832cdd..917d2eaf2d5c 100644 --- a/lib/paymentrequest.py +++ b/lib/paymentrequest.py @@ -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'") @@ -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) @@ -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 diff --git a/lib/x509.py b/lib/x509.py index e296cfa36c02..862ff45efcb3 100644 --- a/lib/x509.py +++ b/lib/x509.py @@ -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