X509V3_PARSE_LIST(3)
π X509V3_PARSE_LIST π
okay so bestie, this is a page from libcrypto's part of the library functions manual, and today we're talking about X509V3_parse_list and X509V3_conf_free β the little duo that creates and destroys CONF_VALUE objects. yes that's the whole vibe. let's get into it π«Ά
β¨ SYNOPSIS β¨
first things first, you gotta pull in the library:
library βlibcryptoβ
#include <openssl/x509v3.h>
then these two icons are at your service:
STACK_OF(CONF_VALUE) *
X509V3_parse_list(const char *string);
void
X509V3_conf_free(CONF_VALUE *conf);
π DESCRIPTION π
X509V3_parse_list() takes your string, parses it, and allocates an array of CONF_VALUE objects. it follows these rules, no cap:
- the string gets split into fields at comma (
',') characters. that's the delimiter, periodt. - if a field contains a colon (
':') character, then the part before the colon is treated as a name and the part after the first colon is the associated value. if there's no colon, the whole field is the name andNULLis used as the associated value. slay. - for each name and each value, leading and trailing whitespace as defined by
isspace(3)is ignored. literally just trimmed away πββοΈ - parsing ends when a NUL, carriage return, or newline character shows up. that's the stop sign, iykyk.
so a new, empty STACK_OF(CONF_VALUE) gets allocated, and for each parsed name, one CONF_VALUE structure β with its optional value β is pushed onto it. every name gets its moment, main character energy for each one β¨
X509V3_conf_free() releases all the memory used by conf. and if conf is NULL, nothing happens β no action, no drama, no crash. we love a chill cleanup π
the typical way to release the memory that came back from X509V3_parse_list() is by calling sk_CONF_VALUE_pop_free() on it, and passing a pointer to the function X509V3_conf_free() as the second argument. match made in heaven fr fr π«Ά
π RETURN VALUES π
X509V3_parse_list() returns the new STACK_OF(CONF_VALUE) object on success, or NULL if an error occurs. and bestie, the error situations are:
- if there isn't any name at all π
- if the name before a colon or after a comma is empty
- if the value after a colon is empty
- if memory allocation fails π
π¦ SEE ALSO π¦
isspace(3), sk_pop_free(3), STACK_OF(3), v2i_ASN1_BIT_STRING(3)
go read those next, you're gonna love them π
π HISTORY π
X509V3_parse_list() and X509V3_conf_free() first appeared in OpenSSL 0.9.2 and have been available since OpenBSD 2.6. veterans. icons. absolute legends πΈ
and that's the page, bestie π written up on the Debian side, dated June 8, 2025 β X509V3_PARSE_LIST(3), signing off πβ¨
π¦ 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) 2024 Ingo Schwarze <schwarze@openbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms