OSSL_ITEM(3ossl)

πŸ’– OSSL_ITEM β€” the OpenSSL core type for generic itemized data πŸ’–

okay bestie, welcome to OSSL_ITEM(3ossl), aka the little struct that could. it's a whole page in section 3 of the OpenSSL manual, and honestly? it's short, it's sweet, and it slays. let's get into it πŸŽ€


✨ NAME ✨

OSSL_ITEM β€” the OpenSSL Core type for generic itemized data. that's it, that's the name, periodt πŸ’…


✨ SYNOPSIS ✨

#include <openssl/core.h>

typedef struct ossl_item_st OSSL_ITEM;
struct ossl_item_st {
    unsigned int id;
    void *ptr;
};

look at her. two fields. no drama. iconic. πŸ‘‘


✨ DESCRIPTION ✨

so like, this type is literally just a tuple of an integer and a pointer. that's the whole vibe. it's a generic type used as a generic descriptor, which basically means the actual meaning of the thing is defined by how it's used β€” it's giving "we'll know what it means when we get there" energy, and no, that's not a bug, that's the design fr fr πŸ¦‹

here's the important bit though, bestie, do not skip this: arrays of this type are passed between the OpenSSL libraries and the providers, and those arrays must be terminated with a tuple where the integer is zero and the pointer NULL. like, 0 and NULL. both. that's your sentinel. no sentinel, no peace. 😭

⚠️ lowkey crucial: if you forget the terminating tuple where id is 0 and ptr is NULL, the code reading your array has no idea where it ends. don't do that to her. πŸ’€

rn this is mainly used for the return value of the provider's error reason strings array β€” so if you wanna see it in the wild, go check out "Provider Functions" in provider-base(7). iykyk 🌸


✨ SEE ALSO ✨

the whole friend group, together at last 🫢


✨ HISTORY ✨

OSSL_ITEM was added in OpenSSL 3.0. she's new-ish, she's thriving, we love her ⭐


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

legal bestie said what she said, and honestly? respect the paperwork. πŸ“œβœ¨

and that's the whole page!! 🌈 this was OpenSSL 3.5.9, dated 2026-09-29, and you just read OSSL_ITEM(3ossl) from cover to cover. main character energy, honestly. go build something cute with your arrays β€” and remember the 0 + NULL terminator, bestie, or it's over for you πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from