help-gnutls
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

My own TLS Extension - Hello World :-)


From: Carolin Latze
Subject: My own TLS Extension - Hello World :-)
Date: Fri, 23 Apr 2010 15:11:16 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100422 Lightning/1.0b1 Thunderbird/3.0.4

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]