VirtualBox

Ignore:
Timestamp:
Jul 3, 2024 5:50:46 PM (7 months ago)
Author:
vboxsync
Message:

Certificate repair function added - bugref:10310

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/crypto/x509-create-sign.cpp

    r104757 r105124  
    6262
    6363RTDECL(int) RTCrX509Certificate_GenerateSelfSignedRsa(RTDIGESTTYPE enmDigestType, uint32_t cBits, uint32_t cSecsValidFor,
    64                                                       uint32_t fKeyUsage, uint64_t fExtKeyUsage, void *pvSubjectTodo,
     64                                                      uint32_t fKeyUsage, uint64_t fExtKeyUsage, const char *pvSubject,
    6565                                                      const char *pszCertFile, const char *pszPrivateKeyFile, PRTERRINFO pErrInfo)
    6666{
     
    6868    AssertReturn(!fKeyUsage, VERR_NOT_IMPLEMENTED);
    6969    AssertReturn(!fExtKeyUsage, VERR_NOT_IMPLEMENTED);
    70     AssertReturn(pvSubjectTodo == NULL, VERR_NOT_IMPLEMENTED);
    7170
    7271    /*
     
    159158        /* Make it self signed: */
    160159        X509_NAME *pX509Name = X509_get_subject_name(pNewCert);
     160        rcOssl = X509_NAME_add_entry_by_txt(pX509Name, "CN", MBSTRING_ASC, (unsigned char *) pvSubject, -1, -1, 0);
     161        AssertStmt(rcOssl > 0, rc = RTErrInfoSet(pErrInfo, VERR_GENERAL_FAILURE, "X509_NAME_add_entry_by_txt failed"));
    161162        rcOssl = X509_set_issuer_name(pNewCert, pX509Name);
    162163        AssertStmt(rcOssl > 0, rc = RTErrInfoSet(pErrInfo, VERR_GENERAL_FAILURE, "X509_set_issuer_name failed"));
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