interceptor.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460
  1. /**
  2. * @description MeshCentral Intel(R) AMT Interceptor
  3. * @author Ylian Saint-Hilaire
  4. * @copyright Intel Corporation 2018-2022
  5. * @license Apache-2.0
  6. * @version v0.0.3
  7. */
  8. /*xjslint node: true */
  9. /*xjslint plusplus: true */
  10. /*xjslint maxlen: 256 */
  11. /*jshint node: true */
  12. /*jshint strict: false */
  13. /*jshint esversion: 6 */
  14. 'use strict';
  15. const crypto = require('crypto');
  16. const common = require('./common.js');
  17. var HttpInterceptorAuthentications = {};
  18. //var RedirInterceptorAuthentications = {};
  19. // Construct a HTTP interceptor object
  20. module.exports.CreateHttpInterceptor = function (args) {
  21. var obj = {};
  22. // Create a random hex string of a given length
  23. obj.randomValueHex = function (len) { return crypto.randomBytes(Math.ceil(len / 2)).toString('hex').slice(0, len); };
  24. obj.args = args;
  25. obj.amt = { acc: '', mode: 0, count: 0, error: false }; // mode: 0:Header, 1:LengthBody, 2:ChunkedBody, 3:UntilClose
  26. obj.ws = { acc: '', mode: 0, count: 0, error: false, authCNonce: obj.randomValueHex(10), authCNonceCount: 1 };
  27. obj.blockAmtStorage = false;
  28. // Private method
  29. obj.Debug = function (msg) { console.log(msg); };
  30. // Process data coming from Intel AMT
  31. obj.processAmtData = function (data) {
  32. obj.amt.acc += data.toString('binary'); // Add data to accumulator
  33. data = '';
  34. var datalen = 0;
  35. do { datalen = data.length; data += obj.processAmtDataEx(); } while (datalen != data.length); // Process as much data as possible
  36. return Buffer.from(data, 'binary');
  37. };
  38. // Process data coming from AMT in the accumulator
  39. obj.processAmtDataEx = function () {
  40. var i, r, headerend;
  41. if (obj.amt.mode == 0) { // Header Mode
  42. // Decode the HTTP header
  43. headerend = obj.amt.acc.indexOf('\r\n\r\n');
  44. if (headerend < 0) return '';
  45. var headerlines = obj.amt.acc.substring(0, headerend).split('\r\n');
  46. obj.amt.acc = obj.amt.acc.substring(headerend + 4);
  47. obj.amt.directive = headerlines[0].split(' ');
  48. var headers = headerlines.slice(1);
  49. obj.amt.headers = {};
  50. obj.amt.mode = 3; // UntilClose
  51. for (i in headers) {
  52. var j = headers[i].indexOf(':');
  53. if (j > 0) {
  54. var v1 = headers[i].substring(0, j).trim().toLowerCase();
  55. var v2 = headers[i].substring(j + 1).trim();
  56. obj.amt.headers[v1] = v2;
  57. if (v1.toLowerCase() == 'www-authenticate') {
  58. HttpInterceptorAuthentications[obj.args.host + ':' + obj.args.port] = v2;
  59. } else if (v1.toLowerCase() == 'content-length') {
  60. obj.amt.count = parseInt(v2);
  61. if (obj.amt.count > 0) {
  62. obj.amt.mode = 1; // LengthBody
  63. } else {
  64. obj.amt.mode = 0; // Header
  65. }
  66. } else if (v1.toLowerCase() == 'transfer-encoding' && v2.toLowerCase() == 'chunked') {
  67. obj.amt.mode = 2; // ChunkedBody
  68. }
  69. }
  70. }
  71. // Reform the HTTP header
  72. r = obj.amt.directive.join(' ') + '\r\n';
  73. for (i in obj.amt.headers) { r += (i + ': ' + obj.amt.headers[i] + '\r\n'); }
  74. r += '\r\n';
  75. return r;
  76. } else if (obj.amt.mode == 1) { // Length Body Mode
  77. // Send the body of content-length size
  78. var rl = obj.amt.count;
  79. if (rl < obj.amt.acc.length) rl = obj.amt.acc.length;
  80. r = obj.amt.acc.substring(0, rl);
  81. obj.amt.acc = obj.amt.acc.substring(rl);
  82. obj.amt.count -= rl;
  83. if (obj.amt.count == 0) { obj.amt.mode = 0; }
  84. return r;
  85. } else if (obj.amt.mode == 2) { // Chunked Body Mode
  86. // Send data one chunk at a time
  87. headerend = obj.amt.acc.indexOf('\r\n');
  88. if (headerend < 0) return '';
  89. var chunksize = parseInt(obj.amt.acc.substring(0, headerend), 16);
  90. if ((chunksize == 0) && (obj.amt.acc.length >= headerend + 4)) {
  91. // Send the ending chunk (NOTE: We do not support trailing headers)
  92. r = obj.amt.acc.substring(0, headerend + 4);
  93. obj.amt.acc = obj.amt.acc.substring(headerend + 4);
  94. obj.amt.mode = 0;
  95. return r;
  96. } else if ((chunksize > 0) && (obj.amt.acc.length >= (headerend + 4 + chunksize))) {
  97. // Send a chunk
  98. r = obj.amt.acc.substring(0, headerend + chunksize + 4);
  99. obj.amt.acc = obj.amt.acc.substring(headerend + chunksize + 4);
  100. return r;
  101. }
  102. } else if (obj.amt.mode == 3) { // Until Close Mode
  103. r = obj.amt.acc;
  104. obj.amt.acc = '';
  105. return r;
  106. }
  107. return '';
  108. };
  109. // Process data coming from the Browser
  110. obj.processBrowserData = function (data) {
  111. obj.ws.acc += data.toString('binary'); // Add data to accumulator
  112. data = '';
  113. var datalen = 0;
  114. do { datalen = data.length; data += obj.processBrowserDataEx(); } while (datalen != data.length); // Process as much data as possible
  115. return Buffer.from(data, 'binary');
  116. };
  117. // Process data coming from the Browser in the accumulator
  118. obj.processBrowserDataEx = function () {
  119. var i, r, headerend;
  120. if (obj.ws.mode == 0) { // Header Mode
  121. // Decode the HTTP header
  122. headerend = obj.ws.acc.indexOf('\r\n\r\n');
  123. if (headerend < 0) return '';
  124. var headerlines = obj.ws.acc.substring(0, headerend).split('\r\n');
  125. obj.ws.acc = obj.ws.acc.substring(headerend + 4);
  126. obj.ws.directive = headerlines[0].split(' ');
  127. // If required, block access to amt-storage. This is needed when web storage is not supported on CIRA.
  128. if ((obj.blockAmtStorage == true) && (obj.ws.directive.length > 1) && (obj.ws.directive[1].indexOf('/amt-storage') == 0)) { obj.ws.directive[1] = obj.ws.directive[1].replace('/amt-storage', '/amt-dummy-storage'); }
  129. var headers = headerlines.slice(1);
  130. obj.ws.headers = {};
  131. obj.ws.mode = 3; // UntilClose
  132. for (i in headers) {
  133. var j = headers[i].indexOf(':');
  134. if (j > 0) {
  135. var v1 = headers[i].substring(0, j).trim().toLowerCase();
  136. var v2 = headers[i].substring(j + 1).trim();
  137. obj.ws.headers[v1] = v2;
  138. if (v1.toLowerCase() == 'www-authenticate') {
  139. HttpInterceptorAuthentications[obj.args.host + ':' + obj.args.port] = v2;
  140. } else if (v1.toLowerCase() == 'content-length') {
  141. obj.ws.count = parseInt(v2);
  142. if (obj.ws.count > 0) {
  143. obj.ws.mode = 1; // LengthBody
  144. } else {
  145. obj.ws.mode = 0; // Header
  146. }
  147. } else if (v1.toLowerCase() == 'transfer-encoding' && v2.toLowerCase() == 'chunked') {
  148. obj.ws.mode = 2; // ChunkedBody
  149. }
  150. }
  151. }
  152. // Insert authentication
  153. if (obj.args.user && obj.args.pass && HttpInterceptorAuthentications[obj.args.host + ':' + obj.args.port]) {
  154. // We have authentication data, lets use it.
  155. var AuthArgs = obj.GetAuthArgs(HttpInterceptorAuthentications[obj.args.host + ':' + obj.args.port]);
  156. // If different QOP options are proposed, always use 'auth' for now.
  157. AuthArgs.qop = 'auth';
  158. // In the future, we should support auth-int, but that will required the body of the request to be accumulated and hashed.
  159. /*
  160. if (AuthArgs.qop != null) { // If Intel AMT supports auth-int, use it.
  161. var qopList = AuthArgs.qop.split(',');
  162. for (var i in qopList) { qopList[i] = qopList[i].trim(); }
  163. if (qopList.indexOf('auth-int') >= 0) { AuthArgs.qop = 'auth-int'; } else { AuthArgs.qop = 'auth'; }
  164. }
  165. */
  166. var hash = obj.ComputeDigesthash(obj.args.user, obj.args.pass, AuthArgs.realm, obj.ws.directive[0], obj.ws.directive[1], AuthArgs.qop, AuthArgs.nonce, obj.ws.authCNonceCount, obj.ws.authCNonce);
  167. var authstr = 'Digest username="' + obj.args.user + '",realm="' + AuthArgs.realm + '",nonce="' + AuthArgs.nonce + '",uri="' + obj.ws.directive[1] + '",qop=' + AuthArgs.qop + ',nc=' + obj.ws.authCNonceCount + ',cnonce="' + obj.ws.authCNonce + '",response="' + hash + '"';
  168. if (AuthArgs.opaque) { authstr += (',opaque="' + AuthArgs.opaque + '"'); }
  169. obj.ws.headers.authorization = authstr;
  170. obj.ws.authCNonceCount++;
  171. } else {
  172. // We don't have authentication, clear it out of the header if needed.
  173. if (obj.ws.headers.authorization) { delete obj.ws.headers.authorization; }
  174. }
  175. // Reform the HTTP header
  176. r = obj.ws.directive.join(' ') + '\r\n';
  177. for (i in obj.ws.headers) { r += (i + ': ' + obj.ws.headers[i] + '\r\n'); }
  178. r += '\r\n';
  179. return r;
  180. } else if (obj.ws.mode == 1) { // Length Body Mode
  181. // Send the body of content-length size
  182. var rl = obj.ws.count;
  183. if (rl < obj.ws.acc.length) rl = obj.ws.acc.length;
  184. r = obj.ws.acc.substring(0, rl);
  185. obj.ws.acc = obj.ws.acc.substring(rl);
  186. obj.ws.count -= rl;
  187. if (obj.ws.count == 0) { obj.ws.mode = 0; }
  188. return r;
  189. } else if (obj.amt.mode == 2) { // Chunked Body Mode
  190. // Send data one chunk at a time
  191. headerend = obj.amt.acc.indexOf('\r\n');
  192. if (headerend < 0) return '';
  193. var chunksize = parseInt(obj.amt.acc.substring(0, headerend), 16);
  194. if (isNaN(chunksize)) { // TODO: Check this path
  195. // Chunk is not in this batch, move one
  196. r = obj.amt.acc.substring(0, headerend + 2);
  197. obj.amt.acc = obj.amt.acc.substring(headerend + 2);
  198. // Peek if we next is the end of chunked transfer
  199. headerend = obj.amt.acc.indexOf('\r\n');
  200. if (headerend > 0) {
  201. chunksize = parseInt(obj.amt.acc.substring(0, headerend), 16);
  202. if (chunksize == 0) { obj.amt.mode = 0; }
  203. }
  204. return r;
  205. } else if (chunksize == 0 && obj.amt.acc.length >= headerend + 4) {
  206. // Send the ending chunk (NOTE: We do not support trailing headers)
  207. r = obj.amt.acc.substring(0, headerend + 4);
  208. obj.amt.acc = obj.amt.acc.substring(headerend + 4);
  209. obj.amt.mode = 0;
  210. return r;
  211. } else if (chunksize > 0 && obj.amt.acc.length >= headerend + 4) {
  212. // Send a chunk
  213. r = obj.amt.acc.substring(0, headerend + chunksize + 4);
  214. obj.amt.acc = obj.amt.acc.substring(headerend + chunksize + 4);
  215. return r;
  216. }
  217. } else if (obj.ws.mode == 3) { // Until Close Mode
  218. r = obj.ws.acc;
  219. obj.ws.acc = '';
  220. return r;
  221. }
  222. return '';
  223. };
  224. // Parse authentication values from the HTTP header
  225. obj.GetAuthArgs = function (authheader) {
  226. var authargs = {};
  227. var authargsstr = authheader.substring(7).split(',');
  228. for (var j in authargsstr) {
  229. var argstr = authargsstr[j];
  230. var i = argstr.indexOf('=');
  231. var k = argstr.substring(0, i).trim().toLowerCase();
  232. var v = argstr.substring(i + 1).trim();
  233. if (v.substring(0, 1) == '\"') { v = v.substring(1, v.length - 1); }
  234. if (i > 0) authargs[k] = v;
  235. }
  236. return authargs;
  237. };
  238. // Compute the MD5 digest hash for a set of values
  239. obj.ComputeDigesthash = function (username, password, realm, method, path, qop, nonce, nc, cnonce) {
  240. var ha1 = crypto.createHash('md5').update(username + ':' + realm + ':' + password).digest('hex');
  241. var ha2 = crypto.createHash('md5').update(method + ':' + path).digest('hex');
  242. return crypto.createHash('md5').update(ha1 + ':' + nonce + ':' + nc + ':' + cnonce + ':' + qop + ':' + ha2).digest('hex');
  243. };
  244. return obj;
  245. };
  246. // Construct a redirection interceptor object
  247. module.exports.CreateRedirInterceptor = function (args) {
  248. var obj = {};
  249. // Create a random hex string of a given length
  250. obj.randomValueHex = function (len) { return crypto.randomBytes(Math.ceil(len / 2)).toString('hex').slice(0, len); };
  251. obj.args = args;
  252. obj.amt = { acc: '', mode: 0, count: 0, error: false, direct: false };
  253. obj.ws = { acc: '', mode: 0, count: 0, error: false, direct: false, authCNonce: obj.randomValueHex(10), authCNonceCount: 1 };
  254. obj.RedirectCommands = { StartRedirectionSession: 0x10, StartRedirectionSessionReply: 0x11, EndRedirectionSession: 0x12, AuthenticateSession: 0x13, AuthenticateSessionReply: 0x14 };
  255. obj.StartRedirectionSessionReplyStatus = { SUCCESS: 0, TYPE_UNKNOWN: 1, BUSY: 2, UNSUPPORTED: 3, ERROR: 0xFF };
  256. obj.AuthenticationStatus = { SUCCESS: 0, FALIURE: 1, NOTSUPPORTED: 2 };
  257. obj.AuthenticationType = { QUERY: 0, USERPASS: 1, KERBEROS: 2, BADDIGEST: 3, DIGEST: 4 };
  258. // Private method
  259. obj.Debug = function (msg) { console.log(msg); };
  260. // Process data coming from Intel AMT
  261. obj.processAmtData = function (data) {
  262. if ((obj.amt.direct == true) && (obj.amt.acc == '')) { return data; } // Interceptor fast path
  263. obj.amt.acc += data.toString('binary'); // Add data to accumulator
  264. data = '';
  265. var datalen = 0;
  266. do { datalen = data.length; data += obj.processAmtDataEx(); } while (datalen != data.length); // Process as much data as possible
  267. return Buffer.from(data, 'binary');
  268. };
  269. // Process data coming from AMT in the accumulator
  270. obj.processAmtDataEx = function () {
  271. var r;
  272. if (obj.amt.acc.length == 0) return '';
  273. if (obj.amt.direct == true) {
  274. var data = obj.amt.acc;
  275. obj.amt.acc = '';
  276. return data;
  277. } else {
  278. //console.log(obj.amt.acc.charCodeAt(0));
  279. switch (obj.amt.acc.charCodeAt(0)) {
  280. case obj.RedirectCommands.StartRedirectionSessionReply: {
  281. if (obj.amt.acc.length < 4) return '';
  282. if (obj.amt.acc.charCodeAt(1) == obj.StartRedirectionSessionReplyStatus.SUCCESS) {
  283. if (obj.amt.acc.length < 13) return '';
  284. var oemlen = obj.amt.acc.charCodeAt(12);
  285. if (obj.amt.acc.length < 13 + oemlen) return '';
  286. r = obj.amt.acc.substring(0, 13 + oemlen);
  287. obj.amt.acc = obj.amt.acc.substring(13 + oemlen);
  288. return r;
  289. }
  290. break;
  291. }
  292. case obj.RedirectCommands.AuthenticateSessionReply: {
  293. if (obj.amt.acc.length < 9) return '';
  294. var l = common.ReadIntX(obj.amt.acc, 5);
  295. if (obj.amt.acc.length < 9 + l) return '';
  296. var authstatus = obj.amt.acc.charCodeAt(1);
  297. var authType = obj.amt.acc.charCodeAt(4);
  298. if ((authType == obj.AuthenticationType.DIGEST) && (authstatus == obj.AuthenticationStatus.FALIURE)) {
  299. // Grab and keep all authentication parameters
  300. var realmlen = obj.amt.acc.charCodeAt(9);
  301. obj.amt.digestRealm = obj.amt.acc.substring(10, 10 + realmlen);
  302. var noncelen = obj.amt.acc.charCodeAt(10 + realmlen);
  303. obj.amt.digestNonce = obj.amt.acc.substring(11 + realmlen, 11 + realmlen + noncelen);
  304. var qoplen = obj.amt.acc.charCodeAt(11 + realmlen + noncelen);
  305. obj.amt.digestQOP = obj.amt.acc.substring(12 + realmlen + noncelen, 12 + realmlen + noncelen + qoplen);
  306. }
  307. else if (authType != obj.AuthenticationType.QUERY && authstatus == obj.AuthenticationStatus.SUCCESS) {
  308. // Intel AMT relayed that authentication was successful, go to direct relay mode in both directions.
  309. obj.ws.direct = true;
  310. obj.amt.direct = true;
  311. }
  312. r = obj.amt.acc.substring(0, 9 + l);
  313. obj.amt.acc = obj.amt.acc.substring(9 + l);
  314. return r;
  315. }
  316. default: {
  317. obj.amt.error = true;
  318. return '';
  319. }
  320. }
  321. }
  322. return '';
  323. };
  324. // Process data coming from the Browser
  325. obj.processBrowserData = function (data) {
  326. if ((obj.ws.direct == true) && (obj.ws.acc == '')) { return data; } // Interceptor fast path
  327. obj.ws.acc += data.toString('binary'); // Add data to accumulator
  328. data = '';
  329. var datalen = 0;
  330. do { datalen = data.length; data += obj.processBrowserDataEx(); } while (datalen != data.length); // Process as much data as possible
  331. return Buffer.from(data, 'binary');
  332. };
  333. // Process data coming from the Browser in the accumulator
  334. obj.processBrowserDataEx = function () {
  335. var r;
  336. if (obj.ws.acc.length == 0) return '';
  337. if (obj.ws.direct == true) {
  338. var data = obj.ws.acc;
  339. obj.ws.acc = '';
  340. return data;
  341. } else {
  342. switch (obj.ws.acc.charCodeAt(0)) {
  343. case obj.RedirectCommands.StartRedirectionSession: {
  344. if (obj.ws.acc.length < 8) return '';
  345. r = obj.ws.acc.substring(0, 8);
  346. obj.ws.acc = obj.ws.acc.substring(8);
  347. return r;
  348. }
  349. case obj.RedirectCommands.EndRedirectionSession: {
  350. if (obj.ws.acc.length < 4) return '';
  351. r = obj.ws.acc.substring(0, 4);
  352. obj.ws.acc = obj.ws.acc.substring(4);
  353. return r;
  354. }
  355. case obj.RedirectCommands.AuthenticateSession: {
  356. if (obj.ws.acc.length < 9) return '';
  357. var l = common.ReadIntX(obj.ws.acc, 5);
  358. if (obj.ws.acc.length < 9 + l) return '';
  359. var authType = obj.ws.acc.charCodeAt(4);
  360. if (authType == obj.AuthenticationType.DIGEST && obj.args.user && obj.args.pass) {
  361. var authurl = '/RedirectionService';
  362. if (obj.amt.digestRealm) {
  363. // Replace this authentication digest with a server created one
  364. // We have everything we need to authenticate
  365. var nc = '0'+ (10000000 + obj.ws.authCNonceCount).toString().substring(1);// set NC at least 8 bytes
  366. obj.ws.authCNonceCount++;
  367. var digest = obj.ComputeDigesthash(obj.args.user, obj.args.pass, obj.amt.digestRealm, 'POST', authurl, obj.amt.digestQOP, obj.amt.digestNonce, nc, obj.ws.authCNonce);
  368. // Replace this authentication digest with a server created one
  369. // We have everything we need to authenticate
  370. r = String.fromCharCode(0x13, 0x00, 0x00, 0x00, 0x04);
  371. r += common.IntToStrX(obj.args.user.length + obj.amt.digestRealm.length + obj.amt.digestNonce.length + authurl.length + obj.ws.authCNonce.length + nc.toString().length + digest.length + obj.amt.digestQOP.length + 8);
  372. r += String.fromCharCode(obj.args.user.length); // Username Length
  373. r += obj.args.user; // Username
  374. r += String.fromCharCode(obj.amt.digestRealm.length); // Realm Length
  375. r += obj.amt.digestRealm; // Realm
  376. r += String.fromCharCode(obj.amt.digestNonce.length); // Nonce Length
  377. r += obj.amt.digestNonce; // Nonce
  378. r += String.fromCharCode(authurl.length); // Authentication URL "/RedirectionService" Length
  379. r += authurl; // Authentication URL
  380. r += String.fromCharCode(obj.ws.authCNonce.length); // CNonce Length
  381. r += obj.ws.authCNonce; // CNonce
  382. r += String.fromCharCode(nc.toString().length); // NonceCount Length
  383. r += nc.toString(); // NonceCount
  384. r += String.fromCharCode(digest.length); // Response Length
  385. r += digest; // Response
  386. r += String.fromCharCode(obj.amt.digestQOP.length); // QOP Length
  387. r += obj.amt.digestQOP; // QOP
  388. obj.ws.acc = obj.ws.acc.substring(9 + l); // Don't relay the original message
  389. return r;
  390. } else {
  391. // Replace this authentication digest with a server created one
  392. // Since we don't have authentication parameters, fill them in with blanks to get an error back what that info.
  393. r = String.fromCharCode(0x13, 0x00, 0x00, 0x00, 0x04);
  394. r += common.IntToStrX(obj.args.user.length + authurl.length + 8);
  395. r += String.fromCharCode(obj.args.user.length);
  396. r += obj.args.user;
  397. r += String.fromCharCode(0x00, 0x00, authurl.length);
  398. r += authurl;
  399. r += String.fromCharCode(0x00, 0x00, 0x00, 0x00);
  400. obj.ws.acc = obj.ws.acc.substring(9 + l); // Don't relay the original message
  401. return r;
  402. }
  403. }
  404. r = obj.ws.acc.substring(0, 9 + l);
  405. obj.ws.acc = obj.ws.acc.substring(9 + l);
  406. return r;
  407. }
  408. default: {
  409. obj.ws.error = true;
  410. }
  411. }
  412. }
  413. return '';
  414. };
  415. // Compute the MD5 digest hash for a set of values
  416. obj.ComputeDigesthash = function (username, password, realm, method, path, qop, nonce, nc, cnonce) {
  417. var ha1 = crypto.createHash('md5').update(username + ':' + realm + ':' + password).digest('hex');
  418. var ha2 = crypto.createHash('md5').update(method + ':' + path).digest('hex');
  419. return crypto.createHash('md5').update(ha1 + ':' + nonce + ':' + nc + ':' + cnonce + ':' + qop + ':' + ha2).digest('hex');
  420. };
  421. return obj;
  422. };