X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FMono.Security%2FMono.Security.X509%2FPKCS12.cs;fp=mcs%2Fclass%2FMono.Security%2FMono.Security.X509%2FPKCS12.cs;h=01e6ffd67a812f6178c8ac6b006abd8d333f14f7;hb=819147f693ffe8965eff7bab444cf1bb4c570238;hp=fc8ac2bb306ec90519e2c0e4da4afd84d6a90bd1;hpb=aee167f8ff0e93bc6443fd4ab4d86da079e91e65;p=mono.git diff --git a/mcs/class/Mono.Security/Mono.Security.X509/PKCS12.cs b/mcs/class/Mono.Security/Mono.Security.X509/PKCS12.cs index fc8ac2bb306..01e6ffd67a8 100644 --- a/mcs/class/Mono.Security/Mono.Security.X509/PKCS12.cs +++ b/mcs/class/Mono.Security/Mono.Security.X509/PKCS12.cs @@ -383,8 +383,13 @@ namespace Mono.Security.X509 { byte[] authSafeData = authSafe.Content [0].Value; byte[] calculatedMac = MAC (_password, macSalt.Value, _iterations, authSafeData); - if (!Compare (macValue, calculatedMac)) - throw new CryptographicException ("Invalid MAC - file may have been tampered!"); + if (!Compare (macValue, calculatedMac)) { + byte[] nullPassword = {0, 0}; + calculatedMac = MAC(nullPassword, macSalt.Value, _iterations, authSafeData); + if (!Compare (macValue, calculatedMac)) + throw new CryptographicException ("Invalid MAC - file may have been tampe red!"); + _password = nullPassword; + } } // we now returns to our original presentation - PFX