From f23c89f0b7b26b61faab92f9b23d20d2e27886fc Mon Sep 17 00:00:00 2001 From: toorls Date: Wed, 12 Oct 2022 06:05:55 -0700 Subject: [PATCH] fix asn1test on windows --- src/u_time.c | 2 +- src/u_time.h | 2 +- tests/asn1test.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/u_time.c b/src/u_time.c index e265840d..d1fa184a 100644 --- a/src/u_time.c +++ b/src/u_time.c @@ -143,7 +143,7 @@ int GMSSL_gmtime_adj(struct tm *tm, long offset_sec) } //convert generalizedtime to tm -int asn1_generalizedtime_to_tm(struct tm *tm, char *gtime) +int asn1_generalizedtime_to_tm(char *gtime,struct tm *tm) { static const int min[9] = { 0, 0, 1, 1, 0, 0, 0, 0, 0 }; static const int max[9] = { 99, 99, 12, 31, 23, 59, 59, 12, 59 }; diff --git a/src/u_time.h b/src/u_time.h index 533cc470..2b7cbba0 100644 --- a/src/u_time.h +++ b/src/u_time.h @@ -15,7 +15,7 @@ extern "C" { int GMSSL_gmtime(const time_t *timep, struct tm *tm_time); time_t GMSSL_timegm(struct tm *tm); int GMSSL_gmtime_adj(struct tm *tm, long offset_sec); -int asn1_generalizedtime_to_tm(struct tm *tm,char *gtime); +int asn1_generalizedtime_to_tm(char *gtime,struct tm *tm); int asn1_utctime_to_tm(struct tm *tm, char *utime); int asn1_tm_to_generalizedtime(struct tm *tm, char *gtime); int asn1_tm_to_utctime(struct tm *tm, char *utime); diff --git a/tests/asn1test.c b/tests/asn1test.c index 96876fd9..5060ec0b 100644 --- a/tests/asn1test.c +++ b/tests/asn1test.c @@ -589,7 +589,7 @@ int main(void) if (test_asn1_utf8_string() != 1) goto err; if (test_asn1_ia5_string() != 1) goto err; if (test_asn1_utc_time() != 1) goto err; - //if (test_asn1_generalized_time() != 1) goto err; + if (test_asn1_generalized_time() != 1) goto err; printf("%s all tests passed\n", __FILE__); return 0; err: