summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorschwarze <>2016-12-15 22:08:23 +0000
committerschwarze <>2016-12-15 22:08:23 +0000
commitb17865ed36ce1e1c66954c264d9dab466b31cae9 (patch)
tree46b5d235788bc8846859ec0e0096a7dc88931339 /src/lib
parentb986d0958179c04d1b3e40e1ee4310fda3e96fec (diff)
downloadopenbsd-b17865ed36ce1e1c66954c264d9dab466b31cae9.tar.gz
openbsd-b17865ed36ce1e1c66954c264d9dab466b31cae9.tar.bz2
openbsd-b17865ed36ce1e1c66954c264d9dab466b31cae9.zip
Document X509_ALGOR_new(3) and X509_ALGOR_free(3)
listed in <openssl/x509.h> and in OpenSSL doc/man3/X509_dup.pod. Explain what an X509_ALGOR object represents and where it is used. Explain how copying works, like in similar pages. New RETURN VALUES, SEE ALSO, and STANDARDS sections. Some macro and wording fixes.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/man/X509_ALGOR_dup.398
1 files changed, 81 insertions, 17 deletions
diff --git a/src/lib/libcrypto/man/X509_ALGOR_dup.3 b/src/lib/libcrypto/man/X509_ALGOR_dup.3
index 5ca80dc3f8..370dbc71db 100644
--- a/src/lib/libcrypto/man/X509_ALGOR_dup.3
+++ b/src/lib/libcrypto/man/X509_ALGOR_dup.3
@@ -1,7 +1,24 @@
1.\" $OpenBSD: X509_ALGOR_dup.3,v 1.2 2016/12/05 16:38:24 jmc Exp $ 1.\" $OpenBSD: X509_ALGOR_dup.3,v 1.3 2016/12/15 22:08:23 schwarze Exp $
2.\" OpenSSL 4692340e Jun 7 15:49:08 2016 -0400 2.\" OpenSSL 4692340e Jun 7 15:49:08 2016 -0400
3.\" 3.\"
4.\" This file was written by Dr. Stephen Henson <steve@openssl.org>. 4.\" This file is a derived work.
5.\" The changes are covered by the following Copyright and license:
6.\"
7.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
8.\"
9.\" Permission to use, copy, modify, and distribute this software for any
10.\" purpose with or without fee is hereby granted, provided that the above
11.\" copyright notice and this permission notice appear in all copies.
12.\"
13.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
14.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
16.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
19.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20.\"
21.\" The original file was written by Dr. Stephen Henson <steve@openssl.org>.
5.\" Copyright (c) 2002, 2015 The OpenSSL Project. All rights reserved. 22.\" Copyright (c) 2002, 2015 The OpenSSL Project. All rights reserved.
6.\" 23.\"
7.\" Redistribution and use in source and binary forms, with or without 24.\" Redistribution and use in source and binary forms, with or without
@@ -48,19 +65,25 @@
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 65.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE. 66.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\" 67.\"
51.Dd $Mdocdate: December 5 2016 $ 68.Dd $Mdocdate: December 15 2016 $
52.Dt X509_ALGOR_DUP 3 69.Dt X509_ALGOR_DUP 3
53.Os 70.Os
54.Sh NAME 71.Sh NAME
72.Nm X509_ALGOR_new ,
73.Nm X509_ALGOR_free ,
55.Nm X509_ALGOR_dup , 74.Nm X509_ALGOR_dup ,
56.Nm X509_ALGOR_set0 , 75.Nm X509_ALGOR_set0 ,
57.Nm X509_ALGOR_get0 , 76.Nm X509_ALGOR_get0 ,
58.Nm X509_ALGOR_set_md , 77.Nm X509_ALGOR_set_md ,
59.Nm X509_ALGOR_cmp 78.Nm X509_ALGOR_cmp
60.Nd AlgorithmIdentifier functions 79.Nd create, change, and inspect algorithm identifiers
61.Sh SYNOPSIS 80.Sh SYNOPSIS
62.In openssl/x509.h 81.In openssl/x509.h
63.Ft X509_ALGOR * 82.Ft X509_ALGOR *
83.Fn X509_ALGOR_new void
84.Ft void
85.Fn X509_ALGOR_free "X509_ALGOR *alg"
86.Ft X509_ALGOR *
64.Fo X509_ALGOR_dup 87.Fo X509_ALGOR_dup
65.Fa "X509_ALGOR *alg" 88.Fa "X509_ALGOR *alg"
66.Fc 89.Fc
@@ -89,9 +112,27 @@
89.Fa "const X509_ALGOR *b" 112.Fa "const X509_ALGOR *b"
90.Fc 113.Fc
91.Sh DESCRIPTION 114.Sh DESCRIPTION
115.Fn X509_ALGOR_new
116allocates and initializes an empty
117.Vt X509_ALGOR
118object, representing an ASN.1 AlgorithmIdentifier structure
119defined in RFC 5280 section 4.1.1.2.
120Such objects can specify a cryptographic algorithm together
121with algorithm-specific parameters.
122They are used by many other objects, for example certificates,
123certificate revocation lists, and certificate requests.
124.Pp
125.Fn X509_ALGOR_free
126frees
127.Fa alg.
128.Pp
92.Fn X509_ALGOR_dup 129.Fn X509_ALGOR_dup
93returns a copy of 130copies
94.Fa alg . 131.Fa alg
132by calling
133.Xr i2d_X509_ALGOR 3
134and
135.Xr d2i_X509_ALGOR 3 .
95.Pp 136.Pp
96.Fn X509_ALGOR_set0 137.Fn X509_ALGOR_set0
97sets the algorithm OID of 138sets the algorithm OID of
@@ -105,15 +146,15 @@ with value
105If 146If
106.Fa ptype 147.Fa ptype
107is 148is
108.Sy V_ASN1_UNDEF 149.Dv V_ASN1_UNDEF
109the parameter is omitted, otherwise 150the parameter is omitted, otherwise
110.Fa ptype 151.Fa ptype
111and 152and
112.Fa pval 153.Fa pval
113have the same meaning as the 154have the same meaning as the
114.Sy type 155.Fa type
115and 156and
116.Sy value 157.Fa value
117parameters to 158parameters to
118.Xr ASN1_TYPE_set 3 . 159.Xr ASN1_TYPE_set 3 .
119All the supplied parameters are used internally so must 160All the supplied parameters are used internally so must
@@ -124,18 +165,16 @@ be freed after this call.
124is the inverse of 165is the inverse of
125.Fn X509_ALGOR_set0 : 166.Fn X509_ALGOR_set0 :
126it returns the algorithm OID in 167it returns the algorithm OID in
127.Sy *paobj 168.Pf * Fa paobj
128and the associated parameter in 169and the associated parameter in
129.Sy *pptype 170.Pf * Fa pptype
130and 171and
131.Sy *ppval 172.Pf * Fa ppval
132from the 173from
133.Sy AlgorithmIdentifier
134.Fa alg . 174.Fa alg .
135.Pp 175.Pp
136.Fn X509_ALGOR_set_md 176.Fn X509_ALGOR_set_md
137sets the 177sets
138.Sy AlgorithmIdentifier
139.Fa alg 178.Fa alg
140to appropriate values for the message digest 179to appropriate values for the message digest
141.Fa md . 180.Fa md .
@@ -144,5 +183,30 @@ to appropriate values for the message digest
144compares 183compares
145.Fa a 184.Fa a
146and 185and
186.Fa b .
187.Sh RETURN VALUES
188.Fn X509_ALGOR_new
189and
190.Fn X509_ALGOR_dup
191return a new
192.Vt X509_ALGOR
193object or
194.Dv NULL
195if an error occurs.
196.Pp
197.Fn X509_ALGOR_set0
198returns 1 for success or 0 for failure.
199.Pp
200.Fn X509_ALGOR_cmp
201returns 0 if
202.Fa a
203and
147.Fa b 204.Fa b
148and returns 0 if they have identical encodings and non-zero otherwise. 205have identical encodings or non-zero otherwise.
206.Sh SEE ALSO
207.Xr ASN1_TYPE_set 3 ,
208.Xr d2i_X509_ALGOR 3 ,
209.Xr X509_PUBKEY_get0_param 3
210.Sh STANDARDS
211RFC 5280: Internet X.509 Public Key Infrastructure Certificate and
212Certificate Revocation List (CRL) Profile