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/pull-and-verify.sh | |
parent | 6a1ba2e632e9b3052b5fd35b64e626d12af699b9 (diff) |
support unsigned aggregate metadata
Diffstat (limited to 'scripts/pull-and-verify.sh')
-rwxr-xr-x | scripts/pull-and-verify.sh | 12 |
1 files changed, 7 insertions, 5 deletions
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 |