libdane: add function dane_query_to_raw_tlsa
authorSimon Arlott <sa.me.uk>
Thu, 10 Jul 2014 21:08:30 +0000 (22:08 +0100)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Fri, 11 Jul 2014 15:37:05 +0000 (17:37 +0200)
commit62120b1872664b883a4ae59b1ff54a424bd2f297
tree8088241b1f3cd847d7c25e7fddc196b7ef350a3e
parent3963518d067a64412bbe0aa9ce5fc33ae729c15f
libdane: add function dane_query_to_raw_tlsa

This function converts a dane_query_t into the parameters needed for
dane_raw_tlsa() to make it easy to copy the results of the (synchronous)
lookup query from one process to another.

This code allocates an unnecessary extra NULL entry for dane_data_len
to avoid trying to malloc 0 bytes if q->data_entries is 0 (it is possible
for malloc/calloc to return NULL when requested to allocate 0 bytes).

Signed-off-by: Simon Arlott
libdane/dane.c
libdane/includes/gnutls/dane.h
libdane/libdane.map