[gnutls-devel] GnuTLS | gnutls_x509_crt_export2 can return values greater than 0 (#1025)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Wed Jun 10 18:40:38 CEST 2020



David Michmerhuizen created an issue: https://gitlab.com/gnutls/gnutls/-/issues/1025



## Description of problem:

The documentation for gnutls_x509_crt_export2 claims that 

"In case of failure a negative error code will be returned, and 0 on success."

This is incorrect, as the value of _gnutls_fbase64_encode is sometimes directly returned, which is the length of the exported certificate.  Specifically, 0 or greater is returned on success. 



## Version of gnutls used:

gnutls-3.6.7


## Distributor of gnutls (e.g., Ubuntu, Fedora, RHEL)

Fedora 


## How reproducible:

Code examination.  And yeah, it happened to me in some code and drove me crazy for a day - thanks. 

Steps to Reproduce:

 * one
 * two
 * three

## Actual results:


## Expected results:

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/issues/1025
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/20200610/70efeb80/attachment.html>


More information about the Gnutls-devel mailing list