dane_query_to_raw_tlsa(3)

✨ dane_query_to_raw_tlsa(3) ✨

okay bestie, welcome to the gnutls manual πŸ’– this one's a section 3 page, so it's all about a C function β€” specifically dane_query_to_raw_tlsa. pull up a chair, we're doing DANE today πŸŽ€


🌸 NAME 🌸

dane_query_to_raw_tlsa β€” it's an API function, babes. that's the whole name section. iconic brevity πŸ’…


✨ SYNOPSIS ✨

#include <gnutls/dane.h>

int dane_query_to_raw_tlsa(dane_query_t q, unsigned int * data_entries,
char *** dane_data, int ** dane_data_len, int * secure, int * bogus);

look at that signature. six arguments. she's high maintenance but she delivers 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

okay so here's the rundown on every single one of these, no skips:

  • dane_query_t q β€” the query result structure. that's your main character right there πŸ‘‘
  • unsigned int * data_entries β€” pointer that gets set to the number of entries in the query. like, how many things are in there πŸ”’
  • char *** dane_data β€” pointer to contain an array of DNS rdata items, terminated with a NULL pointer. > ⚠️ important: the caller must guarantee that the referenced data remains valid until dane_query_deinit() is called. do not let this go stale bestie, it's giving dangling pointer energy 😭
  • int ** dane_data_len β€” pointer to contain the length, in n bytes, of the dane_data items πŸ“
  • int * secure β€” pointer set true if the result is validated securely, false if validation failed or the domain queried has no security info. so like, true = we're good, false = either it flopped or there's just nothing to check 🀷
  • int * bogus β€” pointer set true if the result was not secure due to a security failure. bogus is exactly what it sounds like and you should be paying attention when this one goes true πŸ’€

πŸ’– DESCRIPTION πŸ’–

so this function will provide the DANE data from the query response. that's the job. that's what she does ✨

the pointers dane_data and dane_data_len are allocated with gnutls_malloc() to contain the data from the query result structure β€” and real talk, the individual dane_data items simply point to the original data and are not allocated separately. so it's not a full deep copy situation, it's more of a "here's where it lives" situation 🫢

⚠️ and the returned dane_data are only valid during the lifetime of q. periodt. after q is gone, so is your data. do not be out here using it afterwards πŸ™ˆ

πŸ”₯ RETURNS πŸ”₯

on success, DANE_E_SUCCESS (0) is returned. otherwise you get a negative error value, and that's your cue to go check what went wrong 😭


😭 REPORTING BUGS 😭

found a bug? report it to <bugs@gnutls.org> β€” they want to hear from you fr fr πŸ›

home page: https://www.gnutls.org


Copyright Β© 2001-2023 Free Software Foundation, Inc., and others.

copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. so like, go forth, just keep the receipts πŸ’œ


🌈 SEE ALSO 🌈

the full documentation for gnutls is maintained as a Texinfo manual. if the /usr/share/doc/gnutls/ directory does not contain the HTML form, visit:

https://www.gnutls.org/manual/


and that's the whole page bestie, you ate that πŸŽ€ this one's from gnutls version 3.8.13, page dane_query_to_raw_tlsa(3) β€” go forth and validate your TLSA records responsibly, mwah πŸ’…πŸ’–

πŸ“¦ where this page comes from