diff options
author | RĂ¼diger Timm <rt@openoffice.org> | 2004-11-26 13:54:08 +0000 |
---|---|---|
committer | RĂ¼diger Timm <rt@openoffice.org> | 2004-11-26 13:54:08 +0000 |
commit | db3026d390799cf2134e152ad04976c8b1c4a654 (patch) | |
tree | 219dce66ba20b7ff1220c86add36f4af0ce97b79 | |
parent | a7598f88da16cba3b8685055a1e2e8f7a149ed97 (diff) |
INTEGRATION: CWS xmlsec06 (1.1.1.1.2); FILE MERGED
2004/10/12 08:30:48 mmi 1.1.1.1.2.1: add error detail information
Issue number:
Submitted by:
Reviewed by:
-rw-r--r-- | xmlsecurity/source/framework/decryptorimpl.cxx | 21 | ||||
-rw-r--r-- | xmlsecurity/source/framework/encryptorimpl.cxx | 17 | ||||
-rw-r--r-- | xmlsecurity/source/framework/securityengine.cxx | 6 | ||||
-rw-r--r-- | xmlsecurity/source/framework/securityengine.hxx | 9 |
4 files changed, 24 insertions, 29 deletions
diff --git a/xmlsecurity/source/framework/decryptorimpl.cxx b/xmlsecurity/source/framework/decryptorimpl.cxx index f2d863ecc..0acf7bb6f 100644 --- a/xmlsecurity/source/framework/decryptorimpl.cxx +++ b/xmlsecurity/source/framework/decryptorimpl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: decryptorimpl.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: mt $ $Date: 2004-07-12 13:15:22 $ + * last change: $Author: rt $ $Date: 2004-11-26 14:53:28 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -156,10 +156,7 @@ void DecryptorImpl::notifyResultListener() const cssu::Reference< cssxc::sax::XDecryptionResultListener > xDecryptionResultListener ( m_xResultListener , cssu::UNO_QUERY ) ; - xDecryptionResultListener->decrypted( - m_nSecurityId, - m_bOperationSucceed?(cssxc::sax::DecryptionResult_DECRYPTIONSUCCEED): - (cssxc::sax::DecryptionResult_DECRYPTIONFAIL)); + xDecryptionResultListener->decrypted(m_nSecurityId,m_nStatus); } void DecryptorImpl::startEngine( const cssu::Reference< @@ -193,20 +190,22 @@ void DecryptorImpl::startEngine( const cssu::Reference< * Email: michael.mi@sun.com ******************************************************************************/ { - cssu::Reference< cssxw::XXMLElementWrapper > xDecryptedElement; + cssu::Reference< cssxc::XXMLEncryptionTemplate > xResultTemplate; try { - xDecryptedElement = m_xXMLEncryption->decrypt(xEncryptionTemplate, m_xXMLSecurityContext); + xResultTemplate = m_xXMLEncryption->decrypt(xEncryptionTemplate, m_xXMLSecurityContext); + m_nStatus = xResultTemplate->getStatus(); } catch( cssu::Exception& ) { - xDecryptedElement = NULL; + m_nStatus = cssxc::SecurityOperationStatus_RUNTIMEERROR_FAILED; } - if (xDecryptedElement.is()) + if (m_nStatus == cssxc::SecurityOperationStatus_OPERATION_SUCCEEDED) { + cssu::Reference< cssxw::XXMLElementWrapper > xDecryptedElement + = xResultTemplate->getTemplate(); m_xSAXEventKeeper->setElement(m_nIdOfTemplateEC, xDecryptedElement); - m_bOperationSucceed = true; } } diff --git a/xmlsecurity/source/framework/encryptorimpl.cxx b/xmlsecurity/source/framework/encryptorimpl.cxx index d8643a07d..975aa9242 100644 --- a/xmlsecurity/source/framework/encryptorimpl.cxx +++ b/xmlsecurity/source/framework/encryptorimpl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: encryptorimpl.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: mt $ $Date: 2004-07-12 13:15:22 $ + * last change: $Author: rt $ $Date: 2004-11-26 14:53:41 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -166,10 +166,7 @@ void EncryptorImpl::notifyResultListener() const cssu::Reference< cssxc::sax::XEncryptionResultListener > xEncryptionResultListener ( m_xResultListener , cssu::UNO_QUERY ) ; - xEncryptionResultListener->encrypted( - m_nSecurityId, - m_bOperationSucceed?(cssxc::sax::EncryptionResult_ENCRYPTIONSUCCEED): - (cssxc::sax::EncryptionResult_ENCRYPTIONFAIL)); + xEncryptionResultListener->encrypted( m_nSecurityId, m_nStatus ); } void EncryptorImpl::startEngine( const cssu::Reference< @@ -213,21 +210,19 @@ void EncryptorImpl::startEngine( const cssu::Reference< { xResultTemplate = m_xXMLEncryption->encrypt( xEncryptionTemplate, m_xXMLSecurityContext); + m_nStatus = xResultTemplate->getStatus(); } catch( cssu::Exception& ) { - xResultTemplate = NULL; + m_nStatus = cssxc::SecurityOperationStatus_RUNTIMEERROR_FAILED; } - if (xResultTemplate.is()) + if (m_nStatus == cssxc::SecurityOperationStatus_OPERATION_SUCCEEDED) { cssu::Reference < cssxw::XXMLElementWrapper > xResultEncryption = xResultTemplate->getTemplate(); m_xSAXEventKeeper->setElement(m_nIdOfTemplateEC, xResultEncryption); - m_xSAXEventKeeper->setElement(m_nReferenceId, NULL); - - m_bOperationSucceed = true; } } diff --git a/xmlsecurity/source/framework/securityengine.cxx b/xmlsecurity/source/framework/securityengine.cxx index 5980bea47..c3fa265ca 100644 --- a/xmlsecurity/source/framework/securityengine.cxx +++ b/xmlsecurity/source/framework/securityengine.cxx @@ -2,9 +2,9 @@ * * $RCSfile: securityengine.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: mt $ $Date: 2004-07-12 13:15:23 $ + * last change: $Author: rt $ $Date: 2004-11-26 14:53:55 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -80,7 +80,7 @@ SecurityEngine::SecurityEngine( const cssu::Reference< cssl::XMultiServiceFactor m_nNumOfResolvedReferences(0), m_bMissionDone(false), m_nSecurityId(-1), - m_bOperationSucceed(false) + m_nStatus(::com::sun::star::xml::crypto::SecurityOperationStatus_STATUS_UNKNOWN) { } diff --git a/xmlsecurity/source/framework/securityengine.hxx b/xmlsecurity/source/framework/securityengine.hxx index f0de3b2b2..0de04b0b3 100644 --- a/xmlsecurity/source/framework/securityengine.hxx +++ b/xmlsecurity/source/framework/securityengine.hxx @@ -2,9 +2,9 @@ * * $RCSfile: securityengine.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: mt $ $Date: 2004-07-12 13:15:23 $ + * last change: $Author: rt $ $Date: 2004-11-26 14:54:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -160,9 +160,10 @@ protected: sal_Int32 m_nSecurityId; /* - * the result of the operation + * the status of the operation */ - bool m_bOperationSucceed; + //bool m_bOperationSucceed; + com::sun::star::xml::crypto::SecurityOperationStatus m_nStatus; /* * the result listener, which will receives the security operation result. |