if ((err == GNUTLS_SAN_DNSNAME
|| err == GNUTLS_SAN_RFC822NAME
- || err == GNUTLS_SAN_URI) &&
- strlen (buffer) != size)
+ || err == GNUTLS_SAN_URI) && strlen (buffer) != size)
{
adds (str, _("warning: distributionPoint contains an embedded NUL, "
"replacing with '!'\n"));
gnutls_x509_crq_get_subject_alt_name (cert.crq, altname_idx, buffer,
&size, NULL, NULL);
else if (altname_type == TYPE_CRT_IAN)
- err =
- gnutls_x509_crt_get_issuer_alt_name (cert.crt, altname_idx, buffer,
- &size, NULL);
+ err = gnutls_x509_crt_get_issuer_alt_name (cert.crt, altname_idx,
+ buffer, &size, NULL);
if (err < 0)
{
if ((err == GNUTLS_SAN_DNSNAME
|| err == GNUTLS_SAN_RFC822NAME
- || err == GNUTLS_SAN_URI) &&
- strlen (buffer) != size)
+ || err == GNUTLS_SAN_URI) && strlen (buffer) != size)
{
adds (str, _("warning: altname contains an embedded NUL, "
"replacing with '!'\n"));
break;
case GNUTLS_SAN_RFC822NAME:
- addf (str, "%s\t\t\tRFC822name: %.*s\n", prefix, (int) size, buffer);
+ addf (str, "%s\t\t\tRFC822name: %.*s\n", prefix, (int) size,
+ buffer);
break;
case GNUTLS_SAN_URI:
if (err != GNUTLS_E_SHORT_MEMORY_BUFFER)
{
gnutls_free (buffer);
- addf (str, "error: get_subject/issuer_alt_othername_oid: %s\n",
+ addf (str,
+ "error: get_subject/issuer_alt_othername_oid: %s\n",
gnutls_strerror (err));
return;
}
}
}
-
static void
print_extensions (gnutls_string * str, const char *prefix, int type,
cert_type_t cert)
{
err = gnutls_x509_crt_get_dn (cert, dn, &dn_size);
if (err < 0)
- addf (str, "error: get_dn: %s\n",
- gnutls_strerror (err));
+ addf (str, "error: get_dn: %s\n", gnutls_strerror (err));
else
addf (str, _("\tSubject: %s\n"), dn);
gnutls_free (dn);
{
err = gnutls_x509_crt_get_dn (cert, dn, &dn_size);
if (err < 0)
- addf (str, "unknown subject (%s), ",
- gnutls_strerror (err));
+ addf (str, "unknown subject (%s), ", gnutls_strerror (err));
else
addf (str, "subject `%s', ", dn);
gnutls_free (dn);
{
err = gnutls_x509_crt_get_issuer_dn (cert, dn, &dn_size);
if (err < 0)
- addf (str, "unknown issuer (%s), ",
- gnutls_strerror (err));
+ addf (str, "unknown issuer (%s), ", gnutls_strerror (err));
else
addf (str, "issuer `%s', ", dn);
gnutls_free (dn);
err = gnutls_x509_crt_get_signature_algorithm (cert);
if (err < 0)
- addf (str, "unknown signature algorithm (%s), ",
- gnutls_strerror (err));
+ addf (str, "unknown signature algorithm (%s), ", gnutls_strerror (err));
else
{
const char *name = gnutls_sign_algorithm_get_name (err);
{
err = gnutls_x509_crq_get_dn (cert, dn, &dn_size);
if (err < 0)
- addf (str, "error: get_dn: %s\n",
- gnutls_strerror (err));
+ addf (str, "error: get_dn: %s\n", gnutls_strerror (err));
else
addf (str, _("\tSubject: %s\n"), dn);
gnutls_free (dn);
if (cert->cert)
{
/* Any earlier asn1_der_decoding will modify the ASN.1
- structure, so we need to replace it with a fresh
- structure. */
+ structure, so we need to replace it with a fresh
+ structure. */
asn1_delete_structure (&cert->cert);
result = asn1_create_element (_gnutls_get_pkix (),
}
static int
-get_alt_name(gnutls_x509_crt_t cert, const char *extension_id,
- unsigned int seq, void *ret,
- size_t * ret_size, unsigned int *ret_type,
- unsigned int *critical, int othername_oid)
+get_alt_name (gnutls_x509_crt_t cert, const char *extension_id,
+ unsigned int seq, void *ret,
+ size_t * ret_size, unsigned int *ret_type,
+ unsigned int *critical, int othername_oid)
{
int result;
gnutls_datum_t dnsname;
return GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE;
}
- if (strcmp("2.5.29.17", extension_id) == 0)
- {
- result = asn1_create_element(_gnutls_get_pkix (), "PKIX1.SubjectAltName", &c2);
- }
- else if (strcmp("2.5.29.18", extension_id) == 0)
- {
- result = asn1_create_element(_gnutls_get_pkix (), "PKIX1.IssuerAltName", &c2);
- }
+ if (strcmp ("2.5.29.17", extension_id) == 0)
+ result = asn1_create_element (_gnutls_get_pkix (),
+ "PKIX1.SubjectAltName", &c2);
+ else if (strcmp ("2.5.29.18", extension_id) == 0)
+ result = asn1_create_element (_gnutls_get_pkix (),
+ "PKIX1.IssuerAltName", &c2);
else
{
gnutls_assert ();
size_t * ret_size,
unsigned int *critical)
{
- return get_alt_name (cert, "2.5.29.17", seq, ret, ret_size, NULL, critical, 0);
+ return get_alt_name (cert, "2.5.29.17", seq, ret, ret_size, NULL, critical,
+ 0);
}
/**
**/
int
gnutls_x509_crt_get_issuer_alt_name (gnutls_x509_crt_t cert,
- unsigned int seq, void *ret,
- size_t * ret_size,
- unsigned int *critical)
+ unsigned int seq, void *ret,
+ size_t * ret_size,
+ unsigned int *critical)
{
- return get_alt_name (cert, "2.5.29.18", seq, ret, ret_size, NULL, critical, 0);
+ return get_alt_name (cert, "2.5.29.18", seq, ret, ret_size, NULL, critical,
+ 0);
}
/**
unsigned int *ret_type,
unsigned int *critical)
{
- return get_alt_name (cert, "2.5.29.17", seq, ret, ret_size, ret_type, critical, 0);
+ return get_alt_name (cert, "2.5.29.17", seq, ret, ret_size, ret_type,
+ critical, 0);
}
/**
**/
int
gnutls_x509_crt_get_issuer_alt_name2 (gnutls_x509_crt_t cert,
- unsigned int seq, void *ret,
- size_t * ret_size,
- unsigned int *ret_type,
- unsigned int *critical)
+ unsigned int seq, void *ret,
+ size_t * ret_size,
+ unsigned int *ret_type,
+ unsigned int *critical)
{
- return get_alt_name (cert, "2.5.29.18", seq, ret, ret_size, ret_type, critical, 0);
+ return get_alt_name (cert, "2.5.29.18", seq, ret, ret_size, ret_type,
+ critical, 0);
}
/**
**/
int
gnutls_x509_crt_get_issuer_alt_othername_oid (gnutls_x509_crt_t cert,
- unsigned int seq,
- void *ret, size_t * ret_size)
+ unsigned int seq,
+ void *ret, size_t * ret_size)
{
return get_alt_name (cert, "2.5.29.18", seq, ret, ret_size, NULL, NULL, 1);
}
int
gnutls_x509_crt_get_verify_algorithm (gnutls_x509_crt_t crt,
const gnutls_datum_t * signature,
- gnutls_digest_algorithm_t *hash)
+ gnutls_digest_algorithm_t * hash)
{
if (crt == NULL)
{