Changeset 402 for binary-improvements2/WebServer/src/OpenID.cs
- Timestamp:
- Jan 27, 2023, 7:28:00 PM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements2/WebServer/src/OpenID.cs
r399 r402 19 19 20 20 private static readonly X509Certificate2 caCert = 21 new X509Certificate2 (Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location) + 22 "/steam-rootca.cer"); 21 new X509Certificate2 ($"{Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location)}/steam-rootca.cer"); 23 22 24 23 private static readonly X509Certificate2 caIntermediateCert = 25 new X509Certificate2 (Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location) + 26 "/steam-intermediate.cer"); 24 new X509Certificate2 ($"{Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location)}/steam-intermediate.cer"); 27 25 28 26 private const bool verboseSsl = false; … … 74 72 foreach (X509ChainElement chainEl in privateChain.ChainElements) { 75 73 if (verboseSsl) { 76 Log.Out ( "Validating cert: " + chainEl.Certificate.Subject);74 Log.Out ($"Validating cert: {chainEl.Certificate.Subject}"); 77 75 } 78 76 … … 80 78 foreach (X509ChainStatus chainStatus in chainEl.ChainElementStatus) { 81 79 if (verboseSsl) { 82 Log.Out ( " Status: " + chainStatus.Status);80 Log.Out ($" Status: {chainStatus.Status}"); 83 81 } 84 82 … … 94 92 95 93 // This status is an error, print information 96 Log.Warning ("[OpenID] Steam certificate error: " + chainEl.Certificate.Subject + " ### Error: " + 97 chainStatus.Status); 94 Log.Warning ($"[OpenID] Steam certificate error: {chainEl.Certificate.Subject} ### Error: {chainStatus.Status}"); 98 95 privateChain.Reset (); 99 96 return false; … … 104 101 if (chainStatus.Status != X509ChainStatusFlags.NoError && 105 102 chainStatus.Status != X509ChainStatusFlags.UntrustedRoot) { 106 Log.Warning ( "[OpenID] Steam certificate error: " + chainStatus.Status);103 Log.Warning ($"[OpenID] Steam certificate error: {chainStatus.Status}"); 107 104 privateChain.Reset (); 108 105 return false; … … 130 127 }; 131 128 132 return STEAM_LOGIN + '?' + buildUrlParams (queryParams);129 return $"{STEAM_LOGIN}?{buildUrlParams (queryParams)}"; 133 130 } 134 131 … … 141 138 142 139 if (mode == "error") { 143 Log.Warning ( "[OpenID] Steam OpenID login error: " + getValue (_req, "openid.error"));140 Log.Warning ($"[OpenID] Steam OpenID login error: {getValue (_req, "openid.error")}"); 144 141 if (debugOpenId) { 145 142 PrintOpenIdResponse (_req); … … 174 171 string[] signeds = getValue (_req, "openid.signed").Split (','); 175 172 foreach (string s in signeds) { 176 queryParams ["openid." + s] = getValue (_req, "openid." + s); 173 string name = $"openid.{s}"; 174 queryParams [name] = getValue (_req, name); 177 175 } 178 176 … … 201 199 } 202 200 203 Log.Warning ( "[OpenID] Steam OpenID login failed: {0}", responseString);201 Log.Warning ($"[OpenID] Steam OpenID login failed: {responseString}"); 204 202 return 0; 205 203 } … … 209 207 int i = 0; 210 208 foreach ((string argName, string argValue) in _queryParams) { 211 paramsArr [i++] = argName + "=" + Uri.EscapeDataString (argValue);209 paramsArr [i++] = $"{argName}={Uri.EscapeDataString (argValue)}"; 212 210 } 213 211 … … 218 216 NameValueCollection nvc = _req.QueryString; 219 217 if (nvc [_name] == null) { 220 throw new MissingMemberException ( "[OpenID] OpenID parameter \"" + _name + "\" missing");218 throw new MissingMemberException ($"[OpenID] OpenID parameter \"{_name}\" missing"); 221 219 } 222 220 … … 227 225 NameValueCollection nvc = _req.QueryString; 228 226 for (int i = 0; i < nvc.Count; i++) { 229 Log.Out ( " " + nvc.GetKey (i) + " = " + nvc [i]);227 Log.Out ($" {nvc.GetKey (i)} = {nvc [i]}"); 230 228 } 231 229 }
Note:
See TracChangeset
for help on using the changeset viewer.