diff options
author | Leif Johansson <leifj@sunet.se> | 2011-01-17 11:27:38 +0100 |
---|---|---|
committer | Leif Johansson <leifj@sunet.se> | 2011-01-17 11:27:38 +0100 |
commit | 9fac4cbc421bfbc99d0ba55598ebd8f4d2d42315 (patch) | |
tree | eb9f348f4502ae74f114336070810c4fd321005d /scripts | |
parent | 6a1ba2e632e9b3052b5fd35b64e626d12af699b9 (diff) |
support unsigned aggregate metadata
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/aggregate.sh | 5 | ||||
-rwxr-xr-x | scripts/pull-and-verify.sh | 12 |
2 files changed, 10 insertions, 7 deletions
diff --git a/scripts/aggregate.sh b/scripts/aggregate.sh index c3654d66..7565e48a 100755 --- a/scripts/aggregate.sh +++ b/scripts/aggregate.sh @@ -2,5 +2,6 @@ DIR=`pwd` -$DIR/scripts/pull-and-verify.sh 'http://spaces.internet2.edu/Shibboleth.sso/Metadata' $DIR/certs/spaces.internet2.edu.crt $1 -$DIR/scripts/pull-and-verify.sh 'https://kalmar2.org/simplesaml/module.php/aggregator/?id=kalmarcentral2&set=saml2&exclude=sweden&mimetype=application/xml' $DIR/certs/kalmar-signer.crt $1 +$DIR/scripts/pull-and-verify.sh 'http://spaces.internet2.edu/Shibboleth.sso/Metadata' $1 $DIR/certs/spaces.internet2.edu.crt +$DIR/scripts/pull-and-verify.sh 'https://kalmar2.org/simplesaml/module.php/aggregator/?id=kalmarcentral2&set=saml2&exclude=sweden&mimetype=application/xml' $1 $DIR/certs/kalmar-signer.crt +$DIR/scripts/pull-and-verify.sh 'http://discovery.shibboleth.net/shibboleth.net-metadata.xml' $1 diff --git a/scripts/pull-and-verify.sh b/scripts/pull-and-verify.sh index c53fd66a..6e63e855 100755 --- a/scripts/pull-and-verify.sh +++ b/scripts/pull-and-verify.sh @@ -6,20 +6,22 @@ function die() { } URL=$1 -CERT=$2 -DIR=$3 +DIR=$2 +CERT=$3 TMPF=`mktemp` wget --no-check-certificate -O$TMPF $URL || die "Unable to download $URL: $?" -samlsign -c $CERT -f $TMPF || die "Unable to verify $URL with $CERT: $?" +if [ "x$CERT" != "x" ]; then + samlsign -c $CERT -f $TMPF || die "Unable to verify $URL with $CERT: $?" +fi TMPD=`mktemp -d` xsltproc --stringparam output $TMPD xslt/import-metadata.xsl $TMPF || die "Unable to import metadata from $URL: $?" rsync -avz $TMPD/ $DIR ( echo '<?xml version="1.0"?>' -echo "<EntitiesDescriptor xmlns=\"urn:oasis:names:tc:SAML:2.0:metadata\" xmlns:xi=\"http://www.w3.org/2001/XInclude\" Name=\"http://md.swamid.se/md/$3.xml\">" +echo "<EntitiesDescriptor xmlns=\"urn:oasis:names:tc:SAML:2.0:metadata\" xmlns:xi=\"http://www.w3.org/2001/XInclude\" Name=\"http://md.swamid.se/md/$DIR.xml\">" T=`mktemp` -for md in $3/*.xml; do +for md in $DIR/*.xml; do xsltproc xslt/clean-entitydescriptor.xsl $md > $T && mv $T $md echo "<xi:include href=\"$md\"/>" done |