only validate headers that aren't "spoofable", which will be somewhat implementation dependent.
This commit is contained in:
parent
499b7de0d2
commit
db82d303e2
@ -26,6 +26,7 @@ class HTTPSig {
|
|||||||
|
|
||||||
$body = $data;
|
$body = $data;
|
||||||
$headers = null;
|
$headers = null;
|
||||||
|
$spoofable = false;
|
||||||
|
|
||||||
$result = [
|
$result = [
|
||||||
'signer' => '',
|
'signer' => '',
|
||||||
@ -80,6 +81,9 @@ class HTTPSig {
|
|||||||
if(array_key_exists($h,$headers)) {
|
if(array_key_exists($h,$headers)) {
|
||||||
$signed_data .= $h . ': ' . $headers[$h] . "\n";
|
$signed_data .= $h . ': ' . $headers[$h] . "\n";
|
||||||
}
|
}
|
||||||
|
if(strpos($h,'.')) {
|
||||||
|
$spoofable = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$signed_data = rtrim($signed_data,"\n");
|
$signed_data = rtrim($signed_data,"\n");
|
||||||
|
|
||||||
@ -101,6 +105,7 @@ class HTTPSig {
|
|||||||
if($x === false)
|
if($x === false)
|
||||||
return $result;
|
return $result;
|
||||||
|
|
||||||
|
if(! $spoofable)
|
||||||
$result['header_valid'] = true;
|
$result['header_valid'] = true;
|
||||||
|
|
||||||
if(in_array('digest',$signed_headers)) {
|
if(in_array('digest',$signed_headers)) {
|
||||||
|
Reference in New Issue
Block a user