VirtualBox

Changeset 98046 in vbox


Ignore:
Timestamp:
Jan 11, 2023 12:24:05 AM (2 years ago)
Author:
vboxsync
Message:

Main/IConsole: Updates. bugref:10340

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/ConsoleImplTeleporter.cpp

    r97815 r98046  
    12911291
    12921292    /*
    1293      * Password (includes '\n', see teleporterTrg).
     1293     * Password (includes '\n', see i_teleporterTrg).
    12941294     */
    12951295    const char *pszPassword = pState->mstrPassword.c_str();
     
    13051305                LogRel(("Teleporter: Password read failure (off=%u): %Rrc\n", off, vrc));
    13061306            else
    1307                 LogRel(("Teleporter: Invalid password (off=%u)\n", off));
     1307            {
     1308                /* Must read the whole password before NACK'ing it. */
     1309                size_t const cchMaxRead = RT_ALIGN_Z(pState->mstrPassword.length() * 3, _1K);
     1310                while (off < cchMaxRead && RT_SUCCESS(vrc) && ch != '\n')
     1311                {
     1312                    vrc = RTTcpRead(hSocket, &ch, sizeof(ch), NULL);
     1313                    off++;
     1314                }
     1315                LogRel(("Teleporter: Invalid password\n"));
     1316            }
     1317            RTThreadSleep(RTRandU32Ex(64, 1024)); /* stagger retries */
    13081318            teleporterTcpWriteNACK(pState, VERR_AUTHENTICATION_FAILURE);
    13091319            return VINF_SUCCESS;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette