summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/man/OBJ_create.353
1 files changed, 14 insertions, 39 deletions
diff --git a/src/lib/libcrypto/man/OBJ_create.3 b/src/lib/libcrypto/man/OBJ_create.3
index 75d51f4bb8..08563a573c 100644
--- a/src/lib/libcrypto/man/OBJ_create.3
+++ b/src/lib/libcrypto/man/OBJ_create.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: OBJ_create.3,v 1.11 2025/06/08 22:37:23 schwarze Exp $ 1.\" $OpenBSD: OBJ_create.3,v 1.12 2026/08/05 08:31:06 tb Exp $
2.\" full merge up to: 2.\" full merge up to:
3.\" OpenSSL OBJ_nid2obj.pod 9b86974e Aug 17 15:21:33 2015 -0400 3.\" OpenSSL OBJ_nid2obj.pod 9b86974e Aug 17 15:21:33 2015 -0400
4.\" selective merge up to: 4.\" selective merge up to:
@@ -69,12 +69,11 @@
69.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 69.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
70.\" OF THE POSSIBILITY OF SUCH DAMAGE. 70.\" OF THE POSSIBILITY OF SUCH DAMAGE.
71.\" 71.\"
72.Dd $Mdocdate: June 8 2025 $ 72.Dd $Mdocdate: August 5 2026 $
73.Dt OBJ_CREATE 3 73.Dt OBJ_CREATE 3
74.Os 74.Os
75.Sh NAME 75.Sh NAME
76.Nm OBJ_new_nid , 76.Nm OBJ_new_nid ,
77.Nm OBJ_add_object ,
78.Nm OBJ_create , 77.Nm OBJ_create ,
79.Nm OBJ_create_objects , 78.Nm OBJ_create_objects ,
80.Nm OBJ_cleanup 79.Nm OBJ_cleanup
@@ -85,8 +84,6 @@
85.Ft int 84.Ft int
86.Fn OBJ_new_nid "int increment" 85.Fn OBJ_new_nid "int increment"
87.Ft int 86.Ft int
88.Fn OBJ_add_object "const ASN1_OBJECT *object"
89.Ft int
90.Fo OBJ_create 87.Fo OBJ_create
91.Fa "const char *oid" 88.Fa "const char *oid"
92.Fa "const char *sn" 89.Fa "const char *sn"
@@ -106,19 +103,14 @@ Passing an argument of 1 is usually recommended.
106The return value can be assigned to a new object by passing it as the 103The return value can be assigned to a new object by passing it as the
107.Fa nid 104.Fa nid
108argument to 105argument to
109.Xr ASN1_OBJECT_create 3 106.Xr ASN1_OBJECT_create 3 .
110and by passing the resulting object to
111.Fn OBJ_add_object .
112.Pp 107.Pp
113.Fn OBJ_add_object 108.Fn OBJ_create
114adds a copy of the 109adds an
115.Fa object 110.Vt ASN1_OBJECT
116to the internal table of ASN.1 object identifiers for use by 111to the internal table of ASN.1 object identifiers for use by
117.Xr OBJ_nid2obj 3 112.Xr OBJ_nid2obj 3
118and related functions. 113and related functions.
119.Pp
120.Fn OBJ_create
121provides a simpler way to add a new object to the internal table.
122.Fa oid 114.Fa oid
123is the numerical form of the object, 115is the numerical form of the object,
124.Fa sn 116.Fa sn
@@ -141,8 +133,11 @@ for every line read.
141The three fields of the input lines 133The three fields of the input lines
142are separated by one or more whitespace characters. 134are separated by one or more whitespace characters.
143.Pp 135.Pp
144For all three functions, the objects added to the internal table and 136For the objects added to the internal table by
145all the data contained in them is marked as not dynamically allocated. 137.Fn OBJ_create
138and
139.Fn OBJ_add_objects ,
140all the data contained is marked as not dynamically allocated.
146Consequently, retrieving them with 141Consequently, retrieving them with
147.Xr OBJ_nid2obj 3 142.Xr OBJ_nid2obj 3
148or a similar function and then calling 143or a similar function and then calling
@@ -152,7 +147,6 @@ on the returned pointer will have no effect.
152.Fn OBJ_cleanup 147.Fn OBJ_cleanup
153resets the internal object table to its default state, 148resets the internal object table to its default state,
154removing and freeing all objects that were added with 149removing and freeing all objects that were added with
155.Fn OBJ_add_object ,
156.Fn OBJ_create , 150.Fn OBJ_create ,
157or 151or
158.Fn OBJ_create_objects . 152.Fn OBJ_create_objects .
@@ -160,17 +154,6 @@ or
160.Fn OBJ_new_nid 154.Fn OBJ_new_nid
161returns the new NID. 155returns the new NID.
162.Pp 156.Pp
163.Fn OBJ_add_object
164returns the NID of the added
165.Fa object
166or
167.Dv NID_undef
168if no object was added because the
169.Fa object
170argument was
171.Dv NULL ,
172did not contain an NID, or memory allocation failed.
173.Pp
174.Fn OBJ_create 157.Fn OBJ_create
175returns the new NID or 158returns the new NID or
176.Dv NID_undef 159.Dv NID_undef
@@ -183,8 +166,7 @@ or if memory allocation fails.
183returns the number of objects added. 166returns the number of objects added.
184.Pp 167.Pp
185In some cases of failure of 168In some cases of failure of
186.Fn OBJ_add_object , 169.Fn OBJ_create
187.Fn OBJ_create ,
188and 170and
189.Fn OBJ_create_objects , 171.Fn OBJ_create_objects ,
190the reason can be determined with 172the reason can be determined with
@@ -203,7 +185,6 @@ obj = OBJ_nid2obj(new_nid);
203.Xr OBJ_nid2obj 3 185.Xr OBJ_nid2obj 3
204.Sh HISTORY 186.Sh HISTORY
205.Fn OBJ_new_nid , 187.Fn OBJ_new_nid ,
206.Fn OBJ_add_object ,
207and 188and
208.Fn OBJ_cleanup 189.Fn OBJ_cleanup
209first appeared in SSLeay 0.8.0 and 190first appeared in SSLeay 0.8.0 and
@@ -212,12 +193,6 @@ in SSLeay 0.9.0.
212These functions have been available since 193These functions have been available since
213.Ox 2.4 . 194.Ox 2.4 .
214.Sh CAVEATS 195.Sh CAVEATS
215.Fn OBJ_add_object
216indicates success even after adding an incomplete object that was created with
217.Xr ASN1_OBJECT_create 3
218but lacks a short name, a long name, or an OID.
219.Pp
220Even
221.Fn OBJ_create 196.Fn OBJ_create
222tolerates 197tolerates
223.Dv NULL 198.Dv NULL
@@ -229,11 +204,11 @@ arguments, in which case
229.Xr OBJ_nid2sn 3 204.Xr OBJ_nid2sn 3
230and 205and
231.Xr OBJ_sn2nid 3 206.Xr OBJ_sn2nid 3
232or 207and/or
233.Xr OBJ_nid2ln 3 208.Xr OBJ_nid2ln 3
234and 209and
235.Xr OBJ_ln2nid 3 210.Xr OBJ_ln2nid 3
236will not work on the added object, respectively. 211will not work on the added object.
237.Sh BUGS 212.Sh BUGS
238.Fn OBJ_new_nid 213.Fn OBJ_new_nid
239does not reserve any return value to indicate an error. 214does not reserve any return value to indicate an error.