Fossil SCM

Walk around a warning in older versions of OpenSSL (e.g. 1.0.2g) where ASN1_time_check() is declared with a non-const ASN1_TIME* parameter.

danield 2021-11-02 15:52 trunk
Commit af8109c00d0d5a5ebd1d5829c3e26c381029ace57343dfa8f966af74d6f14373
1 file changed +2 -2
+2 -2
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -99,19 +99,19 @@
9999
** be in UTC (Zulu timezone) with no fractional seconds.
100100
**
101101
** If showUtc==1, add " UTC" at the end of the returned string. This is
102102
** not ISO8601-compliant, but makes the displayed value more user-friendly.
103103
*/
104
-static const char *ssl_asn1time_to_iso8601(const ASN1_TIME *asn1_time,
104
+static const char *ssl_asn1time_to_iso8601(ASN1_TIME *asn1_time,
105105
int showUtc){
106106
assert( showUtc==0 || showUtc==1 );
107107
if( !ASN1_TIME_check(asn1_time) ){
108108
return mprintf("Bad time value");
109109
}else{
110110
char res[20];
111111
char *pr = res;
112
- char *pt = (char *)asn1_time->data;
112
+ const char *pt = (char *)asn1_time->data;
113113
/* 0123456789 1234
114114
** UTCTime: YYMMDDHHMMSSZ (YY >= 50 ? 19YY : 20YY)
115115
** GeneralizedTime: YYYYMMDDHHMMSSZ */
116116
if( asn1_time->length < 15 ){
117117
/* UTCTime, fill out century digits */
118118
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -99,19 +99,19 @@
99 ** be in UTC (Zulu timezone) with no fractional seconds.
100 **
101 ** If showUtc==1, add " UTC" at the end of the returned string. This is
102 ** not ISO8601-compliant, but makes the displayed value more user-friendly.
103 */
104 static const char *ssl_asn1time_to_iso8601(const ASN1_TIME *asn1_time,
105 int showUtc){
106 assert( showUtc==0 || showUtc==1 );
107 if( !ASN1_TIME_check(asn1_time) ){
108 return mprintf("Bad time value");
109 }else{
110 char res[20];
111 char *pr = res;
112 char *pt = (char *)asn1_time->data;
113 /* 0123456789 1234
114 ** UTCTime: YYMMDDHHMMSSZ (YY >= 50 ? 19YY : 20YY)
115 ** GeneralizedTime: YYYYMMDDHHMMSSZ */
116 if( asn1_time->length < 15 ){
117 /* UTCTime, fill out century digits */
118
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -99,19 +99,19 @@
99 ** be in UTC (Zulu timezone) with no fractional seconds.
100 **
101 ** If showUtc==1, add " UTC" at the end of the returned string. This is
102 ** not ISO8601-compliant, but makes the displayed value more user-friendly.
103 */
104 static const char *ssl_asn1time_to_iso8601(ASN1_TIME *asn1_time,
105 int showUtc){
106 assert( showUtc==0 || showUtc==1 );
107 if( !ASN1_TIME_check(asn1_time) ){
108 return mprintf("Bad time value");
109 }else{
110 char res[20];
111 char *pr = res;
112 const char *pt = (char *)asn1_time->data;
113 /* 0123456789 1234
114 ** UTCTime: YYMMDDHHMMSSZ (YY >= 50 ? 19YY : 20YY)
115 ** GeneralizedTime: YYYYMMDDHHMMSSZ */
116 if( asn1_time->length < 15 ){
117 /* UTCTime, fill out century digits */
118

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button