]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
x509: clarify how to release memory allocated for DN
authorDaiki Ueno <ueno@gnu.org>
Thu, 12 Nov 2020 08:19:30 +0000 (09:19 +0100)
committerDaiki Ueno <ueno@gnu.org>
Thu, 12 Nov 2020 08:19:30 +0000 (09:19 +0100)
The application can assume that DNs returned from
_gnutls_x509_get_dn() are allocated with gnutls_malloc() and thus
shall be freed with gnutls_free().

Signed-off-by: Daiki Ueno <ueno@gnu.org>
lib/x509/crl.c
lib/x509/crq.c
lib/x509/x509.c

index 76d90925e80aa100ee564088b8a973b8764a132c..8705be3b6c3129f9dda3fe2cdddf35dcb9b22e9e 100644 (file)
@@ -300,7 +300,7 @@ gnutls_x509_crl_get_dn_oid(gnutls_x509_crl_t crl,
 /**
  * gnutls_x509_crl_get_issuer_dn2:
  * @crl: should contain a #gnutls_x509_crl_t type
- * @dn: a pointer to a structure to hold the name
+ * @dn: a pointer to a structure to hold the name; must be freed using gnutls_free()
  *
  * This function will allocate buffer and copy the name of the CRL issuer.
  * The name will be in the form "C=xxxx,O=yyyy,CN=zzzz" as
@@ -331,7 +331,7 @@ gnutls_x509_crl_get_issuer_dn2(gnutls_x509_crl_t crl, gnutls_datum_t * dn)
 /**
  * gnutls_x509_crl_get_issuer_dn3:
  * @crl: should contain a #gnutls_x509_crl_t type
- * @dn: a pointer to a structure to hold the name
+ * @dn: a pointer to a structure to hold the name; must be freed using gnutls_free()
  * @flags: zero or %GNUTLS_X509_DN_FLAG_COMPAT
  *
  * This function will allocate buffer and copy the name of the CRL issuer.
index afebca2012dceb7c5357ba20f0b9e2dee6722214..3cb2d1c418e33246163d7f590b608cb743579869 100644 (file)
@@ -284,7 +284,7 @@ gnutls_x509_crq_get_dn(gnutls_x509_crq_t crq, char *buf, size_t * buf_size)
 /**
  * gnutls_x509_crq_get_dn2:
  * @crq: should contain a #gnutls_x509_crq_t type
- * @dn: a pointer to a structure to hold the name
+ * @dn: a pointer to a structure to hold the name; must be freed using gnutls_free()
  *
  * This function will allocate buffer and copy the name of the Certificate 
  * request. The name will be in the form "C=xxxx,O=yyyy,CN=zzzz" as
@@ -314,7 +314,7 @@ int gnutls_x509_crq_get_dn2(gnutls_x509_crq_t crq, gnutls_datum_t * dn)
 /**
  * gnutls_x509_crq_get_dn3:
  * @crq: should contain a #gnutls_x509_crq_t type
- * @dn: a pointer to a structure to hold the name
+ * @dn: a pointer to a structure to hold the name; must be freed using gnutls_free()
  * @flags: zero or %GNUTLS_X509_DN_FLAG_COMPAT
  *
  * This function will allocate buffer and copy the name of the Certificate 
index c713f857a077a7aeb235426fcca755031d9e9be9..e9e5423da2e2a0af58b5a78d997b1656e8083779 100644 (file)
@@ -704,7 +704,7 @@ gnutls_x509_crt_get_issuer_dn(gnutls_x509_crt_t cert, char *buf,
 /**
  * gnutls_x509_crt_get_issuer_dn2:
  * @cert: should contain a #gnutls_x509_crt_t type
- * @dn: a pointer to a structure to hold the name
+ * @dn: a pointer to a structure to hold the name; must be freed using gnutls_free()
  *
  * This function will allocate buffer and copy the name of issuer of the Certificate.
  * The name will be in the form "C=xxxx,O=yyyy,CN=zzzz" as
@@ -735,7 +735,7 @@ gnutls_x509_crt_get_issuer_dn2(gnutls_x509_crt_t cert, gnutls_datum_t * dn)
 /**
  * gnutls_x509_crt_get_issuer_dn3:
  * @cert: should contain a #gnutls_x509_crt_t type
- * @dn: a pointer to a structure to hold the name
+ * @dn: a pointer to a structure to hold the name; must be freed using gnutls_free()
  * @flags: zero or %GNUTLS_X509_DN_FLAG_COMPAT
  *
  * This function will allocate buffer and copy the name of issuer of the Certificate.
@@ -888,7 +888,7 @@ gnutls_x509_crt_get_dn(gnutls_x509_crt_t cert, char *buf,
 /**
  * gnutls_x509_crt_get_dn2:
  * @cert: should contain a #gnutls_x509_crt_t type
- * @dn: a pointer to a structure to hold the name
+ * @dn: a pointer to a structure to hold the name; must be freed using gnutls_free()
  *
  * This function will allocate buffer and copy the name of the Certificate.
  * The name will be in the form "C=xxxx,O=yyyy,CN=zzzz" as
@@ -918,7 +918,7 @@ int gnutls_x509_crt_get_dn2(gnutls_x509_crt_t cert, gnutls_datum_t * dn)
 /**
  * gnutls_x509_crt_get_dn3:
  * @cert: should contain a #gnutls_x509_crt_t type
- * @dn: a pointer to a structure to hold the name
+ * @dn: a pointer to a structure to hold the name; must be freed using gnutls_free()
  * @flags: zero or %GNUTLS_X509_DN_FLAG_COMPAT
  *
  * This function will allocate buffer and copy the name of the Certificate.