diff --git a/letsencrypt/acme/messages.py b/letsencrypt/acme/messages.py index c60dd84e8..1009398ea 100644 --- a/letsencrypt/acme/messages.py +++ b/letsencrypt/acme/messages.py @@ -7,9 +7,6 @@ from letsencrypt.acme import jose from letsencrypt.acme import other from letsencrypt.acme import util -from letsencrypt.acme.jose import errors as jose_errors -from letsencrypt.acme.jose import json_util - class Message(jose.TypedJSONObjectWithFields): # _fields_to_json | pylint: disable=abstract-method diff --git a/letsencrypt/acme/messages_test.py b/letsencrypt/acme/messages_test.py index 540882d7c..a419e4072 100644 --- a/letsencrypt/acme/messages_test.py +++ b/letsencrypt/acme/messages_test.py @@ -10,8 +10,6 @@ from letsencrypt.acme import errors from letsencrypt.acme import jose from letsencrypt.acme import other -from letsencrypt.acme.jose import errors as jose_errors - KEY = Crypto.PublicKey.RSA.importKey(pkg_resources.resource_string( 'letsencrypt.client.tests', 'testdata/rsa256_key.pem')) diff --git a/letsencrypt/acme/other.py b/letsencrypt/acme/other.py index 824aa722d..99a4ec551 100644 --- a/letsencrypt/acme/other.py +++ b/letsencrypt/acme/other.py @@ -6,7 +6,6 @@ import Crypto.Random import Crypto.PublicKey.RSA from letsencrypt.acme import jose -from letsencrypt.acme.jose import json_util class Signature(jose.JSONObjectWithFields): @@ -23,13 +22,13 @@ class Signature(jose.JSONObjectWithFields): NONCE_SIZE = 16 """Minimum size of nonce in bytes.""" - alg = json_util.Field('alg', decoder=jose.JWASignature.from_json) - sig = json_util.Field('sig', encoder=jose.b64encode, - decoder=json_util.decode_b64jose) - nonce = json_util.Field( + alg = jose.Field('alg', decoder=jose.JWASignature.from_json) + sig = jose.Field('sig', encoder=jose.b64encode, + decoder=jose.decode_b64jose) + nonce = jose.Field( 'nonce', encoder=jose.b64encode, decoder=functools.partial( - json_util.decode_b64jose, size=NONCE_SIZE, minimum=True)) - jwk = json_util.Field('jwk', decoder=jose.JWK.from_json) + jose.decode_b64jose, size=NONCE_SIZE, minimum=True)) + jwk = jose.Field('jwk', decoder=jose.JWK.from_json) @classmethod def from_msg(cls, msg, key, nonce=None, nonce_size=None, alg=jose.RS256):