diff options
author | schwarze <> | 2022-03-29 17:41:20 +0000 |
---|---|---|
committer | schwarze <> | 2022-03-29 17:41:20 +0000 |
commit | e8a98b915bed429d19b5dd55fed95e1425afbbcf (patch) | |
tree | 6082c1369dce3d521e0488cd4bac5add5139e370 | |
parent | 8827c0cb5a5d36f440901bfa2d88b83ee344e40c (diff) | |
download | openbsd-e8a98b915bed429d19b5dd55fed95e1425afbbcf.tar.gz openbsd-e8a98b915bed429d19b5dd55fed95e1425afbbcf.tar.bz2 openbsd-e8a98b915bed429d19b5dd55fed95e1425afbbcf.zip |
Given asn1/a_object.c rev. 1.45 by jsing@, stop talking about BUGS
we no longer have, focus on what our implementation now does, but
keep short warnings in how far other implementations might be more
fragile. Some improvements to wordings and clarity while here.
OK tb@
-rw-r--r-- | src/lib/libcrypto/man/d2i_ASN1_OBJECT.3 | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/src/lib/libcrypto/man/d2i_ASN1_OBJECT.3 b/src/lib/libcrypto/man/d2i_ASN1_OBJECT.3 index 2f428724d5..913140b30f 100644 --- a/src/lib/libcrypto/man/d2i_ASN1_OBJECT.3 +++ b/src/lib/libcrypto/man/d2i_ASN1_OBJECT.3 | |||
@@ -1,7 +1,6 @@ | |||
1 | .\" $OpenBSD: d2i_ASN1_OBJECT.3,v 1.11 2021/12/08 13:21:04 schwarze Exp $ | 1 | .\" $OpenBSD: d2i_ASN1_OBJECT.3,v 1.12 2022/03/29 17:41:20 schwarze Exp $ |
2 | .\" OpenSSL 05ea606a May 20 20:52:46 2016 -0400 | ||
3 | .\" | 2 | .\" |
4 | .\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org> | 3 | .\" Copyright (c) 2017, 2022 Ingo Schwarze <schwarze@openbsd.org> |
5 | .\" | 4 | .\" |
6 | .\" Permission to use, copy, modify, and distribute this software for any | 5 | .\" Permission to use, copy, modify, and distribute this software for any |
7 | .\" purpose with or without fee is hereby granted, provided that the above | 6 | .\" purpose with or without fee is hereby granted, provided that the above |
@@ -15,7 +14,7 @@ | |||
15 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 14 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
16 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 15 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
17 | .\" | 16 | .\" |
18 | .Dd $Mdocdate: December 8 2021 $ | 17 | .Dd $Mdocdate: March 29 2022 $ |
19 | .Dt D2I_ASN1_OBJECT 3 | 18 | .Dt D2I_ASN1_OBJECT 3 |
20 | .Os | 19 | .Os |
21 | .Sh NAME | 20 | .Sh NAME |
@@ -42,32 +41,36 @@ These functions decode and encode ASN.1 object identifiers. | |||
42 | For details about the semantics, examples, caveats, and bugs, see | 41 | For details about the semantics, examples, caveats, and bugs, see |
43 | .Xr ASN1_item_d2i 3 . | 42 | .Xr ASN1_item_d2i 3 . |
44 | .Pp | 43 | .Pp |
44 | The LibreSSL implementation of | ||
45 | .Fn d2i_ASN1_OBJECT | ||
46 | always calls | ||
47 | .Xr ASN1_OBJECT_free 3 | ||
48 | if an existing object is passed in via | ||
49 | .Fa val_out | ||
50 | and it always creates a new object from scratch. | ||
51 | Other implementations may attempt to reuse an existing object, | ||
52 | which is fragile and prone to bugs. | ||
53 | Consequently, always passing | ||
54 | .Dv NULL | ||
55 | for the | ||
56 | .Fa val_out | ||
57 | argument is recommended. | ||
58 | .Pp | ||
45 | The objects returned from | 59 | The objects returned from |
46 | .Fn d2i_ASN1_OBJECT | 60 | .Fn d2i_ASN1_OBJECT |
47 | and the data contained in them are always marked as dynamically | 61 | and the data contained in them are always marked as dynamically |
48 | allocated, so when they are no longer needed, | 62 | allocated, so when they are no longer needed, |
49 | .Xr ASN1_OBJECT_free 3 | 63 | .Xr ASN1_OBJECT_free 3 |
50 | can be called on them. | 64 | can be called on them. |
51 | .Pp | ||
52 | If reusing an existing object is attempted but the | ||
53 | .Pf * Fa val_out | ||
54 | passed in points to an object that is not marked as dynamically | ||
55 | allocated, then the existing object is left untouched and | ||
56 | .Fn d2i_ASN1_OBJECT | ||
57 | behaves as if | ||
58 | .Pf * Fa val_out | ||
59 | would have been | ||
60 | .Dv NULL : | ||
61 | A new object is allocated and a pointer to it is both stored in | ||
62 | .Pf * Fa val_out | ||
63 | and returned. | ||
64 | .Sh RETURN VALUES | 65 | .Sh RETURN VALUES |
65 | .Fn d2i_ASN1_OBJECT | 66 | .Fn d2i_ASN1_OBJECT |
66 | returns an | 67 | returns a pointer to the new |
67 | .Vt ASN1_OBJECT | 68 | .Vt ASN1_OBJECT |
68 | object or | 69 | object or |
69 | .Dv NULL | 70 | .Dv NULL |
70 | if an error occurs. | 71 | if an error occurs. |
72 | With other implementations, it might return a pointer to the reused | ||
73 | .Vt ASN1_OBJECT . | ||
71 | .Pp | 74 | .Pp |
72 | .Fn i2d_ASN1_OBJECT | 75 | .Fn i2d_ASN1_OBJECT |
73 | returns the number of bytes successfully encoded | 76 | returns the number of bytes successfully encoded |
@@ -101,7 +104,3 @@ on the returned object, and then | |||
101 | and | 104 | and |
102 | .Xr OBJ_nid2ln 3 | 105 | .Xr OBJ_nid2ln 3 |
103 | on the result. | 106 | on the result. |
104 | .Sh BUGS | ||
105 | When reusing a dynamically allocated object that contains dynamically | ||
106 | allocated names, the old names are not freed and the memory containing | ||
107 | them is leaked. | ||