summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorschwarze <>2021-11-21 17:35:53 +0000
committerschwarze <>2021-11-21 17:35:53 +0000
commit531adb9e89fcce417b0bb144eac2484fa61752c5 (patch)
treeda91ecaeac0173016761bb1191c6f4970c8724af /src/lib
parent6ca14af7f854a24c63978e68da252f842c0b7e12 (diff)
downloadopenbsd-531adb9e89fcce417b0bb144eac2484fa61752c5.tar.gz
openbsd-531adb9e89fcce417b0bb144eac2484fa61752c5.tar.bz2
openbsd-531adb9e89fcce417b0bb144eac2484fa61752c5.zip
In asn1.h rev. 1.55 and asn1/a_time.c rev. 1.28, beck@
provided ASN1_TIME_diff(3). Merge the documentation from the OpenSSL 1.1.1 branch, which is still under a free license.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/man/ASN1_TIME_set.375
1 files changed, 72 insertions, 3 deletions
diff --git a/src/lib/libcrypto/man/ASN1_TIME_set.3 b/src/lib/libcrypto/man/ASN1_TIME_set.3
index 7aa3009207..b966165fb2 100644
--- a/src/lib/libcrypto/man/ASN1_TIME_set.3
+++ b/src/lib/libcrypto/man/ASN1_TIME_set.3
@@ -1,6 +1,6 @@
1.\" $OpenBSD: ASN1_TIME_set.3,v 1.15 2019/06/06 01:06:58 schwarze Exp $ 1.\" $OpenBSD: ASN1_TIME_set.3,v 1.16 2021/11/21 17:35:53 schwarze Exp $
2.\" full merge up to: OpenSSL e9b77246 Jan 20 19:58:49 2017 +0100 2.\" full merge up to: OpenSSL e9b77246 Jan 20 19:58:49 2017 +0100
3.\" selective merge up to: OpenSSL b0edda11 Mar 20 13:00:17 2018 +0000 3.\" selective merge up to: OpenSSL 24a535ea Sep 22 13:14:20 2020 +0100
4.\" 4.\"
5.\" This file was written by Dr. Stephen Henson <steve@openssl.org> 5.\" This file was written by Dr. Stephen Henson <steve@openssl.org>
6.\" and Todd Short <tshort@akamai.com>. 6.\" and Todd Short <tshort@akamai.com>.
@@ -50,7 +50,7 @@
50.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 50.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
51.\" OF THE POSSIBILITY OF SUCH DAMAGE. 51.\" OF THE POSSIBILITY OF SUCH DAMAGE.
52.\" 52.\"
53.Dd $Mdocdate: June 6 2019 $ 53.Dd $Mdocdate: November 21 2021 $
54.Dt ASN1_TIME_SET 3 54.Dt ASN1_TIME_SET 3
55.Os 55.Os
56.Sh NAME 56.Sh NAME
@@ -69,6 +69,7 @@
69.Nm ASN1_TIME_print , 69.Nm ASN1_TIME_print ,
70.Nm ASN1_UTCTIME_print , 70.Nm ASN1_UTCTIME_print ,
71.Nm ASN1_GENERALIZEDTIME_print , 71.Nm ASN1_GENERALIZEDTIME_print ,
72.Nm ASN1_TIME_diff ,
72.Nm ASN1_UTCTIME_cmp_time_t , 73.Nm ASN1_UTCTIME_cmp_time_t ,
73.Nm ASN1_TIME_to_generalizedtime 74.Nm ASN1_TIME_to_generalizedtime
74.Nd ASN.1 Time functions 75.Nd ASN.1 Time functions
@@ -153,6 +154,13 @@
153.Fa "const ASN1_GENERALIZEDTIME *s" 154.Fa "const ASN1_GENERALIZEDTIME *s"
154.Fc 155.Fc
155.Ft int 156.Ft int
157.Fo ASN1_TIME_diff
158.Fa "int *pday"
159.Fa "int *psec"
160.Fa "const ASN1_TIME *from"
161.Fa "const ASN1_TIME *to"
162.Fc
163.Ft int
156.Fo ASN1_UTCTIME_cmp_time_t 164.Fo ASN1_UTCTIME_cmp_time_t
157.Fa "const ASN1_UTCTIME *s" 165.Fa "const ASN1_UTCTIME *s"
158.Fa "time_t t" 166.Fa "time_t t"
@@ -273,6 +281,59 @@ The output of
273may include a fractional part following the second. 281may include a fractional part following the second.
274.Pp 282.Pp
275The function 283The function
284.Fn ASN1_TIME_diff
285sets
286.Pf * Fa pday
287and
288.Pf * Fa psec
289to the time difference between
290.Fa from
291and
292.Fa to .
293If
294.Fa to
295represents a time later than
296.Fa from ,
297then one or both (depending on the time difference) of
298.Pf * Fa pday
299and
300.Pf * Fa psec
301will be positive.
302If
303.Fa to
304represents a time earlier than
305.Fa from ,
306then one or both of
307.Pf * Fa pday
308and
309.Pf * Fa psec
310will be negative.
311If
312.Fa to
313and
314.Fa from
315represent the same time, then
316.Pf * Fa pday
317and
318.Pf * Fa psec
319will both be zero.
320If both
321.Pf * Fa pday
322and
323.Pf * Fa psec
324are nonzero they will always have the same sign.
325The value of
326.Pf * Fa psec
327will always be less than the number of seconds in a day.
328If
329.Fa from
330or
331.Fa to
332is
333.Dv NULL ,
334the current time is used.
335.Pp
336The function
276.Fn ASN1_UTCTIME_cmp_time_t 337.Fn ASN1_UTCTIME_cmp_time_t
277compares the two times represented by 338compares the two times represented by
278.Fa s 339.Fa s
@@ -368,6 +429,10 @@ and
368return 1 if the time is successfully printed or 0 if an error 429return 1 if the time is successfully printed or 0 if an error
369occurred (I/O error or invalid time format). 430occurred (I/O error or invalid time format).
370.Pp 431.Pp
432.Fn ASN1_TIME_diff
433returns 1 for success or 0 for failure.
434It can for example fail if a time structure passed in has invalid syntax.
435.Pp
371.Fn ASN1_UTCTIME_cmp_time_t 436.Fn ASN1_UTCTIME_cmp_time_t
372returns \-1 if 437returns \-1 if
373.Fa s 438.Fa s
@@ -439,6 +504,10 @@ and
439.Fn ASN1_TIME_set_string 504.Fn ASN1_TIME_set_string
440first appeared in OpenSSL 1.0.0 and have been available since 505first appeared in OpenSSL 1.0.0 and have been available since
441.Ox 4.9 . 506.Ox 4.9 .
507.Pp
508.Fn ASN1_TIME_diff
509first appeared in OpenSSL 1.0.2 and have been available since
510.Ox 7.1 .
442.Sh CAVEATS 511.Sh CAVEATS
443Some applications add offset times directly to a 512Some applications add offset times directly to a
444.Vt time_t 513.Vt time_t