From fa316e3cab68bdfef2e724cc683688c8e1bd5696 Mon Sep 17 00:00:00 2001 From: Edoardo Putti Date: Sat, 20 Aug 2016 01:41:17 +0200 Subject: [PATCH] adapt request handling for new sign_request --- ca_manager.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/ca_manager.py b/ca_manager.py index 13e3889..c5fa0d4 100755 --- a/ca_manager.py +++ b/ca_manager.py @@ -208,22 +208,15 @@ def sign_request(ca_manager, choosen_request, choosen_ca): return requests = ca_manager.get_requests() - for i, request in enumerate(requests): - print("%2d) %s - %s" % (i, request.req_id, request.get_name())) - req_selection = input('Select a request> ') try: - req_selection = int(req_selection) - req_obj = requests[req_selection] - except: + req_selection = int(choosen_request) + request = requests[req_selection] + except IndexError: return - print("Request details:") - for field_name, field_value in req_obj.get_fields(): - print("- %s: %s" % (field_name, field_value)) - h = hashlib.sha256() - h.update(req_obj.key_data.encode('utf-8')) + h.update(request.key_data.encode('utf-8')) print("Request hash: %s" % h.hexdigest()) print("You are about to sign this request with the following CA:")