diff options
-rw-r--r-- | NEWS | 9 | ||||
-rw-r--r-- | includes/gnutls/x509.h | 7 | ||||
-rw-r--r-- | lib/x509/verify.c | 8 | ||||
-rw-r--r-- | lib/x509/x509.c | 52 | ||||
-rw-r--r-- | lib/x509/x509.h | 4 |
5 files changed, 46 insertions, 34 deletions
@@ -3,6 +3,15 @@ Copyright (C) 2004, 2005, 2006, 2007 Simon Josefsson Copyright (C) 2000, 2001, 2002, 2003, 2004 Nikos Mavroyanopoulos See the end for copying conditions. +* Version 1.7.10 (unreleased) + +** New APIs to extract DER encoded X.509 Subject/Issuer DN. +Suggested by Nate Nielsen <nielsen-list@memberwebs.com>. + +** API and ABI modifications: +gnutls_x509_crt_get_raw_issuer_dn: ADD. +gnutls_x509_crt_get_raw_dn: ADD. + * Version 1.7.9 (released 2007-05-12) ** X.509 certificates are preferred over OpenPGP keys. diff --git a/includes/gnutls/x509.h b/includes/gnutls/x509.h index cf05cd2285..8f570df880 100644 --- a/includes/gnutls/x509.h +++ b/includes/gnutls/x509.h @@ -305,6 +305,13 @@ extern "C" gnutls_certificate_print_formats_t format, gnutls_datum_t *out); + /* Access to internal Certificate fields. + */ + int gnutls_x509_crt_get_raw_issuer_dn (gnutls_x509_crt_t cert, + gnutls_datum_t * start); + int gnutls_x509_crt_get_raw_dn (gnutls_x509_crt_t cert, + gnutls_datum_t * start); + /* RDN handling. */ int gnutls_x509_rdn_get (const gnutls_datum_t * idn, diff --git a/lib/x509/verify.c b/lib/x509/verify.c index 9e6020220b..0ff02f8fb7 100644 --- a/lib/x509/verify.c +++ b/lib/x509/verify.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation + * Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation * * Author: Nikos Mavroyanopoulos * @@ -164,14 +164,14 @@ is_issuer (gnutls_x509_crt_t cert, gnutls_x509_crt_t issuer_cert) NULL, 0}; int ret; - ret = _gnutls_x509_crt_get_raw_issuer_dn (cert, &dn1); + ret = gnutls_x509_crt_get_raw_issuer_dn (cert, &dn1); if (ret < 0) { gnutls_assert (); goto cleanup; } - ret = _gnutls_x509_crt_get_raw_dn (issuer_cert, &dn2); + ret = gnutls_x509_crt_get_raw_dn (issuer_cert, &dn2); if (ret < 0) { gnutls_assert (); @@ -899,7 +899,7 @@ is_crl_issuer (gnutls_x509_crl_t crl, gnutls_x509_crt_t issuer_cert) goto cleanup; } - ret = _gnutls_x509_crt_get_raw_dn (issuer_cert, &dn2); + ret = gnutls_x509_crt_get_raw_dn (issuer_cert, &dn2); if (ret < 0) { gnutls_assert (); diff --git a/lib/x509/x509.c b/lib/x509/x509.c index 956dbfb8e3..8de03ef51b 100644 --- a/lib/x509/x509.c +++ b/lib/x509/x509.c @@ -1682,37 +1682,37 @@ cleanup: return result; } -/*- - * _gnutls_x509_crt_get_raw_issuer_dn - This function returns the issuer's DN DER encoded - * @cert: should contain a gnutls_x509_crt_t structure - * @start: will hold the starting point of the DN - * - * This function will return a pointer to the DER encoded DN structure and - * the length. - * - * Returns 0 on success or a negative value on error. - * - -*/ +/** + * gnutls_x509_crt_get_raw_issuer_dn - This function returns the issuer's DN DER encoded + * @cert: should contain a gnutls_x509_crt_t structure + * @start: will hold the starting point of the DN + * + * This function will return a pointer to the DER encoded DN structure + * and the length. + * + * Returns 0 on success or a negative value on error. + * + **/ int -_gnutls_x509_crt_get_raw_issuer_dn (gnutls_x509_crt_t cert, - gnutls_datum_t * start) +gnutls_x509_crt_get_raw_issuer_dn (gnutls_x509_crt_t cert, + gnutls_datum_t * start) { return _gnutls_x509_crt_get_raw_dn2 (cert, "issuer", start); } -/*- - * _gnutls_x509_crt_get_raw_dn - This function returns the subject's DN DER encoded - * @cert: should contain a gnutls_x509_crt_t structure - * @start: will hold the starting point of the DN - * - * This function will return a pointer to the DER encoded DN structure and - * the length. - * - * Returns 0 on success, or a negative value on error. - * - -*/ +/** + * gnutls_x509_crt_get_raw_dn - This function returns the subject's DN DER encoded + * @cert: should contain a gnutls_x509_crt_t structure + * @start: will hold the starting point of the DN + * + * This function will return a pointer to the DER encoded DN structure and + * the length. + * + * Returns 0 on success, or a negative value on error. + * + **/ int -_gnutls_x509_crt_get_raw_dn (gnutls_x509_crt_t cert, gnutls_datum_t * start) +gnutls_x509_crt_get_raw_dn (gnutls_x509_crt_t cert, gnutls_datum_t * start) { return _gnutls_x509_crt_get_raw_dn2 (cert, "subject", start); } @@ -2158,7 +2158,7 @@ gnutls_x509_crt_check_revocation (gnutls_x509_crt_t cert, return ret; } - ret = _gnutls_x509_crt_get_raw_issuer_dn (cert, &dn2); + ret = gnutls_x509_crt_get_raw_issuer_dn (cert, &dn2); if (ret < 0) { gnutls_assert (); diff --git a/lib/x509/x509.h b/lib/x509/x509.h index 50dde03ae8..f6aac87dda 100644 --- a/lib/x509/x509.h +++ b/lib/x509/x509.h @@ -111,10 +111,6 @@ int gnutls_x509_crt_get_pk_algorithm (gnutls_x509_crt_t cert, unsigned int *bits); int _gnutls_x509_crt_cpy (gnutls_x509_crt_t dest, gnutls_x509_crt_t src); -int _gnutls_x509_crt_get_raw_issuer_dn (gnutls_x509_crt_t cert, - gnutls_datum_t * start); -int _gnutls_x509_crt_get_raw_dn (gnutls_x509_crt_t cert, - gnutls_datum_t * start); int gnutls_x509_crt_get_serial (gnutls_x509_crt_t cert, void *result, size_t * result_size); |