My own TLS Extension - Hello World :-)

Carolin Latze carolin.latze at unifr.ch
Fri Apr 23 16:10:38 CEST 2010


Hi Nikos,

thanks a lot, that did it! In the end, I want to implement a
proof-of-concept of the following draft:
http://tools.ietf.org/html/draft-latze-tls-tpm-extns-01

However I decided to start with some simple HelloWorld examples first.
Next step will be to implement a supplemental data handshake message ...
(after the API works since I get segfaults now, but I assume those are a
result of my great programming skills :))

Thanks a lot!
Carolin

On 04/23/10 15:32, Nikos Mavrogiannopoulos wrote:
> 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
>>
>>     

-- 
Carolin Latze
PhD Student				ICT Engineer

Department of Computer Science		Swisscom Strategy and Innovation
Boulevard de Pérolles 90		Ostermundigenstrasse 93
CH-1700 Fribourg      			CH-3006 Bern
	
phone: +41 26 300 83 30			+41 79 72 965 27
homepage: http://diuf.unifr.ch/people/latzec







More information about the Gnutls-help mailing list