Browse Source

adapt request handling for new sign_request

cmd_module
Edoardo Putti 8 years ago
parent
commit
fa316e3cab
1 changed files with 4 additions and 11 deletions
  1. +4
    -11
      ca_manager.py

+ 4
- 11
ca_manager.py View File

@ -208,22 +208,15 @@ def sign_request(ca_manager, choosen_request, choosen_ca):
return return
requests = ca_manager.get_requests() 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: try:
req_selection = int(req_selection)
req_obj = requests[req_selection]
except:
req_selection = int(choosen_request)
request = requests[req_selection]
except IndexError:
return 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 = 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("Request hash: %s" % h.hexdigest())
print("You are about to sign this request with the following CA:") print("You are about to sign this request with the following CA:")


Loading…
Cancel
Save