From ffd1281b8339838be10657602f709780a9cc25e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauri=20V=C3=B5sandi?= Date: Fri, 13 Apr 2018 07:56:05 +0000 Subject: [PATCH] ocsp: Add EC support --- certidude/api/ocsp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/certidude/api/ocsp.py b/certidude/api/ocsp.py index 508fb20..0d34d89 100644 --- a/certidude/api/ocsp.py +++ b/certidude/api/ocsp.py @@ -100,8 +100,8 @@ class OCSPResource(AuthorityHandler): 'response': { 'tbs_response_data': response_data, 'certs': [server_certificate.asn1], - 'signature_algorithm': {'algorithm': "sha1_rsa"}, - 'signature': asymmetric.rsa_pkcs1v15_sign( + 'signature_algorithm': {'algorithm': "sha1_ecdsa" if self.authority.public_key.algorithm == "ec" else "sha1_rsa" }, + 'signature': (asymmetric.ecdsa_sign if self.authority.public_key.algorithm == "ec" else asymmetric.rsa_pkcs1v15_sign)( self.authority.private_key, response_data.dump(), "sha1"