summaryrefslogtreecommitdiff
path: root/one.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2015-04-15 19:14:12 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2015-04-15 19:14:12 -0700
commit21a7e774bba4832848687dbd8d2e0a1df33650ce (patch)
treef7258ed063b0fca601e33f7f49417f42f95b9600 /one.cpp
parentc301d8e43859066155801b44b9953d38e3e36d03 (diff)
downloadinfinitytier-21a7e774bba4832848687dbd8d2e0a1df33650ce.tar.gz
infinitytier-21a7e774bba4832848687dbd8d2e0a1df33650ce.zip
Wire API auth token stuff.
Diffstat (limited to 'one.cpp')
-rw-r--r--one.cpp18
1 files changed, 0 insertions, 18 deletions
diff --git a/one.cpp b/one.cpp
index 68e1fb93..c5a3e99f 100644
--- a/one.cpp
+++ b/one.cpp
@@ -68,7 +68,6 @@
#include "controller/SqliteNetworkController.hpp"
#endif
-#define ZT1_AUTHTOKEN_SECRET_PATH "authtoken.secret"
#define ZT1_PID_PATH "zerotier-one.pid"
#define ZT1_CONTROLLER_DB_PATH "controller.db"
@@ -643,23 +642,6 @@ int main(int argc,char **argv)
}
}
- std::string authToken;
- {
- std::string authTokenPath(homeDir + ZT_PATH_SEPARATOR_S + ZT1_AUTHTOKEN_SECRET_PATH);
- if (!OSUtils::readFile(authTokenPath.c_str(),authToken)) {
- unsigned char foo[24];
- Utils::getSecureRandom(foo,sizeof(foo));
- authToken = "";
- for(unsigned int i=0;i<sizeof(foo);++i)
- authToken.push_back("abcdefghijklmnopqrstuvwxyz0123456789"[(unsigned long)foo[i] % 36]);
- if (!OSUtils::writeFile(authTokenPath.c_str(),authToken)) {
- fprintf(stderr,"%s: cannot create authtoken.secret"ZT_EOL_S,argv[0]);
- return 1;
- } else OSUtils::lockDownFile(authTokenPath.c_str(),false);
- }
- }
- authToken = Utils::trim(authToken);
-
#ifdef __UNIX_LIKE__
if (getuid() != 0) {
fprintf(stderr,"%s: must be run as root (uid 0)"ZT_EOL_S,argv[0]);