From c050635ad9b36d978a7843b378d5b635be9c3f33 Mon Sep 17 00:00:00 2001 From: tb Date: Wed, 12 Jan 2022 17:54:51 +0000 Subject: [PATCH] ASN1_{,F,T}BOOLEAN_it and the encoding and decoding API will move to internal only soon. Stop documenting them. ok inoguchi jsing --- lib/libcrypto/man/ASN1_TYPE_get.3 | 5 +- lib/libcrypto/man/ASN1_item_new.3 | 7 +- lib/libcrypto/man/ASN1_put_object.3 | 5 +- lib/libcrypto/man/Makefile | 3 +- lib/libcrypto/man/d2i_ASN1_BOOLEAN.3 | 134 --------------------------- 5 files changed, 7 insertions(+), 147 deletions(-) delete mode 100644 lib/libcrypto/man/d2i_ASN1_BOOLEAN.3 diff --git a/lib/libcrypto/man/ASN1_TYPE_get.3 b/lib/libcrypto/man/ASN1_TYPE_get.3 index 3e1bd6f3ecb..03b41f8fa89 100644 --- a/lib/libcrypto/man/ASN1_TYPE_get.3 +++ b/lib/libcrypto/man/ASN1_TYPE_get.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ASN1_TYPE_get.3,v 1.17 2021/12/09 18:50:26 schwarze Exp $ +.\" $OpenBSD: ASN1_TYPE_get.3,v 1.18 2022/01/12 17:54:51 tb Exp $ .\" selective merge up to: OpenSSL 6328d367 Jul 4 21:58:30 2020 +0200 .\" .\" This file is a derived work. @@ -65,7 +65,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 9 2021 $ +.Dd $Mdocdate: January 12 2022 $ .Dt ASN1_TYPE_GET 3 .Os .Sh NAME @@ -410,7 +410,6 @@ returns 0 for a match or non-zero for a mismatch. .Xr ASN1_STRING_dup 3 , .Xr ASN1_STRING_new 3 , .Xr crypto 3 , -.Xr d2i_ASN1_BOOLEAN 3 , .Xr d2i_ASN1_NULL 3 , .Xr d2i_ASN1_SEQUENCE_ANY 3 , .Xr d2i_ASN1_TYPE 3 , diff --git a/lib/libcrypto/man/ASN1_item_new.3 b/lib/libcrypto/man/ASN1_item_new.3 index 7fd3405e1ff..7015ed63191 100644 --- a/lib/libcrypto/man/ASN1_item_new.3 +++ b/lib/libcrypto/man/ASN1_item_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ASN1_item_new.3,v 1.10 2021/11/22 16:19:54 schwarze Exp $ +.\" $OpenBSD: ASN1_item_new.3,v 1.11 2022/01/12 17:54:51 tb Exp $ .\" .\" Copyright (c) 2016, 2018 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: November 22 2021 $ +.Dd $Mdocdate: January 12 2022 $ .Dt ASN1_ITEM_NEW 3 .Os .Sh NAME @@ -87,8 +87,6 @@ object. If .Fa it is -.Dv ASN1_BOOLEAN_it -or .Dv LONG_it , .Fn ASN1_item_new does not return a pointer at all, but a @@ -113,7 +111,6 @@ is returned and an error code can be retrieved with .Xr ASN1_item_verify 3 , .Xr ASN1_NULL_new 3 , .Xr ASN1_TYPE_new 3 , -.Xr d2i_ASN1_BOOLEAN 3 , .Xr d2i_ASN1_NULL 3 , .Xr OBJ_nid2obj 3 .Sh HISTORY diff --git a/lib/libcrypto/man/ASN1_put_object.3 b/lib/libcrypto/man/ASN1_put_object.3 index a435b5a8006..97a352724c6 100644 --- a/lib/libcrypto/man/ASN1_put_object.3 +++ b/lib/libcrypto/man/ASN1_put_object.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ASN1_put_object.3,v 1.4 2021/12/09 19:00:00 schwarze Exp $ +.\" $OpenBSD: ASN1_put_object.3,v 1.5 2022/01/12 17:54:51 tb Exp $ .\" .\" Copyright (c) 2019, 2021 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 9 2021 $ +.Dd $Mdocdate: January 12 2022 $ .Dt ASN1_PUT_OBJECT 3 .Os .Sh NAME @@ -140,7 +140,6 @@ returns the total number of bytes in the encoding of the data element. .Sh SEE ALSO .Xr ASN1_item_i2d 3 , .Xr ASN1_TYPE_get 3 , -.Xr i2d_ASN1_BOOLEAN 3 , .Xr i2d_ASN1_NULL 3 , .Xr i2d_ASN1_OBJECT 3 , .Xr i2d_ASN1_OCTET_STRING 3 , diff --git a/lib/libcrypto/man/Makefile b/lib/libcrypto/man/Makefile index 79da1eb54f8..780e8d62568 100644 --- a/lib/libcrypto/man/Makefile +++ b/lib/libcrypto/man/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.231 2021/12/18 17:47:44 schwarze Exp $ +# $OpenBSD: Makefile,v 1.232 2022/01/12 17:54:51 tb Exp $ .include @@ -381,7 +381,6 @@ MAN= \ X509v3_get_ext_by_NID.3 \ a2d_ASN1_OBJECT.3 \ crypto.3 \ - d2i_ASN1_BOOLEAN.3 \ d2i_ASN1_NULL.3 \ d2i_ASN1_OBJECT.3 \ d2i_ASN1_OCTET_STRING.3 \ diff --git a/lib/libcrypto/man/d2i_ASN1_BOOLEAN.3 b/lib/libcrypto/man/d2i_ASN1_BOOLEAN.3 deleted file mode 100644 index 3f83f3e8580..00000000000 --- a/lib/libcrypto/man/d2i_ASN1_BOOLEAN.3 +++ /dev/null @@ -1,134 +0,0 @@ -.\" $OpenBSD: d2i_ASN1_BOOLEAN.3,v 1.3 2021/12/09 19:03:14 schwarze Exp $ -.\" -.\" Copyright (c) 2021 Ingo Schwarze -.\" -.\" Permission to use, copy, modify, and distribute this software for any -.\" purpose with or without fee is hereby granted, provided that the above -.\" copyright notice and this permission notice appear in all copies. -.\" -.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -.\" -.Dd $Mdocdate: December 9 2021 $ -.Dt D2I_ASN1_BOOLEAN 3 -.Os -.Sh NAME -.Nm d2i_ASN1_BOOLEAN , -.Nm i2d_ASN1_BOOLEAN -.Nd decode and encode an ASN.1 BOOLEAN value -.Sh SYNOPSIS -.In openssl/asn1.h -.Bd -unfilled -typedef int ASN1_BOOLEAN; -.Ed -.Pp -.Ft int -.Fo d2i_ASN1_BOOLEAN -.Fa "int *val_out" -.Fa "const unsigned char **der_in" -.Fa "long length" -.Fc -.Ft int -.Fo i2d_ASN1_BOOLEAN -.Fa "int val_in" -.Fa "unsigned char **der_out" -.Fc -.Sh DESCRIPTION -These functions decode and encode -an ASN.1 value TRUE or FALSE of the type BOOLEAN. -In contrast to most other ASN.1 types, -the library does not represent the BOOLEAN type by a structure. -Instead, -.Vt ASN1_BOOLEAN -is simply an alias for the type -.Vt int . -This type is also represented by the type identifier constant -.Dv V_ASN1_BOOLEAN . -.Pp -.Fn d2i_ASN1_BOOLEAN -verifies that the BER-encoded value at -.Pf * Fa der_in -is of the type BOOLEAN -and that the number encoded in the length octets is 1. -At most -.Fa length -bytes are inspected. -.Pp -Unless -.Fa val_out -is a -.Dv NULL -pointer, it copies the integer value of the single content octet to -.Pf * Fa val_out . -In case of success, -.Pf * Fa der_in -is advanced by three bytes to the byte after the content octet. -.Pp -.Fn i2d_ASN1_BOOLEAN -encodes an ASN.1 value of the type BOOLEAN using DER. -Specifically, unless -.Fa der_out -is a -.Dv NULL -pointer, it writes the identifier octet for the type BOOLEAN, -0x01, the single length octet 0x01, one single content octet containing -.Fa val_in , -and no end-of-content octets to -.Pf * Fa der_out -and advances the pointer -.Pf * Fa der_out -by three bytes to the byte after the content octet. -Making sure that three bytes can be written to -.Pf * Fa der_out -is the responsibility of the caller. -.Pp -If -.Fa val_in -is 0, it encodes the FALSE value. -If -.Fa val_in -is in the range from 1 to 255 inclusive, it encodes the TRUE value. -.Sh RETURN VALUES -In case of success, -.Fn d2i_ASN1_BOOLEAN -returns the integer value of the content octet. -The number 0 represents the FALSE value and any number in the range -from 1 to 255 inclusive represents the TRUE value. -If the -.Fa length -argument is less than 3, if parsing fails, if the ASN.1 object at -.Pf * Fa der_in -is not of the type BOOLEAN, or if the number of content octets is not 1, -.Fn d2i_ASN1_BOOLEAN -returns \-1 to indicate the error. -.Pp -.Fn i2d_ASN1_BOOLEAN -always returns 3, which is the number of bytes in the BER encoding -of an ASN.1 BOOLEAN value. -.Sh SEE ALSO -.Xr ASN1_get_object 3 , -.Xr ASN1_item_d2i 3 , -.Xr ASN1_put_object 3 -.Sh STANDARDS -ITU-T Recommendation X.690, also known as ISO/IEC 8825-1: -Information technology - ASN.1 encoding rules: -Specification of Basic Encoding Rules (BER), Canonical Encoding -Rules (CER) and Distinguished Encoding Rules (DER), -section 8.2: Encoding of a boolean value -.Sh HISTORY -.Fn d2i_ASN1_BOOLEAN -and -.Fn i2d_ASN1_BOOLEAN -first appeared in SSLeay 0.6.2 and have been available since -.Ox 2.4 . -.Sh CAVEATS -The behaviour of -.Fn i2d_ASN1_BOOLEAN -is unspecified if -.Fa val_in -is negative or larger than 255. -- 2.20.1