[Mono-dev] certmgr - #35064

Neale Ferguson neale at sinenomine.net
Mon Nov 9 15:04:17 UTC 2015


Hi,
 I still haven’t found a solution to the problem #35064 (see below). Is
there another way on Linux to achieve the same result - i.e. Import a
private key into the right place required?

Neale

MONO_PATH=$MCS/class/lib/net_4_x:$HOME/Mono/xsp/src/lib
$MONO/mono/mini/mono-sgen $MCS/tools/security/certmgr.exe --importKey -c
-v -m
My MonoTestCert.pfx
Mono Certificate Manager - version 4.3.0.0
Manage X.509 certificates and CRL from stores.
Copyright 2002, 2003 Motus Technologies. Copyright 2004-2008 Novell. BSD
licensed.
 
Unhandled Exception:
System.Security.Cryptography.CryptographicException: Invalid MAC - file may
have been tampered!
  at Mono.Security.X509.PKCS12.Decode (System.Byte[] data) <0x3fffcca5378
0x00fd0> in <filename unknown>:0
  at Mono.Security.X509.PKCS12..ctor (System.Byte[] data) <0x3fffcca4cb0
0x0005e> in <filename unknown>:0
  at Mono.Security.X509.PKCS12.LoadFromFile (System.String filename)
<0x3fffcca47e8  0x0006e> in <filename unknown>:0
  at Mono.Tools.CertificateManager.LoadCertificates (System.String
filename,
System.String password, Boolean verbose) <0x3fffcca2fa8  0x0046e> in
<filename
unknown>:0 
  at Mono.Tools.CertificateManager.ImportKey (ObjectType type, Boolean
machine,
System.String file, System.String password, Boolean verbose)
<0x3fffcca2488 
0x000b2> in <filename unknown>:0
  at Mono.Tools.CertificateManager.Main (System.String[] args)
<0x3fffac5d120 
0x007d4> in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION:
System.Security.Cryptography.CryptographicException: Invalid MAC - file may
have been tampered!
  at Mono.Security.X509.PKCS12.Decode (System.Byte[] data) <0x3fffcca5378
0x00fd0> in <filename unknown>:0
  at Mono.Security.X509.PKCS12..ctor (System.Byte[] data) <0x3fffcca4cb0
0x0005e> in <filename unknown>:0
  at Mono.Security.X509.PKCS12.LoadFromFile (System.String filename)
<0x3fffcca47e8  0x0006e> in <filename unknown>:0
  at Mono.Tools.CertificateManager.LoadCertificates (System.String
filename,
System.String password, Boolean verbose) <0x3fffcca2fa8  0x0046e> in
<filename
unknown>:0 
  at Mono.Tools.CertificateManager.ImportKey (ObjectType type, Boolean
machine,
System.String file, System.String password, Boolean verbose)
<0x3fffcca2488 
0x000b2> in <filename unknown>:0
  at Mono.Tools.CertificateManager.Main (System.String[] args)
<0x3fffac5d120 
0x007d4> in <filename unknown>:0
 
This happens either 3.10.1 or head (as at 19 Oct 2015). I added some debug
code
just to see what was happening:
 
password:  iterations: 2000
MAC does not match calculated MAC
    Lengths: 20 20
47 0D 4F D5 B3 2B D6 62 45 C7 53 8C 33 89 C8 6C B1 DB C5 DA <--- MAC from
key
8B 3D 08 E3 F5 CE 37 AB 64 D1 A6 CE F6 B8 86 75 C1 07 4F BE <---
Calculated MAC



More information about the Mono-devel-list mailing list