Fix to set state of encryption process
[platform/core/security/ode.git] / server / internal-encryption.cpp
1 /*
2  *  Copyright (c) 2015-2017 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *  Licensed under the Apache License, Version 2.0 (the "License");
5  *  you may not use this file except in compliance with the License.
6  *  You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *  Unless required by applicable law or agreed to in writing, software
11  *  distributed under the License is distributed on an "AS IS" BASIS,
12  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *  See the License for the specific language governing permissions and
14  *  limitations under the License
15  */
16 #include <set>
17 #include <algorithm>
18 #include <memory>
19 #include <mutex>
20 #include <condition_variable>
21 #include <list>
22
23 #include <fstream>
24 #include <fcntl.h>
25 #include <signal.h>
26 #include <unistd.h>
27 #include <sys/mount.h>
28 #include <sys/reboot.h>
29 #include <limits.h>
30 #include <stdlib.h>
31 #include <string.h>
32
33 #include <vconf.h>
34 #include <tzplatform_config.h>
35 #include <klay/process.h>
36 #include <klay/file-user.h>
37 #include <klay/filesystem.h>
38 #include <klay/dbus/connection.h>
39 #include <klay/error.h>
40
41 #include "misc.h"
42 #include "logger.h"
43 #include "progress-bar.h"
44 #include "rmi/common.h"
45
46 #include "ext4-tool.h"
47 #include "internal-encryption.h"
48 #include "internal-encryption-common.h"
49 #include "upgrade-support.h"
50
51 namespace ode {
52
53 namespace {
54
55 const char *PRIVILEGE_PLATFORM  = "http://tizen.org/privilege/internal/default/platform";
56
57 // watches systemd jobs
58 class JobWatch {
59 public:
60         explicit JobWatch(dbus::Connection& systemDBus);
61         ~JobWatch();
62
63         bool waitForJob(const std::string& job);
64
65 private:
66         void jobRemoved(const dbus::Variant& parameters);
67
68         struct Job {
69                 Job(uint32_t id,
70                         const std::string& job,
71                         const std::string& unit,
72                         const std::string& result) : id(id), job(job), unit(unit), result(result) {}
73                 uint32_t id;
74                 std::string job;
75                 std::string unit;
76                 std::string result;
77         };
78
79         dbus::Connection::SubscriptionId id;
80         dbus::Connection& systemDBus;
81         std::list<Job> removedJobs;
82         std::mutex jobsMutex;
83         std::condition_variable jobsCv;
84 };
85
86 JobWatch::JobWatch(dbus::Connection& systemDBus) : systemDBus(systemDBus) {
87         auto callback = [this](dbus::Variant parameters) {
88                 this->jobRemoved(parameters);
89         };
90
91         id = systemDBus.subscribeSignal("",
92                                                                         "/org/freedesktop/systemd1",
93                                                                         "org.freedesktop.systemd1.Manager",
94                                                                         "JobRemoved",
95                                                                         callback);
96 }
97
98 JobWatch::~JobWatch() {
99         systemDBus.unsubscribeSignal(id);
100 }
101
102 bool JobWatch::waitForJob(const std::string& job) {
103         while(true) {
104                 std::unique_lock<std::mutex> lock(jobsMutex);
105                 bool timeout = true;
106                 auto sec = std::chrono::seconds(1);
107                 jobsCv.wait_for(lock, 5*sec, [this, &timeout]{
108                                 if (!removedJobs.empty()) {
109                                         timeout = false;
110                                         return true;
111                                 }
112                                 return false;});
113
114                 if (timeout) {
115                         INFO(SINK, "job: " + job + ", result: time out");
116                         return false;
117                 }
118
119                 while(!removedJobs.empty()) {
120                         bool match = (removedJobs.front().job == job);
121                         bool done = (removedJobs.front().result == "done");
122                         removedJobs.pop_front();
123                         if (match)
124                                 return done;
125                 }
126         };
127 }
128
129 void JobWatch::jobRemoved(const dbus::Variant& parameters)
130 {
131         uint32_t id;
132         const char* job;
133         const char* unit;
134         const char* result;
135         parameters.get("(uoss)", &id, &job, &unit, &result);
136         INFO(SINK, "id:" + std::to_string(id) + " job:" + job + " unit:" + unit + " result:" + result);
137
138         {
139                 std::lock_guard<std::mutex> guard(jobsMutex);
140                 removedJobs.emplace_back(id, job, unit, result);
141         }
142         jobsCv.notify_one();
143 }
144
145 std::string getDecodedPath(const std::string &path, const std::string &prefix)
146 {
147         std::string ret = path;
148         size_t pos = 0;
149
150         pos = ret.find(prefix);
151         if (pos != std::string::npos)
152                 ret = ret.substr(prefix.size(), ret.size());
153
154         pos = 0;
155         while ((pos = ret.find("_", pos)) != std::string::npos) {
156                 int a = std::stoi(std::string(1, ret.at(pos+1)), nullptr, 16);
157                 int b = std::stoi(std::string(1, ret.at(pos+2)), nullptr, 16);
158                 if (a < 0 || b < 0)
159                         ret.replace(pos, 3, "_");
160                 else
161                         ret.replace(pos, 3, std::string(1, ((a << 4) | b)));
162                 pos += 1;
163         }
164         return ret;
165 }
166
167 void stopSystemdUnits()
168 {
169         dbus::Connection& systemDBus = dbus::Connection::getSystem();
170         dbus::VariantIterator iter;
171         std::vector<std::string> preprocessUnits;
172         std::set<std::string> unitsToStop;
173
174         auto stopUnit = [&systemDBus](const std::string &unit) {
175                 JobWatch watch(systemDBus);
176                 INFO(SINK, "Stopping unit: " + unit);
177                 const char* job = NULL;
178                 try {
179                         systemDBus.methodcall("org.freedesktop.systemd1",
180                                                                         "/org/freedesktop/systemd1",
181                                                                         "org.freedesktop.systemd1.Manager",
182                                                                         "StopUnit",
183                                                                         -1, "(o)", "(ss)", unit.c_str(), "flush").get("(o)", &job);
184                         INFO(SINK, "Waiting for job: " + std::string(job));
185                         if (!watch.waitForJob(job))
186                                 ERROR(SINK, "Stopping unit: " + unit + " failed");
187                 } catch (runtime::Exception &e) {
188                         ERROR(SINK, std::string(e.what()));
189                 }
190         };
191
192         try {
193                 systemDBus.methodcall("org.freedesktop.systemd1",
194                                                                 "/org/freedesktop/systemd1",
195                                                                 "org.freedesktop.systemd1.Manager",
196                                                                 "ListUnits",
197                                                                 -1, "(a(ssssssouso))", "").get("(a(ssssssouso))", &iter);
198         } catch (runtime::Exception &e) {
199                 INFO(SINK, "Get list of systemd unit : " + std::string(e.what()));
200         }
201
202         while (1) {
203                 unsigned int dataUnit;
204                 char *dataStr[9];
205                 int ret;
206                 ret = iter.get("(ssssssouso)", dataStr, dataStr + 1, dataStr + 2,
207                                                 dataStr + 3, dataStr + 4, dataStr + 5,
208                                                 dataStr + 6, &dataUnit, dataStr + 7, dataStr + 8);
209                 if (!ret)
210                         break;
211
212                 std::string unitName(dataStr[0]);
213                 if (unitName == "security-manager.socket" ||
214                                 unitName == "connman.socket" ||
215                                 unitName == "msg-server.socket") {
216                         preprocessUnits.insert(preprocessUnits.begin(), unitName);
217                 } else if (unitName.compare(0, 5, "user@") == 0 ||
218                                 unitName == "tlm.service" ||
219                                 unitName == "resourced.service" ||
220                                 unitName == "security-manager.service") {
221                         preprocessUnits.push_back(unitName);
222                 }
223         }
224
225         for (auto unit : preprocessUnits) {
226                 stopUnit(unit);
227         }
228
229         for (pid_t pid : runtime::FileUser::getList(INTERNAL_PATH, true)) {
230                 try {
231                         char *unit = nullptr;
232                         systemDBus.methodcall("org.freedesktop.systemd1",
233                                                                         "/org/freedesktop/systemd1",
234                                                                         "org.freedesktop.systemd1.Manager",
235                                                                         "GetUnitByPID",
236                                                                         -1, "(o)", "(u)", (unsigned int)pid)
237                                                                                 .get("(o)", &unit);
238
239                         auto unescapedName = getDecodedPath(unit, "/org/freedesktop/systemd1/unit/");
240                         unitsToStop.insert(unescapedName);
241                 } catch (runtime::Exception &e) {
242                         INFO(SINK, "Killing process: " + std::to_string(pid));
243                         ::kill(pid, SIGKILL);
244                 }
245         }
246
247         for (auto unit : unitsToStop) {
248                 stopUnit(unit);
249         }
250 }
251
252 void showProgressUI(const std::string type)
253 {
254         dbus::Connection& systemDBus = dbus::Connection::getSystem();
255         std::string unit("ode-progress-ui@"+type+".service");
256
257         JobWatch watch(systemDBus);
258         INFO(SINK, "Start unit: " + unit);
259
260         const char* job = NULL;
261         systemDBus.methodcall("org.freedesktop.systemd1",
262                                                         "/org/freedesktop/systemd1",
263                                                         "org.freedesktop.systemd1.Manager",
264                                                         "StartUnit",
265                                                         -1, "(o)", "(ss)", unit.c_str(), "replace").get("(o)", &job);
266
267         INFO(SINK, "Waiting for job: " + std::string(job));
268         if (!watch.waitForJob(job))
269                 ERROR(SINK, "Starting unit: " + unit + " failed");
270 }
271
272 unsigned int getOptions()
273 {
274         unsigned int result = 0;
275         int value;
276
277         value = 0;
278         ::vconf_get_bool(VCONFKEY_ODE_FAST_ENCRYPTION, &value);
279         if (value) {
280                 result |= InternalEncryption::Option::IncludeUnusedRegion;
281         }
282
283         return result;
284 }
285
286 void setOptions(unsigned int options)
287 {
288         bool value;
289
290         if (options & InternalEncryption::Option::IncludeUnusedRegion) {
291                 value = true;
292         } else {
293                 value = false;
294         }
295         ::vconf_set_bool(VCONFKEY_ODE_FAST_ENCRYPTION, value);
296 }
297
298 void execAndWait(const std::string &path, std::vector<std::string> &args)
299 {
300         runtime::Process proc(path, args);
301         int ret = proc.execute();
302         if (ret < 0)
303                 ERROR(SINK, path + " failed for " + args.back());
304
305         ret = proc.waitForFinished();
306         if (ret < 0 || !WIFEXITED(ret) || WEXITSTATUS(ret) != 0)
307                 ERROR(SINK, path + " failed for " + args.back());
308 }
309
310 bool isPartitionTerminated(const std::string &partition)
311 {
312         bool ret = true;
313         const std::string cmd("fuser -m " + partition + " | grep -o '[0-9]*'");
314         char *line = nullptr;
315         size_t len = 0;
316
317         FILE *fp = ::popen(cmd.c_str(), "r");
318         if (fp == nullptr) {
319                 ERROR(SINK, "Failed to get processes on partition");
320                 return false;
321         }
322
323         if (::getline(&line, &len, fp) != -1)
324                 ret = false;
325
326         ::free(line);
327         ::pclose(fp);
328
329         return ret;
330 }
331
332 void unmountInternalStorage(const std::string& source)
333 {
334         if (::umount2("/opt/usr", MNT_DETACH) == -1) {
335                 if (errno != EBUSY && errno != EINVAL) {
336                         throw runtime::Exception("umount() error : " + runtime::GetSystemErrorMessage());
337                 }
338         }
339
340         do {
341                 ::sync();
342                 static const char *fuserPath = "/usr/bin/fuser";
343                 std::vector<std::string> args = {
344                         fuserPath, "-m", "-k", "-s", "-SIGTERM", source,
345                 };
346                 execAndWait(fuserPath, args);
347                 ::usleep((useconds_t)((unsigned int)(500)*1000));
348
349                 args[4] = "-SIGKILL";
350                 execAndWait(fuserPath, args);
351                 ::usleep((useconds_t)((unsigned int)(200)*1000));
352         } while (!isPartitionTerminated(source));
353 }
354
355 }
356
357 InternalEncryptionServer::InternalEncryptionServer(ServerContext& srv,
358                                                                                                    KeyServer& key) :
359         server(srv),
360         keyServer(key)
361 {
362         server.expose(this, PRIVILEGE_PLATFORM, (int)(InternalEncryptionServer::setMountPassword)(std::string));
363         server.expose(this, PRIVILEGE_PLATFORM, (int)(InternalEncryptionServer::mount)(std::vector<unsigned char>, unsigned int));
364         server.expose(this, PRIVILEGE_PLATFORM, (int)(InternalEncryptionServer::umount)());
365         server.expose(this, PRIVILEGE_PLATFORM, (int)(InternalEncryptionServer::isMounted)());
366         server.expose(this, PRIVILEGE_PLATFORM, (int)(InternalEncryptionServer::encrypt)(std::string, unsigned int));
367         server.expose(this, PRIVILEGE_PLATFORM, (int)(InternalEncryptionServer::decrypt)(std::string));
368         server.expose(this, "", (int)(InternalEncryptionServer::isPasswordInitialized)());
369         server.expose(this, PRIVILEGE_PLATFORM, (int)(InternalEncryptionServer::recovery)());
370         server.expose(this, PRIVILEGE_PLATFORM, (int)(InternalEncryptionServer::initPassword)(std::string));
371         server.expose(this, PRIVILEGE_PLATFORM, (int)(InternalEncryptionServer::cleanPassword)(std::string));
372         server.expose(this, PRIVILEGE_PLATFORM, (int)(InternalEncryptionServer::changePassword)(std::string, std::string));
373         server.expose(this, PRIVILEGE_PLATFORM, (int)(InternalEncryptionServer::verifyPassword)(std::string));
374         server.expose(this, "", (int)(InternalEncryptionServer::getState)());
375         server.expose(this, "", (unsigned int)(InternalEncryptionServer::getSupportedOptions)());
376         server.expose(this, "", (std::string)(InternalEncryptionServer::getDevicePath)());
377
378         server.createNotification("InternalEncryptionServer::mount");
379
380         std::string source = findDevPath();
381
382         engine.reset(new INTERNAL_ENGINE(
383                 source, INTERNAL_PATH,
384                 ProgressBar([](int v) {
385                         ::vconf_set_str(VCONFKEY_ODE_ENCRYPT_PROGRESS,
386                                                         std::to_string(v).c_str());
387                 })
388         ));
389 }
390
391 InternalEncryptionServer::~InternalEncryptionServer()
392 {
393 }
394
395 int InternalEncryptionServer::setMountPassword(const std::string& password)
396 {
397         const std::string& dev = engine->getSource();
398
399         // check if upgrade flag exists
400         if(UpgradeSupport::removeUpgradeFlag()) {
401                 INFO("Upgrade flag detected.");
402                 // try to load the master key
403                 try {
404                         mountKey = UpgradeSupport::loadMasterKey(dev);
405
406                         // encrypt the master key with given password
407                         return keyServer.changePassword2(dev, mountKey, password);
408                 } catch (const runtime::Exception&) {
409                         INFO("Failed to load the master key stored during upgrade.");
410                 }
411         }
412
413         return keyServer.get(dev, password, mountKey);
414 }
415
416 int InternalEncryptionServer::mount(const std::vector<unsigned char> &mk, unsigned int options)
417 {
418         if (mountKey.empty() && mk.empty()) {
419                 ERROR(SINK, "You need to set master key first.");
420                 return error::NoData;
421         }
422
423         BinaryData key = mk.empty() ? mountKey : mk;
424         mountKey.clear();
425
426         if (getState() != State::Encrypted) {
427                 INFO(SINK, "Cannot mount, SD partition's state incorrect.");
428                 return error::NoSuchDevice;
429         }
430
431         if (engine->isMounted()) {
432                 INFO(SINK, "Partition already mounted.");
433                 return error::None;
434         }
435
436         INFO(SINK, "Mounting internal storage.");
437         try {
438                 engine->mount(key, getOptions());
439
440                 server.notify("InternalEncryptionServer::mount");
441
442                 runtime::File("/tmp/.lazy_mount").create(O_WRONLY);
443                 runtime::File("/tmp/.unlock_mnt").create(O_WRONLY);
444         } catch (runtime::Exception &e) {
445                 ERROR(SINK, "Mount failed: " + std::string(e.what()));
446                 return error::Unknown;
447         }
448
449         return error::None;
450 }
451
452 int InternalEncryptionServer::isMounted()
453 {
454         int ret = 0;
455         try {
456                 ret = engine->isMounted() ? 1 : 0;
457         } catch (runtime::Exception &e) {
458                 ERROR(SINK, "Failed to access the mount flag");
459                 return error::Unknown;
460         }
461         return ret;
462 }
463
464 int InternalEncryptionServer::umount()
465 {
466         if (getState() != State::Encrypted) {
467                 ERROR(SINK, "Cannot umount, partition's state incorrect.");
468                 return error::NoSuchDevice;
469         }
470
471         if (!engine->isMounted()) {
472                 INFO(SINK, "Partition already umounted.");
473                 return error::None;
474         }
475
476         INFO(SINK, "Closing all processes using internal storage.");
477         try {
478                 stopSystemdUnits();
479                 INFO(SINK, "Umounting internal storage.");
480                 unmountInternalStorage("/dev/mapper/userdata");
481                 engine->umount();
482         } catch (runtime::Exception &e) {
483                 ERROR(SINK, "Umount failed: " + std::string(e.what()));
484                 return error::Unknown;
485         }
486
487         return error::None;
488 }
489
490 int InternalEncryptionServer::encrypt(const std::string& password, unsigned int options)
491 {
492         if (getState() != State::Unencrypted) {
493                 ERROR(SINK, "Cannot encrypt, partition's state incorrect.");
494                 return error::NoSuchDevice;
495         }
496
497         BinaryData masterKey;
498         int ret = keyServer.get(engine->getSource(), password, masterKey);
499         if (ret != error::None)
500                 return ret;
501
502         auto encryptWorker = [masterKey, options, this]() {
503                 try {
504                         showProgressUI("encrypt");
505                         ::sleep(1);
506
507                         runtime::File file("/opt/etc/.odeprogress");
508                         file.create(0640);
509
510                         std::string source = engine->getSource();
511                         auto mntPaths = findMountPointsByDevice(source);
512
513                         if (!mntPaths.empty()) {
514                                 INFO(SINK, "Closing all processes using internal storage.");
515                                 stopSystemdUnits();
516
517                                 INFO(SINK, "Unmounting internal storage.");
518                                 unmountInternalStorage(source);
519                         }
520
521                         INFO(SINK, "Encryption started.");
522                         ::vconf_set_str(VCONFKEY_ODE_CRYPTO_STATE, "error_partially_encrypted");
523                         try {
524                                 engine->encrypt(masterKey, options);
525                         } catch (runtime::Exception &e) {
526                                 ERROR(SINK, e.what());
527                                 if (!engine->isStarted()) {
528                                         ::vconf_set_str(VCONFKEY_ODE_CRYPTO_STATE, "unencrypted");
529                                         file.remove();
530                                 }
531                                 ::sync();
532                                 ::reboot(RB_AUTOBOOT);
533                         }
534                         setOptions(options & getSupportedOptions());
535
536                         INFO(SINK, "Encryption completed.");
537                         ::vconf_set_str(VCONFKEY_ODE_CRYPTO_STATE, "encrypted");
538                         server.notify("InternalEncryptionServer::mount");
539
540                         file.remove();
541
542                         INFO(SINK, "Syncing disk and rebooting.");
543                         ::sync();
544                         ::reboot(RB_AUTOBOOT);
545                 } catch (runtime::Exception &e) {
546                         ERROR(SINK, "Encryption failed: " + std::string(e.what()));
547                 }
548         };
549
550         std::thread asyncWork(encryptWorker);
551         asyncWork.detach();
552
553         return error::None;
554 }
555
556 int InternalEncryptionServer::decrypt(const std::string& password)
557 {
558         if (getState() != State::Encrypted) {
559                 ERROR(SINK, "Cannot decrypt, partition's state incorrect.");
560                 return error::NoSuchDevice;
561         }
562
563         BinaryData masterKey;
564         int ret = keyServer.get(engine->getSource(), password, masterKey);
565         if (ret != error::None)
566                 return ret;
567
568         auto decryptWorker = [masterKey, this]() {
569                 try {
570                         showProgressUI("decrypt");
571                         ::sleep(1);
572
573                         runtime::File file("/opt/etc/.odeprogress");
574                         file.create(0640);
575
576                         if (engine->isMounted()) {
577                                 INFO(SINK, "Closing all processes using internal storage.");
578                                 stopSystemdUnits();
579
580                                 INFO(SINK, "Umounting internal storage.");
581                                 unmountInternalStorage("/dev/mapper/userdata");
582                                 engine->umount();
583                         }
584
585                         INFO(SINK, "Decryption started.");
586                         ::vconf_set_str(VCONFKEY_ODE_CRYPTO_STATE, "error_partially_decrypted");
587                         try {
588                                 engine->decrypt(masterKey, getOptions());
589                         } catch (runtime::Exception &e) {
590                                 ERROR(SINK, e.what());
591                                 if (!engine->isStarted()) {
592                                         ::vconf_set_str(VCONFKEY_ODE_CRYPTO_STATE, "encrypted");
593                                         file.remove();
594                                 }
595                                 ::sync();
596                                 ::reboot(RB_AUTOBOOT);
597                         }
598
599                         INFO(SINK, "Decryption complete.");
600                         ::vconf_set_str(VCONFKEY_ODE_CRYPTO_STATE, "unencrypted");
601
602                         file.remove();
603
604                         INFO(SINK, "Syncing disk and rebooting.");
605                         ::sync();
606                         ::reboot(RB_AUTOBOOT);
607                 } catch (runtime::Exception &e) {
608                         ERROR(SINK, "Decryption failed: " + std::string(e.what()));
609                 }
610         };
611
612         std::thread asyncWork(decryptWorker);
613         asyncWork.detach();
614
615         return error::None;
616 }
617
618 int InternalEncryptionServer::recovery()
619 {
620         int state = getState();
621
622         if (state == State::Unencrypted)
623                 return error::NoSuchDevice;
624
625         runtime::File file("/opt/.factoryreset");
626         file.create(0640);
627
628         ::sync();
629         try {
630                 dbus::Connection& systemDBus = dbus::Connection::getSystem();
631                 systemDBus.methodcall("org.tizen.system.deviced",
632                                                                 "/Org/Tizen/System/DeviceD/Power",
633                                                                 "org.tizen.system.deviced.power",
634                                                                 "reboot",
635                                                                 -1, "()", "(si)", "reboot", 0);
636         } catch (runtime::Exception &e) {
637                 ::reboot(RB_AUTOBOOT);
638         }
639         return error::None;
640 }
641
642 int InternalEncryptionServer::isPasswordInitialized()
643 {
644         return keyServer.isInitialized(engine->getSource());
645 }
646
647 int InternalEncryptionServer::initPassword(const std::string& password)
648 {
649         return keyServer.init(engine->getSource(), password, Key::DEFAULT_256BIT);
650 }
651
652 int InternalEncryptionServer::cleanPassword(const std::string& password)
653 {
654         return keyServer.remove(engine->getSource(), password);
655 }
656
657 int InternalEncryptionServer::changePassword(const std::string& oldPassword,
658                                                                                 const std::string& newPassword)
659 {
660         return keyServer.changePassword(engine->getSource(), oldPassword, newPassword);
661 }
662
663 int InternalEncryptionServer::verifyPassword(const std::string& password)
664 {
665         return keyServer.verifyPassword(engine->getSource(), password);
666 }
667
668 int InternalEncryptionServer::getState()
669 {
670         char *value = ::vconf_get_str(VCONFKEY_ODE_CRYPTO_STATE);
671         if (value == NULL) {
672                 throw runtime::Exception("Failed to get vconf value.");
673         }
674
675         std::string valueStr(value);
676         free(value);
677
678         if (valueStr == "encrypted")
679                 return State::Encrypted;
680         else if (valueStr == "unencrypted")
681                 return State::Unencrypted;
682         else if (valueStr == "error_partially_encrypted" || valueStr == "error_partially_decrypted")
683                 return State::Corrupted;
684
685         return State::Invalid;
686 }
687
688 unsigned int InternalEncryptionServer::getSupportedOptions()
689 {
690         return engine->getSupportedOptions();
691 }
692
693 std::string InternalEncryptionServer::getDevicePath() const
694 {
695         return engine->getSource();
696 }
697
698 } // namespace ode