diff options
author | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2021-01-07 19:09:59 +0200 |
---|---|---|
committer | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2021-01-07 19:30:35 +0200 |
commit | bdc3707f2dba5b617959ccdd6d9b1633bce9577d (patch) | |
tree | 7ccd02d50001c99495c3e6e662f64be1861c2154 | |
parent | 3fb7f94bc406f67f79c9daf9899a443c6202621c (diff) | |
download | pysaml2-bdc3707f2dba5b617959ccdd6d9b1633bce9577d.tar.gz |
Cleanup and reorder sigver imports
Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com>
-rw-r--r-- | src/saml2/sigver.py | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/src/saml2/sigver.py b/src/saml2/sigver.py index 52324eb4..15c3ebee 100644 --- a/src/saml2/sigver.py +++ b/src/saml2/sigver.py @@ -1,7 +1,6 @@ """ Functions connected to signing and verifying. Based on the use of xmlsec1 binaries and not the python xmlsec module. """ -from OpenSSL import crypto import base64 import hashlib @@ -10,19 +9,21 @@ import logging import os import six from uuid import uuid4 as gen_random_key - from time import mktime +from tempfile import NamedTemporaryFile +from subprocess import Popen +from subprocess import PIPE +from importlib_resources import path as _resource_path + +from OpenSSL import crypto + import pytz from six.moves.urllib import parse import saml2.cryptography.asymmetric import saml2.cryptography.pki - -from tempfile import NamedTemporaryFile -from subprocess import Popen -from subprocess import PIPE - +import saml2.xmldsig as ds from saml2 import samlp from saml2 import SamlBase from saml2 import SAMLError @@ -31,20 +32,14 @@ from saml2 import class_name from saml2 import saml from saml2 import ExtensionElement from saml2 import VERSION - from saml2.cert import OpenSSLWrapper from saml2.extension import pefim from saml2.extension.pefim import SPCertEnc from saml2.saml import EncryptedAssertion - -import saml2.xmldsig as ds - from saml2.s_utils import sid from saml2.s_utils import Unsupported - from saml2.time_util import instant from saml2.time_util import str_to_time - from saml2.xmldsig import SIG_RSA_SHA1 from saml2.xmldsig import SIG_RSA_SHA224 from saml2.xmldsig import SIG_RSA_SHA256 @@ -1466,7 +1461,7 @@ class SecurityContext(object): # saml-core section "5.4 XML Signature Profile" defines constrains on the # xmldsig-core facilities. It explicitly dictates that enveloped signatures - # are the only signatures allowed. This mean that: + # are the only signatures allowed. This means that: # * Assertion/RequestType/ResponseType elements must have an ID attribute # * signatures must have a single Reference element # * the Reference element must have a URI attribute |