VirtualBox

Changeset 106164 in vbox for trunk/src/VBox/Main/src-server


Ignore:
Timestamp:
Sep 26, 2024 10:42:10 AM (4 months ago)
Author:
vboxsync
Message:

Main/VRDEServerImpl.cpp: Don't overwrite the 'NEGOTIATE' security method. Use case insenitive compare for the method like we do in the server code. Removed unnecessary rollbacks on i_generateServerCertificate failure (since it won't fail after mData.backup()). bugref:10310

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/VRDEServerImpl.cpp

    r106061 r106164  
    279279 * Klaus, some settings saving input required here!
    280280 */
    281         mData->mapProperties["Security/Method"] = Utf8Str("TLS");
     281        if (!mData->mapProperties["Security/Method"].equalsIgnoreCase("NEGOTIATE"))
     282            mData->mapProperties["Security/Method"] = Utf8Str("TLS");
    282283        mData->mapProperties["Security/ServerCertificate"] = strServerCertificate;
    283284        mData->mapProperties["Security/ServerPrivateKey"] = strServerPrivateKey;
     
    297298HRESULT VRDEServer::i_certificateRepair(BOOL &certificateGenerated)
    298299{
    299     if (mData->mapProperties["Security/Method"] != "RDP" || mData->mapProperties["Security/Method"] != "None")
     300    if (   !mData->mapProperties["Security/Method"].equalsIgnoreCase("RDP")
     301        && !mData->mapProperties["Security/Method"].equalsIgnoreCase("None"))
    300302    {
    301303        Utf8Str strServerCertificate(VRDE_AUTO_GENENERATED_CERT_FILENAME);
     
    347349                AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    348350                mData.backup();
    349                 mData->mapProperties["Security/Method"] = Utf8Str("TLS");
     351                if (!mData->mapProperties["Security/Method"].equalsIgnoreCase("NEGOTIATE"))
     352                    mData->mapProperties["Security/Method"] = Utf8Str("TLS");
    350353                mData->mapProperties["Security/ServerCertificate"] = strServerCertificate;
    351354                mData->mapProperties["Security/ServerPrivateKey"] = strServerPrivateKey;
     
    368371                vrc = i_generateServerCertificate();
    369372                if (RT_FAILURE(vrc))
    370                 {
    371                     i_rollback();
    372373                    return setError(VBOX_E_IPRT_ERROR, tr("Failed to auto generate server key and certificate: (%Rrc)\n"), vrc);
    373                 }
    374374                certificateGenerated = true;
    375375            }
     
    385385            vrc = i_generateServerCertificate();
    386386            if (RT_FAILURE(vrc))
    387             {
    388                 i_rollback();
    389387                return setError(VBOX_E_IPRT_ERROR, tr("Failed to auto generate server key and certificate: (%Rrc)\n"), vrc);
    390             }
    391388            certificateGenerated = true;
    392389        }
     
    398395            vrc = i_generateServerCertificate();
    399396            if (RT_FAILURE(vrc))
    400             {
    401                 i_rollback();
    402397                return setError(VBOX_E_IPRT_ERROR, tr("Failed to auto generate server key and certificate: (%Rrc)\n"), vrc);
    403             }
    404398            certificateGenerated = true;
    405399        }
     
    418412                vrc = i_generateServerCertificate();
    419413                if (RT_FAILURE(vrc))
    420                 {
    421                     i_rollback();
    422414                    return setError(VBOX_E_IPRT_ERROR, tr("Failed to auto generate server key and certificate: (%Rrc)\n"), vrc);
    423                 }
    424415                certificateGenerated = true;
    425416            }
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