VirtualBox

Changeset 60332 in vbox for trunk


Ignore:
Timestamp:
Apr 5, 2016 12:32:22 PM (9 years ago)
Author:
vboxsync
Message:

ApplianceImpl: The what's needed to determine the trusted state of the certificate is already all there, no need of extra variables. Also: Data members shall start with 'm' unless obvious (like with 'm->xxx'). There shall be space after 'if'. A 'bool' shall under no circumstances start with a 'l' prefix.

Location:
trunk/src/VBox/Main
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/ApplianceImpl.h

    r60220 r60332  
    115115    VirtualBox* const mVirtualBox;
    116116
    117     ComObjPtr<Certificate> pCertificateInfo;
     117    ComObjPtr<Certificate> mptrCertificateInfo;
    118118    struct ImportStack;
    119119    class TaskOVF;
  • trunk/src/VBox/Main/src-server/ApplianceImpl.cpp

    r60220 r60332  
    410410    AssertReturn(m->m_pSecretKeyStore, E_FAIL);
    411411
    412     pCertificateInfo.createObject();
    413     pCertificateInfo->init(this);
     412    mptrCertificateInfo.createObject();
     413    mptrCertificateInfo->init(this);
    414414
    415415    i_initApplianceIONameMap();
     
    522522HRESULT Appliance::getCertificate(ComPtr<ICertificate> &aCertificateInfo)
    523523{
    524 
    525524    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    526525
     
    528527        return E_ACCESSDENIED;
    529528
    530 
    531         pCertificateInfo.queryInterfaceTo(aCertificateInfo.asOutParam());
    532 
    533 
     529/** @todo r=bird: What about when there is no signature and certificate? */
     530    mptrCertificateInfo.queryInterfaceTo(aCertificateInfo.asOutParam());
    534531    return S_OK;
    535532}
  • trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp

    r60328 r60332  
    17161716     * digest that is encrypted with the certificate in the latter part.
    17171717     */
    1718     bool lTrusted = false;
    1719 
    17201718    if (m->pbSignedDigest)
    17211719    {
     
    18101808             * is acceptible.  But, first make sure it makes internal sense.
    18111809             */
    1812             m->fCertificateMissingPath = false;
     1810            m->fCertificateMissingPath = false; /** @todo need to check if the certificate is trusted by the system! */
    18131811            vrc = RTCrX509Certificate_VerifySignatureSelfSigned(&m->SignerCert, RTErrInfoInitStatic(&StaticErrInfo));
    18141812            if (RT_SUCCESS(vrc))
     
    18311829                if (   !m->SignerCert.TbsCertificate.T3.pBasicConstraints
    18321830                    || !m->SignerCert.TbsCertificate.T3.pBasicConstraints->CA.fValue)
    1833                 {
    18341831                    i_addWarning(tr("Self signed certificate used to sign '%s' is not marked as certificate authority (CA)"),
    18351832                                 pTask->locInfo.strPath.c_str());
    1836                 }
    1837                 else
    1838                     lTrusted = true;
    18391833            }
    18401834            else
     
    19201914                            else
    19211915                                hrc2 = setErrorVrc(vrc, "RTCrX509CertPathsSetValidTimeSpec failed: %Rrc", vrc);
    1922 
    1923                             if(RT_SUCCESS(vrc))
    1924                                 lTrusted = true;
    19251916                        }
    19261917                        else if (vrc == VERR_CR_X509_CPV_NO_TRUSTED_PATHS)
     
    19591950
    19601951    /** @todo provide details about the signatory, signature, etc.  */
    1961     if(m->fSignerCertLoaded)
    1962     {
    1963         pCertificateInfo->initCertificate(&m->SignerCert, lTrusted);
    1964     }
     1952    if (m->fSignerCertLoaded)
     1953        mptrCertificateInfo->initCertificate(&m->SignerCert, m->fCertificateValid && !m->fCertificateMissingPath);
    19651954
    19661955    /*
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