When a certificate has a policy attached but no policyQualifiers,
`certtool` should omit the policyQualifiers sequence entirely, rather
than emitting an empty sequence.
Closes: #1238
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
goto cleanup;
}
+ if (policies->policy[j].qualifiers == 0) {
+ /* remove the optional policyQualifiers if none are present. */
+ result = asn1_write_value(c2, "?LAST.policyQualifiers", NULL, 0);
+ if (result != ASN1_SUCCESS) {
+ gnutls_assert();
+ result = _gnutls_asn2err(result);
+ goto cleanup;
+ }
+ }
+
for (i = 0;
i < MIN(policies->policy[j].qualifiers,
GNUTLS_MAX_QUALIFIERS); i++) {