summaryrefslogtreecommitdiff
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
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>
-rwxr-xr-xscripts/DumpWeakCerts.pl9
-rw-r--r--scripts/perl_mysql.sample6
2 files changed, 14 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;
diff --git a/scripts/perl_mysql.sample b/scripts/perl_mysql.sample
new file mode 100644
index 0000000..4800289
--- /dev/null
+++ b/scripts/perl_mysql.sample
@@ -0,0 +1,6 @@
+# This file contains the data needed to connect to the database to be
+# used in perl scripts
+
+$cacert_db_config = 'DBI:mysql:database=cacert;host=127.0.0.1';
+$cacert_db_user = 'cacert';
+$cacert_db_password = '<put_password_here>'; \ No newline at end of file