VirtualBox

Ignore:
Timestamp:
May 6, 2020 3:32:25 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
137768
Message:

VBoxManage,manual: Use the new RTCrX509Certificate_WriteToVfsFile function to write out the signing certificate. bugref:9699

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageAppliance.cpp

    r84151 r84164  
    19301930
    19311931/**
    1932  * Appends the certificate in PEM format to the given VFS file.
    1933  */
    1934 static int doWriteCertificate(RTVFSFILE hVfsFileSignature, PCRTCRX509CERTIFICATE pCertificate)
    1935 {
    1936     RT_NOREF(hVfsFileSignature, pCertificate);
    1937     RTPrintf("TODO: doWriteCertificate\n");
    1938     return VINF_SUCCESS;
    1939 }
    1940 
    1941 
    1942 /**
    19431932 * Performs the OVA signing, producing an in-memory cert-file.
    19441933 */
    1945 static int doTheOvaSigning(PCRTCRX509CERTIFICATE pCertificate, RTCRKEY hPrivateKey,
     1934static int doTheOvaSigning(PRTCRX509CERTIFICATE pCertificate, RTCRKEY hPrivateKey,
    19461935                           const char *pszManifestName, RTVFSFILE hVfsFileManifest,
    19471936                           bool fPkcs7, unsigned cIntermediateCerts, const char **papszIntermediateCerts,
     
    20172006                                                 pszDigestType, pszManifestName, cbSignature, pvSignature);
    20182007                            if (RT_SUCCESS(rc))
    2019                                 rc = doWriteCertificate(hVfsFileSignature, pCertificate);
     2008                            {
     2009                                rc = RTCrX509Certificate_WriteToVfsFile(hVfsFileSignature, pCertificate,
     2010                                                                        RTErrInfoInitStatic(pErrInfo));
     2011                                if (RT_SUCCESS(rc))
     2012                                {
     2013                                    if (fPkcs7)
     2014                                        rc = doAddPkcs7Signature(pCertificate, hPrivateKey, cIntermediateCerts,
     2015                                                                 papszIntermediateCerts, hDigest, pErrInfo, hVfsFileSignature);
     2016                                    if (RT_SUCCESS(rc))
     2017                                    {
     2018                                        /*
     2019                                         * Success.
     2020                                         */
     2021                                        *phVfsFileSignature = hVfsFileSignature;
     2022                                        hVfsFileSignature = NIL_RTVFSFILE;
     2023                                    }
     2024                                }
     2025                                else
     2026                                    RTMsgError("Failed to write certificate to signature file: %Rrc%#RTeim", rc, &pErrInfo->Core);
     2027                            }
    20202028                            else
    20212029                                RTMsgError("Failed to produce signature file: %Rrc", rc);
    2022                             if (RT_SUCCESS(rc) && fPkcs7)
    2023                                 rc = doAddPkcs7Signature(pCertificate, hPrivateKey, cIntermediateCerts, papszIntermediateCerts,
    2024                                                          hDigest, pErrInfo, hVfsFileSignature);
    2025                             if (RT_SUCCESS(rc))
    2026                             {
    2027                                 /*
    2028                                  * Success.
    2029                                  */
    2030                                 *phVfsFileSignature = hVfsFileSignature;
    2031                             }
    2032                             else
    2033                                 RTVfsFileRelease(hVfsFileSignature);
     2030                            RTVfsFileRelease(hVfsFileSignature);
    20342031                        }
    20352032                        else
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