View Issue Details

IDProjectCategoryView StatusLast Update
0000814Main CAcert WebsiteGPG/PGPpublic2013-11-20 22:23
ReporterSourcerer Assigned ToSourcerer  
PriorityimmediateSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Fixed in Version2010 Q1 
Summary0000814: Multiple OpenPGP keys are handled incorrectly
DescriptionWhen uploading an OpenPGP Base64 container that contains several keys, CAcert handles the keys wrongly, and prefers the first key.
TagsNo tags attached.
Attached Files
npubs.patch (910 bytes)   
diff --git a/www/gpg.php b/www/gpg.php
index f97966f..894f298 100644
--- a/www/gpg.php
+++ b/www/gpg.php
@@ -104,11 +104,25 @@ function verifyEmail($email)
 		$resulttable=_("The following UIDs were found in your key:")."<br/><table border='1'><tr><td>#</td><td>"._("Name")."</td><td>"._("Email")."</td><td>Result</td>";
 		$i=0;
 		$lastvalidemail="";
+                $npubs=0;
 		foreach(explode("\n", $gpg) as $line)
 		{
 			$bits = explode(":", $line);
 			$resulttable.="<tr><td>".++$i."</td>";
 			$name = $comment = "";
+			if($bits[0] == "pub")
+			{
+				$npubs++;
+			}
+			if($npubs>1)
+			{
+				showheader(_("Welcome to CAcert.org"));
+				echo "<font color='#ff0000'>"._("Please upload only one key at a time.")."</font>";
+				unset($_REQUEST['process']);
+				$id = $oldid;
+				unset($oldid);
+				exit();
+			}
 			if($bits[0] == "pub" && (!$keyid || !$when))
 			{
 				$keyid = $bits[4];
npubs.patch (910 bytes)   
Reviewed by
Test Instructions

Activities

edgarwahn

2010-03-29 09:40

developer   ~0001569

Tested on cacert1.it-sls.de, looks good.

Sourcerer

2010-03-29 18:21

administrator   ~0001572

Hole has been closed.

Issue History

Date Modified Username Field Change
2010-03-28 23:20 Sourcerer New Issue
2010-03-28 23:20 Sourcerer File Added: npubs.patch
2010-03-29 09:40 edgarwahn Note Added: 0001569
2010-03-29 18:21 Sourcerer Note Added: 0001572
2010-03-29 18:21 Sourcerer Status new => closed
2010-03-29 18:21 Sourcerer Resolution open => fixed
2010-03-29 18:21 Sourcerer Assigned To => Sourcerer
2011-06-19 16:12 edgarwahn Source_changeset_attached => cacert-devel release a84f4ce8
2011-06-19 16:46 edgarwahn Source_changeset_attached => cacert-devel release a84f4ce8
2011-06-21 23:57 edgarwahn Source_changeset_attached => cacert-devel release a84f4ce8
2011-06-21 23:57 edgarwahn Source_changeset_attached => cacert-devel release 6c2e9fb5
2011-06-22 00:09 edgarwahn Source_changeset_attached => cacert-devel release a84f4ce8
2011-06-22 00:09 edgarwahn Source_changeset_attached => cacert-devel release 6c2e9fb5
2013-01-15 14:33 Werner Dworak Fixed in Version => 2010 Q1
2013-11-20 22:23 NEOatNHNG View Status private => public