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

Method ServerAuth

src/remote/server/server.cpp:543–635  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

541 virtual void accept(PACKET* send, Auth::WriterImplementation* authBlock) = 0;
542
543 ServerAuth(ClumpletReader* aPb, const ParametersSet& aTags,
544 rem_port* port, bool multiPartData = false)
545 : authItr(NULL),
546 userName(getPool()),
547 authServer(NULL),
548 tags(&aTags),
549 hopsCount(0),
550 authPort(port)
551 {
552 if (!authPort->port_srv_auth_block)
553 {
554 authPort->port_srv_auth_block = FB_NEW SrvAuthBlock(authPort);
555 }
556
557 HANDSHAKE_DEBUG(fprintf(stderr, "Srv: ServerAuth()\n"));
558
559 if (aPb->find(tags->user_name))
560 {
561 aPb->getString(userName);
562 fb_utils::dpbItemUpper(userName);
563 if (authPort->port_srv_auth_block->getLogin() &&
564 userName != authPort->port_srv_auth_block->getLogin())
565 {
566 (Arg::Gds(isc_login) << Arg::Gds(isc_login_changed)).raise();
567 }
568 authPort->port_srv_auth_block->setLogin(userName);
569 HANDSHAKE_DEBUG(fprintf(stderr, "Srv: ServerAuth(): user name=%s\n", userName.c_str()));
570 }
571
572 UCharBuffer u;
573 if (port->port_protocol >= PROTOCOL_VERSION13)
574 {
575 string x;
576
577 if (aPb->find(tags->plugin_name))
578 {
579 aPb->getString(x);
580 authPort->port_srv_auth_block->setPluginName(x);
581 HANDSHAKE_DEBUG(fprintf(stderr, "Srv: ServerAuth(): plugin name=%s\n", x.c_str()));
582 }
583
584 if (aPb->find(tags->plugin_list))
585 {
586 aPb->getString(x);
587 authPort->port_srv_auth_block->setPluginList(x);
588 HANDSHAKE_DEBUG(fprintf(stderr, "Srv: ServerAuth(): plugin list=%s\n", x.c_str()));
589 }
590
591 if (tags->specific_data && aPb->find(tags->specific_data))
592 {
593 if (multiPartData)
594 getMultiPartConnectParameter(u, *aPb, tags->specific_data);
595 else
596 aPb->getData(u);
597 authPort->port_srv_auth_block->setDataForPlugin(u);
598 HANDSHAKE_DEBUG(fprintf(stderr, "Srv: ServerAuth(): plugin data is %u len\n", static_cast<unsigned>(u.getCount())));
599 }
600 else

Callers

nothing calls this directly

Calls 15

SrvAuthBlockClass · 0.85
GdsClass · 0.85
ENC_cryptFunction · 0.85
fb_strlenFunction · 0.85
ServerCallbackClass · 0.85
setLoginMethod · 0.80
setPluginNameMethod · 0.80
setPluginListMethod · 0.80
setDataForPluginMethod · 0.80
getClumpTagMethod · 0.80
dpbItemUpperFunction · 0.50

Tested by

no test coverage detected