diff options
Diffstat (limited to 'src/lib/libcrypto/man')
-rw-r--r-- | src/lib/libcrypto/man/ASN1_time_parse.3 | 94 | ||||
-rw-r--r-- | src/lib/libcrypto/man/Makefile | 3 |
2 files changed, 96 insertions, 1 deletions
diff --git a/src/lib/libcrypto/man/ASN1_time_parse.3 b/src/lib/libcrypto/man/ASN1_time_parse.3 new file mode 100644 index 0000000000..e70a292f6d --- /dev/null +++ b/src/lib/libcrypto/man/ASN1_time_parse.3 | |||
@@ -0,0 +1,94 @@ | |||
1 | .\" $OpenBSD: ASN1_time_parse.3,v 1.1 2016/11/04 18:07:23 beck Exp $ | ||
2 | .\" | ||
3 | .\" Copyright (c) 2016 Bob Beck <beck@@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: November 4 2016 $ | ||
18 | .Dt ASN1_TIME_PARSE 3 | ||
19 | .Os | ||
20 | .Sh NAME | ||
21 | .Nm ASN1_time_parse, | ||
22 | .Nm ASN1_time_tm_cmp | ||
23 | .Nd LibreSSL utilities for asn1 format time. | ||
24 | .Sh SYNOPSIS | ||
25 | .In asn1.h | ||
26 | .Ft "int" | ||
27 | .Fn ASN1_time_parse "const char *bytes" "size_t len" "struct tm *tm" "int mode | ||
28 | .Ft "int" | ||
29 | .Fn ASN1_time_tm_cmp "struct tm *tm1" "struct tm *tm2" | ||
30 | .Sh DESCRIPTION | ||
31 | The | ||
32 | .Nm ASN1_time_parse | ||
33 | function parses an asn1 time string of | ||
34 | .Ar len | ||
35 | bytes starting at | ||
36 | .Ar bytes . | ||
37 | The resulting time is stored in | ||
38 | .Ar tm | ||
39 | if | ||
40 | .Ar tm | ||
41 | is non NULL. | ||
42 | .Pp | ||
43 | The | ||
44 | .Ar mode | ||
45 | parameter must be one of | ||
46 | .Bl -bullet -offset four | ||
47 | .It | ||
48 | .Ar 0 | ||
49 | to parse a time as specified in RFC 5280 for an X509 object, | ||
50 | which may be either a UTC time or a Generalized time. | ||
51 | .It | ||
52 | .Ar V_ASN1_UTCTIME | ||
53 | to parse an RFC 5280 format UTC time. | ||
54 | .It | ||
55 | .Ar V_ASN1_GENERALIZEDTIME | ||
56 | to parse an RFC 5280 format Generalized time. | ||
57 | .El | ||
58 | .Pp | ||
59 | The | ||
60 | .Nm ASN1_time_tm_cmp | ||
61 | function compares two times in | ||
62 | .Ar tm1 | ||
63 | and | ||
64 | .Ar tm2 | ||
65 | .Sh RETURN VALUES | ||
66 | .Nm ASN1_parse_time | ||
67 | returns | ||
68 | .Bl -bullet -offset four | ||
69 | .It | ||
70 | .Ar -1 | ||
71 | if the string was invalid for the | ||
72 | .Ar mode | ||
73 | specified | ||
74 | .It | ||
75 | .Ar V_ASN1_UTCTIME | ||
76 | if the string parsed as a valid UTC time. | ||
77 | .It : | ||
78 | .Ar V_ASN1_GENERALIZEDTIME | ||
79 | if the string parsed as a valid Generalized time. | ||
80 | .El | ||
81 | .Pp | ||
82 | .Nm ASN1_time_tm_cmp | ||
83 | returns | ||
84 | .Bl -bullet -offset four | ||
85 | .It | ||
86 | .Ar -1 | ||
87 | if tm1 is less than tm2. | ||
88 | .It | ||
89 | .Ar 1 | ||
90 | if tm1 is greater than tm2. | ||
91 | .It | ||
92 | .Ar 0 | ||
93 | if tm1 is the same as tm2. | ||
94 | .El | ||
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile index a76a03c78a..7819029ff6 100644 --- a/src/lib/libcrypto/man/Makefile +++ b/src/lib/libcrypto/man/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: Makefile,v 1.46 2016/11/04 15:29:03 schwarze Exp $ | 1 | # $OpenBSD: Makefile,v 1.47 2016/11/04 18:07:23 beck Exp $ |
2 | 2 | ||
3 | .include <bsd.own.mk> # for NOMAN | 3 | .include <bsd.own.mk> # for NOMAN |
4 | 4 | ||
@@ -11,6 +11,7 @@ MAN= \ | |||
11 | ASN1_STRING_new.3 \ | 11 | ASN1_STRING_new.3 \ |
12 | ASN1_STRING_print_ex.3 \ | 12 | ASN1_STRING_print_ex.3 \ |
13 | ASN1_generate_nconf.3 \ | 13 | ASN1_generate_nconf.3 \ |
14 | ASN1_time_parse.3 \ | ||
14 | BF_set_key.3 \ | 15 | BF_set_key.3 \ |
15 | BIO.3 \ | 16 | BIO.3 \ |
16 | BIO_ctrl.3 \ | 17 | BIO_ctrl.3 \ |