Minor fixes

This commit is contained in:
Salvatore Ingala
2019-10-22 18:59:27 +08:00
parent b39f7ef55b
commit 9b1af92fc3
3 changed files with 3 additions and 5 deletions

View File

@@ -31,8 +31,8 @@ class Watcher:
raise ValueError("No signing key provided. Please fix your pisa.conf")
else:
with open(PISA_SECRET_KEY, "r") as key_file:
privkey_pem = key_file.read().encode("utf-8")
self.signing_key = load_pem_private_key(privkey_pem, password=None, backend=default_backend())
secret_key_pem = key_file.read().encode("utf-8")
self.signing_key = load_pem_private_key(secret_key_pem, password=None, backend=default_backend())
def add_appointment(self, appointment):
# Rationale:
@@ -73,7 +73,6 @@ class Watcher:
logger.info("New appointment accepted.", locator=appointment.locator)
print(appointment.to_json().encode("utf-8"))
signature = self.signing_key.sign(
appointment.to_json().encode("utf-8"),
ec.ECDSA(hashes.SHA256())