ASN1_OBJECT_NEW(3ossl)
π ASN1_OBJECT_NEW β bestie edition π
okay so this page is from OpenSSL, and it's the 3ossl manual, and it's all about the two lil' object allocation functions ASN1_OBJECT_new and ASN1_OBJECT_free. no cap, it's short, but we're gonna make it cute. β¨
β¨ NAME β¨
ASN1_OBJECT_new, ASN1_OBJECT_free β the object allocation functions, aka the birth and the farewell of an ASN1_OBJECT. π
πΈ SYNOPSIS πΈ
#include <openssl/asn1.h>
ASN1_OBJECT *ASN1_OBJECT_new(void);
void ASN1_OBJECT_free(ASN1_OBJECT *a);
like, that's it. two lines. one to make it, one to yeet it. π
π¦ DESCRIPTION π¦
so these are the ASN1_OBJECT allocation routines β they allocate and free an ASN1_OBJECT structure, and that structure is the thing that represents an ASN1 OBJECT IDENTIFIER. iconic behavior honestly.
ASN1_OBJECT_new()β allocates and initializes anASN1_OBJECTstructure. brand new baby object, freshly initialized, living its best life. π«ΆASN1_OBJECT_free()β frees up theASN1_OBJECTstructure a. and listen: if a isNULL, nothing is done. literally nothing. it just vibes. no crash, no drama. π
π NOTES π
okay bestie, this is the important part so read it twice:
even thoughASN1_OBJECT_new()allocates a newASN1_OBJECTstructure, it is almost never used in applications. like, almost never never.
instead, the ASN1 object utility functions β things like OBJ_nid2obj() β are what you use. so if you were about to reach for ASN1_OBJECT_new(), maybe don't?? the utility functions are the main characters here. π
β RETURN VALUES β
- if the allocation fails,
ASN1_OBJECT_new()returnsNULLand sets an error code that you can grab withERR_get_error(3). so if you getNULL, go check the error queue, it's giving receipts. π - otherwise it returns a pointer to the newly allocated structure. slay. π₯
ASN1_OBJECT_free()returns no value. it's a void function, it gives you nothing back and that's just its vibe. π€·
π SEE ALSO π
π COPYRIGHT π
Copyright 2002-2016 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!! πβ¨ this was version 3.5.9, dated 2026-09-29, straight from the OpenSSL girlies themselves β go forth and free your objects, and remember: if a is NULL, nothing is done, and honestly? that's the energy we're bringing into the rest of our day. ππ¦π
π¦ where this page comes from
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms