My own TLS Extension - Hello World :-)

Nikos Mavrogiannopoulos nmav at gnutls.org
Fri Apr 23 15:32:10 CEST 2010


Hello,
 We hide all functions by default unless they are exported (in the gnu
linker at least). If I remember well it is the libgnutls.map file that
you need to change.  Just from curiosity, which extension are you
trying to add?

btw. I plan to augment the extension  API to automatically store
extensions to session resumption db (for the moment this only affect
you in the sense that  you will not see your extension in a resumed
session, unless you dig deeper in libgnutls).

regards,
Nikos

On Fri, Apr 23, 2010 at 3:11 PM, Carolin Latze <carolin.latze at unifr.ch> wrote:
> Hi everybody,
>
> I tried to write my own TLS extension and ran into problems when trying
> to define an API for that extension. But let me explain step-by-step:
>
> I use gnutls 2.9.11 and followed
> http://www.gnu.org/software/gnutls/devel/manual/gnutls.html#TLS-Extension-Handling
> to add an extension that sends a fix HelloWorld message from client to
> server and vice versa and prints it (using printf). In order to do so, I
> modified and added the following files:
>
> lib/m4/hooks.m4
> lib/gnutls_int.h
> lib/gnutls_extensions.c
> lib/ext_helloworld.{h|c}
> lib/Makefile.am
>
> That worked pretty well. My very simple client and server application
> (they do a standard handshake) print out the HelloWorld as expected.
>
> Now, I wanted to add an API to be able to specify the HelloWorld message
> within the client and server application. In order to do so, I added the
> following line to lib/includes/gnutls/gnutls.h:
>
> int gnutls_helloworld_set_msg(gnutls_session_t session, const char *msg);
>
> The function itself is defined in lib/gnutls_helloworld.c. Furthermore I
> added gnutls_helloworld.c to lib/Makefile.am. Running make and make
> install does not show any problems but when I try to call
> gnutls_helloworld_set_msg in my client application, I run into linker
> problems:
>
> undefined reference to `gnutls_helloworld_set_msg'
>
> However when I run nm with my GnuTLS library, gnutls_helloworld_set_msg
> is listed.
>
> Does anybody have an idea whats going wrong here? I assume I missed on
> modification that is needed to export API methods, but I have no idea
> where.... Any help would be appreciated.
>
> Carolin
>
>
> _______________________________________________
> Help-gnutls mailing list
> Help-gnutls at gnu.org
> http://lists.gnu.org/mailman/listinfo/help-gnutls
>





More information about the Gnutls-help mailing list