diff options
author | schwarze <> | 2021-11-22 12:06:51 +0000 |
---|---|---|
committer | schwarze <> | 2021-11-22 12:06:51 +0000 |
commit | 4edfc9271874010ee9d11c3271d63fd7403731aa (patch) | |
tree | b3740035e1465cd567d2fc81415390c1b6b2d244 /src/lib | |
parent | 17ed5d3a5a436a18bd5da10d744ff29d89e16473 (diff) | |
download | openbsd-4edfc9271874010ee9d11c3271d63fd7403731aa.tar.gz openbsd-4edfc9271874010ee9d11c3271d63fd7403731aa.tar.bz2 openbsd-4edfc9271874010ee9d11c3271d63fd7403731aa.zip |
document ASN1_OBJECT_create(3)
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libcrypto/man/ASN1_OBJECT_new.3 | 71 |
1 files changed, 61 insertions, 10 deletions
diff --git a/src/lib/libcrypto/man/ASN1_OBJECT_new.3 b/src/lib/libcrypto/man/ASN1_OBJECT_new.3 index cf48cccef9..671631094b 100644 --- a/src/lib/libcrypto/man/ASN1_OBJECT_new.3 +++ b/src/lib/libcrypto/man/ASN1_OBJECT_new.3 | |||
@@ -1,10 +1,10 @@ | |||
1 | .\" $OpenBSD: ASN1_OBJECT_new.3,v 1.11 2019/06/06 01:06:58 schwarze Exp $ | 1 | .\" $OpenBSD: ASN1_OBJECT_new.3,v 1.12 2021/11/22 12:06:51 schwarze Exp $ |
2 | .\" OpenSSL 99d63d4 Mar 19 12:28:58 2016 -0400 | 2 | .\" full merge up to: OpenSSL 99d63d4 Mar 19 12:28:58 2016 -0400 |
3 | .\" | 3 | .\" |
4 | .\" This file is a derived work. | 4 | .\" This file is a derived work. |
5 | .\" The changes are covered by the following Copyright and license: | 5 | .\" The changes are covered by the following Copyright and license: |
6 | .\" | 6 | .\" |
7 | .\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org> | 7 | .\" Copyright (c) 2017, 2021 Ingo Schwarze <schwarze@openbsd.org> |
8 | .\" | 8 | .\" |
9 | .\" Permission to use, copy, modify, and distribute this software for any | 9 | .\" Permission to use, copy, modify, and distribute this software for any |
10 | .\" purpose with or without fee is hereby granted, provided that the above | 10 | .\" purpose with or without fee is hereby granted, provided that the above |
@@ -65,11 +65,12 @@ | |||
65 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 65 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
66 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 66 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
67 | .\" | 67 | .\" |
68 | .Dd $Mdocdate: June 6 2019 $ | 68 | .Dd $Mdocdate: November 22 2021 $ |
69 | .Dt ASN1_OBJECT_NEW 3 | 69 | .Dt ASN1_OBJECT_NEW 3 |
70 | .Os | 70 | .Os |
71 | .Sh NAME | 71 | .Sh NAME |
72 | .Nm ASN1_OBJECT_new , | 72 | .Nm ASN1_OBJECT_new , |
73 | .Nm ASN1_OBJECT_create , | ||
73 | .Nm ASN1_OBJECT_free | 74 | .Nm ASN1_OBJECT_free |
74 | .Nd ASN.1 object identifiers | 75 | .Nd ASN.1 object identifiers |
75 | .Sh SYNOPSIS | 76 | .Sh SYNOPSIS |
@@ -78,6 +79,14 @@ | |||
78 | .Fo ASN1_OBJECT_new | 79 | .Fo ASN1_OBJECT_new |
79 | .Fa void | 80 | .Fa void |
80 | .Fc | 81 | .Fc |
82 | .Ft ASN1_OBJECT * | ||
83 | .Fo ASN1_OBJECT_create | ||
84 | .Fa "int nid" | ||
85 | .Fa "unsigned char *content" | ||
86 | .Fa "int len" | ||
87 | .Fa "const char *short_name" | ||
88 | .Fa "const char *long_name" | ||
89 | .Fc | ||
81 | .Ft void | 90 | .Ft void |
82 | .Fo ASN1_OBJECT_free | 91 | .Fo ASN1_OBJECT_free |
83 | .Fa "ASN1_OBJECT *a" | 92 | .Fa "ASN1_OBJECT *a" |
@@ -92,10 +101,28 @@ and a sequence of integers identifying a node in the International | |||
92 | Object Identifier tree as specified in ITU-T recommendation X.660. | 101 | Object Identifier tree as specified in ITU-T recommendation X.660. |
93 | The new object is marked as dynamically allocated. | 102 | The new object is marked as dynamically allocated. |
94 | .Pp | 103 | .Pp |
104 | .Fn ASN1_OBJECT_create | ||
105 | allocates a new | ||
106 | .Vt ASN1_OBJECT | ||
107 | with the given | ||
108 | .Fa nid , | ||
109 | copies the | ||
110 | .Fa len | ||
111 | DER | ||
112 | .Fa content | ||
113 | octets, the | ||
114 | .Fa short_name , | ||
115 | and the | ||
116 | .Fa long_name | ||
117 | into it, and marks the new object and all data contained in it | ||
118 | as dynamically allocated. | ||
119 | .Pp | ||
95 | Application programs normally use utility functions like | 120 | Application programs normally use utility functions like |
96 | .Xr OBJ_nid2obj 3 | 121 | .Xr OBJ_nid2obj 3 |
97 | rather than using | 122 | rather than using |
98 | .Fn ASN1_OBJECT_new | 123 | .Fn ASN1_OBJECT_new |
124 | or | ||
125 | .Fn ASN1_OBJECT_create | ||
99 | directly. | 126 | directly. |
100 | .Pp | 127 | .Pp |
101 | .Fn ASN1_OBJECT_free | 128 | .Fn ASN1_OBJECT_free |
@@ -123,13 +150,34 @@ is a | |||
123 | pointer or if neither the object itself nor any of its content | 150 | pointer or if neither the object itself nor any of its content |
124 | is marked as dynamically allocated, no action occurs. | 151 | is marked as dynamically allocated, no action occurs. |
125 | .Sh RETURN VALUES | 152 | .Sh RETURN VALUES |
126 | If the allocation fails, | ||
127 | .Fn ASN1_OBJECT_new | 153 | .Fn ASN1_OBJECT_new |
128 | returns | 154 | and |
155 | .Fn ASN1_OBJECT_create | ||
156 | return a pointer to the new object or | ||
129 | .Dv NULL | 157 | .Dv NULL |
130 | and sets an error code that can be obtained by | 158 | if memory allocation fails, |
131 | .Xr ERR_get_error 3 . | 159 | .Sh ERRORS |
132 | Otherwise it returns a pointer to the new object. | 160 | After failure of |
161 | .Fn ASN1_OBJECT_new | ||
162 | or | ||
163 | .Fn ASN1_OBJECT_create , | ||
164 | the following diagnostic can be retrieved with | ||
165 | .Xr ERR_get_error 3 , | ||
166 | .Xr ERR_GET_REASON 3 , | ||
167 | and | ||
168 | .Xr ERR_reason_error_string 3 : | ||
169 | .Bl -tag -width Ds | ||
170 | .It Dv ERR_R_MALLOC_FAILURE Qq "malloc failure" | ||
171 | Memory allocation failed. | ||
172 | .El | ||
173 | .Pp | ||
174 | After some cases of failure of | ||
175 | .Fn ASN1_OBJECT_create , | ||
176 | the following diagnostic can be retrieved in addition to the above: | ||
177 | .Bl -tag -width Ds | ||
178 | .It Dv ERR_R_ASN1_LIB Qq "ASN1 lib" | ||
179 | Memory allocation failed. | ||
180 | .El | ||
133 | .Sh SEE ALSO | 181 | .Sh SEE ALSO |
134 | .Xr ASN1_TYPE_get 3 , | 182 | .Xr ASN1_TYPE_get 3 , |
135 | .Xr d2i_ASN1_OBJECT 3 , | 183 | .Xr d2i_ASN1_OBJECT 3 , |
@@ -138,5 +186,8 @@ Otherwise it returns a pointer to the new object. | |||
138 | .Fn ASN1_OBJECT_new | 186 | .Fn ASN1_OBJECT_new |
139 | and | 187 | and |
140 | .Fn ASN1_OBJECT_free | 188 | .Fn ASN1_OBJECT_free |
141 | first appeared in SSLeay 0.5.1 and have been available since | 189 | first appeared in SSLeay 0.5.1 and |
190 | .Fn ASN1_OBJECT_create | ||
191 | in SSLeay 0.8.0. | ||
192 | These functions have been available since | ||
142 | .Ox 2.4 . | 193 | .Ox 2.4 . |