From 62258ba3b4737432a95c3af8d0e03ed3fb7953e7 Mon Sep 17 00:00:00 2001 From: open-license-manager <rillf@maildrop.cc> Date: 周一, 13 10月 2014 05:05:37 +0800 Subject: [PATCH] windows ok --- src/library/os/linux/os-linux.cpp | 27 ++++----------------------- 1 files changed, 4 insertions(+), 23 deletions(-) diff --git a/src/library/os/linux/os-linux.cpp b/src/library/os/linux/os-linux.cpp index 722c8ad..fffd816 100644 --- a/src/library/os/linux/os-linux.cpp +++ b/src/library/os/linux/os-linux.cpp @@ -1,4 +1,6 @@ +#ifndef _GNU_SOURCE #define _GNU_SOURCE /* To get defns of NI_MAXSERV and NI_MAXHOST */ +#endif #include <arpa/inet.h> #include <sys/socket.h> #include <netdb.h> @@ -21,7 +23,7 @@ #include <sys/ioctl.h> #include <sys/stat.h> #include "../os-cpp.h" -#include "../../base/public-key.h" +#include "public-key.h" #include <openssl/evp.h> #include <openssl/bio.h> @@ -32,33 +34,12 @@ using namespace std; -string OsFunctions::getModuleName() { - char path[2048] = { 0 }; - string strPath; - string result; - pid_t pid = getpid(); - const string pidstr = to_string(((long) pid)); - strPath = string("/proc/") + pidstr + "/exe"; - const char * proc_path = strPath.c_str(); - int ch = readlink(proc_path, path, 2048); - if (ch != -1) { - path[ch] = '\0'; - result = string(path); - } else { - throw runtime_error( - string("Can't find: ") + strPath + " proc filesystem mounted?"); - } - return result; -} - - bool OsFunctions::verifySignature(const char* stringToVerify, const char* signatureB64) { EVP_MD_CTX *mdctx = NULL; - char *pubKey = PUBLIC_KEY - ; + const char *pubKey = PUBLIC_KEY; BIO* bio = BIO_new_mem_buf((void*) (pubKey), strlen(pubKey)); RSA *rsa = PEM_read_bio_RSAPublicKey(bio, NULL, NULL, NULL); -- Gitblit v1.9.1