Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Gather statistics about distinct RSA moduli used
Browse files Browse the repository at this point in the history
See ukf/ukf-meta#113.
  • Loading branch information
iay committed Feb 14, 2017
1 parent f8e9458 commit dd9abae
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
23 changes: 23 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2434,6 +2434,29 @@
<delete file="${temp.dir}/embedded.pem" quiet="true" verbose="false"/>
</target>

<!--
Check embedded certificates in our production aggregate.
You can ignore almost all of the output from this, other than
the summary information at the end and in particular the
number of distinct RSA moduli.
-->
<target name="check.embedded.all">
<echo>Extracting embedded certificates</echo>
<XALAN
i="${aggregates.dir}/${mdaggr.prod.signed}"
o="${temp.dir}/embedded.pem"
x="${build.dir}/extract_embedded.xsl"/>
<echo>Checking embedded certificates</echo>
<echo>Note: ignore expiry on eduGAIN entities</echo>
<exec executable="perl" dir="${utilities.dir}"
input="${temp.dir}/embedded.pem">
<arg value="${utilities.dir}/check_embedded.pl"/>
<arg value="${entities.dir}/expiry_whitelist.txt"/>
</exec>
<delete file="${temp.dir}/embedded.pem" quiet="true" verbose="false"/>
</target>

<!--
Check for IdPs using the single-port configuration.
-->
Expand Down
13 changes: 13 additions & 0 deletions utilities/check_embedded.pl
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,14 @@ sub comment {
next;
}

#
# Track distinct RSA moduli
#
if (/^Modulus=(.*)$/) {
$modulus = $1;
# print " modulus: '$modulus'\n";
$rsa_modulus{$modulus} = 1;
}
}
close SSL;
#print " text lines: $#lines\n";
Expand Down Expand Up @@ -405,6 +413,11 @@ sub comment {
}
print "\n";

$distinct_moduli = scalar keys %rsa_modulus;
if ($distinct_moduli > 1) {
print "Distinct RSA moduli: $distinct_moduli\n";
}

my $first = 1;
foreach $fingerprint (sort keys %expiry_whitelist) {
if ($expiry_whitelist{$fingerprint} eq 'unused') {
Expand Down

0 comments on commit dd9abae

Please sign in to comment.