diff options
| -rw-r--r-- | src/lib/libcrypto/man/OBJ_create.3 | 53 |
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. | |||
| 106 | The return value can be assigned to a new object by passing it as the | 103 | The return value can be assigned to a new object by passing it as the |
| 107 | .Fa nid | 104 | .Fa nid |
| 108 | argument to | 105 | argument to |
| 109 | .Xr ASN1_OBJECT_create 3 | 106 | .Xr ASN1_OBJECT_create 3 . |
| 110 | and by passing the resulting object to | ||
| 111 | .Fn OBJ_add_object . | ||
| 112 | .Pp | 107 | .Pp |
| 113 | .Fn OBJ_add_object | 108 | .Fn OBJ_create |
| 114 | adds a copy of the | 109 | adds an |
| 115 | .Fa object | 110 | .Vt ASN1_OBJECT |
| 116 | to the internal table of ASN.1 object identifiers for use by | 111 | to the internal table of ASN.1 object identifiers for use by |
| 117 | .Xr OBJ_nid2obj 3 | 112 | .Xr OBJ_nid2obj 3 |
| 118 | and related functions. | 113 | and related functions. |
| 119 | .Pp | ||
| 120 | .Fn OBJ_create | ||
| 121 | provides a simpler way to add a new object to the internal table. | ||
| 122 | .Fa oid | 114 | .Fa oid |
| 123 | is the numerical form of the object, | 115 | is the numerical form of the object, |
| 124 | .Fa sn | 116 | .Fa sn |
| @@ -141,8 +133,11 @@ for every line read. | |||
| 141 | The three fields of the input lines | 133 | The three fields of the input lines |
| 142 | are separated by one or more whitespace characters. | 134 | are separated by one or more whitespace characters. |
| 143 | .Pp | 135 | .Pp |
| 144 | For all three functions, the objects added to the internal table and | 136 | For the objects added to the internal table by |
| 145 | all the data contained in them is marked as not dynamically allocated. | 137 | .Fn OBJ_create |
| 138 | and | ||
| 139 | .Fn OBJ_add_objects , | ||
| 140 | all the data contained is marked as not dynamically allocated. | ||
| 146 | Consequently, retrieving them with | 141 | Consequently, retrieving them with |
| 147 | .Xr OBJ_nid2obj 3 | 142 | .Xr OBJ_nid2obj 3 |
| 148 | or a similar function and then calling | 143 | or 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 |
| 153 | resets the internal object table to its default state, | 148 | resets the internal object table to its default state, |
| 154 | removing and freeing all objects that were added with | 149 | removing and freeing all objects that were added with |
| 155 | .Fn OBJ_add_object , | ||
| 156 | .Fn OBJ_create , | 150 | .Fn OBJ_create , |
| 157 | or | 151 | or |
| 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 |
| 161 | returns the new NID. | 155 | returns the new NID. |
| 162 | .Pp | 156 | .Pp |
| 163 | .Fn OBJ_add_object | ||
| 164 | returns the NID of the added | ||
| 165 | .Fa object | ||
| 166 | or | ||
| 167 | .Dv NID_undef | ||
| 168 | if no object was added because the | ||
| 169 | .Fa object | ||
| 170 | argument was | ||
| 171 | .Dv NULL , | ||
| 172 | did not contain an NID, or memory allocation failed. | ||
| 173 | .Pp | ||
| 174 | .Fn OBJ_create | 157 | .Fn OBJ_create |
| 175 | returns the new NID or | 158 | returns the new NID or |
| 176 | .Dv NID_undef | 159 | .Dv NID_undef |
| @@ -183,8 +166,7 @@ or if memory allocation fails. | |||
| 183 | returns the number of objects added. | 166 | returns the number of objects added. |
| 184 | .Pp | 167 | .Pp |
| 185 | In some cases of failure of | 168 | In some cases of failure of |
| 186 | .Fn OBJ_add_object , | 169 | .Fn OBJ_create |
| 187 | .Fn OBJ_create , | ||
| 188 | and | 170 | and |
| 189 | .Fn OBJ_create_objects , | 171 | .Fn OBJ_create_objects , |
| 190 | the reason can be determined with | 172 | the 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 , | ||
| 207 | and | 188 | and |
| 208 | .Fn OBJ_cleanup | 189 | .Fn OBJ_cleanup |
| 209 | first appeared in SSLeay 0.8.0 and | 190 | first appeared in SSLeay 0.8.0 and |
| @@ -212,12 +193,6 @@ in SSLeay 0.9.0. | |||
| 212 | These functions have been available since | 193 | These functions have been available since |
| 213 | .Ox 2.4 . | 194 | .Ox 2.4 . |
| 214 | .Sh CAVEATS | 195 | .Sh CAVEATS |
| 215 | .Fn OBJ_add_object | ||
| 216 | indicates success even after adding an incomplete object that was created with | ||
| 217 | .Xr ASN1_OBJECT_create 3 | ||
| 218 | but lacks a short name, a long name, or an OID. | ||
| 219 | .Pp | ||
| 220 | Even | ||
| 221 | .Fn OBJ_create | 196 | .Fn OBJ_create |
| 222 | tolerates | 197 | tolerates |
| 223 | .Dv NULL | 198 | .Dv NULL |
| @@ -229,11 +204,11 @@ arguments, in which case | |||
| 229 | .Xr OBJ_nid2sn 3 | 204 | .Xr OBJ_nid2sn 3 |
| 230 | and | 205 | and |
| 231 | .Xr OBJ_sn2nid 3 | 206 | .Xr OBJ_sn2nid 3 |
| 232 | or | 207 | and/or |
| 233 | .Xr OBJ_nid2ln 3 | 208 | .Xr OBJ_nid2ln 3 |
| 234 | and | 209 | and |
| 235 | .Xr OBJ_ln2nid 3 | 210 | .Xr OBJ_ln2nid 3 |
| 236 | will not work on the added object, respectively. | 211 | will not work on the added object. |
| 237 | .Sh BUGS | 212 | .Sh BUGS |
| 238 | .Fn OBJ_new_nid | 213 | .Fn OBJ_new_nid |
| 239 | does not reserve any return value to indicate an error. | 214 | does not reserve any return value to indicate an error. |
