gnutls_x509_crt_check_ip(3)
β¨ gnutls_x509_crt_check_ip β¨
okay so bestie, welcome to the gnutls manual, section 3 (library calls, the fun ones) π this one is literally called gnutls_x509_crt_check_ip and it's the "does this cert actually belong to this IP" girlie. let's get into it π«Ά
πΈ NAME πΈ
gnutls_x509_crt_check_ip β the API function that does the IP-matching thing, no cap π
π¦ SYNOPSIS π¦
#include <gnutls/x509.h>
unsigned gnutls_x509_crt_check_ip(gnutls_x509_crt_t cert, const unsigned
char * ip, unsigned int ip_size, unsigned int flags);
like, copy that exactly, don't freestyle it β¨
π ARGUMENTS π
gnutls_x509_crt_t certβ this one should contain agnutls_x509_crt_ttype. that's the whole vibe, that's the assignment πconst unsigned char * ipβ a pointer to the raw IP address. raw as in raw raw, not the cute dotted-decimal string version πunsigned int ip_sizeβ the number of bytes inip. and the only valid answers are 4 or 16. that's it. 4 or 16. (4 for v4, 16 for v6, iykyk) πunsigned int flagsβ should be zero. like, genuinely zero. that's the whole job π
π DESCRIPTION π
so here's the tea β this function checks if the IP allowed IP addresses listed in the certificate's subject alternative name match the IP address you handed it. that's it, that's the function. match β slay, no match β not slay π
β RETURNS β
- non-zero = successful match π (yes bestie, you ate)
- zero = failure π (it's giving "not your cert, not your IP")
π REPORTING BUGS π
found a bug? not me gatekeeping the email β report it 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. (translation: go off, just keep the receipt π§Ύβ¨)
π₯ 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, periodt π
this was page gnutls_x509_crt_check_ip(3) from gnutls version 3.8.13 β go forth and match those IPs, main character π¦ππ
π¦ 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