Add asn1_time_to_tm function and check days in month
authorPaul Yang <yang.yang@baishancloud.com>
Mon, 10 Jul 2017 19:01:24 +0000 (03:01 +0800)
committerPauli <paul.dale@oracle.com>
Sun, 23 Jul 2017 22:27:27 +0000 (08:27 +1000)
commit3d0f1cb9fdd630c6c920bc97bf496538717e7705
tree9158a0ff2ce5d7385fd441d6ecd5eb05bcd1d63a
parenta1099821f9937717f92464056d80f2e303a73a4d
Add asn1_time_to_tm function and check days in month

Based on discussion in PR #3566. Reduce duplicated code in original
asn1_utctime_to_tm and asn1_generalizedtime_to_tm, and introduce a new
internal function asn1_time_to_tm. This function also checks if the days
in the input time string is valid or not for the corresponding month.

Test cases are also added.

Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/3905)
crypto/asn1/a_gentm.c
crypto/asn1/a_time.c
crypto/asn1/a_utctm.c
crypto/asn1/asn1_locl.h
doc/man3/ASN1_TIME_set.pod
test/x509_time_test.c