// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
using System;
using System.IO;
using System.Runtime.InteropServices;
+using System.Security;
using System.Security.Cryptography;
-using Mono.Security;
using Mono.Security.X509;
namespace Mono.Security.Authenticode {
try {
CheckSignature (value);
}
- catch {
+ catch (SecurityException) {
+ throw;
+ }
+ catch (Exception) {
reason = 1;
}
}
}
base.Close ();
- if (!signedHash.CompareValue (hash))
+ if (!signedHash.CompareValue (hash)) {
+ reason = 2;
return false;
+ }
// messageDigest is a hash of spcIndirectDataContext (which includes the file hash)
byte[] spcIDC = spc [0].Value;
{
string contentType = null;
ASN1 messageDigest = null;
- string spcStatementType = null;
- string spcSpOpusInfo = null;
+// string spcStatementType = null;
+// string spcSpOpusInfo = null;
for (int i=0; i < sd.SignerInfo.AuthenticatedAttributes.Count; i++) {
ASN1 attr = (ASN1) sd.SignerInfo.AuthenticatedAttributes [i];
// possible values
// - individualCodeSigning (1 3 6 1 4 1 311 2 1 21)
// - commercialCodeSigning (1 3 6 1 4 1 311 2 1 22)
- spcStatementType = ASN1Convert.ToOid (attr[1][0][0]);
+// spcStatementType = ASN1Convert.ToOid (attr[1][0][0]);
break;
case "1.3.6.1.4.1.311.2.1.12":
// spcSpOpusInfo (Microsoft code signing)
- try {
+/* try {
spcSpOpusInfo = System.Text.Encoding.UTF8.GetString (attr[1][0][0][0].Value);
}
catch (NullReferenceException) {
spcSpOpusInfo = null;
- }
+ }*/
break;
default:
break;