summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschwarze <>2022-03-29 17:41:20 +0000
committerschwarze <>2022-03-29 17:41:20 +0000
commite8a98b915bed429d19b5dd55fed95e1425afbbcf (patch)
tree6082c1369dce3d521e0488cd4bac5add5139e370
parent8827c0cb5a5d36f440901bfa2d88b83ee344e40c (diff)
downloadopenbsd-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.343
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.
42For details about the semantics, examples, caveats, and bugs, see 41For 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
44The LibreSSL implementation of
45.Fn d2i_ASN1_OBJECT
46always calls
47.Xr ASN1_OBJECT_free 3
48if an existing object is passed in via
49.Fa val_out
50and it always creates a new object from scratch.
51Other implementations may attempt to reuse an existing object,
52which is fragile and prone to bugs.
53Consequently, always passing
54.Dv NULL
55for the
56.Fa val_out
57argument is recommended.
58.Pp
45The objects returned from 59The objects returned from
46.Fn d2i_ASN1_OBJECT 60.Fn d2i_ASN1_OBJECT
47and the data contained in them are always marked as dynamically 61and the data contained in them are always marked as dynamically
48allocated, so when they are no longer needed, 62allocated, so when they are no longer needed,
49.Xr ASN1_OBJECT_free 3 63.Xr ASN1_OBJECT_free 3
50can be called on them. 64can be called on them.
51.Pp
52If reusing an existing object is attempted but the
53.Pf * Fa val_out
54passed in points to an object that is not marked as dynamically
55allocated, then the existing object is left untouched and
56.Fn d2i_ASN1_OBJECT
57behaves as if
58.Pf * Fa val_out
59would have been
60.Dv NULL :
61A new object is allocated and a pointer to it is both stored in
62.Pf * Fa val_out
63and returned.
64.Sh RETURN VALUES 65.Sh RETURN VALUES
65.Fn d2i_ASN1_OBJECT 66.Fn d2i_ASN1_OBJECT
66returns an 67returns a pointer to the new
67.Vt ASN1_OBJECT 68.Vt ASN1_OBJECT
68object or 69object or
69.Dv NULL 70.Dv NULL
70if an error occurs. 71if an error occurs.
72With 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
73returns the number of bytes successfully encoded 76returns the number of bytes successfully encoded
@@ -101,7 +104,3 @@ on the returned object, and then
101and 104and
102.Xr OBJ_nid2ln 3 105.Xr OBJ_nid2ln 3
103on the result. 106on the result.
104.Sh BUGS
105When reusing a dynamically allocated object that contains dynamically
106allocated names, the old names are not freed and the memory containing
107them is leaked.