summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/man/d2i_ASN1_OBJECT.3130
1 files changed, 72 insertions, 58 deletions
diff --git a/src/lib/libcrypto/man/d2i_ASN1_OBJECT.3 b/src/lib/libcrypto/man/d2i_ASN1_OBJECT.3
index 77e6848394..7098c774f0 100644
--- a/src/lib/libcrypto/man/d2i_ASN1_OBJECT.3
+++ b/src/lib/libcrypto/man/d2i_ASN1_OBJECT.3
@@ -1,78 +1,92 @@
1.\" $OpenBSD: d2i_ASN1_OBJECT.3,v 1.4 2016/12/08 20:22:08 jmc Exp $ 1.\" $OpenBSD: d2i_ASN1_OBJECT.3,v 1.5 2017/01/04 09:04:45 schwarze Exp $
2.\" OpenSSL 05ea606a May 20 20:52:46 2016 -0400 2.\" OpenSSL 05ea606a May 20 20:52:46 2016 -0400
3.\" 3.\"
4.\" This file was written by Dr. Stephen Henson <steve@openssl.org>. 4.\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
5.\" Copyright (c) 2002, 2015 The OpenSSL Project. All rights reserved.
6.\" 5.\"
7.\" Redistribution and use in source and binary forms, with or without 6.\" Permission to use, copy, modify, and distribute this software for any
8.\" modification, are permitted provided that the following conditions 7.\" purpose with or without fee is hereby granted, provided that the above
9.\" are met: 8.\" copyright notice and this permission notice appear in all copies.
10.\" 9.\"
11.\" 1. Redistributions of source code must retain the above copyright 10.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12.\" notice, this list of conditions and the following disclaimer. 11.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
13.\" 17.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright 18.Dd $Mdocdate: January 4 2017 $
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: December 8 2016 $
52.Dt D2I_ASN1_OBJECT 3 19.Dt D2I_ASN1_OBJECT 3
53.Os 20.Os
54.Sh NAME 21.Sh NAME
55.Nm d2i_ASN1_OBJECT , 22.Nm d2i_ASN1_OBJECT ,
56.Nm i2d_ASN1_OBJECT 23.Nm i2d_ASN1_OBJECT
57.Nd ASN.1 OBJECT IDENTIFIER functions 24.Nd decode and encode ASN.1 object identifiers
58.Sh SYNOPSIS 25.Sh SYNOPSIS
59.In openssl/objects.h 26.In openssl/asn1.h
60.Ft ASN1_OBJECT * 27.Ft ASN1_OBJECT *
61.Fo d2i_ASN1_OBJECT 28.Fo d2i_ASN1_OBJECT
62.Fa "ASN1_OBJECT **a" 29.Fa "ASN1_OBJECT **val_out"
63.Fa "unsigned char **pp" 30.Fa "unsigned char **der_in"
64.Fa "long length" 31.Fa "long length"
65.Fc 32.Fc
66.Ft int 33.Ft int
67.Fo i2d_ASN1_OBJECT 34.Fo i2d_ASN1_OBJECT
68.Fa "ASN1_OBJECT *a" 35.Fa "ASN1_OBJECT *val_in"
69.Fa "unsigned char **pp" 36.Fa "unsigned char **der_out"
70.Fc 37.Fc
71.Sh DESCRIPTION 38.Sh DESCRIPTION
72These functions decode and encode an ASN.1 OBJECT IDENTIFIER. 39These functions decode and encode ASN.1 object identifiers.
73They otherwise behave in a similar way to 40For details about the semantics, examples, caveats, and bugs, see
74.Xr d2i_X509 3 41.Xr ASN1_item_d2i 3 .
75and 42.Pp
76.Xr i2d_X509 3 . 43The objects returned from
44.Fn d2i_ASN1_OBJECT
45and the data contained in them are always marked as dynamically
46allocated, so when they are no longer needed,
47.Xr ASN1_OBJECT_free 3
48can be called on them.
49.Pp
50If reusing an existing object is attempted but the
51.Pf * Fa val_out
52passed in points to an object that is not marked as dynamically
53allocated, then the existing object is left untouched and
54.Fn d2i_ASN1_OBJECT
55behaves as if
56.Pf * Fa val_out
57would have been
58.Dv NULL :
59A new object is allocated and a pointer to it is both stored in
60.Pf * Fa val_out
61and returned.
62.Sh RETURN VALUES
63.Fn d2i_ASN1_OBJECT
64returns an
65.Vt ASN1_OBJECT
66object or
67.Dv NULL
68if an error occurs.
69.Pp
70.Fn i2d_ASN1_OBJECT
71returns the number of bytes successfully encoded
72or a value <= 0 if an error occurs.
77.Sh SEE ALSO 73.Sh SEE ALSO
78.Xr d2i_X509 3 74.Xr ASN1_item_d2i 3 ,
75.Xr ASN1_OBJECT_new 3 ,
76.Xr OBJ_nid2obj 3
77.Sh CAVEATS
78.Fn d2i_ASN1_OBJECT
79never sets the long and short names of the object, not even if the
80object identifier matches one that is built-in to the library.
81To find the names of an object identifier parsed from DER or BER
82input, call
83.Xr OBJ_obj2nid 3
84on the returned object, and then
85.Xr OBJ_nid2sn 3
86and
87.Xr OBJ_nid2ln 3
88on the result.
89.Sh BUGS
90When reusing a dynamically allocated object that contains dynamically
91allocated names, the old names are not freed and the memory containing
92them is leaked.