1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-14 15:23:39 +00:00

Fixed build for No_OpenSSL build mode

This commit is contained in:
Bryan Roe
2020-02-14 09:14:17 -08:00
parent 7730d9a627
commit 4d7aa678bd
2 changed files with 44 additions and 9 deletions

View File

@@ -1643,7 +1643,7 @@ duk_ret_t ILibDuktape_MeshAgent_ServerInfo(duk_context *ctx)
return(1);
}
#ifndef MICROSTACK_NOTLS
duk_ret_t ILibDuktape_MeshAgent_GenerateCertsForDiagnosticAgent(duk_context *ctx)
{
char tmp[UTIL_SHA384_HASHSIZE];
@@ -1736,6 +1736,7 @@ duk_ret_t ILibDuktape_MeshAgent_GenerateCertsForDiagnosticAgent(duk_context *ctx
}
#endif
}
#endif
duk_ret_t ILibDuktape_MeshAgent_forceExit(duk_context *ctx)
{
@@ -3820,6 +3821,7 @@ int MeshAgent_AgentMode(MeshAgentHostContainer *agentHost, int paramLen, char **
{
agentHost->capabilities |= MeshCommand_AuthInfo_CapabilitiesMask_RECOVERY; parseCommands = 0;
}
#ifndef MICROSTACK_NOTLS
if (strcmp(param[ri], "-nocertstore") == 0)
{
parseCommands = 0;
@@ -3828,6 +3830,7 @@ int MeshAgent_AgentMode(MeshAgentHostContainer *agentHost, int paramLen, char **
agentHost->noCertStore = 1;
#endif
}
#endif
}
@@ -3871,15 +3874,42 @@ int MeshAgent_AgentMode(MeshAgentHostContainer *agentHost, int paramLen, char **
}
}
paramLen -= ixr;
if (installFlag != 0)
{
int bufLen = 0;
char *buf;
duk_context *ctxx = ILibDuktape_ScriptContainer_InitializeJavaScriptEngineEx(0, 0, agentHost->chain, NULL, NULL, agentHost->exePath, NULL, NULL, NULL);
duk_eval_string(ctxx, "require('user-sessions').isRoot();");
if (!duk_get_boolean(ctxx, -1))
{
printf(" Administrator permissions needed...\n");
installFlag = 0;
}
switch (installFlag)
{
case 1:
bufLen = ILibSimpleDataStore_Cached_GetJSONEx(agentHost->masterDb, NULL, 0);
buf = (char*)ILibMemory_SmartAllocate(bufLen);
bufLen = ILibSimpleDataStore_Cached_GetJSONEx(agentHost->masterDb, buf, bufLen);
ILibMemory_Free(buf);
break;
default:
break;
}
duk_destroy_heap(ctxx);
}
agentHost->httpClientManager = ILibCreateWebClient(3, agentHost->chain);

View File

@@ -1073,9 +1073,10 @@ void ILibDuktape_ScriptContainer_Process_Init(duk_context *ctx, char **argList)
{
int i = 0;
ILibDuktape_EventEmitter *emitter;
#ifndef MICROSTACK_NOTLS
char *sslv = (char*)SSLeay_version(SSLEAY_VERSION);
char *sslvS = strstr(sslv, " ") + 1;
#endif
duk_push_global_object(ctx); // [g]
duk_push_object(ctx); // [g][process]
@@ -1127,6 +1128,8 @@ void ILibDuktape_ScriptContainer_Process_Init(duk_context *ctx, char **argList)
duk_put_prop_string(ctx, -2, "SIGTABLE");
duk_push_object(ctx);
#ifndef MICROSTACK_NOTLS
if (sslvS != ((char*)NULL + 1))
{
char *tmp = strstr(sslvS, " ");
@@ -1136,6 +1139,8 @@ void ILibDuktape_ScriptContainer_Process_Init(duk_context *ctx, char **argList)
duk_put_prop_string(ctx, -2, "openssl");
}
}
#endif
duk_push_string(ctx, DUK_GIT_DESCRIBE); duk_put_prop_string(ctx, -2, "duktape");
if (SOURCE_COMMIT_DATE != NULL)
{