[gnutls-devel] GnuTLS | WIP: AIA callback to retrieve missing chain certificates (!1262)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Sat May 30 12:11:12 CEST 2020




Sahana Prasad commented on a discussion on tests/missingissuer.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1262#note_352271774

> +	gnutls_datum_t tmp;
> +	int ret;
> +
> +	tmp.data = (unsigned char *)missing_cert_insert;
> +	tmp.size = strlen(missing_cert_insert);
> +
> +	ret = gnutls_x509_crt_import(issuer, &tmp, GNUTLS_X509_FMT_PEM);
> +	if (ret < 0) {
> +		fprintf(stderr, "error: %s\n", gnutls_strerror(ret));
> +		return -1;
> +	}
> +
> +	ret = gnutls_x509_crt_print(crt, GNUTLS_CRT_PRINT_ONELINE, &tmp);
> +	if (ret < 0) {
> +		fprintf(stderr, "error: %s\n", gnutls_strerror(ret));
> +		gnutls_free(tmp.data);

I think gnutls_x509_crt_print() is allocating dynamic memory and `gnutls_free(tmp.data)` has to be freed.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/1262#note_352271774
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20200530/f1507dcd/attachment.html>


More information about the Gnutls-devel mailing list