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.
Commit
af8109c00d0d5a5ebd1d5829c3e26c381029ace57343dfa8f966af74d6f14373
Parent
d70ea01c83ff756…
1 file changed
+2
-2
+2
-2
| --- src/http_ssl.c | ||
| +++ src/http_ssl.c | ||
| @@ -99,19 +99,19 @@ | ||
| 99 | 99 | ** be in UTC (Zulu timezone) with no fractional seconds. |
| 100 | 100 | ** |
| 101 | 101 | ** If showUtc==1, add " UTC" at the end of the returned string. This is |
| 102 | 102 | ** not ISO8601-compliant, but makes the displayed value more user-friendly. |
| 103 | 103 | */ |
| 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, | |
| 105 | 105 | int showUtc){ |
| 106 | 106 | assert( showUtc==0 || showUtc==1 ); |
| 107 | 107 | if( !ASN1_TIME_check(asn1_time) ){ |
| 108 | 108 | return mprintf("Bad time value"); |
| 109 | 109 | }else{ |
| 110 | 110 | char res[20]; |
| 111 | 111 | char *pr = res; |
| 112 | - char *pt = (char *)asn1_time->data; | |
| 112 | + const char *pt = (char *)asn1_time->data; | |
| 113 | 113 | /* 0123456789 1234 |
| 114 | 114 | ** UTCTime: YYMMDDHHMMSSZ (YY >= 50 ? 19YY : 20YY) |
| 115 | 115 | ** GeneralizedTime: YYYYMMDDHHMMSSZ */ |
| 116 | 116 | if( asn1_time->length < 15 ){ |
| 117 | 117 | /* UTCTime, fill out century digits */ |
| 118 | 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(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 |