Skip to content

Commit 303f8d5

Browse files
committed
remove BattleNet, GuildWars & Trion Authenticators support
1 parent d5d9cac commit 303f8d5

28 files changed

Lines changed: 9 additions & 4176 deletions

Authenticator/Authenticator.csproj

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -59,26 +59,16 @@
5959
<Compile Include="Classes\AuthHelper.cs" />
6060
<Compile Include="Classes\Exceptions.cs" />
6161
<Compile Include="Classes\Base32.cs" />
62-
<Compile Include="Classes\BattleNetAuthenticator.cs" />
6362
<Compile Include="Classes\GoogleAuthenticator.cs" />
6463
<Compile Include="Classes\HOTPAuthenticator.cs" />
6564
<Compile Include="Classes\OtpauthMigration.cs" />
6665
<Compile Include="Classes\RegisteredAuthenticator.cs" />
67-
<Compile Include="Classes\TrionAuthenticator.cs" />
6866
<Compile Include="Classes\MessageForwarder.cs" />
6967
<Compile Include="Controls\AuthenticatorListBox.cs" SubType="Component" />
7068
<Compile Include="Dialogs\AddAuthenticator.cs" SubType="Form" />
7169
<Compile Include="Dialogs\AddAuthenticator.designer.cs">
7270
<DependentUpon>AddAuthenticator.cs</DependentUpon>
7371
</Compile>
74-
<Compile Include="Dialogs\AddBattleNetAuthenticator.cs" SubType="Form" />
75-
<Compile Include="Dialogs\AddBattleNetAuthenticator.Designer.cs">
76-
<DependentUpon>AddBattleNetAuthenticator.cs</DependentUpon>
77-
</Compile>
78-
<Compile Include="Dialogs\AddGuildWarsAuthenticator.cs" SubType="Form" />
79-
<Compile Include="Dialogs\AddGuildWarsAuthenticator.designer.cs">
80-
<DependentUpon>AddGuildWarsAuthenticator.cs</DependentUpon>
81-
</Compile>
8272
<Compile Include="Dialogs\AddMicrosoftAuthenticator.cs" SubType="Form" />
8373
<Compile Include="Dialogs\AddMicrosoftAuthenticator.designer.cs">
8474
<DependentUpon>AddMicrosoftAuthenticator.cs</DependentUpon>
@@ -87,10 +77,6 @@
8777
<Compile Include="Dialogs\AddOktaVerifyAuthenticator.Designer.cs">
8878
<DependentUpon>AddOktaVerifyAuthenticator.cs</DependentUpon>
8979
</Compile>
90-
<Compile Include="Dialogs\AddTrionAuthenticator.cs" SubType="Form" />
91-
<Compile Include="Dialogs\AddTrionAuthenticator.designer.cs">
92-
<DependentUpon>AddTrionAuthenticator.cs</DependentUpon>
93-
</Compile>
9480
<Compile Include="Dialogs\ChangePasswordForm.cs" SubType="Form" />
9581
<Compile Include="Dialogs\ChangePasswordForm.Designer.cs">
9682
<DependentUpon>ChangePasswordForm.cs</DependentUpon>
@@ -115,18 +101,10 @@
115101
<Compile Include="Dialogs\SetPasswordForm.Designer.cs">
116102
<DependentUpon>SetPasswordForm.cs</DependentUpon>
117103
</Compile>
118-
<Compile Include="Dialogs\ShowRestoreCodeForm.cs" SubType="Form" />
119-
<Compile Include="Dialogs\ShowRestoreCodeForm.designer.cs">
120-
<DependentUpon>ShowRestoreCodeForm.cs</DependentUpon>
121-
</Compile>
122104
<Compile Include="Dialogs\ShowSecretKeyForm.cs" SubType="Form" />
123105
<Compile Include="Dialogs\ShowSecretKeyForm.designer.cs">
124106
<DependentUpon>ShowSecretKeyForm.cs</DependentUpon>
125107
</Compile>
126-
<Compile Include="Dialogs\ShowTrionSecretForm.cs" SubType="Form" />
127-
<Compile Include="Dialogs\ShowTrionSecretForm.designer.cs">
128-
<DependentUpon>ShowTrionSecretForm.cs</DependentUpon>
129-
</Compile>
130108
<Compile Include="Dialogs\SnippingTool.cs" SubType="Form" />
131109
<Compile Include="Dialogs\UnprotectPasswordForm.cs" SubType="Form" />
132110
<Compile Include="Dialogs\UnprotectPasswordForm.designer.cs">
@@ -146,23 +124,13 @@
146124
<EmbeddedResource Include="Dialogs\AddAuthenticator.resx">
147125
<DependentUpon>AddAuthenticator.cs</DependentUpon>
148126
</EmbeddedResource>
149-
<EmbeddedResource Include="Dialogs\AddBattleNetAuthenticator.resx">
150-
<DependentUpon>AddBattleNetAuthenticator.cs</DependentUpon>
151-
</EmbeddedResource>
152-
<EmbeddedResource Include="Dialogs\AddGuildWarsAuthenticator.resx">
153-
<DependentUpon>AddGuildWarsAuthenticator.cs</DependentUpon>
154-
<SubType>Designer</SubType>
155-
</EmbeddedResource>
156127
<EmbeddedResource Include="Dialogs\AddMicrosoftAuthenticator.resx">
157128
<DependentUpon>AddMicrosoftAuthenticator.cs</DependentUpon>
158129
<SubType>Designer</SubType>
159130
</EmbeddedResource>
160131
<EmbeddedResource Include="Dialogs\AddOktaVerifyAuthenticator.resx">
161132
<DependentUpon>AddOktaVerifyAuthenticator.cs</DependentUpon>
162133
</EmbeddedResource>
163-
<EmbeddedResource Include="Dialogs\AddTrionAuthenticator.resx">
164-
<DependentUpon>AddTrionAuthenticator.cs</DependentUpon>
165-
</EmbeddedResource>
166134
<EmbeddedResource Include="Dialogs\ChangePasswordForm.resx">
167135
<DependentUpon>ChangePasswordForm.cs</DependentUpon>
168136
</EmbeddedResource>
@@ -182,15 +150,9 @@
182150
<EmbeddedResource Include="Dialogs\SetPasswordForm.resx">
183151
<DependentUpon>SetPasswordForm.cs</DependentUpon>
184152
</EmbeddedResource>
185-
<EmbeddedResource Include="Dialogs\ShowRestoreCodeForm.resx">
186-
<DependentUpon>ShowRestoreCodeForm.cs</DependentUpon>
187-
</EmbeddedResource>
188153
<EmbeddedResource Include="Dialogs\ShowSecretKeyForm.resx">
189154
<DependentUpon>ShowSecretKeyForm.cs</DependentUpon>
190155
</EmbeddedResource>
191-
<EmbeddedResource Include="Dialogs\ShowTrionSecretForm.resx">
192-
<DependentUpon>ShowTrionSecretForm.cs</DependentUpon>
193-
</EmbeddedResource>
194156
<EmbeddedResource Include="Dialogs\UnprotectPasswordForm.resx">
195157
<DependentUpon>UnprotectPasswordForm.cs</DependentUpon>
196158
</EmbeddedResource>

