Carolin Latze<address@hidden> writes:
Hi Simon,
It is difficult to tell from just description of the problem... Try
printing the entire buffer that is sent by _gnutls_gen_supplement and
the buffer received by _gnutls_parse_supplemental and hand-check that
they are correct and match.
If I did not do something completely wrong (which is ofc always
possible), they do not match, which is weird. Like you will see in the
source code below, I printed buf at the end of
_gnutls_gen_supplemental as well as data at the beginning of
_gnutls_parse_supplemental.
There is a bug in your printing code, it has to be:
_gnutls_debug_log ("EXT[%p]: supp send buffer: ",session);
for(i=0;i<buf->length;i++) _gnutls_debug_log ("%02x",buf->data[i]& 0xFF);
Check the warnings when you build the code, it would catch issues like
that.
With that, the buffers sent and received are identical:
|<2>| EXT[0x9073780]: supp send buffer: |<2>| 00|<2>| 00|<2>| 07|<2>| 00|<2>| 01|<2>| 00|<2>|
03|<2>| 6c|<2>| 6c|<2>| 6f|<2>|
|<2>| EXT[0x8de9c58]: recv supp buf: |<2>| 00|<2>| 00|<2>| 07|<2>| 00|<2>| 01|<2>| 00|<2>|
03|<2>| 6c|<2>| 6c|<2>| 6f|<2>|
Another bug was that your ext_helloworld.c cleared out the buffer, you
need to remove this call:
_gnutls_buffer_init(buf);
Maybe you could push a git branch with your
work somewhere, so we can more easily reproduce the problem?
Due to the lack of a git server, I put my GnuTLS version on a webserver:
http://diuf.unifr.ch/people/latzec/gnutls-2.9.11-CL.tar.gz
If you prefer a git branch, I need to get a server first :-) (which is
probably not impossible, but needs more time :))
A tarball is fine. You can push to free git servers out there, such as
repo.or.cz.
/Simon