diff options
author | RĂ¼diger Timm <rt@openoffice.org> | 2005-11-11 08:21:18 +0000 |
---|---|---|
committer | RĂ¼diger Timm <rt@openoffice.org> | 2005-11-11 08:21:18 +0000 |
commit | b8bcfeaac04c635074e72684465206e0d8f87308 (patch) | |
tree | 3c23fc31a2577db0bc7b6b6fd8bea43d4eb88146 /xmlsecurity | |
parent | ce32648a698305d1f3ce70e9ff1e947f59ab1620 (diff) |
INTEGRATION: CWS xmlsec13 (1.4.28); FILE MERGED
2005/10/31 13:44:06 jl 1.4.28.2: RESYNC: (1.4-1.5); FILE MERGED
2005/10/25 10:59:34 jl 1.4.28.1: #i54495 errorhandling for verification and signing fixed
Diffstat (limited to 'xmlsecurity')
-rw-r--r-- | xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx | 46 |
1 files changed, 28 insertions, 18 deletions
diff --git a/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx index 998d3805136c..54a2ed5e783b 100644 --- a/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx @@ -4,9 +4,9 @@ * * $RCSfile: xmlsignature_nssimpl.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: rt $ $Date: 2005-09-09 17:36:20 $ + * last change: $Author: rt $ $Date: 2005-11-11 09:21:18 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -155,7 +155,7 @@ SAL_CALL XMLSignature_NssImpl :: generate( if( pSecEnv == NULL ) throw RuntimeException() ; - setErrorRecorder( aTemplate ); + setErrorRecorder(); pMngr = pSecEnv->createKeysManager() ; //i39448 if( !pMngr ) { @@ -173,19 +173,19 @@ SAL_CALL XMLSignature_NssImpl :: generate( } //Sign the template - if( xmlSecDSigCtxSign( pDsigCtx , pNode ) < 0 ) { - xmlSecDSigCtxDestroy( pDsigCtx ) ; - pSecEnv->destroyKeysManager( pMngr ) ; //i39448 - - //Unregistered the stream/URI binding - if( xUriBinding.is() ) - xmlUnregisterStreamInputCallbacks() ; - - //throw XMLSignatureException() ; - clearErrorRecorder(); - return aTemplate; + if( xmlSecDSigCtxSign( pDsigCtx , pNode ) == 0 ) + { + if (pDsigCtx->status == xmlSecDSigStatusSucceeded) + aTemplate->setStatus(com::sun::star::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED); + else + aTemplate->setStatus(com::sun::star::xml::crypto::SecurityOperationStatus_UNKNOWN); + } + else + { + aTemplate->setStatus(com::sun::star::xml::crypto::SecurityOperationStatus_UNKNOWN); } + xmlSecDSigCtxDestroy( pDsigCtx ) ; pSecEnv->destroyKeysManager( pMngr ) ; //i39448 @@ -240,7 +240,7 @@ SAL_CALL XMLSignature_NssImpl :: validate( throw RuntimeException() ; } - setErrorRecorder( aTemplate ); + setErrorRecorder(); sal_Int32 nSecurityEnvironment = aSecurityCtx->getSecurityEnvironmentNumber(); sal_Int32 i; @@ -277,15 +277,25 @@ SAL_CALL XMLSignature_NssImpl :: validate( //Verify signature int rs = xmlSecDSigCtxVerify( pDsigCtx , pNode ); - xmlSecDSigCtxDestroy( pDsigCtx ) ; - pSecEnv->destroyKeysManager( pMngr ) ; //i39448 - if (rs >= 0) + if (rs == 0 && + pDsigCtx->status == xmlSecDSigStatusSucceeded) { + aTemplate->setStatus(com::sun::star::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED); + xmlSecDSigCtxDestroy( pDsigCtx ) ; + pSecEnv->destroyKeysManager( pMngr ); break; } + else + { + aTemplate->setStatus(com::sun::star::xml::crypto::SecurityOperationStatus_UNKNOWN); + } + xmlSecDSigCtxDestroy( pDsigCtx ) ; + pSecEnv->destroyKeysManager( pMngr ); } + + //Unregistered the stream/URI binding if( xUriBinding.is() ) xmlUnregisterStreamInputCallbacks() ; |