securemail: update library and readme

This commit is contained in:
fabrixxm 2015-11-07 00:06:17 +01:00
parent b9e5d016e3
commit a25f694960
5 changed files with 35 additions and 19 deletions

View file

@ -89,7 +89,7 @@ class GPG_Public_Key {
$len = ord($sa[$i++]);
if ($len > 191 && $len < 224) $len = (($len - 192) << 8) + ord($sa[$i++]);
else if ($len == 255) $len = (ord($sa[$i++]) << 24) + (ord($sa[$i++]) << 16) + (ord($sa[$i++]) << 8) + ord($sa[$i++]);
else if ($len > 223 && len < 255) $len = (1 << ($len & 0x1f));
else if ($len > 223 && $len < 255) $len = (1 << ($len & 0x1f));
} else {
$len = $tag & 3;
$tag = ($tag >> 2) & 15;
@ -137,10 +137,11 @@ class GPG_Public_Key {
// echo "POSITION: $delimPos\n";
$pkt = chr(0x99) . chr($delimPos >> 8) . chr($delimPos & 255) . substr($s, $headerPos, $delimPos);
// this does not work, tried it with RSA 1024 and RSA 4096 keys generated by GnuPG v2 (2.0.29) on Windows running Apache and PHP 5.6.3
// $pkt = chr(0x99) . chr($delimPos >> 8) . chr($delimPos & 255) . substr($s, $headerPos, $delimPos);
// this is the original signing string which seems to have only worked for key lengths of 1024 or less
//$pkt = chr(0x99) . chr($len >> 8) . chr($len & 255) . substr($s, $k, $len);
$pkt = chr(0x99) . chr($len >> 8) . chr($len & 255) . substr($s, $k, $len); // use this for now
$fp = sha1($pkt);
$this->fp = $fp;
@ -214,4 +215,4 @@ class GPG_Public_Key {
}
}
?>
?>