Commit c4188808ad26140b3229c4aa284994db9566cd38
1 parent
a628c6b5
Exists in
master
and in
3 other branches
Fixing portability issue.
Showing
1 changed file
with
4 additions
and
2 deletions
Show diff stats
src/lib3270/ssl/ctx_init.c
... | ... | @@ -113,10 +113,12 @@ int lib3270_check_X509_crl(H3270 *hSession, SSL_ERROR_MESSAGE * message) |
113 | 113 | |
114 | 114 | // https://stackoverflow.com/questions/23407376/testing-x509-certificate-expiry-date-with-c |
115 | 115 | time_t now = time(NULL); |
116 | - if(X509_cmp_time(X509_CRL_get0_nextUpdate(hSession->ssl.crl.cert), &now)) | |
116 | + const ASN1_TIME * next_update = X509_CRL_get0_nextUpdate(hSession->ssl.crl.cert); | |
117 | + | |
118 | + if(X509_cmp_time(next_update, &now)) | |
117 | 119 | { |
118 | 120 | int day, sec; |
119 | - if(ASN1_TIME_diff(&day, &sec, NULL, X509_CRL_get0_nextUpdate(hSession->ssl.crl.cert))) | |
121 | + if(ASN1_TIME_diff(&day, &sec, NULL, next_update)) | |
120 | 122 | { |
121 | 123 | trace_ssl(hSession,"CRL Certificate is valid for %d day(s) and %d second(s)\n",day,sec); |
122 | 124 | return 0; | ... | ... |