<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
	<id>http://wiki.mipt.ru/index.php?action=history&amp;feed=atom&amp;title=Development%3AMNet_Protocol</id>
	<title>Development:MNet Protocol - История изменений</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.mipt.ru/index.php?action=history&amp;feed=atom&amp;title=Development%3AMNet_Protocol"/>
	<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=Development:MNet_Protocol&amp;action=history"/>
	<updated>2026-05-07T18:27:17Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>http://wiki.mipt.ru/index.php?title=Development:MNet_Protocol&amp;diff=11332&amp;oldid=prev</id>
		<title>Олег Давидович: 1 версия импортирована</title>
		<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=Development:MNet_Protocol&amp;diff=11332&amp;oldid=prev"/>
		<updated>2024-10-21T08:51:25Z</updated>

		<summary type="html">&lt;p&gt;1 версия импортирована&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Предыдущая версия&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Версия от 08:51, 21 октября 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Олег Давидович</name></author>
	</entry>
	<entry>
		<id>http://wiki.mipt.ru/index.php?title=Development:MNet_Protocol&amp;diff=11331&amp;oldid=prev</id>
		<title>1&gt;Tsala: category edit</title>
		<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=Development:MNet_Protocol&amp;diff=11331&amp;oldid=prev"/>
		<updated>2010-02-18T20:17:42Z</updated>

		<summary type="html">&lt;p&gt;category edit&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
