mainGnuTLS - Support: sr #108123, [PATCH] Fix...


sr #108123: [PATCH] Fix trust_list_add_system_trust on Windows

Submitter:  Marti Raudsepp <intgr>
Submitted:  Mon 03 Sep 2012 07:10:58 PM UTC
Category:  Core library Priority:  5 - Normal
Severity:  4 - Important Status:  Done
Privacy:  Public Assigned to:  nmav
Open/Closed:  Closed Operating System:  Microsoft Windows
* Mandatory Fields

Add a New Comment Rich Markup

Mon 03 Sep 2012 07:52:37 PM UTC, comment #1: 

You're right. I've applied it. This looks like an issue in the 3.1.x released. The gnutls_x509_trust_list_add_system_trust() in 3.0.x should work as expected.

Nikos Mavrogiannopoulos <nmav>
Group administrator
Mon 03 Sep 2012 07:10:58 PM UTC, original submission:  

Apparently gnutls_x509_trust_list_add_system_trust is broken on Windows -- it never manages to import any certificates on the machines I tried it on (always returning 0). Upon closer inspection, the gnutls_x509_trust_list_add_trust_mem function always returned -49 (GNUTLS_E_NO_CERTIFICATE_FOUND). Looking further in the function, the problem was obvious...

Patch attached:
Fix gnutls_x509_trust_list_add_trust_mem with DER-format certificates.

The function took a "type" argument and then happily proceeded to ignore
it and try PEM format anyway.

Most importantly, this makes gnutls_x509_trust_list_add_system_trust
work on Windows, which loads DER certificates using this function.  I'll
be damned if that actually ever worked properly -- certainly not in any
git version. :)

Also added test for gnutls_x509_trust_list_add_trust_mem.

Also available on github:

I agree to assign my copyrights on this patch to the FSF.

Marti Raudsepp <intgr>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #26466:  win32-systrust-fix.patch added by intgr (6KiB - text/x-patch)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by nmav (Posted a comment)
  • -email is unavailable- added by intgr (Submitted the item)
  • -email is unavailable- added by intgr (Marti Raudsepp)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.


    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-09-25 nmav Open/ClosedOpen Closed
    2012-09-03 nmav StatusNone Done
        Assigned toNone nmav
    2012-09-03 intgr Attached File- Added win32-systrust-fix.patch, #26466
        Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.12