… | |
… | |
132 | rsa_hash (const rsaid &id, const rsachallenge &chg, rsaresponse &h) |
132 | rsa_hash (const rsaid &id, const rsachallenge &chg, rsaresponse &h) |
133 | { |
133 | { |
134 | EVP_MD_CTX ctx; |
134 | EVP_MD_CTX ctx; |
135 | |
135 | |
136 | EVP_MD_CTX_init (&ctx); |
136 | EVP_MD_CTX_init (&ctx); |
137 | require (EVP_DigestInit (&ctx, RSA_HASH)); |
137 | require (EVP_DigestInit (&ctx, RSA_HASH)); |
138 | require (EVP_DigestUpdate(&ctx, &chg, sizeof chg)); |
138 | require (EVP_DigestUpdate (&ctx, &chg, sizeof chg)); |
139 | require (EVP_DigestUpdate(&ctx, &id, sizeof id)); |
139 | require (EVP_DigestUpdate (&ctx, &id, sizeof id)); |
140 | require (EVP_DigestFinal (&ctx, (unsigned char *)&h, 0)); |
140 | require (EVP_DigestFinal (&ctx, (unsigned char *)&h, 0)); |
141 | EVP_MD_CTX_cleanup (&ctx); |
141 | EVP_MD_CTX_cleanup (&ctx); |
142 | } |
142 | } |
143 | |
143 | |
144 | struct rsa_entry |
144 | struct rsa_entry |
145 | { |
145 | { |
… | |
… | |
924 | } |
924 | } |
925 | } |
925 | } |
926 | |
926 | |
927 | delete ictx; ictx = 0; |
927 | delete ictx; ictx = 0; |
928 | delete octx; octx = 0; |
928 | delete octx; octx = 0; |
929 | #if ENABLE_DNS |
|
|
930 | dnsv4_reset_connection (); |
|
|
931 | #endif |
|
|
932 | |
929 | |
933 | si.host = 0; |
930 | si.host = 0; |
934 | |
931 | |
935 | last_activity = 0.; |
932 | last_activity = 0.; |
936 | //last_si_change = 0.; |
933 | //last_si_change = 0.; |
… | |
… | |
1313 | |
1310 | |
1314 | c->conf->protocols = p->protocols; |
1311 | c->conf->protocols = p->protocols; |
1315 | protocol = best_protocol (c->conf->protocols & THISNODE->protocols & p->si.supported_protocols (c->conf)); |
1312 | protocol = best_protocol (c->conf->protocols & THISNODE->protocols & p->si.supported_protocols (c->conf)); |
1316 | p->si.upgrade_protocol (protocol, c->conf); |
1313 | p->si.upgrade_protocol (protocol, c->conf); |
1317 | |
1314 | |
1318 | slog (L_TRACE, "%s >> PT_CONNECT_INFO(%s,%s,p%02x) [%d]", |
1315 | slog (L_TRACE, "%s >> PT_CONNECT_INFO(%s,%s,protocols=%02x,protocol=%02x,upgradable=%02x) [%d]", |
1319 | conf->nodename, |
1316 | conf->nodename, |
1320 | vpn->conns[p->id - 1]->conf->nodename, |
1317 | vpn->conns[p->id - 1]->conf->nodename, |
1321 | (const char *)p->si, |
1318 | (const char *)p->si, |
1322 | p->protocols, |
1319 | p->protocols, |
|
|
1320 | protocol, |
|
|
1321 | p->si.supported_protocols (c->conf), |
1323 | !c->ictx && !c->octx); |
1322 | !c->ictx && !c->octx); |
1324 | |
1323 | |
1325 | const sockinfo &dsi = forward_si (p->si); |
1324 | const sockinfo &dsi = forward_si (p->si); |
1326 | |
1325 | |
1327 | if (dsi.valid ()) |
1326 | if (dsi.valid ()) |
1328 | c->send_auth_request (dsi, true); |
1327 | c->send_auth_request (dsi, true); |
|
|
1328 | else |
|
|
1329 | slog (L_INFO, "connect info for %s received (%s), but still unable to contact.", |
|
|
1330 | vpn->conns[p->id - 1]->conf->nodename, |
|
|
1331 | (const char *)p->si); |
1329 | } |
1332 | } |
1330 | else |
1333 | else |
1331 | slog (L_WARN, |
1334 | slog (L_WARN, |
1332 | _("received authenticated connection request from unknown node #%d, config file mismatch?"), |
1335 | _("received authenticated connection request from unknown node #%d, config file mismatch?"), |
1333 | p->id); |
1336 | p->id); |