Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/VBox/Runtime/common/crypto/ssl-openssl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ RTDECL(int) RTCrSslSessionGetCertIssuerNameAsString(RTCRSSLSESSION hSslSession,
X509 *pCert = SSL_get_certificate(pThis->pSsl);
if (pCert)
{
X509_NAME *pIssuer = X509_get_issuer_name(pCert);
const X509_NAME *pIssuer = X509_get_issuer_name(pCert);
if (pIssuer)
{
char *pszSrc = X509_NAME_oneline(pIssuer, NULL, 0);
Expand Down
4 changes: 3 additions & 1 deletion src/VBox/Runtime/common/crypto/x509-create-sign.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ RTDECL(int) RTCrX509Certificate_GenerateSelfSignedRsa(RTDIGESTTYPE enmDigestType
/** @todo check what the subject name is... Offer way to specify it? */

/* Make it self signed: */
X509_NAME *pX509Name = X509_get_subject_name(pNewCert);
X509_NAME *pX509Name = X509_NAME_new();
X509_set_subject_name(pNewCert, pX509Name);
rcOssl = X509_NAME_add_entry_by_txt(pX509Name, "CN", MBSTRING_ASC, (unsigned char *) pvSubject, -1, -1, 0);
AssertStmt(rcOssl > 0, rc = RTErrInfoSet(pErrInfo, VERR_GENERAL_FAILURE, "X509_NAME_add_entry_by_txt failed"));
rcOssl = X509_set_issuer_name(pNewCert, pX509Name);
Expand Down Expand Up @@ -211,6 +212,7 @@ RTDECL(int) RTCrX509Certificate_GenerateSelfSignedRsa(RTDIGESTTYPE enmDigestType
rc = RTErrInfoSet(pErrInfo, VERR_CR_KEY_GEN_FAILED_RSA, "X509_sign failed");
}

X509_NAME_free(pX509Name);
X509_free(pNewCert);
}
else
Expand Down