(cert2epi): don't include subject if its null
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17368 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -177,20 +177,25 @@ cert2epi(hx509_context context, void *ctx, hx509_cert c)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
id.subjectName = calloc(1, sizeof(*id.subjectName));
|
||||
if (id.subjectName == NULL) {
|
||||
hx509_name_free(&subject);
|
||||
free_ExternalPrincipalIdentifier(&id);
|
||||
return ENOMEM;
|
||||
}
|
||||
if (hx509_name_is_null_p(subject) != 0) {
|
||||
|
||||
ret = hx509_name_to_der_name(subject, &id.subjectName->data,
|
||||
&id.subjectName->length);
|
||||
hx509_name_free(&subject);
|
||||
if (ret) {
|
||||
free_ExternalPrincipalIdentifier(&id);
|
||||
return ret;
|
||||
id.subjectName = calloc(1, sizeof(*id.subjectName));
|
||||
if (id.subjectName == NULL) {
|
||||
hx509_name_free(&subject);
|
||||
free_ExternalPrincipalIdentifier(&id);
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
ret = hx509_name_to_der_name(subject, &id.subjectName->data,
|
||||
&id.subjectName->length);
|
||||
if (ret) {
|
||||
hx509_name_free(&subject);
|
||||
free_ExternalPrincipalIdentifier(&id);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
hx509_name_free(&subject);
|
||||
|
||||
|
||||
id.issuerAndSerialNumber = calloc(1, sizeof(*id.issuerAndSerialNumber));
|
||||
if (id.issuerAndSerialNumber == NULL) {
|
||||
|
Reference in New Issue
Block a user