ASN1_STRING_TABLE_ADD(3SSL)

πŸ’– ASN1_STRING_TABLE_ADD β€” the OpenSSL one, bestie πŸ’–

okay so this is a page straight out of the OpenSSL manual, and it's all about the ASN1_STRING_TABLE situation. Three whole functions, one struct, zero chill. Let's get into it. πŸ¦‹


✨ NAME ✨

ASN1_STRING_TABLE, ASN1_STRING_TABLE_add, ASN1_STRING_TABLE_get, ASN1_STRING_TABLE_cleanup β€” the ASN1_STRING_TABLE manipulation functions, aka the little crew that runs your string table. πŸ‘‘


🌸 SYNOPSIS 🌸

#include <openssl/asn1.h>

typedef struct asn1_string_table_st ASN1_STRING_TABLE;

int ASN1_STRING_TABLE_add(int nid, long minsize, long maxsize,
                          unsigned long mask, unsigned long flags);
ASN1_STRING_TABLE *ASN1_STRING_TABLE_get(int nid);
void ASN1_STRING_TABLE_cleanup(void);

like, that's it. that's the whole vibe. copy it exactly bestie, no typos πŸ’…


πŸŽ€ DESCRIPTION πŸŽ€

🌈 Types 🌈

ASN1_STRING_TABLE is a table, right, and it holds string information for a NID object β€” basically the minimum size, the maximum size, the type, and etc. all bundled together like a cute little info card for your NID. ✨

🧚 Functions 🧚

  • ASN1_STRING_TABLE_add() β€” adds a brand new ASN1_STRING_TABLE item into the local ASN1 string table, based on the nid plus all the other parameters you hand it. 🫢

and here's the part that matters: if the item is already in the table, the fields of ASN1_STRING_TABLE get updated (depending on the values of those parameters, like, e.g., minsize and maxsize >= 0, mask and flags != 0). and if the nid is standard? then a copy of the standard ASN1_STRING_TABLE is created and updated with the other parameters. iconic behaviour honestly. πŸŽ€

  • ASN1_STRING_TABLE_get() β€” searches for an ASN1_STRING_TABLE item based on nid. it checks the local table first, then the standard one. no cap, that's the order. πŸ”
  • ASN1_STRING_TABLE_cleanup() β€” frees all the ASN1_STRING_TABLE items that were added by ASN1_STRING_TABLE_add(). spring cleaning for your table, periodt. 🧹

πŸ’œ RETURN VALUES πŸ’œ

  • ASN1_STRING_TABLE_add() returns 1 on success, and 0 if an error occurred. 😭
  • ASN1_STRING_TABLE_get() returns a valid ASN1_STRING_TABLE structure, or NULL if nothing is found. πŸ’€
  • ASN1_STRING_TABLE_cleanup() does not return a value. it just does its thing and leaves. πŸ’…

⭐ SEE ALSO ⭐


Copyright 2017-2020 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>.


and that's the whole page bestie, go forth and manipulate your string tables responsibly πŸ¦‹βœ¨

this was OpenSSL 4.0.3, dated 2026-09-29, and you just read the ASN1_STRING_TABLE_ADD(3SSL) era of the manual. stay iconic, hydrate, and read your error codes. love u, byeee πŸ’–πŸŒΈ
πŸ“¦ where this page comes from