From 3b8a78795bef4ca09dc876e28a533d702bf5275d Mon Sep 17 00:00:00 2001 From: beck <> Date: Fri, 4 Nov 2016 18:07:24 +0000 Subject: make public ASN1_time_parse and ASN1_time_tm_cmp to replace former hidden functions.. document with a man page. bump majors on libtls, libssl, libcrypto ok jsing@ guenther@ --- src/lib/libcrypto/man/ASN1_time_parse.3 | 94 +++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 src/lib/libcrypto/man/ASN1_time_parse.3 (limited to 'src/lib/libcrypto/man/ASN1_time_parse.3') 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 @@ +.\" $OpenBSD: ASN1_time_parse.3,v 1.1 2016/11/04 18:07:23 beck Exp $ +.\" +.\" Copyright (c) 2016 Bob Beck +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd $Mdocdate: November 4 2016 $ +.Dt ASN1_TIME_PARSE 3 +.Os +.Sh NAME +.Nm ASN1_time_parse, +.Nm ASN1_time_tm_cmp +.Nd LibreSSL utilities for asn1 format time. +.Sh SYNOPSIS +.In asn1.h +.Ft "int" +.Fn ASN1_time_parse "const char *bytes" "size_t len" "struct tm *tm" "int mode +.Ft "int" +.Fn ASN1_time_tm_cmp "struct tm *tm1" "struct tm *tm2" +.Sh DESCRIPTION +The +.Nm ASN1_time_parse +function parses an asn1 time string of +.Ar len +bytes starting at +.Ar bytes . +The resulting time is stored in +.Ar tm +if +.Ar tm +is non NULL. +.Pp +The +.Ar mode +parameter must be one of +.Bl -bullet -offset four +.It +.Ar 0 +to parse a time as specified in RFC 5280 for an X509 object, +which may be either a UTC time or a Generalized time. +.It +.Ar V_ASN1_UTCTIME +to parse an RFC 5280 format UTC time. +.It +.Ar V_ASN1_GENERALIZEDTIME +to parse an RFC 5280 format Generalized time. +.El +.Pp +The +.Nm ASN1_time_tm_cmp +function compares two times in +.Ar tm1 +and +.Ar tm2 +.Sh RETURN VALUES +.Nm ASN1_parse_time +returns +.Bl -bullet -offset four +.It +.Ar -1 +if the string was invalid for the +.Ar mode +specified +.It +.Ar V_ASN1_UTCTIME +if the string parsed as a valid UTC time. +.It : +.Ar V_ASN1_GENERALIZEDTIME +if the string parsed as a valid Generalized time. +.El +.Pp +.Nm ASN1_time_tm_cmp +returns +.Bl -bullet -offset four +.It +.Ar -1 +if tm1 is less than tm2. +.It +.Ar 1 +if tm1 is greater than tm2. +.It +.Ar 0 +if tm1 is the same as tm2. +.El -- cgit v1.2.3-55-g6feb