GNUTLS_X509_CRT_GET_NAME_CONSTRAINTS(3)
π gnutls_x509_crt_get_name_constraints β the manual page, but make it make sense π
okay bestie, so this is a page from the gnutls manual, and it's about the function gnutls_x509_crt_get_name_constraints. yes the name is a whole mouthful, we're gonna get through it together π«Ά
β¨ NAME β¨
gnutls_x509_crt_get_name_constraints β it's an API function, bestie. that's the whole name section. slay.
πΈ SYNOPSIS πΈ
#include <gnutls/x509.h>
int gnutls_x509_crt_get_name_constraints(gnutls_x509_crt_t crt,
gnutls_x509_name_constraints_t nc, unsigned int flags, unsigned int *
critical);
like yes it's four arguments, no it's not that deep, keep reading π
π ARGUMENTS π
gnutls_x509_crt_t crtβ this one should contain agnutls_x509_crt_ttype. that's what the page says and i'm not gonna lie to you. it's your cert, girl, hand it over.gnutls_x509_name_constraints_t ncβ the nameconstraints intermediate type. this is the lil container where the good stuff lands.unsigned int flagsβ it's either zero, orGNUTLS_EXT_FLAG_APPEND. pick your fighter.unsigned int * criticalβ the extension status. pointer, so it writes back to you. main character behaviour, honestly.
π DESCRIPTION π
so this function will return an intermediate type that contains the name constraints of the CA certificate you handed it. that structure is the whole point: you pair it up with gnutls_x509_name_constraints_check() to verify whether a server's name is actually in accordance with the constraints. vibe check for certificates, fr fr π¦
now, the tea about flags π β when flags is set to GNUTLS_EXT_FLAG_APPEND, here's what happens:
- if the
ncstructure is empty, this function behaves identically as if the flag was not set at all. no drama, no difference. - otherwise, if there are elements in the
ncstructure, then the constraints get merged with the existing constraints following RFC5280 p6.1.4. and specifically: excluded constraints will be appended, and permitted ones will be intersected. yes, exactly like that, i'm not paraphrasing, that's the rule π
β οΈ and this is the important one bestie:ncmust be initialized prior to calling this function. do not skip this. do not pass go. initialize yournc. π
β RETURNS β
- on success,
GNUTLS_E_SUCCESS(0) is returned β¨ GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLEif the extension is not present π- otherwise, a negative error value. so like, if it's negative, it's not giving π
π SINCE π
3.3.0 β it's been here since 3.3.0, iconic, no cap π
π REPORTING BUGS π
found a bug? don't suffer in silence, tell the people:
- Report bugs to
<bugs@gnutls.org>. π§ - Home page:
https://www.gnutls.orgπ
π COPYRIGHT π
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. π«Ά
π 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 was gnutls version 3.8.13, signing off with love and correct name constraints ππ¦π
π¦ where this page comes from
- alpine 3.22: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.23: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.24: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- arch rolling: gnutls 3.8.13-3 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- ubuntu stonking: gnutls-doc 3.8.13-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms