summaryrefslogtreecommitdiff
path: root/lib/libcrypto
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2021-10-22 13:29:42 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2021-10-22 13:29:42 +0000
commit28e930edf605a3e42957f034dde1a7bbb7bed5b6 (patch)
tree0df3ff37d6afd470d20fd8299e89f140fc2f5dea /lib/libcrypto
parent3dfb6be4613568a06fdafaf5f320dfa50b7ade80 (diff)
new manual page X509at_add1_attr(3)
describing five functions to change arrays of X.501 Attribute objects
Diffstat (limited to 'lib/libcrypto')
-rw-r--r--lib/libcrypto/man/Makefile7
-rw-r--r--lib/libcrypto/man/X509_ATTRIBUTE_new.33
-rw-r--r--lib/libcrypto/man/X509at_add1_attr.3131
-rw-r--r--lib/libcrypto/man/X509at_get_attr.35
4 files changed, 140 insertions, 6 deletions
diff --git a/lib/libcrypto/man/Makefile b/lib/libcrypto/man/Makefile
index e31e6992a22..74b3a251afe 100644
--- a/lib/libcrypto/man/Makefile
+++ b/lib/libcrypto/man/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.197 2021/10/22 11:24:45 schwarze Exp $
+# $OpenBSD: Makefile,v 1.198 2021/10/22 13:29:41 schwarze Exp $
.include <bsd.own.mk>
@@ -275,8 +275,6 @@ MAN= \
UI_get_string_type.3 \
UI_new.3 \
X25519.3 \
- X509V3_get_d2i.3 \
- X509at_get_attr.3 \
X509_ALGOR_dup.3 \
X509_ATTRIBUTE_get0_object.3 \
X509_ATTRIBUTE_new.3 \
@@ -345,6 +343,9 @@ MAN= \
X509_verify_cert.3 \
X509V3_EXT_print.3 \
X509V3_extensions_print.3 \
+ X509V3_get_d2i.3 \
+ X509at_add1_attr.3 \
+ X509at_get_attr.3 \
X509v3_get_ext_by_NID.3 \
crypto.3 \
d2i_ASN1_NULL.3 \
diff --git a/lib/libcrypto/man/X509_ATTRIBUTE_new.3 b/lib/libcrypto/man/X509_ATTRIBUTE_new.3
index c25144531ab..1d059acceac 100644
--- a/lib/libcrypto/man/X509_ATTRIBUTE_new.3
+++ b/lib/libcrypto/man/X509_ATTRIBUTE_new.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: X509_ATTRIBUTE_new.3,v 1.12 2021/10/22 11:24:45 schwarze Exp $
+.\" $OpenBSD: X509_ATTRIBUTE_new.3,v 1.13 2021/10/22 13:29:41 schwarze Exp $
.\"
.\" Copyright (c) 2016, 2021 Ingo Schwarze <schwarze@openbsd.org>
.\"
@@ -120,6 +120,7 @@ fails on
.Xr X509_EXTENSION_new 3 ,
.Xr X509_new 3 ,
.Xr X509_REQ_new 3 ,
+.Xr X509at_add1_attr 3 ,
.Xr X509at_get_attr 3
.Sh STANDARDS
.Bl -ohang
diff --git a/lib/libcrypto/man/X509at_add1_attr.3 b/lib/libcrypto/man/X509at_add1_attr.3
new file mode 100644
index 00000000000..cb5999a7029
--- /dev/null
+++ b/lib/libcrypto/man/X509at_add1_attr.3
@@ -0,0 +1,131 @@
+.\" $OpenBSD: X509at_add1_attr.3,v 1.1 2021/10/22 13:29:41 schwarze Exp $
+.\"
+.\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org>
+.\"
+.\" 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: October 22 2021 $
+.Dt X509AT_ADD1_ATTR 3
+.Os
+.Sh NAME
+.Nm X509at_add1_attr ,
+.Nm X509at_add1_attr_by_OBJ ,
+.Nm X509at_add1_attr_by_NID ,
+.Nm X509at_add1_attr_by_txt ,
+.Nm X509at_delete_attr
+.Nd change an array of X.501 Attribute objects
+.Sh SYNOPSIS
+.In openssl/x509.h
+.Ft STACK_OF(X509_ATTRIBUTE) *
+.Fo X509at_add1_attr
+.Fa "STACK_OF(X509_ATTRIBUTE) **pattrs"
+.Fa "X509_ATTRIBUTE *attr"
+.Fc
+.Ft STACK_OF(X509_ATTRIBUTE) *
+.Fo X509at_add1_attr_by_OBJ
+.Fa "STACK_OF(X509_ATTRIBUTE) **pattrs"
+.Fa "const ASN1_OBJECT *obj"
+.Fa "int type"
+.Fa "const unsigned char *data"
+.Fa "int len"
+.Fc
+.Ft STACK_OF(X509_ATTRIBUTE) *
+.Fo X509at_add1_attr_by_NID
+.Fa "STACK_OF(X509_ATTRIBUTE) **pattrs"
+.Fa "int nid"
+.Fa "int type"
+.Fa "const unsigned char *data"
+.Fa "int len"
+.Fc
+.Ft STACK_OF(X509_ATTRIBUTE) *
+.Fo X509at_add1_attr_by_txt
+.Fa "STACK_OF(X509_ATTRIBUTE) **pattrs"
+.Fa "const char *name"
+.Fa "int type"
+.Fa "const unsigned char *data"
+.Fa "int len"
+.Fc
+.Ft X509_ATTRIBUTE *
+.Fo X509at_delete_attr
+.Fa "STACK_OF(X509_ATTRIBUTE) *attrs"
+.Fa "int index"
+.Fc
+.Sh DESCRIPTION
+.Fn X509at_add1_attr
+appends a deep copy of
+.Fa attr
+to the end of
+.Pf ** Fa pattrs .
+If
+.Pf * Fa pattrs
+is
+.Dv NULL ,
+a new array is allocated, and in case of success,
+a pointer to it is assigned to
+.Pf * Fa pattrs .
+.Pp
+.Fn X509at_add1_attr_by_OBJ ,
+.Fn X509at_add1_attr_by_NID ,
+and
+.Fn X509at_add1_attr_by_txt
+create a new X.501 Attribute object using
+.Xr X509_ATTRIBUTE_create_by_OBJ 3 ,
+.Xr X509_ATTRIBUTE_create_by_NID 3 ,
+or
+.Xr X509_ATTRIBUTE_create_by_txt 3 ,
+respectively, and append it to
+.Pf ** Fa pattrs
+using
+.Fn X509at_add1_attr .
+.Pp
+.Fn X509at_delete_attr
+deletes the element with the zero-based
+.Fa index
+from the array
+.Pf * Fa attrs .
+.Sh RETURN VALUES
+.Fn X509at_add1_attr ,
+.Fn X509at_add1_attr_by_OBJ ,
+.Fn X509at_add1_attr_by_NID ,
+and
+.Fn X509at_add1_attr_by_txt
+return a pointer to the modified or new array or
+.Dv NULL
+if the
+.Fa pattrs
+argument is
+.Dv NULL
+or if creating or copying the X.501 Attribute object
+or memory allocation fails.
+.Pp
+.Fn X509at_delete_attr
+returns the deleted element or
+.Dv NULL
+if
+.Fa attrs
+is
+.Dv NULL
+or if the requested
+.Fa index
+is negative or greater than or equal to the number of objects in
+.Pf * Fa attrs .
+.Sh SEE ALSO
+.Xr OBJ_nid2obj 3 ,
+.Xr STACK_OF 3 ,
+.Xr X509_ATTRIBUTE_create_by_OBJ 3 ,
+.Xr X509_ATTRIBUTE_new 3 ,
+.Xr X509at_get_attr 3
+.Sh HISTORY
+These funtions first appeared in OpenSSL 0.9.5
+and have been available since
+.Ox 2.7 .
diff --git a/lib/libcrypto/man/X509at_get_attr.3 b/lib/libcrypto/man/X509at_get_attr.3
index 8e1a65e2d18..64a2d8d4790 100644
--- a/lib/libcrypto/man/X509at_get_attr.3
+++ b/lib/libcrypto/man/X509at_get_attr.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: X509at_get_attr.3,v 1.1 2021/10/22 11:24:45 schwarze Exp $
+.\" $OpenBSD: X509at_get_attr.3,v 1.2 2021/10/22 13:29:41 schwarze Exp $
.\"
.\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org>
.\"
@@ -142,7 +142,8 @@ on failure.
.Xr OBJ_nid2obj 3 ,
.Xr STACK_OF 3 ,
.Xr X509_ATTRIBUTE_get0_data 3 ,
-.Xr X509_ATTRIBUTE_new 3
+.Xr X509_ATTRIBUTE_new 3 ,
+.Xr X509at_add1_attr 3
.Sh HISTORY
.Fn X509at_get_attr ,
.Fn X509at_get_attr_count ,