Kaydet (Commit) f7a7f2b0 authored tarafından Michael Mi's avatar Michael Mi

Issue number:

Submitted by:  Andrew Fan
Reviewed by:
üst 401fc9b2
......@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
# $Revision: 1.1.1.1 $
# $Revision: 1.2 $
#
# last change: $Author: mt $ $Date: 2004-07-12 13:15:21 $
# last change: $Author: mmi $ $Date: 2004-07-23 03:12:26 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
......@@ -82,6 +82,7 @@ CDEFS += -DXMLSEC_CRYPTO_NSS -DXMLSEC_NO_XSLT
# --- Files --------------------------------------------------------
SLOFILES = \
$(SLO)$/baseencoding.obj \
$(SLO)$/saxhelper.obj \
$(SLO)$/xmldocumentwrapper_xmlsecimpl.obj \
$(SLO)$/xmlelementwrapper_xmlsecimpl.obj \
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: xmlencryption_mscryptimpl.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-23 03:12:26 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -104,6 +104,7 @@ using ::com::sun::star::xml::crypto::XSecurityEnvironment ;
using ::com::sun::star::xml::crypto::XXMLEncryption ;
using ::com::sun::star::xml::crypto::XXMLEncryptionTemplate ;
using ::com::sun::star::xml::crypto::XXMLSecurityContext ;
using ::com::sun::star::xml::crypto::XMLEncryptionException ;
XMLEncryption_MSCryptImpl :: XMLEncryption_MSCryptImpl( const Reference< XMultiServiceFactory >& aFactory ) : m_xServiceManager( aFactory ) {
}
......@@ -147,7 +148,7 @@ SAL_CALL XMLEncryption_MSCryptImpl :: encrypt(
//Create Encryption context
pEncCtx = xmlSecEncCtxCreate( pMngr ) ;
if( pEncCtx == NULL )
throw RuntimeException() ;
throw XMLEncryptionException() ;
//Get the encryption template
......@@ -181,7 +182,7 @@ SAL_CALL XMLEncryption_MSCryptImpl :: encrypt(
if( pCipherData == NULL ) {
xmlSecEncCtxDestroy( pEncCtx ) ;
throw RuntimeException() ;
throw XMLEncryptionException() ;
}
xmlNodePtr pCipherValue = pCipherData->children;
......@@ -192,14 +193,14 @@ SAL_CALL XMLEncryption_MSCryptImpl :: encrypt(
if( pCipherValue == NULL ) {
xmlSecEncCtxDestroy( pEncCtx ) ;
throw RuntimeException() ;
throw XMLEncryptionException() ;
}
pContent = pCipherValue->children;
if( pContent == NULL ) {
xmlSecEncCtxDestroy( pEncCtx ) ;
throw RuntimeException() ;
throw XMLEncryptionException() ;
}
xmlUnlinkNode(pContent);
......@@ -223,7 +224,7 @@ SAL_CALL XMLEncryption_MSCryptImpl :: encrypt(
//Encrypt the template
if( xmlSecEncCtxXmlEncrypt( pEncCtx , pEncryptedData , pContent ) < 0 ) {
xmlSecEncCtxDestroy( pEncCtx ) ;
throw RuntimeException() ;
throw XMLEncryptionException() ;
}
xmlSecEncCtxDestroy( pEncCtx ) ;
......@@ -275,7 +276,7 @@ XMLEncryption_MSCryptImpl :: decrypt(
//Create Encryption context
pEncCtx = xmlSecEncCtxCreate( pMngr ) ;
if( pEncCtx == NULL )
throw RuntimeException() ;
throw XMLEncryptionException() ;
//Get the encryption template
......@@ -317,7 +318,7 @@ XMLEncryption_MSCryptImpl :: decrypt(
//Decrypt the template
if( xmlSecEncCtxDecrypt( pEncCtx , pEncryptedData ) < 0 || pEncCtx->result == NULL ) {
xmlSecEncCtxDestroy( pEncCtx ) ;
throw RuntimeException() ;
throw XMLEncryptionException() ;
}
/*----------------------------------------
if( pEncCtx->resultReplaced != 0 ) {
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: xmlsignature_mscryptimpl.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-23 03:12:26 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -104,6 +104,7 @@ using ::com::sun::star::xml::crypto::XXMLSignature ;
using ::com::sun::star::xml::crypto::XXMLSignatureTemplate ;
using ::com::sun::star::xml::crypto::XXMLSecurityContext ;
using ::com::sun::star::xml::crypto::XUriBinding ;
using ::com::sun::star::xml::crypto::XMLSignatureException ;
XMLSignature_MSCryptImpl :: XMLSignature_MSCryptImpl( const Reference< XMultiServiceFactory >& aFactory ) : m_xServiceManager( aFactory ) {
}
......@@ -170,7 +171,7 @@ SAL_CALL XMLSignature_MSCryptImpl :: generate(
//Create Signature context
pDsigCtx = xmlSecDSigCtxCreate( pMngr ) ;
if( pDsigCtx == NULL )
throw RuntimeException() ;
throw XMLSignatureException() ;
//Sign the template
if( xmlSecDSigCtxSign( pDsigCtx , pNode ) < 0 ) {
......@@ -180,7 +181,7 @@ SAL_CALL XMLSignature_MSCryptImpl :: generate(
if( xUriBinding.is() )
xmlUnregisterStreamInputCallbacks() ;
throw RuntimeException() ;
throw XMLSignatureException() ;
}
xmlSecDSigCtxDestroy( pDsigCtx ) ;
......@@ -259,7 +260,7 @@ XMLSignature_MSCryptImpl :: validate(
//Create Signature context
pDsigCtx = xmlSecDSigCtxCreate( pMngr ) ;
if( pDsigCtx == NULL )
throw RuntimeException() ;
throw XMLSignatureException() ;
//Verify signature
......@@ -270,7 +271,7 @@ XMLSignature_MSCryptImpl :: validate(
if( xUriBinding.is() )
xmlUnregisterStreamInputCallbacks() ;
throw RuntimeException() ;
throw XMLSignatureException() ;
}
valid = ( pDsigCtx->status == xmlSecDSigStatusSucceeded ) ;
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: xmlencryption_nssimpl.cxx,v $
*
* $Revision: 1.1.1.1 $
* $Revision: 1.2 $
*
* last change: $Author: mt $ $Date: 2004-07-12 13:15:21 $
* last change: $Author: mmi $ $Date: 2004-07-23 03:12:27 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -104,6 +104,7 @@ using ::com::sun::star::xml::crypto::XSecurityEnvironment ;
using ::com::sun::star::xml::crypto::XXMLEncryption ;
using ::com::sun::star::xml::crypto::XXMLEncryptionTemplate ;
using ::com::sun::star::xml::crypto::XXMLSecurityContext ;
using ::com::sun::star::xml::crypto::XMLEncryptionException ;
XMLEncryption_NssImpl :: XMLEncryption_NssImpl( const Reference< XMultiServiceFactory >& aFactory ) : m_xServiceManager( aFactory ) {
}
......@@ -147,7 +148,7 @@ SAL_CALL XMLEncryption_NssImpl :: encrypt(
//Create Encryption context
pEncCtx = xmlSecEncCtxCreate( pMngr ) ;
if( pEncCtx == NULL )
throw RuntimeException() ;
throw XMLEncryptionException() ;
//Get the encryption template
......@@ -182,7 +183,7 @@ SAL_CALL XMLEncryption_NssImpl :: encrypt(
if( pCipherData == NULL ) {
xmlSecEncCtxDestroy( pEncCtx ) ;
throw RuntimeException() ;
throw XMLEncryptionException() ;
}
xmlNodePtr pCipherValue = pCipherData->children;
......@@ -193,7 +194,7 @@ SAL_CALL XMLEncryption_NssImpl :: encrypt(
if( pCipherValue == NULL ) {
xmlSecEncCtxDestroy( pEncCtx ) ;
throw RuntimeException() ;
throw XMLEncryptionException() ;
}
pContent = pCipherValue->children;
......@@ -203,13 +204,13 @@ SAL_CALL XMLEncryption_NssImpl :: encrypt(
Reference< XXMLElementWrapper > xTarget = aTemplate->getTarget() ;
if( !xTarget.is() ) {
xmlSecEncCtxDestroy( pEncCtx ) ;
throw RuntimeException() ;
throw XMLEncryptionException() ;
}
Reference< XUnoTunnel > xTgtTunnel( xTarget , UNO_QUERY ) ;
if( !xTgtTunnel.is() ) {
xmlSecEncCtxDestroy( pEncCtx ) ;
throw RuntimeException() ;
throw XMLEncryptionException() ;
}
XMLElementWrapper_XmlSecImpl* pTarget = ( XMLElementWrapper_XmlSecImpl* )xTgtTunnel->getSomething( XMLElementWrapper_XmlSecImpl::getUnoTunnelImplementationId() ) ;
......@@ -223,7 +224,7 @@ SAL_CALL XMLEncryption_NssImpl :: encrypt(
if( pContent == NULL ) {
xmlSecEncCtxDestroy( pEncCtx ) ;
throw RuntimeException() ;
throw XMLEncryptionException() ;
}
/* MM : remove the following 2 lines
......@@ -249,7 +250,7 @@ SAL_CALL XMLEncryption_NssImpl :: encrypt(
//Encrypt the template
if( xmlSecEncCtxXmlEncrypt( pEncCtx , pEncryptedData , pContent ) < 0 ) {
xmlSecEncCtxDestroy( pEncCtx ) ;
throw RuntimeException() ;
throw XMLEncryptionException() ;
}
xmlSecEncCtxDestroy( pEncCtx ) ;
......@@ -301,7 +302,7 @@ XMLEncryption_NssImpl :: decrypt(
//Create Encryption context
pEncCtx = xmlSecEncCtxCreate( pMngr ) ;
if( pEncCtx == NULL )
throw RuntimeException() ;
throw XMLEncryptionException() ;
//Get the encryption template
......@@ -343,7 +344,7 @@ XMLEncryption_NssImpl :: decrypt(
//Decrypt the template
if( xmlSecEncCtxDecrypt( pEncCtx , pEncryptedData ) < 0 || pEncCtx->result == NULL ) {
xmlSecEncCtxDestroy( pEncCtx ) ;
throw RuntimeException() ;
throw XMLEncryptionException() ;
}
/*----------------------------------------
if( pEncCtx->resultReplaced != 0 ) {
......@@ -363,7 +364,7 @@ XMLEncryption_NssImpl :: decrypt(
pNode->setNativeElement( pContent ) ;
} else {
xmlSecEncCtxDestroy( pEncCtx ) ;
throw RuntimeException() ;
throw XMLEncryptionException() ;
}
----------------------------------------*/
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: xmlsignature_nssimpl.cxx,v $
*
* $Revision: 1.1.1.1 $
* $Revision: 1.2 $
*
* last change: $Author: mt $ $Date: 2004-07-12 13:15:21 $
* last change: $Author: mmi $ $Date: 2004-07-23 03:12:27 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -104,6 +104,7 @@ using ::com::sun::star::xml::crypto::XXMLSignature ;
using ::com::sun::star::xml::crypto::XXMLSignatureTemplate ;
using ::com::sun::star::xml::crypto::XXMLSecurityContext ;
using ::com::sun::star::xml::crypto::XUriBinding ;
using ::com::sun::star::xml::crypto::XMLSignatureException ;
XMLSignature_NssImpl :: XMLSignature_NssImpl( const Reference< XMultiServiceFactory >& aFactory ) : m_xServiceManager( aFactory ) {
}
......@@ -170,7 +171,7 @@ SAL_CALL XMLSignature_NssImpl :: generate(
//Create Signature context
pDsigCtx = xmlSecDSigCtxCreate( pMngr ) ;
if( pDsigCtx == NULL )
throw RuntimeException() ;
throw XMLSignatureException() ;
//Sign the template
if( xmlSecDSigCtxSign( pDsigCtx , pNode ) < 0 ) {
......@@ -180,7 +181,7 @@ SAL_CALL XMLSignature_NssImpl :: generate(
if( xUriBinding.is() )
xmlUnregisterStreamInputCallbacks() ;
throw RuntimeException() ;
throw XMLSignatureException() ;
}
xmlSecDSigCtxDestroy( pDsigCtx ) ;
......@@ -259,7 +260,7 @@ XMLSignature_NssImpl :: validate(
//Create Signature context
pDsigCtx = xmlSecDSigCtxCreate( pMngr ) ;
if( pDsigCtx == NULL )
throw RuntimeException() ;
throw XMLSignatureException() ;
//Verify signature
......@@ -270,7 +271,7 @@ XMLSignature_NssImpl :: validate(
if( xUriBinding.is() )
xmlUnregisterStreamInputCallbacks() ;
throw RuntimeException() ;
throw XMLSignatureException() ;
}
valid = ( pDsigCtx->status == xmlSecDSigStatusSucceeded ) ;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment