diff options
author | schwarze <> | 2021-11-21 17:35:53 +0000 |
---|---|---|
committer | schwarze <> | 2021-11-21 17:35:53 +0000 |
commit | 531adb9e89fcce417b0bb144eac2484fa61752c5 (patch) | |
tree | da91ecaeac0173016761bb1191c6f4970c8724af /src/lib | |
parent | 6ca14af7f854a24c63978e68da252f842c0b7e12 (diff) | |
download | openbsd-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.3 | 75 |
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 | |||
273 | may include a fractional part following the second. | 281 | may include a fractional part following the second. |
274 | .Pp | 282 | .Pp |
275 | The function | 283 | The function |
284 | .Fn ASN1_TIME_diff | ||
285 | sets | ||
286 | .Pf * Fa pday | ||
287 | and | ||
288 | .Pf * Fa psec | ||
289 | to the time difference between | ||
290 | .Fa from | ||
291 | and | ||
292 | .Fa to . | ||
293 | If | ||
294 | .Fa to | ||
295 | represents a time later than | ||
296 | .Fa from , | ||
297 | then one or both (depending on the time difference) of | ||
298 | .Pf * Fa pday | ||
299 | and | ||
300 | .Pf * Fa psec | ||
301 | will be positive. | ||
302 | If | ||
303 | .Fa to | ||
304 | represents a time earlier than | ||
305 | .Fa from , | ||
306 | then one or both of | ||
307 | .Pf * Fa pday | ||
308 | and | ||
309 | .Pf * Fa psec | ||
310 | will be negative. | ||
311 | If | ||
312 | .Fa to | ||
313 | and | ||
314 | .Fa from | ||
315 | represent the same time, then | ||
316 | .Pf * Fa pday | ||
317 | and | ||
318 | .Pf * Fa psec | ||
319 | will both be zero. | ||
320 | If both | ||
321 | .Pf * Fa pday | ||
322 | and | ||
323 | .Pf * Fa psec | ||
324 | are nonzero they will always have the same sign. | ||
325 | The value of | ||
326 | .Pf * Fa psec | ||
327 | will always be less than the number of seconds in a day. | ||
328 | If | ||
329 | .Fa from | ||
330 | or | ||
331 | .Fa to | ||
332 | is | ||
333 | .Dv NULL , | ||
334 | the current time is used. | ||
335 | .Pp | ||
336 | The function | ||
276 | .Fn ASN1_UTCTIME_cmp_time_t | 337 | .Fn ASN1_UTCTIME_cmp_time_t |
277 | compares the two times represented by | 338 | compares the two times represented by |
278 | .Fa s | 339 | .Fa s |
@@ -368,6 +429,10 @@ and | |||
368 | return 1 if the time is successfully printed or 0 if an error | 429 | return 1 if the time is successfully printed or 0 if an error |
369 | occurred (I/O error or invalid time format). | 430 | occurred (I/O error or invalid time format). |
370 | .Pp | 431 | .Pp |
432 | .Fn ASN1_TIME_diff | ||
433 | returns 1 for success or 0 for failure. | ||
434 | It 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 |
372 | returns \-1 if | 437 | returns \-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 |
440 | first appeared in OpenSSL 1.0.0 and have been available since | 505 | first 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 | ||
509 | first appeared in OpenSSL 1.0.2 and have been available since | ||
510 | .Ox 7.1 . | ||
442 | .Sh CAVEATS | 511 | .Sh CAVEATS |
443 | Some applications add offset times directly to a | 512 | Some applications add offset times directly to a |
444 | .Vt time_t | 513 | .Vt time_t |