[gnutls-devel] GnuTLS | gnutls_x509_crt_list_import2 returns 0, and not the number of certificates read (#794)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Thu Jun 27 16:07:01 CEST 2019



Sam Hall created an issue:


  ## Description of problem:
The function gnutls_x509_crt_list_import2 is documented as returning a negative value if an error occurs, or the number of certificates
read if the import was successful. However, at the end of the function in the source code (gitlab master), 0 is always returned on success.
There is an integer 'ret' used throughout the function, which stores the result of the internal call to gnutls_x509_crt_list_import2, but
this is only returned if it is less than 0. I believe that either ret should be returned, or the documentation should be updated to 
describe the observed behaviour.

## Version of gnutls used:
3.5.8

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

Steps to Reproduce:

 * 1. Generate one certificate and store it in DER format.
 * 2. Use this function to import the certificate.

## Actual results:
The call to gnutls_x509_crt_list_import2 returns 0.

## Expected results:
The call to gnutls_x509_crt_list_import2 should return 1.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/issues/794
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/20190627/707b8f18/attachment.html>


More information about the Gnutls-devel mailing list