aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/https/x509/x509.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon/https/x509/x509.c')
-rw-r--r--src/daemon/https/x509/x509.c81
1 files changed, 0 insertions, 81 deletions
diff --git a/src/daemon/https/x509/x509.c b/src/daemon/https/x509/x509.c
index 2fa84551..2b624986 100644
--- a/src/daemon/https/x509/x509.c
+++ b/src/daemon/https/x509/x509.c
@@ -328,87 +328,6 @@ MHD_gnutls_x509_crt_get_key_usage (MHD_gnutls_x509_crt_t cert,
328} 328}
329 329
330 330
331static int
332MHD__gnutls_x509_crt_get_raw_dn2 (MHD_gnutls_x509_crt_t cert,
333 const char *whom,
334 MHD_gnutls_datum_t * start)
335{
336 ASN1_TYPE c2 = ASN1_TYPE_EMPTY;
337 int result, len1;
338 int start1, end1;
339 MHD_gnutls_datum_t signed_data = { NULL,
340 0
341 };
342
343 /* get the issuer of 'cert'
344 */
345 if ((result =
346 MHD__asn1_create_element (MHD__gnutls_get_pkix (),
347 "PKIX1.TBSCertificate",
348 &c2)) != ASN1_SUCCESS)
349 {
350 MHD_gnutls_assert ();
351 return MHD_gtls_asn2err (result);
352 }
353
354 result = MHD__gnutls_x509_get_signed_data (cert->cert, "tbsCertificate",
355 &signed_data);
356 if (result < 0)
357 {
358 MHD_gnutls_assert ();
359 goto cleanup;
360 }
361
362 result =
363 MHD__asn1_der_decoding (&c2, signed_data.data, signed_data.size, NULL);
364 if (result != ASN1_SUCCESS)
365 {
366 MHD_gnutls_assert ();
367 MHD__asn1_delete_structure (&c2);
368 result = MHD_gtls_asn2err (result);
369 goto cleanup;
370 }
371
372 result =
373 MHD__asn1_der_decoding_startEnd (c2, signed_data.data, signed_data.size,
374 whom, &start1, &end1);
375
376 if (result != ASN1_SUCCESS)
377 {
378 MHD_gnutls_assert ();
379 result = MHD_gtls_asn2err (result);
380 goto cleanup;
381 }
382
383 len1 = end1 - start1 + 1;
384
385 MHD__gnutls_set_datum (start, &signed_data.data[start1], len1);
386
387 result = 0;
388
389cleanup:MHD__asn1_delete_structure (&c2);
390 MHD__gnutls_free_datum (&signed_data);
391 return result;
392}
393
394/**
395 * MHD_gnutls_x509_crt_get_raw_dn - This function returns the subject's DN DER encoded
396 * @cert: should contain a MHD_gnutls_x509_crt_t structure
397 * @start: will hold the starting point of the DN
398 *
399 * This function will return a pointer to the DER encoded DN structure and
400 * the length.
401 *
402 * Returns 0 on success, or a negative value on error.
403 *
404 **/
405int
406MHD_gnutls_x509_crt_get_raw_dn (MHD_gnutls_x509_crt_t cert,
407 MHD_gnutls_datum_t * start)
408{
409 return MHD__gnutls_x509_crt_get_raw_dn2 (cert, "subject", start);
410}
411
412/** 331/**
413 * MHD_gnutls_x509_crt_export - This function will export the certificate 332 * MHD_gnutls_x509_crt_export - This function will export the certificate
414 * @cert: Holds the certificate 333 * @cert: Holds the certificate