summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorschwarze <>2021-11-08 14:44:14 +0000
committerschwarze <>2021-11-08 14:44:14 +0000
commit1c8420281d824e74eaa0857f8882012608e2bc86 (patch)
tree87565c58a3bc4bb440b58bedc939b86b19f28275 /src/lib
parent96dd57eb43c913bd5831db883e29231b45d3dc93 (diff)
downloadopenbsd-1c8420281d824e74eaa0857f8882012608e2bc86.tar.gz
openbsd-1c8420281d824e74eaa0857f8882012608e2bc86.tar.bz2
openbsd-1c8420281d824e74eaa0857f8882012608e2bc86.zip
Document X509_gmtime_adj(3).
While here, improve some argument names, improve ordering of the material, and mention the meaning of negative and of large arguments,
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/man/X509_cmp_time.390
1 files changed, 67 insertions, 23 deletions
diff --git a/src/lib/libcrypto/man/X509_cmp_time.3 b/src/lib/libcrypto/man/X509_cmp_time.3
index 96b671f3c9..7c61e2f605 100644
--- a/src/lib/libcrypto/man/X509_cmp_time.3
+++ b/src/lib/libcrypto/man/X509_cmp_time.3
@@ -1,7 +1,24 @@
1.\" $OpenBSD: X509_cmp_time.3,v 1.9 2019/06/06 01:06:59 schwarze Exp $ 1.\" $OpenBSD: X509_cmp_time.3,v 1.10 2021/11/08 14:44:14 schwarze Exp $
2.\" OpenSSL X509_cmp_time.pod 24053693 Mar 28 14:27:37 2017 +0200 2.\" full merge up to: OpenSSL 83cf7abf May 29 13:07:08 2018 +0100
3.\" 3.\"
4.\" This file was written by Emilia Kasper <emilia@openssl.org> 4.\" This file is a derived work.
5.\" The changes are covered by the following Copyright and license:
6.\"
7.\" Copyright (c) 2017, 2021 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 Emilia Kasper <emilia@openssl.org>
5.\" Copyright (c) 2017 The OpenSSL Project. All rights reserved. 22.\" Copyright (c) 2017 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,14 +65,15 @@
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: June 6 2019 $ 68.Dd $Mdocdate: November 8 2021 $
52.Dt X509_CMP_TIME 3 69.Dt X509_CMP_TIME 3
53.Os 70.Os
54.Sh NAME 71.Sh NAME
55.Nm X509_cmp_time , 72.Nm X509_cmp_time ,
56.Nm X509_cmp_current_time , 73.Nm X509_cmp_current_time ,
57.Nm X509_time_adj_ex , 74.Nm X509_time_adj_ex ,
58.Nm X509_time_adj 75.Nm X509_time_adj ,
76.Nm X509_gmtime_adj
59.Nd ASN.1 Time utilities 77.Nd ASN.1 Time utilities
60.Sh SYNOPSIS 78.Sh SYNOPSIS
61.In openssl/x509.h 79.In openssl/x509.h
@@ -70,16 +88,21 @@
70.Fc 88.Fc
71.Ft ASN1_TIME * 89.Ft ASN1_TIME *
72.Fo X509_time_adj_ex 90.Fo X509_time_adj_ex
73.Fa "ASN1_TIME *asn1_time" 91.Fa "ASN1_TIME *out_time"
74.Fa "int offset_day" 92.Fa "int offset_day"
75.Fa "long offset_sec" 93.Fa "long offset_sec"
76.Fa "time_t *in_tm" 94.Fa "time_t *in_time"
77.Fc 95.Fc
78.Ft ASN1_TIME * 96.Ft ASN1_TIME *
79.Fo X509_time_adj 97.Fo X509_time_adj
80.Fa "ASN1_TIME *asn1_time" 98.Fa "ASN1_TIME *out_time"
99.Fa "long offset_sec"
100.Fa "time_t *in_time"
101.Fc
102.Ft ASN1_TIME *
103.Fo X509_gmtime_adj
104.Fa "ASN1_TIME *out_time"
81.Fa "long offset_sec" 105.Fa "long offset_sec"
82.Fa "time_t *in_tm"
83.Fc 106.Fc
84.Sh DESCRIPTION 107.Sh DESCRIPTION
85.Fn X509_cmp_time 108.Fn X509_cmp_time
@@ -94,28 +117,46 @@ compares it to the current time.
94.Pp 117.Pp
95.Fn X509_time_adj_ex 118.Fn X509_time_adj_ex
96sets 119sets
97.Fa asn1_time 120.Fa out_time
98to a time 121to a time
99.Fa offset_day 122.Fa offset_day
100and 123and
101.Fa offset_sec 124.Fa offset_sec
102later than 125later than
103.Fa in_tm . 126.Fa in_time .
104.Fn X509_time_adj 127The values of
105does the same with a 0 day offset. 128.Fa offset_day
129and
130.Fa offset_sec
131can be negative to set a time before
132.Fa in_time .
133The
134.Fa offset_sec
135value can also exceed the number of seconds in a day.
106If 136If
107.Fa asn1_time 137.Fa in_time
138is
139.Dv NULL ,
140the current time is used instead.
141If
142.Fa out_time
108is 143is
109.Dv NULL , 144.Dv NULL ,
110a new 145a new
111.Vt ASN1_TIME 146.Vt ASN1_TIME
112structure is allocated and returned. 147structure is allocated and returned.
113.Pp 148.Pp
114In all functions, if 149.Fn X509_time_adj
115.Fa in_tm 150does the same with a 0 day offset.
116is 151.Pp
117.Dv NULL , 152.Fn X509_gmtime_adj
118the current time is used. 153does the same using the current time instead of
154.Fa in_time ,
155that is, it sets
156.Fa out_time
157to a time
158.Fa offset_sec
159seconds later than the current time.
119.Sh RETURN VALUES 160.Sh RETURN VALUES
120.Fn X509_cmp_time 161.Fn X509_cmp_time
121and 162and
@@ -126,10 +167,11 @@ is earlier than or equal to
126.Fa cmp_time , 167.Fa cmp_time ,
1271 if it is later, or 0 on error. 1681 if it is later, or 0 on error.
128.Pp 169.Pp
129.Fn X509_time_adj_ex 170.Fn X509_time_adj_ex ,
171.Fn X509_time_adj ,
130and 172and
131.Fn X509_time_adj 173.Fn X509_gmtime_adj
132return a pointer to the updated 174return a pointer to the updated or newly allocated
133.Vt ASN1_TIME 175.Vt ASN1_TIME
134structure or 176structure or
135.Dv NULL 177.Dv NULL
@@ -141,7 +183,9 @@ on error.
141.Xr time 3 183.Xr time 3
142.Sh HISTORY 184.Sh HISTORY
143.Fn X509_cmp_current_time 185.Fn X509_cmp_current_time
144first appeared in SSLeay 0.6.0 and has been available since 186and
187.Fn X509_gmtime_adj
188first appeared in SSLeay 0.6.0 and have been available since
145.Ox 2.4 . 189.Ox 2.4 .
146.Pp 190.Pp
147.Fn X509_cmp_time 191.Fn X509_cmp_time