MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / createPluginsItr

Method createPluginsItr

src/remote/server/server.cpp:7568–7634  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7566}
7567
7568void SrvAuthBlock::createPluginsItr()
7569{
7570 if (firstTime || plugins)
7571 {
7572 return;
7573 }
7574
7575 ParsedList fromClient(pluginList);
7576 ParsedList onServer(port->getPortConfig()->getPlugins(IPluginManager::TYPE_AUTH_SERVER));
7577 ParsedList final;
7578
7579 for (unsigned s = 0; s < onServer.getCount(); ++s)
7580 {
7581 // do not expect too long lists, therefore use double loop
7582 for (unsigned c = 0; c < fromClient.getCount(); ++c)
7583 {
7584 if (onServer[s] == fromClient[c])
7585 {
7586 final.push(onServer[s]);
7587 }
7588 }
7589 }
7590
7591 if (final.getCount() == 0)
7592 {
7593 HANDSHAKE_DEBUG(fprintf(stderr, "Srv: createPluginsItr: No matching plugins on server\n"));
7594
7595 Arg::Gds loginError(isc_login_error);
7596#ifdef DEV_BUILD
7597 loginError << Arg::Gds(isc_random) << "No matching plugins on server";
7598#endif
7599 gds__log("Authentication error\n\tNo matching plugins on server");
7600 loginError.raise();
7601 }
7602
7603 // reorder to make it match first, already passed, plugin data
7604 for (unsigned f = 1; f < final.getCount(); ++f)
7605 {
7606 if (final[f] == pluginName)
7607 {
7608 final[f] = final[0];
7609 final[0] = pluginName;
7610 break;
7611 }
7612 }
7613
7614 // special case - last plugin from the list on the server may be used to check
7615 // correctness of what previous plugins added to auth parameters block
7616 bool multiFactor = true;
7617 for (unsigned sp = 0; sp < final.getCount(); ++sp)
7618 {
7619 if (final[sp] == onServer[onServer.getCount() - 1])
7620 {
7621 multiFactor = false;
7622 break;
7623 }
7624 }
7625 if (multiFactor)

Callers 2

authenticateMethod · 0.80
accept_connectionFunction · 0.80

Calls 8

GdsClass · 0.85
getPortConfigMethod · 0.80
makeListMethod · 0.80
getPluginsMethod · 0.45
getCountMethod · 0.45
pushMethod · 0.45
raiseMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected