Skip to content

Commit 664503f

Browse files
author
Hans Hörberg
committed
Added configuration so the test sp can change sign and digest algorithm.
If SIGN_ALG = None DIGEST_ALG = None in service_conf sha1 will be used.
1 parent 3b84f65 commit 664503f

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

example/sp-wsgi/service_conf.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
from saml2.assertion import Policy
2+
import saml2.xmldsig as ds
23

3-
HOST = '127.0.0.1'
4+
HOST = 'localhost'
45
PORT = 8087
56
HTTPS = False
7+
SIGN_ALG = None
8+
DIGEST_ALG = None
9+
#SIGN_ALG = ds.SIG_RSA_SHA512
10+
#DIGEST_ALG = ds.DIGEST_SHA512
611

712
# Which groups of entity categories to use
813
POLICY = Policy(

example/sp-wsgi/sp.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#from srtest import exception_trace
4242
from saml2.samlp import Extensions
4343
from saml2 import xmldsig as ds
44+
import saml2.xmldsig as ds
4445

4546
logger = logging.getLogger("")
4647
hdlr = logging.FileHandler('spx.log')
@@ -877,6 +878,8 @@ def application(environ, start_response):
877878

878879
add_urls()
879880

881+
ds.DefaultSignature(service_conf.SIGN_ALG, service_conf.DIGEST_ALG)
882+
880883
SRV = wsgiserver.CherryPyWSGIServer((HOST, PORT), application)
881884

882885
_https = ""

0 commit comments

Comments
 (0)