Commit 209a189 1 parent 8e13286 commit 209a189 Copy full SHA for 209a189
File tree 2 files changed +18
-8
lines changed
SteamKit2/SteamKit2/Steam
2 files changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -139,14 +139,6 @@ public async Task<CredentialsAuthSession> BeginAuthSessionViaCredentialsAsync( A
139
139
140
140
// Encrypt the password
141
141
var publicKey = await GetPasswordRSAPublicKeyAsync ( details . Username ! ) . ConfigureAwait ( false ) ;
142
-
143
- // Password limit is 64. If it's longer, trim it.
144
- if ( ! string . IsNullOrEmpty ( details . Password ) && details . Password . Length > 64 )
145
- {
146
- DebugLog . WriteLine ( nameof ( SteamAuthentication ) , "Notice: password is longer than 64 characters and will be trimmed." ) ;
147
- details . Password = details . Password . Substring ( 0 , 64 ) ;
148
- }
149
-
150
142
var rsaParameters = new RSAParameters
151
143
{
152
144
Modulus = Utils . DecodeHexString ( publicKey . publickey_mod ) ,
Original file line number Diff line number Diff line change @@ -231,6 +231,24 @@ public void LogOn( LogOnDetails details )
231
231
throw new ArgumentException ( "LogOn requires a username and password or access token to be set in 'details'." ) ;
232
232
}
233
233
234
+ // Password limit is 64.
235
+ if ( ! string . IsNullOrEmpty ( details . Password ) && details . Password . Length > 64 )
236
+ {
237
+ DebugLog . WriteLine ( nameof ( SteamUser ) , "Notice: password is longer than 64 characters and will be trimmed." ) ;
238
+ }
239
+
240
+ // Password Unicode check.
241
+ if ( details . Password != null )
242
+ {
243
+ for ( var i = 0 ; i < details . Password . Length ; i ++ )
244
+ {
245
+ if ( details . Password [ i ] > 127 )
246
+ {
247
+ throw new ArgumentException ( "Password contains non standard ASCII characters." ) ;
248
+ }
249
+ }
250
+ }
251
+
234
252
if ( ! this . Client . IsConnected )
235
253
{
236
254
this . Client . PostCallback ( new LoggedOnCallback ( EResult . NoConnection ) ) ;
You can’t perform that action at this time.
0 commit comments