VirtualBox

Ignore:
Timestamp:
May 13, 2024 6:51:25 PM (7 months ago)
Author:
vboxsync
Message:

Fixed potential overwriting of certificates - bugref:10310

File:
1 edited

Legend:

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

    r104570 r104618  
    296296
    297297        /*
    298         * If TLS is not explicitely disabled then auto-generate
    299         * a self-signed certificate for this VM.
    300         */
    301         if (mData->mapProperties["Security/Method"] != "RDP")
    302         {
    303             int vrc = i_generateServerCertificate();
    304             if (RT_FAILURE(vrc))
     298         * If TLS is not explicitly disabled and there is not an existing certificate
     299         * then auto-generate a self-signed certificate for this VM.
     300         */
     301        Utf8Str strPath = mData->mapProperties["Security/ServerCertificate"];
     302        if (aEnabled && strPath.isEmpty())
     303        {
     304            if (mData->mapProperties["Security/Method"] != "RDP")
    305305            {
    306                 LogRel(("Failed to auto generate server key and certificate: (%Rrc)\n", vrc));
     306                int vrc = i_generateServerCertificate();
     307                if (RT_FAILURE(vrc))
     308                {
     309                    LogRel(("Failed to auto generate server key and certificate: (%Rrc)\n", vrc));
     310                }
    307311            }
    308312        }
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