X509_STORE_NEW(3ossl)
π
X509_STORE_NEW(3ossl) β bestie's guide to allocating, freeing & locking an X509_STORE π
ok so this is one of those 3ossl manual pages (yes, that's the section, slay), and it's literally all about the lifecycle of an X509_STORE β making one, keeping it alive, locking it so nobody else touches it, and freeing it when you're done. Think of it as the "birth, bodyguard, and burial" page for your store. π¦
β¨ SYNOPSIS β¨
#include <openssl/x509_vfy.h>
X509_STORE *X509_STORE_new(void);
void X509_STORE_free(X509_STORE *xs);
int X509_STORE_lock(X509_STORE *xs);
int X509_STORE_unlock(X509_STORE *xs);
int X509_STORE_up_ref(X509_STORE *xs);
like, that's the whole cast of characters right there π β five functions, one header, no cap.
π DESCRIPTION π
X509_STORE_new()β hands you a brand-newX509_STORE. freshly allocated, main character energy, all yours. πX509_STORE_up_ref()β bumps up the reference count on theX509_STOREobject. it's giving "you can share me, I'm not going anywhere." π«ΆX509_STORE_lock()β locks the store so other threads can't modify it.X509_STORE_unlock()β unlocks it again. it's the "don't touch my stuff while I'm working" duo. πβ¨X509_STORE_free()β frees up a singleX509_STOREobject. and here's the cute part: if the argument isNULL, nothing is done. no drama, no crash, just vibes. π (don't worry bestie,NULLis safe here fr fr)
π RETURN VALUES π
X509_STORE_new()β returns a freshly createdX509_STORE, orNULLif the call fails. πX509_STORE_up_ref(),X509_STORE_lock()andX509_STORE_unlock()β return1for success and0for failure. simple as that. βX509_STORE_free()β does not return values. it just does its thing and leaves. π
π¦ SEE ALSO π¦
iykyk, go read those next π
πΈ HISTORY πΈ
the X509_STORE_up_ref(), X509_STORE_lock() and X509_STORE_unlock() functions were added in OpenSSL 1.1.0. so yeah, they've been iconic for a minute. π
π COPYRIGHT π
Copyright 2016-2024 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.
ngl the license paragraph is the "please read the terms" part of the group chat, but like, legally you do gotta read it π«Ά
ok that's the page!! this version is from 3.5.6, dated 2026-04-07, and it's the X509_STORE_NEW(3ossl) page β mwah, go allocate responsibly bestie π
π₯
π¦ where this page comes from
- freebsd 15.1: base 15.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms