summaryrefslogtreecommitdiff
path: root/scripts/DumpWeakCerts.pl
diff options
context:
space:
mode:
authorMichael Tänzer <neo@nhng.de>2011-03-27 22:25:05 +0200
committerMichael Tänzer <neo@nhng.de>2011-03-27 22:25:05 +0200
commit3cdf9f382b70f4fb44f70e9e7acfb3775a24f906 (patch)
treeb4de995c9b169b5cc2bfb59559cee71a14f82a3e /scripts/DumpWeakCerts.pl
parent00bf1965735bd5a5bc41ed3db42ac935b5a5e387 (diff)
downloadcacert-devel-3cdf9f382b70f4fb44f70e9e7acfb3775a24f906.tar.gz
cacert-devel-3cdf9f382b70f4fb44f70e9e7acfb3775a24f906.tar.xz
cacert-devel-3cdf9f382b70f4fb44f70e9e7acfb3775a24f906.zip
#918: Weak keys in certificates
Detection script: Put database username and password into a separate file Signed-off-by: Michael Tänzer <neo@nhng.de>
Diffstat (limited to 'scripts/DumpWeakCerts.pl')
-rwxr-xr-xscripts/DumpWeakCerts.pl9
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/DumpWeakCerts.pl b/scripts/DumpWeakCerts.pl
index b00988c..54bd11a 100755
--- a/scripts/DumpWeakCerts.pl
+++ b/scripts/DumpWeakCerts.pl
@@ -7,7 +7,14 @@ use warnings;
use DBI;
-my $dbh = DBI->connect('DBI:mysql:database=cacert;host=127.0.0.1', 'cacert', 'FKj54eZQsZIW', { RaiseError => 1 } ) || die "Cannot connect database: $DBI::errstr";
+my $cacert_db_config;
+my $cacert_db_user;
+my $cacert_db_password;
+
+# Read database access data from the config file
+eval `cat perl_mysql`;
+
+my $dbh = DBI->connect($cacert_db_config, $cacert_db_user, $cacert_db_password, { RaiseError => 1 } ) || die "Cannot connect database: $DBI::errstr";
my $sth_certs;
my $sth_userdata;