Skip to content

Commit bdc3707

Browse files
committed
Cleanup and reorder sigver imports
Signed-off-by: Ivan Kanakarakis <[email protected]>
1 parent 3fb7f94 commit bdc3707

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

src/saml2/sigver.py

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
""" Functions connected to signing and verifying.
22
Based on the use of xmlsec1 binaries and not the python xmlsec module.
33
"""
4-
from OpenSSL import crypto
54

65
import base64
76
import hashlib
@@ -10,19 +9,21 @@
109
import os
1110
import six
1211
from uuid import uuid4 as gen_random_key
13-
1412
from time import mktime
13+
from tempfile import NamedTemporaryFile
14+
from subprocess import Popen
15+
from subprocess import PIPE
16+
from importlib_resources import path as _resource_path
17+
18+
from OpenSSL import crypto
19+
1520
import pytz
1621

1722
from six.moves.urllib import parse
1823

1924
import saml2.cryptography.asymmetric
2025
import saml2.cryptography.pki
21-
22-
from tempfile import NamedTemporaryFile
23-
from subprocess import Popen
24-
from subprocess import PIPE
25-
26+
import saml2.xmldsig as ds
2627
from saml2 import samlp
2728
from saml2 import SamlBase
2829
from saml2 import SAMLError
@@ -31,20 +32,14 @@
3132
from saml2 import saml
3233
from saml2 import ExtensionElement
3334
from saml2 import VERSION
34-
3535
from saml2.cert import OpenSSLWrapper
3636
from saml2.extension import pefim
3737
from saml2.extension.pefim import SPCertEnc
3838
from saml2.saml import EncryptedAssertion
39-
40-
import saml2.xmldsig as ds
41-
4239
from saml2.s_utils import sid
4340
from saml2.s_utils import Unsupported
44-
4541
from saml2.time_util import instant
4642
from saml2.time_util import str_to_time
47-
4843
from saml2.xmldsig import SIG_RSA_SHA1
4944
from saml2.xmldsig import SIG_RSA_SHA224
5045
from saml2.xmldsig import SIG_RSA_SHA256
@@ -1466,7 +1461,7 @@ def _check_signature(self, decoded_xml, item, node_name=NODE_NAME, origdoc=None,
14661461

14671462
# saml-core section "5.4 XML Signature Profile" defines constrains on the
14681463
# xmldsig-core facilities. It explicitly dictates that enveloped signatures
1469-
# are the only signatures allowed. This mean that:
1464+
# are the only signatures allowed. This means that:
14701465
# * Assertion/RequestType/ResponseType elements must have an ID attribute
14711466
# * signatures must have a single Reference element
14721467
# * the Reference element must have a URI attribute

0 commit comments

Comments
 (0)