Skip to content

Commit

Permalink
Merge pull request #42 from CykuTW/fix-validationalg-in-viewstate
Browse files Browse the repository at this point in the history
Fix ArgumentException thrown in ViewState plugin
  • Loading branch information
pwntester authored Aug 17, 2019
2 parents fd4a2f9 + af94844 commit 9e03c52
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 9e03c52

Please sign in to comment.