Authenticator/Classes/AuthAuthenticator.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -407,11 +407,7 @@ public virtual string ToUrl(bool compat = false) {
407407
extraparams += "&algorithm=" + AuthenticatorData.HmacType;
408408
}
409409

410-
if (AuthenticatorData is BattleNetAuthenticator battleNetAuthenticator) {
411-
extraparams += "&serial=" +
412-
HttpUtility.UrlEncode(battleNetAuthenticator.Serial.Replace("-", ""));
413-
}
414-
else if (AuthenticatorData is HotpAuthenticator hotpAuthenticator) {
410+
if (AuthenticatorData is HotpAuthenticator hotpAuthenticator) {
415411
type = "hotp";
416412
extraparams += "&counter=" + hotpAuthenticator.Counter;
417413
}

Authenticator/Classes/AuthConfig.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -487,12 +487,6 @@ protected bool ReadXmlInternal(XmlReader reader, string password = null) {
487487
AuthenticatorData = Authenticator.ReadXmlv2(reader, password)
488488
};
489489
switch (authOld.AuthenticatorData) {
490-
case BattleNetAuthenticator _:
491-
authOld.Name = "Battle.net";
492-
break;
493-
case GuildWarsAuthenticator _:
494-
authOld.Name = "GuildWars 2";
495-
break;
496490
default:
497491
authOld.Name = "Authenticator";
498492
break;

Authenticator/Classes/AuthHelper.cs

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -114,23 +114,6 @@ static AuthHelper() {
114114
AuthenticatorType = RegisteredAuthenticator.AuthenticatorTypes.OktaVerify,
115115
Icon = "OktaVerifyAuthenticatorIcon.png"
116116
},
117-
118-
null,
119-
new RegisteredAuthenticator {
120-
Name = "Battle.Net",
121-
AuthenticatorType = RegisteredAuthenticator.AuthenticatorTypes.BattleNet,
122-
Icon = "BattleNetAuthenticatorIcon.png"
123-
},
124-
new RegisteredAuthenticator {
125-
Name = "Guild Wars 2",
126-
AuthenticatorType = RegisteredAuthenticator.AuthenticatorTypes.GuildWars,
127-
Icon = "GuildWarsAuthenticatorIcon.png"
128-
},
129-
new RegisteredAuthenticator {
130-
Name = "Glyph / Trion",
131-
AuthenticatorType = RegisteredAuthenticator.AuthenticatorTypes.Trion,
132-
Icon = "GlyphIcon.png"
133-
},
134117
};
135118

136119
public static string DetectIconByIssuer(string issuer) {
@@ -477,29 +460,7 @@ public static List<AuthAuthenticator> ImportAuthenticators(Form parent, string f
477460
importedAuthenticator.AutoRefresh = false;
478461
//
479462
Authenticator auth;
480-
if (string.Compare(issuer, "BattleNet", true) == 0) {
481-
var serial = query["serial"];
482-
if (string.IsNullOrEmpty(serial)) {
483-
throw new ApplicationException("Battle.net Authenticator does not have a serial");
484-
}
485-
486-
serial = serial.ToUpper();
487-
if (Regex.IsMatch(serial, @"^[A-Z]{2}-?[\d]{4}-?[\d]{4}-?[\d]{4}$") == false) {
488-
throw new ApplicationException("Invalid serial for Battle.net Authenticator");
489-
}
490-
491-
auth = new BattleNetAuthenticator();
492-
//char[] decoded = Base32.getInstance().Decode(secret).Select(c => Convert.ToChar(c)).ToArray(); // this is hex string values
493-
//string hex = new string(decoded);
494-
//((BattleNetAuthenticator)auth).SecretKey = Authenticator.StringToByteArray(hex);
495-
496-
((BattleNetAuthenticator) auth).SecretKey = Base32.GetInstance().Decode(secret);
497-
498-
((BattleNetAuthenticator) auth).Serial = serial;
499-
500-
issuer = string.Empty;
501-
}
502-
else if (uri.Host == "hotp") {
463+
if (uri.Host == "hotp") {
503464
auth = new HotpAuthenticator();
504465
((HotpAuthenticator) auth).SecretKey = Base32.GetInstance().Decode(secret);
505466
((HotpAuthenticator) auth).Counter = int.Parse(counter);

Authenticator/Classes/Authenticator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public static Authenticator ReadXmlv2(XmlReader reader, string password = null)
182182
}
183183

184184
if (authenticator == null) {
185-
authenticator = new BattleNetAuthenticator();
185+
authenticator = new GoogleAuthenticator();
186186
}
187187

188188
reader.MoveToContent();

0 commit comments

Comments
 (0)