only validate headers that aren't "spoofable", which will be somewhat implementation dependent.

This commit is contained in:
zotlabs 2017-09-03 17:12:42 -07:00
parent 499b7de0d2
commit db82d303e2

View File

@ -26,6 +26,7 @@ class HTTPSig {
$body = $data;
$headers = null;
$spoofable = false;
$result = [
'signer' => '',
@ -80,6 +81,9 @@ class HTTPSig {
if(array_key_exists($h,$headers)) {
$signed_data .= $h . ': ' . $headers[$h] . "\n";
}
if(strpos($h,'.')) {
$spoofable = true;
}
}
$signed_data = rtrim($signed_data,"\n");
@ -101,6 +105,7 @@ class HTTPSig {
if($x === false)
return $result;
if(! $spoofable)
$result['header_valid'] = true;
if(in_array('digest',$signed_headers)) {