[gnutls-devel] gnutls handling error

hammi_mohamed_tahar at hotmail.fr hammi_mohamed_tahar at hotmail.fr
Mon Jul 7 00:47:21 CEST 2014

First of all, thank you for your answer,

As OS, I have Ubuntu 14.04 Desktop 64 bits. For GNUTLS installation I 
followed these steps :

1- Install the prequisites:  sudo apt-get install build-essential 
nettle-dev libgmp-dev
2- Download the GnuTLS source files:  wget 
3- Extract the files:  unxz gnutls-3.1.23.tar.xz && tar -xvf 
4- Change into the build directory:  cd gnutls-3.1.23
5- Compile and install:  ./configure && make && make install
6- Add a symlink to your libgnutls.so.28 file so gnutls-cli can tell us 
what version we are
running:  ln -s /usr/local/lib/libgnutls.so.28 /usr/lib/libgnutls.so.28

After, to create my extension, I followed this tutorial 
(http://gnutls.org/manual/html_node/TLS-Extension-Handling.html), for 
compilation I did these commands:

1-  ./configure --enable-myExtension  :


           version:              3.1.23 shared 49:3:21
           Host/Target system:   x86_64-unknown-linux-gnu
           Build system:         x86_64-unknown-linux-gnu
           Install prefix:       /usr/local
           Compiler:             gcc -std=gnu99
           CFlags:               -g -O2
           Library types:        Shared=yes, Static=yes

         configure: External hardware support:

           /dev/crypto:          no
           Hardware accel:       x86-64
           PKCS#11 support:      yes
           TPM support:          no

         configure: Optional features:
         (note that included applications might not compile properly
         if features are disabled)

           DTLS-SRTP support:    yes
           OCSP support:         yes
           OpenPGP support:      yes
           SRP support:          yes
           PSK support:          yes
           DHE support:          yes
           ECDHE support:        yes
           RSA-EXPORT support:   yes
           Anon auth support:    yes
           Heartbeat support:    yes

            configure: Optional applications   :

           crywrap app:          yes
           local libopts:        no
           local libtasn1:       no

            configure: Optional libraries:

           Guile wrappers:       no
           C++ library:          yes
           DANE library:         no
           OpenSSL compat:       yes

         configure: System files:

           Trust store pkcs:
           Trust store file: /etc/ssl/certs/ca-certificates.crt
           Blacklist file:
           CRL file:
           DNSSEC root key file: /etc/unbound/root.key

2- make

./../gnutls_datum.h:26:24: error: unknown type name 'gnutls_datum_t'
  int _gnutls_set_datum (gnutls_datum_t * dat, const void *data,
./../gnutls_datum.h:27:26: error: unknown type name 'size_t'
                           size_t data_size);

/gnutls_int.h:726:3: error: unknown type name 'gnutls_buffer_st'
gnutls_int.h:782:3: error: unknown type name 'gnutls_buffer_st'
myExtension.c 15:11 : error: unknown type name 'opaque'
             const opaque * data,


Finaly, for the other extensions, for exemple when I execute this commande:
gnutls-cli --verbose --port 443www.ietf.org  --heartbeat,
With Wireshark, I can see the add of the new extension.

Nb: Even when I dont touch the source code of gnutls and when I juste 
modifie the gnutls_int.h file for exemple :
and after executing with ./configure, make, sudo make install, In 
wireshark the Type of the extension did not change and still equal to 
000d that it means 13 in decimal.

Think you.

Mohamed Tahar HAMMI

Le 05/07/2014 12:27, Nikos Mavrogiannopoulos a écrit :
> On Fri, 2014-07-04 at 12:40 +0200,hammi_mohamed_tahar at hotmail.fr  wrote:
>> Hello,
>> I'm trying to create a new TLS extension  with Gnutls, so i've install
>> "gnutls-3.3.4" with all their dependencies, when i make "make check"
>> i've got no error and all is well. After i've followed this tutorial
>> (http://gnutls.org/manual/html_node/TLS-Extension-Handling.html) to make
>> the necessary modifications, but when i compile the new code with "make"
>> commande after done "./configure --enable-myExtension" i got some errors
>> messages, for exemple:
>> ....
>> /gnutls_int.h:726:3: error: unknown type name 'gnutls_buffer_st'
>> ....
>> gnutls_int.h:782:3: error: unknown type name 'gnutls_buffer_st'
>> .....
>> myExtension.c 15:11 : error: unknown type name 'opaque'
>>              const opaque * data,
> How did you try to compile it? These will be defined if you have a
> normal gnutls built. Check how the other extensions are defined/used,
> and if there is something missing from the documentation let us know.
> regards,
> Nikos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/attachments/20140707/7c2b17b1/attachment-0001.html>

More information about the Gnutls-devel mailing list