From 575be62e8696afc99854358752928ca94ba12269 Mon Sep 17 00:00:00 2001 From: Ian Young Date: Tue, 29 Jul 2008 16:35:02 +0000 Subject: [PATCH] Add a tool to remove the old Eduserv gateway certificate from all affected entities once it has expired. --- build.xml | 19 +++++++++++++++ build/remove_old_eduserv_cert.pl | 41 ++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100755 build/remove_old_eduserv_cert.pl diff --git a/build.xml b/build.xml index 95626d60..a2c402bd 100644 --- a/build.xml +++ b/build.xml @@ -470,6 +470,25 @@ + + + Removing old Eduserv gateway certificate + + + + + + + + + + + + + + diff --git a/build/remove_old_eduserv_cert.pl b/build/remove_old_eduserv_cert.pl new file mode 100755 index 00000000..0472e61e --- /dev/null +++ b/build/remove_old_eduserv_cert.pl @@ -0,0 +1,41 @@ +#!/usr/bin/perl -w + +# +# The input file is a fragment file that may or may not need to have +# the old Eduserv gateway certificate removed from it. Remove the certificate if +# required, or just re-export the file unchanged. +# + +# This line indicates that the old certificate is present +$old_cert_line = 'MIIDaTCCAtKgAwIBAgIQLqPCly3VfA8B2xVsTv59ajANBgkqhkiG9w0BAQUFADCB'; + +while (<>) { + + if (/$old_cert_line/) { + $delete = 1; + } + + if ($ended) { + print $_; + } else { + push @lines, $_; + if ($delete && /<\/KeyDescriptor/) { + while ((pop @lines) !~ //) { + # re-export the old file + while ($line = shift @lines) { + print $line; + } + $ended = 1; + } + +} + +# end