diff options
Diffstat (limited to 'src/lib/libcrypto')
| -rw-r--r-- | src/lib/libcrypto/man/X509_ATTRIBUTE_new.3 | 66 | 
1 files changed, 60 insertions, 6 deletions
diff --git a/src/lib/libcrypto/man/X509_ATTRIBUTE_new.3 b/src/lib/libcrypto/man/X509_ATTRIBUTE_new.3 index 66779d637b..aa14ea2099 100644 --- a/src/lib/libcrypto/man/X509_ATTRIBUTE_new.3 +++ b/src/lib/libcrypto/man/X509_ATTRIBUTE_new.3  | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | .\" $OpenBSD: X509_ATTRIBUTE_new.3,v 1.8 2020/06/04 10:24:27 schwarze Exp $ | 1 | .\" $OpenBSD: X509_ATTRIBUTE_new.3,v 1.9 2021/10/20 03:31:20 schwarze Exp $ | 
| 2 | .\" | 2 | .\" | 
| 3 | .\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org> | 3 | .\" Copyright (c) 2016, 2021 Ingo Schwarze <schwarze@openbsd.org> | 
| 4 | .\" | 4 | .\" | 
| 5 | .\" Permission to use, copy, modify, and distribute this software for any | 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 | 6 | .\" purpose with or without fee is hereby granted, provided that the above | 
| @@ -14,20 +14,26 @@ | |||
| 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: June 4 2020 $ | 17 | .Dd $Mdocdate: October 20 2021 $ | 
| 18 | .Dt X509_ATTRIBUTE_NEW 3 | 18 | .Dt X509_ATTRIBUTE_NEW 3 | 
| 19 | .Os | 19 | .Os | 
| 20 | .Sh NAME | 20 | .Sh NAME | 
| 21 | .Nm X509_ATTRIBUTE_new , | 21 | .Nm X509_ATTRIBUTE_new , | 
| 22 | .Nm X509_ATTRIBUTE_create , | ||
| 23 | .Nm X509_ATTRIBUTE_dup , | ||
| 22 | .Nm X509_ATTRIBUTE_free | 24 | .Nm X509_ATTRIBUTE_free | 
| 23 | .\" In the following line, "X.501" and "Attribute" are not typos. | 25 | .\" In the following line, "X.501" and "Attribute" are not typos. | 
| 24 | .\" The "Attribute" type is defined in X.501, not in X.509. | 26 | .\" The "Attribute" type is defined in X.501, not in X.509. | 
| 25 | .\" The type in called "Attribute" with capital "A", not "attribute". | 27 | .\" The type is called "Attribute" with capital "A", not "attribute". | 
| 26 | .Nd generic X.501 Attribute | 28 | .Nd generic X.501 Attribute | 
| 27 | .Sh SYNOPSIS | 29 | .Sh SYNOPSIS | 
| 28 | .In openssl/x509.h | 30 | .In openssl/x509.h | 
| 29 | .Ft X509_ATTRIBUTE * | 31 | .Ft X509_ATTRIBUTE * | 
| 30 | .Fn X509_ATTRIBUTE_new void | 32 | .Fn X509_ATTRIBUTE_new void | 
| 33 | .Ft X509_ATTRIBUTE * | ||
| 34 | .Fn X509_ATTRIBUTE_create "int nid" "int type" "void *value" | ||
| 35 | .Ft X509_ATTRIBUTE * | ||
| 36 | .Fn X509_ATTRIBUTE_dup "X509_ATTRIBUTE *attr" | ||
| 31 | .Ft void | 37 | .Ft void | 
| 32 | .Fn X509_ATTRIBUTE_free "X509_ATTRIBUTE *attr" | 38 | .Fn X509_ATTRIBUTE_free "X509_ATTRIBUTE *attr" | 
| 33 | .Sh DESCRIPTION | 39 | .Sh DESCRIPTION | 
| @@ -52,18 +58,60 @@ container object described in | |||
| 52 | allocates and initializes an empty | 58 | allocates and initializes an empty | 
| 53 | .Vt X509_ATTRIBUTE | 59 | .Vt X509_ATTRIBUTE | 
| 54 | object. | 60 | object. | 
| 61 | .Pp | ||
| 62 | .Fn X509_ATTRIBUTE_create | ||
| 63 | allocates a new multi-valued | ||
| 64 | .Vt X509_ATTRIBUTE | ||
| 65 | object of the type | ||
| 66 | .Fa nid | ||
| 67 | and initializes its set of values | ||
| 68 | to contain one new ASN.1 ANY object with the given | ||
| 69 | .Fa value | ||
| 70 | and | ||
| 71 | .Fa type . | ||
| 72 | The | ||
| 73 | .Fa type | ||
| 74 | usually is one of the | ||
| 75 | .Dv V_ASN1_* | ||
| 76 | constants defined in | ||
| 77 | .In openssl/asn1.h ; | ||
| 78 | it is stored without validating it. | ||
| 79 | If the function succeeds, ownership of the | ||
| 80 | .Fa value | ||
| 81 | is transferred to the new | ||
| 82 | .Vt X509_ATTRIBUTE | ||
| 83 | object. | ||
| 84 | .Pp | ||
| 85 | Be careful to not confuse the type of the attribute | ||
| 86 | and the type of the value. | ||
| 87 | .Pp | ||
| 88 | .Fn X509_ATTRIBUTE_dup | ||
| 89 | creates a deep copy of | ||
| 90 | .Fa attr . | ||
| 91 | .Pp | ||
| 55 | .Fn X509_ATTRIBUTE_free | 92 | .Fn X509_ATTRIBUTE_free | 
| 56 | frees | 93 | frees | 
| 57 | .Fa attr . | 94 | .Fa attr . | 
| 58 | .Sh RETURN VALUES | 95 | .Sh RETURN VALUES | 
| 59 | .Fn X509_ATTRIBUTE_new | 96 | .Fn X509_ATTRIBUTE_new , | 
| 60 | returns the new | 97 | .Fn X509_ATTRIBUTE_create , | 
| 98 | and | ||
| 99 | .Fn X509_ATTRIBUTE_dup | ||
| 100 | return the new | ||
| 61 | .Vt X509_ATTRIBUTE | 101 | .Vt X509_ATTRIBUTE | 
| 62 | object or | 102 | object or | 
| 63 | .Dv NULL | 103 | .Dv NULL | 
| 64 | if an error occurs. | 104 | if an error occurs. | 
| 105 | .Pp | ||
| 106 | In particular, these functions fail if memory allocation fails. | ||
| 107 | .Fn X509_ATTRIBUTE_create | ||
| 108 | also fails if | ||
| 109 | .Xr OBJ_nid2obj 3 | ||
| 110 | fails on | ||
| 111 | .Fa nid . | ||
| 65 | .Sh SEE ALSO | 112 | .Sh SEE ALSO | 
| 66 | .Xr d2i_X509_ATTRIBUTE 3 , | 113 | .Xr d2i_X509_ATTRIBUTE 3 , | 
| 114 | .Xr OBJ_nid2obj 3 , | ||
| 67 | .Xr PKCS12_SAFEBAG_new 3 , | 115 | .Xr PKCS12_SAFEBAG_new 3 , | 
| 68 | .Xr PKCS7_add_attribute 3 , | 116 | .Xr PKCS7_add_attribute 3 , | 
| 69 | .Xr PKCS8_PRIV_KEY_INFO_new 3 , | 117 | .Xr PKCS8_PRIV_KEY_INFO_new 3 , | 
| @@ -96,6 +144,12 @@ and | |||
| 96 | .Fn X509_ATTRIBUTE_free | 144 | .Fn X509_ATTRIBUTE_free | 
| 97 | first appeared in SSLeay 0.5.1 and have been available since | 145 | first appeared in SSLeay 0.5.1 and have been available since | 
| 98 | .Ox 2.4 . | 146 | .Ox 2.4 . | 
| 147 | .Pp | ||
| 148 | .Fn X509_ATTRIBUTE_create | ||
| 149 | and | ||
| 150 | .Fn X509_ATTRIBUTE_dup | ||
| 151 | first appeared in SSLeay 0.9.1 and have been available since | ||
| 152 | .Ox 2.6 . | ||
| 99 | .Sh BUGS | 153 | .Sh BUGS | 
| 100 | A data type designed to hold arbitrary data is an oxymoron. | 154 | A data type designed to hold arbitrary data is an oxymoron. | 
| 101 | .Pp | 155 | .Pp | 
