diff --git a/stapled/core/stapleadder.py b/stapled/core/stapleadder.py index 3c8580a..adba588 100644 --- a/stapled/core/stapleadder.py +++ b/stapled/core/stapleadder.py @@ -11,7 +11,6 @@ from io import StringIO from stapled.core.excepthandler import stapled_except_handle import stapled.core.exceptions -import stapled.util.functions try: _ = BrokenPipeError @@ -137,9 +136,7 @@ def add_staple(self, model): :param model: An object that has a binary string `ocsp_staple` in it and a filename `filename`. """ - command = self.OCSP_ADD.format( - stapled.util.functions.base64(model.ocsp_staple.raw) - ) + command = self.OCSP_ADD.format(model.ocsp_staple.base64) LOG.debug("Setting OCSP staple with command '%s'", command) directory = os.path.dirname(model.filename) response = self.send(directory, command) diff --git a/stapled/util/ocsp.py b/stapled/util/ocsp.py index 7cde16e..b0bc81b 100644 --- a/stapled/util/ocsp.py +++ b/stapled/util/ocsp.py @@ -5,6 +5,7 @@ from builtins import str import datetime import asn1crypto +from stapled.util.functions import base64 class OCSPResponseParser(object): @@ -22,6 +23,10 @@ def __init__(self, ocsp_object=None): # SingleResponse object should be in these keys self.tbsresponse = self.response['responses'][0] + @property + def base64(self): + return base64(self.raw.dump()) + @property def status(self): """