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

 
 

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

Submitted by:  Alexander Vershilov <qnikst>
Submitted on:  Tue 27 Nov 2012 09:40:08 AM UTC  
 
Category: NonePriority: 5 - Normal
Severity: 3 - NormalStatus: Need Info
Privacy: PublicAssigned to: Nikos Mavrogiannopoulos <nmav>
Open/Closed: ClosedOperating System: GNU/Linux

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission 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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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 File(s):
   
   
Comment:
   

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

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by nmav (Posted a comment)
  • -unavailable- added by qnikst (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 16 Feb 2013 11:49:48 AM UTCnmavOpen/ClosedOpen=>Closed
    Tue 27 Nov 2012 11:30:47 PM UTCnmavAttached File-=>Added ne_gnutls-2.c, #26985
    Tue 27 Nov 2012 08:34:32 PM UTCqnikstAttached File-=>Added subversion-neon-gnutls.log, #26984
    Tue 27 Nov 2012 05:11:24 PM UTCnmavStatusNone=>Need Info
      Assigned toNone=>nmav

    Back to the top


    Powered by Savane 3.1-cleanup