ASN1_OBJECT_NEW(3SSL)

πŸ’… ASN1_OBJECT_NEW β€” the 3SSL manual, bestie edition ✨

okay so this is the page for ASN1_OBJECT_new and ASN1_OBJECT_free, aka the object allocation functions β€” yes the whole page is literally about making and yeeting an ASN1_OBJECT. it's short. it's iconic. let's go 🫢


πŸŽ€ NAME πŸŽ€

ASN1_OBJECT_new, ASN1_OBJECT_free β€” the object allocation functions πŸ’–


🌸 SYNOPSIS 🌸

like, the whole vibe in code form:

#include <openssl/asn1.h>

void ASN1_OBJECT_free(ASN1_OBJECT *a);

and now the sad part 😭 β€” the following functions have been deprecated since OpenSSL 4.0, and you can hide them entirely by defining OPENSSL_API_COMPAT with a suitable version value, see openssl_user_macros(7):

ASN1_OBJECT *ASN1_OBJECT_new(void);
heads up bestie: that second one is on the deprecated list. it's giving legacy. it's giving "why are you still calling me". but we'll get there πŸ’€

πŸ¦‹ DESCRIPTION πŸ¦‹

so the ASN1_OBJECT allocation routines allocate and free an ASN1_OBJECT structure, and that structure represents an ASN1 OBJECT IDENTIFIER. that's the whole job description. that's the assignment πŸ‘‘

  • ASN1_OBJECT_new() is deprecated and exists for legacy backward compatibility reasons β€” and it always returns NULL. not sometimes. not "if it feels like it". always. it is fr fr not doing the thing you want 🀑
  • ASN1_OBJECT_free() frees up the ASN1_OBJECT structure a. and if a is NULL, nothing is done β€” no crash, no drama, no nothing. it just looks at the NULL and walks away. main character energy honestly ✨

⭐ NOTES ⭐

okay so this is the part where I hold your hand gently 🫢

even though ASN1_OBJECT_new() allocates a new ASN1_OBJECT structure, it is almost never used in applications. like, basically never. the ASN1 object utility functions such as OBJ_nid2obj() are used instead. so if you were about to reach for ASN1_OBJECT_new(), bestie, put it down. lowkey OBJ_nid2obj() is the moment. iykyk πŸ’…


🌈 RETURN VALUES 🌈

  • ASN1_OBJECT_new() always return NULL. yes, "return", singular verb, that's the manpage's grammar, we respect it 😌 and yes, NULL. every time. no cap.
  • ASN1_OBJECT_free() returns no value. it just does the deed and leaves. silent. mysterious. iconic πŸ”₯

πŸ‘‘ SEE ALSO πŸ‘‘

d2i_ASN1_OBJECT(3) β€” go read that one next, bestie, it's the friend this page keeps pointing at 🌸


πŸŽ€ HISTORY πŸŽ€

ASN1_OBJECT_new() was deprecated in OpenSSL 4.0. that's the lore. that's the timeline πŸ•°οΈ


Copyright 2002-2026 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 page!! ✨ this was ASN1_OBJECT_NEW from the OpenSSL 3SSL manual, version 4.0.3, dated 2026-09-29. slay, go free your objects responsibly πŸ’–πŸŽ€πŸ¦‹
πŸ“¦ where this page comes from