diff options
| author | schwarze <> | 2021-10-22 11:24:45 +0000 |
|---|---|---|
| committer | schwarze <> | 2021-10-22 11:24:45 +0000 |
| commit | e77c47a6c45fefc684164ca97d019ec300c5be21 (patch) | |
| tree | 4f5e236c10112a271b54f67ea47f275d0e212267 /src/lib/libcrypto/man | |
| parent | 8ec905c6206db791419e84ccc5ca015e1f5732ad (diff) | |
| download | openbsd-e77c47a6c45fefc684164ca97d019ec300c5be21.tar.gz openbsd-e77c47a6c45fefc684164ca97d019ec300c5be21.tar.bz2 openbsd-e77c47a6c45fefc684164ca97d019ec300c5be21.zip | |
new manual page X509at_get_attr(3)
documenting five X.501 Attribute read accessors
Diffstat (limited to 'src/lib/libcrypto/man')
| -rw-r--r-- | src/lib/libcrypto/man/Makefile | 3 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/X509_ATTRIBUTE_new.3 | 7 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/X509at_get_attr.3 | 157 |
3 files changed, 163 insertions, 4 deletions
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile index 51c2cf45b7..e31e6992a2 100644 --- a/src/lib/libcrypto/man/Makefile +++ b/src/lib/libcrypto/man/Makefile | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | # $OpenBSD: Makefile,v 1.196 2021/10/21 16:26:34 schwarze Exp $ | 1 | # $OpenBSD: Makefile,v 1.197 2021/10/22 11:24:45 schwarze Exp $ |
| 2 | 2 | ||
| 3 | .include <bsd.own.mk> | 3 | .include <bsd.own.mk> |
| 4 | 4 | ||
| @@ -276,6 +276,7 @@ MAN= \ | |||
| 276 | UI_new.3 \ | 276 | UI_new.3 \ |
| 277 | X25519.3 \ | 277 | X25519.3 \ |
| 278 | X509V3_get_d2i.3 \ | 278 | X509V3_get_d2i.3 \ |
| 279 | X509at_get_attr.3 \ | ||
| 279 | X509_ALGOR_dup.3 \ | 280 | X509_ALGOR_dup.3 \ |
| 280 | X509_ATTRIBUTE_get0_object.3 \ | 281 | X509_ATTRIBUTE_get0_object.3 \ |
| 281 | X509_ATTRIBUTE_new.3 \ | 282 | X509_ATTRIBUTE_new.3 \ |
diff --git a/src/lib/libcrypto/man/X509_ATTRIBUTE_new.3 b/src/lib/libcrypto/man/X509_ATTRIBUTE_new.3 index e0cff822da..c25144531a 100644 --- a/src/lib/libcrypto/man/X509_ATTRIBUTE_new.3 +++ b/src/lib/libcrypto/man/X509_ATTRIBUTE_new.3 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | .\" $OpenBSD: X509_ATTRIBUTE_new.3,v 1.11 2021/10/21 16:26:34 schwarze Exp $ | 1 | .\" $OpenBSD: X509_ATTRIBUTE_new.3,v 1.12 2021/10/22 11:24:45 schwarze Exp $ |
| 2 | .\" | 2 | .\" |
| 3 | .\" Copyright (c) 2016, 2021 Ingo Schwarze <schwarze@openbsd.org> | 3 | .\" Copyright (c) 2016, 2021 Ingo Schwarze <schwarze@openbsd.org> |
| 4 | .\" | 4 | .\" |
| @@ -14,7 +14,7 @@ | |||
| 14 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 14 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 15 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 15 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 16 | .\" | 16 | .\" |
| 17 | .Dd $Mdocdate: October 21 2021 $ | 17 | .Dd $Mdocdate: October 22 2021 $ |
| 18 | .Dt X509_ATTRIBUTE_NEW 3 | 18 | .Dt X509_ATTRIBUTE_NEW 3 |
| 19 | .Os | 19 | .Os |
| 20 | .Sh NAME | 20 | .Sh NAME |
| @@ -119,7 +119,8 @@ fails on | |||
| 119 | .Xr X509_ATTRIBUTE_set1_object 3 , | 119 | .Xr X509_ATTRIBUTE_set1_object 3 , |
| 120 | .Xr X509_EXTENSION_new 3 , | 120 | .Xr X509_EXTENSION_new 3 , |
| 121 | .Xr X509_new 3 , | 121 | .Xr X509_new 3 , |
| 122 | .Xr X509_REQ_new 3 | 122 | .Xr X509_REQ_new 3 , |
| 123 | .Xr X509at_get_attr 3 | ||
| 123 | .Sh STANDARDS | 124 | .Sh STANDARDS |
| 124 | .Bl -ohang | 125 | .Bl -ohang |
| 125 | .It Xo | 126 | .It Xo |
diff --git a/src/lib/libcrypto/man/X509at_get_attr.3 b/src/lib/libcrypto/man/X509at_get_attr.3 new file mode 100644 index 0000000000..8e1a65e2d1 --- /dev/null +++ b/src/lib/libcrypto/man/X509at_get_attr.3 | |||
| @@ -0,0 +1,157 @@ | |||
| 1 | .\" $OpenBSD: X509at_get_attr.3,v 1.1 2021/10/22 11:24:45 schwarze Exp $ | ||
| 2 | .\" | ||
| 3 | .\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org> | ||
| 4 | .\" | ||
| 5 | .\" Permission to use, copy, modify, and distribute this software for any | ||
| 6 | .\" purpose with or without fee is hereby granted, provided that the above | ||
| 7 | .\" copyright notice and this permission notice appear in all copies. | ||
| 8 | .\" | ||
| 9 | .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
| 10 | .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
| 11 | .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
| 12 | .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
| 13 | .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
| 14 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
| 15 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
| 16 | .\" | ||
| 17 | .Dd $Mdocdate: October 22 2021 $ | ||
| 18 | .Dt X509AT_GET_ATTR 3 | ||
| 19 | .Os | ||
| 20 | .Sh NAME | ||
| 21 | .Nm X509at_get_attr , | ||
| 22 | .Nm X509at_get_attr_count , | ||
| 23 | .Nm X509at_get_attr_by_OBJ , | ||
| 24 | .Nm X509at_get_attr_by_NID , | ||
| 25 | .Nm X509at_get0_data_by_OBJ | ||
| 26 | .\" In the following line, "X.501" and "Attribute" are not typos. | ||
| 27 | .\" The "Attribute" type is defined in X.501, not in X.509. | ||
| 28 | .\" The type is called "Attribute" with capital "A", not "attribute". | ||
| 29 | .Nd X.501 Attribute array read accessors | ||
| 30 | .Sh SYNOPSIS | ||
| 31 | .In openssl/x509.h | ||
| 32 | .Ft X509_ATTRIBUTE * | ||
| 33 | .Fo X509at_get_attr | ||
| 34 | .Fa "const STACK_OF(X509_ATTRIBUTE) *attrs" | ||
| 35 | .Fa "int index" | ||
| 36 | .Fc | ||
| 37 | .Ft int | ||
| 38 | .Fo X509at_get_attr_count | ||
| 39 | .Fa "const STACK_OF(X509_ATTRIBUTE) *attrs" | ||
| 40 | .Fc | ||
| 41 | .Ft int | ||
| 42 | .Fo X509at_get_attr_by_OBJ | ||
| 43 | .Fa "const STACK_OF(X509_ATTRIBUTE) *attrs" | ||
| 44 | .Fa "const ASN1_OBJECT *obj" | ||
| 45 | .Fa "int start_after" | ||
| 46 | .Fc | ||
| 47 | .Ft int | ||
| 48 | .Fo X509at_get_attr_by_NID | ||
| 49 | .Fa "const STACK_OF(X509_ATTRIBUTE) *attrs" | ||
| 50 | .Fa "int nid" | ||
| 51 | .Fa "int start_after" | ||
| 52 | .Fc | ||
| 53 | .Ft void * | ||
| 54 | .Fo X509at_get0_data_by_OBJ | ||
| 55 | .Fa "STACK_OF(X509_ATTRIBUTE) *attrs" | ||
| 56 | .Fa "const ASN1_OBJECT *obj" | ||
| 57 | .Fa "int start_after" | ||
| 58 | .Fa "int type" | ||
| 59 | .Fc | ||
| 60 | .Sh DESCRIPTION | ||
| 61 | These functions retrieve information from the | ||
| 62 | .Fa attrs | ||
| 63 | array of X.501 Attibute objects. | ||
| 64 | They all fail if | ||
| 65 | .Fa attrs | ||
| 66 | is a | ||
| 67 | .Dv NULL | ||
| 68 | pointer. | ||
| 69 | .Pp | ||
| 70 | .Fn X509at_get_attr | ||
| 71 | returns the array element at the zero-based | ||
| 72 | .Fa index . | ||
| 73 | It fails if the | ||
| 74 | .Fa index | ||
| 75 | is negative or greater than or equal to the number of objects in the array. | ||
| 76 | .Pp | ||
| 77 | .Fn X509at_get_attr_count | ||
| 78 | returns the number of objects currently stored in the array. | ||
| 79 | .Pp | ||
| 80 | The three remaining functions search the array starting after the index | ||
| 81 | .Fa start_after . | ||
| 82 | They fail if no matching object is found. | ||
| 83 | .Fn X509at_get0_data_by_OBJ | ||
| 84 | also fails if the data is not of the requested | ||
| 85 | .Fa type . | ||
| 86 | .Pp | ||
| 87 | Additionally, the | ||
| 88 | .Fa start_after | ||
| 89 | argument of | ||
| 90 | .Fn X509at_get0_data_by_OBJ | ||
| 91 | is interpreted in a special way. | ||
| 92 | If | ||
| 93 | .Fa start_after | ||
| 94 | is \-2 or smaller, | ||
| 95 | .Fn X509at_get0_data_by_OBJ | ||
| 96 | also fails if | ||
| 97 | .Fa attrs | ||
| 98 | contains more than one matching object. | ||
| 99 | If | ||
| 100 | .Fa start_after | ||
| 101 | is \-3 or smaller, it also fails unless the matching object | ||
| 102 | contains exactly one value. | ||
| 103 | .Sh RETURN VALUES | ||
| 104 | .Fn X509at_get_attr | ||
| 105 | returns an internal pointer or | ||
| 106 | or | ||
| 107 | .Dv NULL | ||
| 108 | on failure. | ||
| 109 | .Pp | ||
| 110 | .Fn X509at_get_attr_count | ||
| 111 | returns the number of array elements or \-1 on failure. | ||
| 112 | .Pp | ||
| 113 | .Fn X509at_get_attr_by_OBJ | ||
| 114 | and | ||
| 115 | .Fn X509at_get_attr_by_NID | ||
| 116 | return the index of the first object in the array | ||
| 117 | that has an index greater than | ||
| 118 | .Fa start_after | ||
| 119 | and a type matching | ||
| 120 | .Fa obj | ||
| 121 | or | ||
| 122 | .Fa nid , | ||
| 123 | respectively, or \-1 on failure. | ||
| 124 | In addition, | ||
| 125 | .Fn X509at_get_attr_by_NID | ||
| 126 | returns \-2 | ||
| 127 | if | ||
| 128 | .Xr OBJ_nid2obj 3 | ||
| 129 | fails on the requested | ||
| 130 | .Fa nid . | ||
| 131 | .Pp | ||
| 132 | .Fn X509at_get0_data_by_OBJ | ||
| 133 | returns an internal pointer to the data contained in the value | ||
| 134 | of the first object that has an index greater than | ||
| 135 | .Fa start_after | ||
| 136 | and a type matching | ||
| 137 | .Fa obj , | ||
| 138 | or | ||
| 139 | .Dv NULL | ||
| 140 | on failure. | ||
| 141 | .Sh SEE ALSO | ||
| 142 | .Xr OBJ_nid2obj 3 , | ||
| 143 | .Xr STACK_OF 3 , | ||
| 144 | .Xr X509_ATTRIBUTE_get0_data 3 , | ||
| 145 | .Xr X509_ATTRIBUTE_new 3 | ||
| 146 | .Sh HISTORY | ||
| 147 | .Fn X509at_get_attr , | ||
| 148 | .Fn X509at_get_attr_count , | ||
| 149 | .Fn X509at_get_attr_by_OBJ , | ||
| 150 | and | ||
| 151 | .Fn X509at_get_attr_by_NID | ||
| 152 | first appeared in OpenSSL 0.9.5 and have been available since | ||
| 153 | .Ox 2.7 . | ||
| 154 | .Pp | ||
| 155 | .Fn X509at_get0_data_by_OBJ | ||
| 156 | first appeared in OpenSSL 0.9.8h and has been available since | ||
| 157 | .Ox 4.5 . | ||
