in HashCalculator/Views/TpmPcrs.xaml.cs [68:94]
private void Extend_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
{
string algorithmName = (string)ListOfAlgorithms.SelectedItem;
// if input cannot be hashed, don't change PCR values
try
{
string inputHash = Worker.ComputeHash(algorithmName, Input.Text, true);
if (inputHash != null &&
inputHash.Length > 0)
{
string oldPCR = PCR.Text;
PCR.Text = Worker.ComputeHash(algorithmName, PCR.Text + Input.Text, true);
ExtendDescription.Text = m_ExtendDescriptionTemplate + "\n\n" +
"Old PCR Value: " + oldPCR + "\n" +
"Input Hash: " + Input.Text + "\n" +
"Concatenated Value: " + oldPCR + Input.Text + "\n" +
"New PCR Value: " + PCR.Text;
}
}
catch (Exception ex)
{
if (!string.IsNullOrEmpty(ex.Message))
{
ExtendDescription.Text = ex.Message;
}
}
}