MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / Options_GetSecure

Function Options_GetSecure

src/Options.c:215–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

213}
214
215void Options_GetSecure(const char* opt, cc_string* dst) {
216 cc_uint8 data[1500];
217 int dataLen;
218 cc_string raw;
219 cc_result res;
220
221 Options_UNSAFE_Get(opt, &raw);
222 if (!raw.length) return;
223 if (raw.length > 2000) Process_Abort("too large to base64");
224
225 dataLen = Convert_FromBase64(raw.buffer, raw.length, data);
226 res = Platform_Decrypt(data, dataLen, dst);
227 if (res) Platform_Log2("Error %e decrypting option %c", &res, opt);
228}

Callers 4

Session_LoadFunction · 0.85
DirectConnectScreen_LoadFunction · 0.85
MainScreen_LoadFunction · 0.85
Resume_ParseFunction · 0.85

Calls 4

Options_UNSAFE_GetFunction · 0.85
Convert_FromBase64Function · 0.85
Platform_Log2Function · 0.85
Platform_DecryptFunction · 0.70

Tested by

no test coverage detected