mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 12:40:01 +01:00
mnet MDL-16858 verify the signature in the xmlrpc response
This commit is contained in:
parent
5a355930d9
commit
cd8f1cf656
@ -281,6 +281,13 @@ class mnet_xmlrpc_client {
|
||||
}
|
||||
$this->error[] = $this->response['faultCode'] . " : " . $this->response['faultString'] ."\n".$guidance;
|
||||
}
|
||||
|
||||
// ok, it's signed, but is it signed with the right certificate ?
|
||||
// do this *after* we check for an out of date key
|
||||
if (!openssl_verify($this->xmlrpcresponse, base64_decode($sig_parser->signature), $mnet_peer->public_key)) {
|
||||
$this->error[] = 'Invalid signature';
|
||||
}
|
||||
|
||||
return empty($this->error);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user