Skip to content

Commit

Permalink
Disable debug code
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph M. Wintersteiger committed Mar 22, 2022
1 parent 53050f1 commit 8ffae31
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions tests/e2e_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,28 @@

from loguru import logger as LOG

from OpenSSL.crypto import (
# dump_certificate,
load_certificate,
# FILETYPE_TEXT,
FILETYPE_PEM,
X509,
X509Store,
X509StoreContext,
)


def verify_endorsements_openssl(service_cert, receipt):
node_cert_pem = receipt["cert"].encode()
store = X509Store()
store.add_cert(X509.from_cryptography(service_cert))
chain = None
if "service_endorsements" in receipt:
chain = []
for endo in receipt["service_endorsements"]:
chain.append(load_certificate(FILETYPE_PEM, endo.encode()))
ctx = X509StoreContext(store, load_certificate(FILETYPE_PEM, node_cert_pem), chain)
ctx.verify_certificate() # throws on error
# from OpenSSL.crypto import (
# # dump_certificate,
# load_certificate,
# # FILETYPE_TEXT,
# FILETYPE_PEM,
# X509,
# X509Store,
# X509StoreContext,
# )


# def verify_endorsements_openssl(service_cert, receipt):
# node_cert_pem = receipt["cert"].encode()
# store = X509Store()
# store.add_cert(X509.from_cryptography(service_cert))
# chain = None
# if "service_endorsements" in receipt:
# chain = []
# for endo in receipt["service_endorsements"]:
# chain.append(load_certificate(FILETYPE_PEM, endo.encode()))
# ctx = X509StoreContext(store, load_certificate(FILETYPE_PEM, node_cert_pem), chain)
# ctx.verify_certificate() # throws on error


def verify_receipt(
Expand Down

0 comments on commit 8ffae31

Please sign in to comment.