1 .\" $OpenBSD: d2i_ASN1_NULL.3,v 1.1 2016/12/29 17:42:54 schwarze Exp $
3 .\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
5 .\" Permission to use, copy, modify, and distribute this software for any
6 .\" purpose with or without fee is hereby granted, provided that the above
7 .\" copyright notice and this permission notice appear in all copies.
9 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 .Dd $Mdocdate: December 29 2016 $
23 .Nd decode and encode an ASN.1 NULL type
28 .Fa "ASN1_NULL **val_out"
29 .Fa "const unsigned char **der_in"
34 .Fa "ASN1_NULL *val_in"
35 .Fa "unsigned char **der_out"
38 These functions decode and encode the ASN.1 value NULL of type NULL.
39 For details about the semantics, examples, caveats, and bugs, see
43 verifies that the BER-encoded value at
45 is NULL and of type NULL.
48 is less than 2 or if the first two bytes of
50 differ from 0x05 and 0x00.
53 is advanced by two bytes and
55 is set to a specific invalid pointer representing the unique
62 and encodes the ASN.1 value NULL of type NULL using DER.
63 Specifically, it writes the identifier octet for the type NULL,
64 0x05, followed by the length octet 0x00, and no content or
65 end-of-content octets.
68 returns a specific invalid pointer representing the unique
75 returns 2 if successful or 0 if an error occurs.
80 ITU-T Recommendation X.690, also known as ISO/IEC 8825-1:
81 Information technology - ASN.1 encoding rules:
82 Specification of Basic Encoding Rules (BER), Canonical Encoding
83 Rules (CER) and Distinguished Encoding Rules (DER),
84 section 8.8: Encoding of null value