summaryrefslogtreecommitdiff
path: root/CommModule
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2014-12-16 21:03:54 +0100
committerBenny Baumann <BenBE@geshi.org>2014-12-16 21:08:25 +0100
commit0988a0c268653910f78a50e16d34edf14a89dc13 (patch)
tree3c8bcc1e070b4c15825758e16b4a426a58cf1fe0 /CommModule
parentdd6c8d16286f10c22b0fe7e4908825e18db9d703 (diff)
parent5596d4a37845019c6053c184a94689101a7d48a8 (diff)
downloadcacert-devel-0988a0c268653910f78a50e16d34edf14a89dc13.tar.gz
cacert-devel-0988a0c268653910f78a50e16d34edf14a89dc13.tar.xz
cacert-devel-0988a0c268653910f78a50e16d34edf14a89dc13.zip
Merge branch 'release' into bug-1131bug-1131
Conflicts: pages/wot/6.php www/policy/CAcertCommunityAgreement.php The conflict in the CCA document page was introduced due to the rename of the file. This instance can be safely ignored, as bug 1131 introduces a new version superseeding the old document. The instance in pages/wot/6.php is a bit more complicated, but basically results from a change of bug 1137 and the modified paths to the policy documents.
Diffstat (limited to 'CommModule')
-rwxr-xr-xCommModule/client.pl13
-rwxr-xr-xCommModule/usbclient.pl2
2 files changed, 11 insertions, 4 deletions
diff --git a/CommModule/client.pl b/CommModule/client.pl
index bf92b27..25e6a73 100755
--- a/CommModule/client.pl
+++ b/CommModule/client.pl
@@ -31,7 +31,7 @@ use DBI;
use Locale::gettext;
use IO::Socket;
use MIME::Base64;
-use Digest::SHA1 qw(sha1_hex);
+use Digest::SHA qw(sha1_hex);
#Protocol version:
my $ver=1;
@@ -441,7 +441,7 @@ sub calculateDays($)
{
if($_[0])
{
- my @sum = $dbh->selectrow_array("select sum(`points`) as `total` from `notary` where `to`='".$_[0]."' group by `to`");
+ my @sum = $dbh->selectrow_array("select sum(`points`) as `total` from `notary` where `to`='".$_[0]."' and `deleted`=0 group by `to`");
SysLog("Summe: $sum[0]\n") if($debug);
return ($sum[0]>=50)?730:180;
@@ -834,8 +834,15 @@ sub HandleCerts($$)
my $days=$org?($server?(365*2):365):calculateDays($row{"memid"});
+ my $md_id = 0;
+ $md_id = 1 if( $row{'md'} eq "md5");
+ $md_id = 2 if( $row{'md'} eq "sha1");
+ $md_id = 3 if( $row{'md'} eq "rmd160");
+ $md_id = 8 if( $row{'md'} eq "sha256");
+ $md_id = 9 if( $row{'md'} eq "sha384");
+ $md_id =10 if( $row{'md'} eq "sha512");
- $crt=Request($ver,1,1,$row{'rootcert'}-1,$profile,$row{'md'}eq"sha1"?2:0,$days,$row{'keytype'}eq"NS"?1:0,$content,$SAN,$subject);
+ $crt=Request($ver,1,1,$row{'rootcert'}-1,$profile,$md_id,$days,$row{'keytype'}eq"NS"?1:0,$content,$SAN,$subject);
if(length($crt))
{
if($crt=~m/^-----BEGIN CERTIFICATE-----/)
diff --git a/CommModule/usbclient.pl b/CommModule/usbclient.pl
index 3cbe2c3..6cbc111 100755
--- a/CommModule/usbclient.pl
+++ b/CommModule/usbclient.pl
@@ -425,7 +425,7 @@ sub calculateDays($)
{
if($_[0])
{
- my @sum = $dbh->selectrow_array("select sum(`points`) as `total` from `notary` where `to`='".$_[0]."' group by `to`");
+ my @sum = $dbh->selectrow_array("select sum(`points`) as `total` from `notary` where `to`='".$_[0]."' and `deleted`=0 group by `to`");
SysLog("Summe: $sum[0]\n") if($debug);
return ($sum[0]>=50)?730:180;