MCPcopy Create free account
hub / github.com/assaultcube/AC / addline

Method addline

source/src/crypto.cpp:1278–1298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1276}
1277
1278void makecert::addline(const char *key, const char *val, const char *com)
1279{
1280 if(!com || !*com) com = "";
1281 int keylen = strlen(key), vallen = strlen(val), comlen = strlen(com);
1282 if(*key && *val && endbuf - curbuf > keylen + vallen + comlen + 3)
1283 {
1284 certline &l = c->lines.add();
1285 l.key = curbuf;
1286 strcpy(curbuf, key);
1287 curbuf += keylen + 1;
1288 l.val = curbuf;
1289 strcpy(curbuf, val);
1290 curbuf += vallen + 1;
1291 l.comment = curbuf;
1292 strcpy(curbuf, com);
1293 curbuf += comlen + 1;
1294 // extract name and type for the filename
1295 if(!strcasecmp(l.key, "name")) c->name = l.val;
1296 else if(!strcasecmp(l.key, "type")) c->type = getlistindex(l.val, certtypekeywords, false, 0);
1297 }
1298}
1299
1300char *makecert::sign(const uchar *keypair, const char *com)
1301{

Callers 1

crypto.cppFile · 0.45

Calls 2

getlistindexFunction · 0.85
addMethod · 0.45

Tested by

no test coverage detected