X509_STORE_NEW(3ossl)

πŸ“¦ version 3.5.0, in opensuse-leap 16.0

πŸ’… X509_STORE_NEW β€” bestie's guide to allocating, freeing and locking an X509_STORE

okay so this is the 3ossl manual page, and it's literally the lore drop for X509_STORE_new, X509_STORE_up_ref, X509_STORE_free, X509_STORE_lock and X509_STORE_unlock β€” the whole allocation/freeing/locking saga. it's giving "small API, big responsibilities" ngl πŸŽ€


✨ NAME ✨

X509_STORE_new, X509_STORE_up_ref, X509_STORE_free, X509_STORE_lock, X509_STORE_unlock β€” the X509_STORE allocation, freeing and locking functions. that's the whole cast, no extras, no cameos πŸ’…


🌸 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);

that's it. that's the whole menu. copy it exactly, bestie, don't get creative with the return types πŸ™ˆ


πŸ¦‹ DESCRIPTION πŸ¦‹

so like, here's what each one actually does:

  • X509_STORE_new() β€” returns a new X509_STORE. brand new, fresh out the box, main character energy ✨
  • X509_STORE_up_ref() β€” increments the reference count associated with the X509_STORE object. it's literally the "you're doing amazing sweetie" of refcounts β€” more refs, more love 🫢
  • X509_STORE_lock() β€” locks the store from modification by other threads, and X509_STORE_unlock() unlocks it. classic mutual exclusion moment, keep those threads from stepping on each other πŸ’€
  • X509_STORE_free() β€” frees up a single X509_STORE object. and important: if the argument is NULL, nothing is done. no crash, no drama, just vibes 🌈

πŸ”₯ RETURN VALUES πŸ”₯

okay so the vibe check results:

  • X509_STORE_new() returns a newly created X509_STORE or NULL if the call fails. NULL = it did not slay 😭
  • X509_STORE_up_ref(), X509_STORE_lock() and X509_STORE_unlock() return 1 for success and 0 for failure. binary queen behavior πŸ‘‘
  • X509_STORE_free() does not return values. it just does the thing and leaves. iconic ⭐

πŸ’– SEE ALSO πŸ’–

go read these next, iykyk:


🧚 HISTORY 🧚

the X509_STORE_up_ref(), X509_STORE_lock() and X509_STORE_unlock() functions were added in OpenSSL 1.1.0. so they're not new new, but they're still that girl πŸ’œ


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>.

fr fr read the license, bestie. "may not use this file except in compliance with the License" is not a suggestion, it's a whole mood. 🫢

and that's the page!! πŸ’…βœ¨ this was OpenSSL 3.5.0, dated 2026-09-25, page X509_STORE_NEW(3ossl) β€” go forth and refcount responsibly, mwah πŸŽ€

πŸ“¦ where this page comes from