ASN1_STRING_NEW(3ossl)
π ASN1_STRING_NEW π
okay bestie, welcome to the ASN1_STRING allocation corner of the OpenSSL manual, page ASN1_STRING_NEW(3ossl) β yes that's the manual name, we're just folding it in here at the top because we're β¨casualβ¨ like that.
This page is literally about three lil functions that make and unmake ASN1_STRING structs. Nothing more, nothing less. It's giving "short king of a manpage" and honestly? We respect it. π«Ά
β¨ 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);
no cap, that's the whole vibe right there. three functions. one header. let's go. π
πΈ DESCRIPTION πΈ
okay so here's the tea on each one:
ASN1_STRING_new()β returns an allocatedASN1_STRINGstructure. and its type? undefined. literally undefined. it's an unlabeled baddie. πASN1_STRING_type_new()β returns an allocatedASN1_STRINGstructure, but this one knows itself. it's of typetype. main character energy fr fr. πASN1_STRING_free()β frees upa. and ifaisNULL? nothing is done. nothing!! it just. does nothing. iconic behaviour, no crash, no drama, we love a function that minds its own business. π
π NOTES π
the way that other string types literally just call these ASN1_STRING functions... iykyk. like, for example, ASN1_OCTET_STRING_new() calls ASN1_STRING_type_new(V_ASN1_OCTET_STRING). so yeah, all the other string types are lowkey just borrowing the same machinery under the hood. it's a whole ecosystem, bestie. π
π RETURN VALUES π
ASN1_STRING_new()andASN1_STRING_type_new()return a validASN1_STRINGstructure, orNULLif an error occurred. so like... check that pointer, okay? don't be out here dereferencingNULL, that's not the move. πASN1_STRING_free()does not return a value. it just frees and dips. π¦
β SEE ALSO β
go read it, it's the friend of the friend, you'll need it when something returns NULL and you're like "why tho" π
π 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>.
and that's the whole page, bestie!! β¨ this was OpenSSL version 3.5.9, dated 2026-09-29, and the manual page itself goes by ASN1_STRING_NEW(3ossl). now go forth and allocate responsibly, mwah ππΈπ
π¦ 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