Upgrade to Capicom 2.1.0.2 makes the Verify method to fail
- From: Elena <Elena@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 26 Feb 2009 15:01:01 -0800
Hello.
We have a client-server application where the client signs the message
before passing it to the server. The server verifies the messages before
processing the request.
The application is written in .net 1.1 C#. Both methods (sign and verify)
worked fine with the Capicom 2.0.0.3 version. After the installation of the
KB931906 on the server, which upgraded Capicom to version 2.1.0.2, the Verify
method returns Certificate Invalid. (though the upgrade has been available
for some time, it is only recently that we upgraded.)
I have tried upgrading the client pc as well but it did not make any
difference.
The code is as follows:
public static bool Verify(string contents, string base64SignedStr)
{
ICertificate certificate = null;
try
{
CAPICOM.ISignedData signedData = new
CAPICOM.SignedDataClass();
signedData.Content = contents;
signedData.Verify(base64SignedStr, true,
CAPICOM.CAPICOM_SIGNED_DATA_VERIFY_FLAG.CAPICOM_VERIFY_SIGNATURE_AND_CERTIFICATE);
//Indexer doesn't work, so use Enumerator instead...
foreach (object signer in signedData.Signers)
{
CAPICOM.ISigner2 sig = (CAPICOM.ISigner2)signer;
certificate = sig.Certificate;
break;
}
}
catch (Exception ex)
{
System.Diagnostics.EventLog.WriteEntry("CertVerify",
"Exception: " + ex.ToString(), System.Diagnostics.EventLogEntryType.Error);
}
CAPICOM.ICertificateStatus status = certificate.IsValid();
bool bResult = status.Result;
return bResult;
}
We are relying on the (CAPICOM.ICertificateStatus) status.Result to indicate
whether the verification was successful or not. With the 2.0.0.3 version of
Capicom, it returns "true". With 2.1.0.2 "false" is returned.
I have tested with the same code and with the same content and signature,
and the two Capicom versions are returning different results.
Another note is that in order to compile and run with the 2.1.0.2 version of
Capicom.dll I had to use .Net 2. However, the code itself is exactly the same
as in .Net 1.1.
Any help would be higly appreciated.
Please let me know if any other details are required.
Elena
.
- Prev by Date: RE: CNG Kernel Mode Question
- Previous by thread: run only allowed windows application in Group policy Locked All
- Index(es):
Relevant Pages
|
Loading