summaryrefslogtreecommitdiff
path: root/xmlsecurity
diff options
context:
space:
mode:
authorMichael Mi <mmi@openoffice.org>2004-07-28 01:27:50 +0000
committerMichael Mi <mmi@openoffice.org>2004-07-28 01:27:50 +0000
commit51ed32f789d9f58ee159a881e464994ad3984c5e (patch)
tree5d5acf06dd0b1841568b4233476b809f7b5bfdde /xmlsecurity
parent1f9acb2f71e95ce9333728ab19dea0aa8e12f819 (diff)
bug fix
Issue number: Submitted by: Reviewed by:
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/source/helper/xsecctl.hxx6
-rw-r--r--xmlsecurity/source/helper/xsecparser.cxx15
-rw-r--r--xmlsecurity/source/helper/xsecverify.cxx16
-rw-r--r--xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx10
-rw-r--r--xmlsecurity/tools/demo/multisigdemo.cxx20
5 files changed, 49 insertions, 18 deletions
diff --git a/xmlsecurity/source/helper/xsecctl.hxx b/xmlsecurity/source/helper/xsecctl.hxx
index 7e2cc53f38cc..516a0046d010 100644
--- a/xmlsecurity/source/helper/xsecctl.hxx
+++ b/xmlsecurity/source/helper/xsecctl.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xsecctl.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: mt $ $Date: 2004-07-14 11:05:46 $
+ * last change: $Author: mmi $ $Date: 2004-07-28 02:26:48 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -438,6 +438,8 @@ private:
void setDigestValue( rtl::OUString& ouDigestValue );
void setDate( rtl::OUString& ouDate );
void setTime( rtl::OUString& ouTime );
+ void setId( rtl::OUString& ouId );
+ void setPropertyId( rtl::OUString& ouPropertyId );
com::sun::star::uno::Reference<
com::sun::star::xml::crypto::sax::XReferenceResolvedListener > prepareSignatureToRead(
diff --git a/xmlsecurity/source/helper/xsecparser.cxx b/xmlsecurity/source/helper/xsecparser.cxx
index 8ad5a7f747cd..6c3e76a59d13 100644
--- a/xmlsecurity/source/helper/xsecparser.cxx
+++ b/xmlsecurity/source/helper/xsecparser.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xsecparser.cxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: mt $ $Date: 2004-07-12 13:15:22 $
+ * last change: $Author: mmi $ $Date: 2004-07-28 02:26:48 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -136,6 +136,10 @@ void SAL_CALL XSecParser::startElement(
if ( aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_SIGNATURE)) )
{
m_pXSecController->addSignature();
+ if (ouIdAttr != NULL)
+ {
+ m_pXSecController->setId( ouIdAttr );
+ }
}
else if ( aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_REFERENCE)) )
{
@@ -199,6 +203,13 @@ void SAL_CALL XSecParser::startElement(
m_ouDigestValue = rtl::OUString::createFromAscii("");
m_bInDigestValue = true;
}
+ else if ( aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_SIGNATUREPROPERTY)) )
+ {
+ if (ouIdAttr != NULL)
+ {
+ m_pXSecController->setPropertyId( ouIdAttr );
+ }
+ }
else if (aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_DATE)))
{
m_ouDate = rtl::OUString::createFromAscii("");
diff --git a/xmlsecurity/source/helper/xsecverify.cxx b/xmlsecurity/source/helper/xsecverify.cxx
index 577fea6d7ace..33e007d729e6 100644
--- a/xmlsecurity/source/helper/xsecverify.cxx
+++ b/xmlsecurity/source/helper/xsecverify.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xsecverify.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: mmi $ $Date: 2004-07-15 08:12:09 $
+ * last change: $Author: mmi $ $Date: 2004-07-28 02:26:48 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -257,6 +257,18 @@ void XSecController::setTime( rtl::OUString& ouTime )
isi.signatureInfor.ouTime = ouTime;
}
+void XSecController::setId( rtl::OUString& ouId )
+{
+ InternalSignatureInformation &isi = m_vInternalSignatureInformations[m_vInternalSignatureInformations.size()-1];
+ isi.signatureInfor.ouSignatureId = ouId;
+}
+
+void XSecController::setPropertyId( rtl::OUString& ouPropertyId )
+{
+ InternalSignatureInformation &isi = m_vInternalSignatureInformations[m_vInternalSignatureInformations.size()-1];
+ isi.signatureInfor.ouPropertyId = ouPropertyId;
+}
+
/* public: for signature verify */
void XSecController::collectToVerify( const rtl::OUString& referenceId )
{
diff --git a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx
index 42feadaa41e5..7da5ff8a2445 100644
--- a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: x509certificate_nssimpl.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: mmi $ $Date: 2004-07-15 08:12:09 $
+ * last change: $Author: mmi $ $Date: 2004-07-28 02:27:26 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -381,7 +381,7 @@ X509Certificate_NssImpl* X509Certificate_NssImpl :: getImplementation( const Ref
if( pCert != NULL )
{
unsigned char fingerprint[20];
- char *fpStr = NULL;
+ //char *fpStr = NULL;
SECItem fpItem;
int length = ((id == SEC_OID_MD5)?MD5_LENGTH:SHA1_LENGTH);
@@ -389,7 +389,7 @@ X509Certificate_NssImpl* X509Certificate_NssImpl :: getImplementation( const Ref
PK11_HashBuf(id, fingerprint, pCert->derCert.data, pCert->derCert.len);
fpItem.data = fingerprint;
fpItem.len = length;
- fpStr = CERT_Hexify(&fpItem, 1);
+ //fpStr = CERT_Hexify(&fpItem, 1);
Sequence< sal_Int8 > thumbprint( length ) ;
for( int i = 0 ; i < length ; i ++ )
@@ -397,7 +397,7 @@ X509Certificate_NssImpl* X509Certificate_NssImpl :: getImplementation( const Ref
thumbprint[i] = fingerprint[i];
}
- PORT_Free(fpStr);
+ //PORT_Free(fpStr);
return thumbprint;
}
else
diff --git a/xmlsecurity/tools/demo/multisigdemo.cxx b/xmlsecurity/tools/demo/multisigdemo.cxx
index 63efd3a1cac3..2036b2b50aaa 100644
--- a/xmlsecurity/tools/demo/multisigdemo.cxx
+++ b/xmlsecurity/tools/demo/multisigdemo.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: multisigdemo.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: mt $ $Date: 2004-07-26 07:29:34 $
+ * last change: $Author: mmi $ $Date: 2004-07-28 02:27:50 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -70,6 +70,8 @@
#include <xmlsecurity/biginteger.hxx>
+#include <tools/date.hxx>
+#include <tools/time.hxx>
namespace cssu = com::sun::star::uno;
namespace cssl = com::sun::star::lang;
@@ -165,17 +167,20 @@ int SAL_CALL main( int argc, char **argv )
aSignatureHelper.AddForSigning( nSecurityId, aXMLFileName, aXMLFileName, sal_False );
aSignatureHelper.AddForSigning( nSecurityId, aBINFileName, aBINFileName, sal_True );
+ aSignatureHelper.SetDateTime( nSecurityId, Date(), Time());
+
/*
- * creates another signature on the xml stream, use no.4 certificate
+ * creates another signature on the xml stream, use no.1 certificate
*/
nSecurityId = aSignatureHelper.GetNewSecurityId();
aSignatureHelper.SetX509Certificate(
nSecurityId,
- xPersonalCerts[3]->getIssuerName(),
- bigIntegerToNumericString( xPersonalCerts[3]->getSerialNumber()));
+ xPersonalCerts[0]->getIssuerName(),
+ bigIntegerToNumericString( xPersonalCerts[0]->getSerialNumber()));
aSignatureHelper.AddForSigning( nSecurityId, aXMLFileName, aXMLFileName, sal_False );
+ aSignatureHelper.SetDateTime( nSecurityId, Date(), Time());
/*
* creates the output stream
@@ -260,10 +265,11 @@ int SAL_CALL main( int argc, char **argv )
*/
aSignatureHelper.SetX509Certificate(
nSecurityId,
- xPersonalCerts[4]->getIssuerName(),
- bigIntegerToNumericString( xPersonalCerts[4]->getSerialNumber()));
+ xPersonalCerts[1]->getIssuerName(),
+ bigIntegerToNumericString( xPersonalCerts[1]->getSerialNumber()));
aSignatureHelper.AddForSigning( nSecurityId, aBINFileName, aBINFileName, sal_True );
+ aSignatureHelper.SetDateTime( nSecurityId, Date(), Time());
pStream = new SvFileStream( aSIGFileName, STREAM_WRITE );
xLockBytes = new SvLockBytes( pStream, TRUE );