Edit File by line
/home/barbar84/www/wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../var/softacul.../moodle29
File: privatekey.php
<?php
[0] Fix | Delete
[1] Fix | Delete
// We do not need this file any more
[2] Fix | Delete
@unlink('privatekey.php');
[3] Fix | Delete
[4] Fix | Delete
$ltikey = __mod_lti_verify_private_key();
[5] Fix | Delete
[6] Fix | Delete
echo '<kid>'.$ltikey['kid'].'</kid>';
[7] Fix | Delete
echo '<privatekey>'.$ltikey['privatekey'].'</privatekey>';
[8] Fix | Delete
[9] Fix | Delete
function __mod_lti_verify_private_key() {
[10] Fix | Delete
global $error;
[11] Fix | Delete
[12] Fix | Delete
if (!function_exists('openssl_random_pseudo_bytes')) {
[13] Fix | Delete
$error[] = "openssl must be loaded for openssl_random_pseudo_bytes to function";
[14] Fix | Delete
return null;
[15] Fix | Delete
}
[16] Fix | Delete
[17] Fix | Delete
// Create the private key.
[18] Fix | Delete
$kid = bin2hex(openssl_random_pseudo_bytes(10));
[19] Fix | Delete
[20] Fix | Delete
$config = array(
[21] Fix | Delete
"digest_alg" => "sha256",
[22] Fix | Delete
"private_key_bits" => 2048,
[23] Fix | Delete
"private_key_type" => OPENSSL_KEYTYPE_RSA,
[24] Fix | Delete
);
[25] Fix | Delete
$res = openssl_pkey_new($config);
[26] Fix | Delete
openssl_pkey_export($res, $privatekey);
[27] Fix | Delete
[28] Fix | Delete
return array(
[29] Fix | Delete
'kid' => $kid,
[30] Fix | Delete
'privatekey' => $privatekey,
[31] Fix | Delete
);
[32] Fix | Delete
}
[33] Fix | Delete
[34] Fix | Delete
?>
[35] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function