From: Nikos Mavrogiannopoulos Date: Mon, 9 Jan 2012 22:34:53 +0000 (+0100) Subject: Added gnutls_x509_dn_oid_name(). X-Git-Tag: gnutls-3_0_12~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d7dd842ce72938fb1c7eb581b1cf1c58013cc4e;p=thirdparty%2Fgnutls.git Added gnutls_x509_dn_oid_name(). --- diff --git a/NEWS b/NEWS index 5ff929a5e8..da74964ca3 100644 --- a/NEWS +++ b/NEWS @@ -10,9 +10,12 @@ and public keys as well. ** libgnutls: Corrected memory leak in DH parameter generation. +** libgnutls: Added gnutls_x509_dn_oid_name() to +return a descriptive name of a DN OID. + ** API and ABI modifications: gnutls_pubkey_encrypt_data: Added - +gnutls_x509_dn_oid_name: Added * Version 3.0.11 (released 2012-01-06) diff --git a/lib/includes/gnutls/x509.h b/lib/includes/gnutls/x509.h index 2ade033d95..e34f372140 100644 --- a/lib/includes/gnutls/x509.h +++ b/lib/includes/gnutls/x509.h @@ -295,6 +295,8 @@ extern "C" int gnutls_x509_dn_oid_known (const char *oid); + const char* gnutls_x509_dn_oid_name (const char *oid); + /* Read extensions by OID. */ int gnutls_x509_crt_get_extension_oid (gnutls_x509_crt_t cert, int indx, void *oid, size_t * oid_size); diff --git a/lib/libgnutls.map b/lib/libgnutls.map index 81b0cef289..d570cb1cb5 100644 --- a/lib/libgnutls.map +++ b/lib/libgnutls.map @@ -728,6 +728,7 @@ GNUTLS_3_0_0 { gnutls_priority_get_cipher_suite_index; gnutls_random_art; gnutls_pubkey_encrypt_data; + gnutls_x509_dn_oid_name; } GNUTLS_2_12; GNUTLS_PRIVATE { diff --git a/lib/x509/common.c b/lib/x509/common.c index 69db11db70..ce84d379ee 100644 --- a/lib/x509/common.c +++ b/lib/x509/common.c @@ -171,8 +171,18 @@ _gnutls_x509_oid_data_choice (const char *oid) return 0; } -const char * -_gnutls_x509_oid2ldap_string (const char *oid) +/** + * gnutls_x509_dn_oid_name: + * @oid: holds an Object Identifier in a null terminated string + * + * This function will return the name of a known DN OID. + * + * Returns: A null terminated string or NULL otherwise. + * + * Since: 3.0.0 + **/ +const char* +gnutls_x509_dn_oid_name (const char *oid) { int i = 0; diff --git a/lib/x509/common.h b/lib/x509/common.h index 1d6caaf23d..ec6a6cd431 100644 --- a/lib/x509/common.h +++ b/lib/x509/common.h @@ -79,8 +79,6 @@ int _gnutls_x509_data2hex (const opaque * data, size_t data_size, const char *_gnutls_x509_oid2asn_string (const char *oid); -const char *_gnutls_x509_oid2ldap_string (const char *OID); - int _gnutls_x509_oid_data_choice (const char *OID); int _gnutls_x509_oid_data_printable (const char *OID); diff --git a/lib/x509/dn.c b/lib/x509/dn.c index 1cfe3a07bc..fd9052ea4b 100644 --- a/lib/x509/dn.c +++ b/lib/x509/dn.c @@ -42,7 +42,7 @@ oid2ldap_string (const char *oid) { const char *ret; - ret = _gnutls_x509_oid2ldap_string (oid); + ret = gnutls_x509_dn_oid_name (oid); if (ret) return ret;