Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
ASN1_ITEM_NEW(3)	 BSD Library Functions Manual	      ASN1_ITEM_NEW(3)

NAME
     ASN1_item_new, ASN1_item_free -- generic ASN.1 value constructor and de-
     structor

SYNOPSIS
     #include <openssl/asn1.h>

     ASN1_VALUE	*
     ASN1_item_new(const ASN1_ITEM *it);

     void
     ASN1_item_free(ASN1_VALUE *val_in,	const ASN1_ITEM	*it);

DESCRIPTION
     ASN1_item_new() allocates and initializes an empty	ASN.1 value of the
     type described by the global static object	it.

     ASN1_item_free() frees an ASN.1 value of the type described by it.	 If
     the true type of val_in fails to match the	specified it, buffer overflows
     and segmentation faults are likely	to occur.  It is not possible to re-
     cover the type of an ASN1_VALUE object by inspecting it; the type always
     needs to be remembered separately.

     ASN1_VALUE	is an incomplete type, and pointers to it always require cast-
     ing to the	correct	complete type before they can be dereferenced.	For
     all practical purposes, a pointer to ASN1_VALUE is	equivalent to a	void
     pointer.

     Depending on it, there are	more than 150 different	types that
     ASN1_item_new() may return.  Most of them are pointers to structures or
     pointers to arrays	of structures, but there are a few exceptions, for ex-
     ample: If it is ASN1_NULL_it, ASN1_item_new() returns a specific invalid
     pointer representing the unique ASN1_NULL object.	If it is
     ASN1_BOOLEAN_it or	LONG_it, ASN1_item_new() does not return a pointer at
     all, but a	long value cast	to ASN1_VALUE *.

RETURN VALUES
     ASN1_item_new() returns the new ASN1_VALUE	object or NULL if an error oc-
     curs.

SEE ALSO
     ASN1_item_d2i(3), ASN1_TYPE_new(3), d2i_ASN1_NULL(3), OBJ_nid2obj(3)

BUGS
     The ASN1_VALUE type compromises type safety and invites programming mis-
     takes that	will typically have severe consequences.

BSD				January	3, 2017				   BSD

NAME | SYNOPSIS | DESCRIPTION | RETURN VALUES | SEE ALSO | BUGS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=ASN1_item_new&sektion=3&manpath=FreeBSD+12.1-RELEASE+and+Ports>

home | help