Moodle Networks allows other sites to perform RPC calls on a Moodle instance in a secure fashion. (Most) requests are signed and encrypted for security. Sites are identified by their web root ($CFG-&amp;gt;wwwroot in Moodle), and publish a public key (RSA). Requests and responses are encoded using XML-RPC, and signing and encryption are performed using XML-SIG and XML-ENC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Application types ==&lt;br /&gt;
&lt;br /&gt;
* MNet supports different types of applications, with different access URLs&lt;br /&gt;
* defined in mnet_application table&lt;br /&gt;
* lists names and URLs for RPC&lt;br /&gt;
&lt;br /&gt;
== Log in flow ==&lt;br /&gt;
&lt;br /&gt;
* dramatis personae&lt;br /&gt;
** user&lt;br /&gt;
** IdP (identity provider) = site the user is logging in from&lt;br /&gt;
** SP (service provider) = site the user is logging in to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Basic successful log in ===&lt;br /&gt;
&lt;br /&gt;
# user clicks on link on IdP&lt;br /&gt;
# user is taken to /auth/mnet/jump.php with hostid parameter set to SP&amp;#039;s ID, and (optionally) wantsurl set&lt;br /&gt;
# IdP generates token and creates MNet session (see below)&lt;br /&gt;
# IdP redirects user to SP&amp;#039;s &amp;quot;land&amp;quot; url (as defined in mnet_application table) with token, idp, and wantsurl parameters set&lt;br /&gt;
# user visits SP&amp;#039;s land url&lt;br /&gt;
# SP calls &amp;quot;auth/mnet/auth.php/user_authorise&amp;quot; on IdP via XML-RPC with token and user&amp;#039;s useragent string as parameters&lt;br /&gt;
# IdP verifies MNet session and returns user data&lt;br /&gt;
# SP may fetch additional data from IdP, add user to its own DB, update enrolments on IdP, etc.&lt;br /&gt;
# SP redirects user to wantsurl&lt;br /&gt;
&lt;br /&gt;
== MNet session ==&lt;br /&gt;
&lt;br /&gt;
ID provider stores:&lt;br /&gt;
* host&lt;br /&gt;
* userid&lt;br /&gt;
* username&lt;br /&gt;
* sha1(useragent)&lt;br /&gt;
* token&lt;br /&gt;
* confirm timeout&lt;br /&gt;
* expires&lt;br /&gt;
* session id&lt;br /&gt;
&lt;br /&gt;
== Allowed RPC calls ==&lt;br /&gt;
&lt;br /&gt;
* permissions stored in mnet_host2service x mnet_service2rpc x mnet_rpc (except for &amp;quot;dangerous&amp;quot; calls)&lt;br /&gt;
* modules/plugins must have ($module_)mnet_publishes function&lt;br /&gt;
* system&lt;br /&gt;
** system/listMethods&lt;br /&gt;
** system/methodSignature&lt;br /&gt;
** system/methodHelp&lt;br /&gt;
** system/listServices&lt;br /&gt;
** system/keyswap&lt;br /&gt;
* auth&lt;br /&gt;
** auth/$plugin/auth.php/$method -&amp;gt; file:/auth/$plugin/auth.php class:auth_plugin_$plugin method:$method&lt;br /&gt;
* enrol&lt;br /&gt;
** auth/$plugin/enrol.php/$method -&amp;gt; file:/enrol/$plugin/enrol.php class:enrolment_plugin_$plugin method:$method&lt;br /&gt;
* portfolio (Moodle 2.0)&lt;br /&gt;
** portfolio/$plugin/lib.php/$method -&amp;gt; file:/portfolio/type/$plugin/lib.php class:portfolio_plugin_$plugin method:$method&lt;br /&gt;
* repository (Moodle 2.0)&lt;br /&gt;
** repository/$plugin/repository.class.php/$method -&amp;gt; file:repository/$plugin/repository.class.php class:repository_$plugin method:$method&lt;br /&gt;
* mod&lt;br /&gt;
** mod/$module/rpclib.php/$function -&amp;gt; file:/mod/$module/rpclib.php function:$function&lt;br /&gt;
* dangerous (only if sender has plaintext_is_ok set)&lt;br /&gt;
** dangerous/$path/$function -&amp;gt; file:/$path function:$function (response is not encrypted/signed)&lt;br /&gt;
&lt;br /&gt;
see [[Development:MNet services]] for more information on the default available methods&lt;br /&gt;
&lt;br /&gt;
== Security ==&lt;br /&gt;
&lt;br /&gt;
* XML-RPC messages are encrypted/signed using public key cryptography&lt;br /&gt;
* use wrappers based on XML-SEC&lt;br /&gt;
* wrappers have &amp;quot;wwwroot&amp;quot; element to identify the sender&lt;br /&gt;
* Note: security may be compromised by a man-in-the-middle and/or DNS attack&lt;br /&gt;
* see also [[Mnet keys]]&lt;br /&gt;
&lt;br /&gt;
== encryption ==&lt;br /&gt;
&lt;br /&gt;
* uses openssl&amp;#039;s seal routine&lt;br /&gt;
* RC4-encrypted (128-bit key)&lt;br /&gt;
* RC4 key encrypted (RSA) with public key&lt;br /&gt;
&lt;br /&gt;
== signature ==&lt;br /&gt;
&lt;br /&gt;
* digest: SHA-1&lt;br /&gt;
* signature: RSA (despite the XML-SIG wrapper claiming to be DSA)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== key generation ==&lt;br /&gt;
&lt;br /&gt;
* 1024 bit RSA&lt;br /&gt;
* self-signed&lt;br /&gt;
* send certificate as PEM-encoded&lt;br /&gt;
* X.509 certificate fields (only CN is actually checked)&lt;br /&gt;
* C (country name)&lt;br /&gt;
* ST (state or province name)&lt;br /&gt;
* L (locality name)&lt;br /&gt;
* O (organization name)&lt;br /&gt;
* OU (organizational unit name) = Moodle (or whatever software you are running)&lt;br /&gt;
* CN (common name) = $wwwroot (no trailing slashes)&lt;br /&gt;
* EMAILADDRESS (email address)&lt;br /&gt;
&lt;br /&gt;
== Error handling ==&lt;br /&gt;
&lt;br /&gt;
see also [[Development:MNet faults]]&lt;br /&gt;
&lt;br /&gt;
=== if signature does not match ===&lt;br /&gt;
(see also http://moodle.org/mod/forum/discuss.php?d=102113)&lt;br /&gt;
&lt;br /&gt;
* server sends &amp;quot;system/listServices&amp;quot; to client&lt;br /&gt;
* system/listServices is used so that the server will return a (signed) 7025 fault&lt;br /&gt;
* server retrieves key from response&lt;br /&gt;
&lt;br /&gt;
=== if decryption fails ===&lt;br /&gt;
* try decrypting against old keys&lt;br /&gt;
* if able to decrypt, send fault #7025, signed with old private key, with certificate as content. This reduces an attacker&amp;#039;s ability to perform a man-in-the-middle attack.&lt;br /&gt;
* otherwise, send fault #7023&lt;br /&gt;
&lt;br /&gt;
[[Category:MNet]]&lt;/div&gt;</summary>
		<author><name>1&gt;Tsala</name></author>
	</entry>
</feed>