Skip to content

Commit

Permalink
Fix ArgumentException thrown when validationAlg is 3DES in ViewState …
Browse files Browse the repository at this point in the history
…plugin
  • Loading branch information
CykuTW committed Jun 8, 2019
1 parent b3c3400 commit af94844
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ysoserial/Plugins/ViewStatePlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,12 @@ public object Run(string[] args)
config.Decryption = decryptionAlg;
config.DecryptionKey = decryptionKey;
}
config.Validation = (MachineKeyValidation)Enum.Parse(typeof(MachineKeyValidation), validationAlg);
if (validationAlg.ToUpper().Equals("3DES"))
{
// If validationAlg is 3DES, modify it to TripleDES in order for Enum.Parse to work.
validationAlg = "TripleDES";
}
config.Validation = (MachineKeyValidation)Enum.Parse(typeof(MachineKeyValidation), validationAlg);
config.ValidationKey = validationKey;
readOnlyField.SetValue(config, true);

Expand Down

0 comments on commit af94844

Please sign in to comment.