From: Simon Josefsson Date: Sun, 8 Jun 2008 20:12:56 +0000 (+0200) Subject: gnutls_x509_crt_get_extension_oid: Doc fix. X-Git-Tag: gnutls_2_3_14~16 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d44ffe657ea8c86e4836fbf824e65b40db0346b4;p=thirdparty%2Fgnutls.git gnutls_x509_crt_get_extension_oid: Doc fix. Reported by Sam Varshavchik . --- diff --git a/NEWS b/NEWS index d426060963..973345f311 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,9 @@ Earlier it may have failed with an unresolved reference to strlen. ** Changed OpenPGP verification behaviour. An OpenPGP certificate is now only considered verified if all the user IDs are verified. +** Doc fix for gnutls_x509_crt_get_extension_oid. +Reported by Sam Varshavchik . + ** API and ABI modifications: No changes since last version. diff --git a/lib/x509/x509.c b/lib/x509/x509.c index dc131d40f7..21287b8060 100644 --- a/lib/x509/x509.c +++ b/lib/x509/x509.c @@ -1574,7 +1574,8 @@ gnutls_x509_crt_get_extension_oid (gnutls_x509_crt_t cert, int indx, * @cert: should contain a #gnutls_x509_crt_t structure * @indx: Specifies which extension OID to send. Use zero to get the first one. * @oid: a pointer to a structure to hold the OID - * @sizeof_oid: initially holds the size of @oid + * @sizeof_oid: initially holds the maximum size of @oid, on return + * holds actual size of @oid. * @critical: output variable with critical flag, may be NULL. * * This function will return the requested extension OID in the @@ -1582,6 +1583,10 @@ gnutls_x509_crt_get_extension_oid (gnutls_x509_crt_t cert, int indx, * be stored as a string in the provided buffer. Use * gnutls_x509_crt_get_extension_data() to extract the data. * + * If the buffer provided is not long enough to hold the output, then + * *@sizeof_oid is updated and %GNUTLS_E_SHORT_MEMORY_BUFFER will be + * returned. + * Return 0 on success. A negative value may be returned in case of * parsing error. If you have reached the last extension available * GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE will be returned.