ASN1_STRING_NEW(3ossl)
π ASN1_STRING_NEW β the OpenSSL manual, bestie edition
okay so this is the ASN1_STRING_NEW(3ossl) page from the OpenSSL manual, and it's literally all about the ASN1_STRING allocation functions. three little guys: one makes a string, one makes a string of a specific type, one yeets it into the void. let's get into it π
β¨ NAME β¨
ASN1_STRING_new, ASN1_STRING_type_new, ASN1_STRING_free β the ASN1_STRING allocation functions. that's it, that's the whole vibe: allocate, allocate-with-a-type, free. π
π¦ SYNOPSIS π¦
#include <openssl/asn1.h>
ASN1_STRING *ASN1_STRING_new(void);
ASN1_STRING *ASN1_STRING_type_new(int type);
void ASN1_STRING_free(ASN1_STRING *a);
like hello?? include the header first, obviously. π
πΈ DESCRIPTION πΈ
so here's the tea, bestie β three functions, each doing exactly one thing:
ASN1_STRING_new()β returns an allocatedASN1_STRINGstructure. and its type? undefined. literally undefined. it's giving "new phone who dis" energy, no type assigned yet. πASN1_STRING_type_new()β returns an allocatedASN1_STRINGstructure of type type. this one actually knows who it is. main character energy, it has a type. πASN1_STRING_free()β frees a. and if a isNULL, nothing is done. like, nothing at all. it just looks at theNULLand moves on with its life. no notes. π«Ά
π§ NOTES π§
okay this is the fun part β other string types call these ASN1_STRING functions. so like, the whole family is connected, iykyk. for example:
ASN1_OCTET_STRING_new() calls ASN1_STRING_type_new(V_ASN1_OCTET_STRING).
see?? it's a whole ecosystem. the octet string one is out here just vibing on top of ASN1_STRING_type_new with V_ASN1_OCTET_STRING as its personality. so iconic. β
π₯ RETURN VALUES π₯
ASN1_STRING_new()andASN1_STRING_type_new()β return a validASN1_STRINGstructure, orNULLif an error occurred. so like, check forNULL, bestie, fr fr. πASN1_STRING_free()β does not return a value. it'svoid. it gives nothing back. and honestly? respect. π
π SEE ALSO π
ERR_get_error(3)β go look at your errors, you deserve to know what went wrong. π¦
π COPYRIGHT π
Copyright 2002-2023 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>.
real talk: that's not a vibe, that's a license. please actually comply with it, bestie. the Apache License 2.0 said what it said. π
and that's the page!! mwah π this was the 3.5.0 version of the OpenSSL manual, dated 2026-09-25 β no cap, that's the actual source and date, go off and allocate responsibly πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: openssl-3-doc 3.5.0-160000.11.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms