| 295 | } |
| 296 | |
| 297 | void RouterContext::NewNTCP2Keys () |
| 298 | { |
| 299 | m_NTCP2StaticKeys.reset (new i2p::crypto::X25519Keys ()); |
| 300 | m_NTCP2StaticKeys->GenerateKeys (); |
| 301 | m_NTCP2Keys.reset (new NTCP2PrivateKeys ()); |
| 302 | m_NTCP2StaticKeys->GetPrivateKey (m_NTCP2Keys->staticPrivateKey); |
| 303 | memcpy (m_NTCP2Keys->staticPublicKey, m_NTCP2StaticKeys->GetPublicKey (), 32); |
| 304 | RAND_bytes (m_NTCP2Keys->iv, 16); |
| 305 | // save |
| 306 | std::ofstream fk (i2p::fs::DataDirPath (NTCP2_KEYS), std::ofstream::binary | std::ofstream::out); |
| 307 | fk.write ((char *)m_NTCP2Keys.get (), sizeof (NTCP2PrivateKeys)); |
| 308 | } |
| 309 | |
| 310 | void RouterContext::NewSSU2Keys () |
| 311 | { |
nothing calls this directly
no test coverage detected