Refactor ASN1_TIME_print functions
authorPaul Yang <yang.yang@baishancloud.com>
Mon, 31 Jul 2017 00:14:58 +0000 (20:14 -0400)
committerRich Salz <rsalz@openssl.org>
Mon, 31 Jul 2017 00:14:58 +0000 (20:14 -0400)
commitf673c4f8f2a12bb8efcb0869646fdf0efd6bf30e
treedb79c9fd4f78c83b035e52626e3f2c8db8336211
parent27eb9f23e60e5ed15651011f56eaf04591120630
Refactor ASN1_TIME_print functions

Check time string format before parsing
Reduce more duplicated code
By involving asn1_time_to_tm, we can now get information we mostly need
to print a time string.

This follows what was discussed at
https://github.com/openssl/openssl/pull/4001#discussion_r129092251

Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4039)
crypto/asn1/a_gentm.c
crypto/asn1/a_time.c
crypto/asn1/a_utctm.c