mainGnuTLS - Support: sr #108189, gnutls_x509_crt_init(1) returns...

 
 

sr #108189: gnutls_x509_crt_init(1) returns null in neon

Submitter:  Alexander Vershilov <qnikst>
Submitted:  Tue 27 Nov 2012 09:40:08 AM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  Need Info
Privacy:  Public Assigned to:  nmav
Open/Closed:  Closed Operating System:  GNU/Linux
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 28 Nov 2012 10:33:13 AM UTC, comment #7: 

Thanks, that file (with minor fixes) fixed situation. I'll apply it in gentoo, and try to mail upstream.


Alexander Vershilov <qnikst>
Tue 27 Nov 2012 11:30:47 PM UTC, comment #6: 

One issue I noticed is on line 489 that size is not set to zero. The new attached file should fix the first warning, but I don't know whether the others are related (the gnutls line numbers in the file do not correspond to anything i can check).


(file #26985)

Nikos Mavrogiannopoulos <nmav>
Group administrator
Tue 27 Nov 2012 11:17:50 PM UTC, comment #5: 

Which version of gnutls did you use for this trace? It would be best to try with the latest version released (3.1.5).


Nikos Mavrogiannopoulos <nmav>
Group administrator
Tue 27 Nov 2012 08:34:32 PM UTC, comment #4: 

I think that problem is that neon incorrectly uses gnutls, the only reason I've filled a bug is that neon upsteam seems dead, and this error was introduced with some gnutls update. So any suggestions how to fix this error are welcome.

I've attached a valgrind log:

==13911==    at 0x8C90344: gnutls_x509_crt_get_subject (x509.c:2362)

this is done after calling:

 x509_crt_copy line 486 [1]

 issuer = x509_crt_copy(issuer); // <- here returns null
 cert = populate_cert(ne_calloc(sizeof *cert), issuer);


[1] http://svn.webdav.org/repos/projects/neon/trunk/src/ne_gnutls.c

(file #26984)

Alexander Vershilov <qnikst>
Tue 27 Nov 2012 05:11:24 PM UTC, comment #3: 

Could you then try with valgrind? This function is very inprobable to cause an error because it is one of the most tested in our included tests. The issue could be somewhere unrelated due to a memory corruption or so.

Nikos Mavrogiannopoulos <nmav>
Group administrator
Tue 27 Nov 2012 12:51:18 PM UTC, comment #2: 

I also have no idea how that commit can be related to that error, but testing it and previous commits has a stable result (an error after and and success before). I can make an image of a system where I have tested, with a sets of a scripts. Also I can send a bisect history.

No, changing to '< 0' instead 'of != 0' haven't solved my issue (at least with latest gnutls), I'll check on the previous versions).

Alexander Vershilov <qnikst>
Tue 27 Nov 2012 10:05:37 AM UTC, comment #1: 

Hello the commit that you mention has only changes in text files so I don't know how it relates to the issue you notice. In any case if you fix the check to:

if (gnutls_x509_crt_init(&dest) < 0) {

(instead of != 0), does it fix the issue for you?

Nikos Mavrogiannopoulos <nmav>
Group administrator
Tue 27 Nov 2012 09:40:08 AM UTC, original submission:  

When neon is used with resent gnutls version it segfaults when it is used by subversion to checkout some https repositories. [1,2]

error was in code sample:

    gnutls_x509_crt dest;
   
    if (gnutls_x509_crt_init(&dest) != 0) {
        return NULL;
    }

I tried to find out when this behavior is introduced and find out that it's a commit:

  50f0068ae327abce4f648cfb12132b0254f9afa8 [3]

And problem still persist in current gnutls versions.

How to reproduce:
1). install gnutls
2). install neon with gnutls support
3). install subversion
4). try to checkout svn repo (e.g. https://crossfire.svn.sourceforge.net/svnroot/crossfire)

Libraries and programs:

1). gnutls >= 2.99.4
2). neon-0.29.6
3). subversion 1.7.7

-----
[1] https://bugs.gentoo.org/show_bug.cgi?id=440936
[2] https://bugs.gentoo.org/show_bug.cgi?id=443854
[3] http://git.savannah.gnu.org/cgit/gnutls.git/commit/?id=50f0068ae327abce4f648cfb12132b0254f9afa8

I can provide additional information if needed.

Alexander Vershilov <qnikst>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #26985:  ne_gnutls-2.c added by nmav (40KiB - text/x-csrc)
file #26984:  subversion-neon-gnutls.log added by qnikst (5KiB - text/x-log - valgrind result)

 

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 qnikst (Submitted the item)
  •  

    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
    2013-02-16 nmav Open/ClosedOpen Closed
    2012-11-27 nmav Attached File- Added ne_gnutls-2.c, #26985
    2012-11-27 qnikst Attached File- Added subversion-neon-gnutls.log, #26984
    2012-11-27 nmav StatusNone Need Info
        Assigned toNone nmav

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code