X509V3_ADDR_SUBSET(3)
π NAME π
okay bestie, welcome to the X509V3_ADDR_SUBSET(3) page π
β it's giving βRFC 3779 subset relationshipβ realness. We're talking about X509v3_addr_subset, X509v3_asid_subset, and how they check whether one resource set is fully tucked inside another. no cap, it's iconic. β¨
π¦ SYNOPSIS π¦
library βlibcryptoβ #include <openssl/x509v3.h>
int
X509v3_addr_subset(IPAddrBlocks *child, IPAddrBlocks *parent);
int
X509v3_asid_subset(ASIdentifiers *child, ASIdentifiers *parent);
πΈ DESCRIPTION πΈ
X509v3_addr_subset() determines if all IP address resources present in child are contained in the corresponding resources in parent. lowkey the whole vibe is βis the child set a subset of the parent set?β π«Ά
β οΈ bestie, listen: the implementation assumes but does not ensure that bothchildandparentare in canonical form as described inX509v3_addr_is_canonical(3). In particular, bothchildandparentare sorted appropriately and they contain at most oneIPAddressFamilyobject per address family identifier (AFI) and optional subsequent address family identifier (SAFI). this is not a drill π
The checks are, in order:
- If
childisNULLor identical toparentthenchildis a subset ofparent. In particular, aNULLparentis allowed for aNULLchild. - If
parentisNULLthenchildis not a subset ofparent. - If
X509v3_addr_inherits(3)determines thatchildinherits or thatparentinherits thenchildis not a subset ofparent. - Each address prefix or range in
childmust be a subset of an address prefix or range in theparent, takingAFIand optionalSAFIinto account:- For each
IPAddressFamilyofchildthere must be anIPAddressFamilyofparentwith the sameAFIand optionalSAFI. - Since the address prefixes and ranges in corresponding
IPAddressFamilyobjects inchildandparentare sorted in ascending order, and do not overlap, they can be traversed simultaneously in linear time. For each prefix or range inchildthere must be a prefix or range inparentwhose minimal address is smaller and whose maximal address is larger.
- For each
If any of these steps fails, child is not a subset of parent. that's the tea β
X509v3_asid_subset() determines if all AS identifier resources in child are contained in the corresponding resources in parent.
The description for X509v3_addr_subset() applies mutatis mutandis. In particular, child and parent must be in canonical form per X509v3_asid_is_canonical(3), but this is not enforced. bestie, the canonical-form thing is still a vibe requirement, not a guarantee π
π₯ RETURN VALUES π₯
X509v3_addr_subset() and X509v3_asid_subset() return 1 if and only if child is a subset of parent, otherwise they return 0. If both child and parent are in canonical form, these functions cannot fail. slay, no surprise chaos π
π SEE ALSO π
ASIdentifiers_new(3)ASRange_new(3)crypto(3)IPAddressRange_new(3)X509_new(3)X509v3_addr_add_inherit(3)X509v3_asid_add_inherit(3)
β STANDARDS β
RFC 3779: X.509 Extensions for IP Addresses and AS Identifiers. periodt π
π¦ HISTORY π¦
These functions first appeared in OpenSSL 0.9.8e and have been available since OpenBSD 7.1. look at them being all vintage and iconic π
mwah π
Debian Β· June 8, 2025 Β· X509V3_ADDR_SUBSET(3) β byeee, bestie π
π¦ where this page comes from
- alpine 3.24: libressl-doc 4.3.1-r0 Β· custom
- arch rolling: libressl 4.4.0-1 Β· ISC AND custom:OpenSSL
- Copyright (c) 2023 Theo Buehler <tb@openbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms