| 1309 | } |
| 1310 | |
| 1311 | void rem_port::addServerKeys(const CSTRING* passedStr) |
| 1312 | { |
| 1313 | ClumpletReader newKeys(ClumpletReader::UnTagged, |
| 1314 | passedStr->cstr_address, passedStr->cstr_length); |
| 1315 | |
| 1316 | PathName type, plugins, plugin; |
| 1317 | unsigned len; |
| 1318 | KnownServerKey* currentKey = nullptr; |
| 1319 | for (newKeys.rewind(); !newKeys.isEof(); newKeys.moveNext()) |
| 1320 | { |
| 1321 | switch(newKeys.getClumpTag()) |
| 1322 | { |
| 1323 | case TAG_KEY_TYPE: |
| 1324 | newKeys.getPath(type); |
| 1325 | break; |
| 1326 | case TAG_KEY_PLUGINS: |
| 1327 | newKeys.getPath(plugins); |
| 1328 | plugins += ' '; |
| 1329 | plugins.insert(0, " "); |
| 1330 | currentKey = &port_known_server_keys.add(); |
| 1331 | currentKey->type = type; |
| 1332 | currentKey->plugins = plugins; |
| 1333 | break; |
| 1334 | case TAG_PLUGIN_SPECIFIC: |
| 1335 | plugin.assign(newKeys.getBytes(), newKeys.getClumpLength()); |
| 1336 | len = strlen(plugin.c_str()) + 1; |
| 1337 | if (len < plugin.length()) |
| 1338 | { |
| 1339 | const char* data = &plugin[len]; |
| 1340 | len = plugin.length() - len; |
| 1341 | plugin.recalculate_length(); |
| 1342 | currentKey->addSpecificData(plugin, len, data); |
| 1343 | } |
| 1344 | break; |
| 1345 | } |
| 1346 | } |
| 1347 | } |
| 1348 | |
| 1349 | bool rem_port::tryNewKey(InternalCryptKey* cryptKey) |
| 1350 | { |
no test coverage detected