Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
e62ba5bb
Kaydet (Commit)
e62ba5bb
authored
Ock 13, 2016
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
xmlsecurity: don't assume the signature is always a single stream
Change-Id: I07ce23d698fea9338a85b086a5a3c3418e8c8290
üst
faf636b0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
2 deletions
+34
-2
documentsignaturehelper.hxx
xmlsecurity/inc/xmlsecurity/documentsignaturehelper.hxx
+7
-0
xmlsignaturehelper.hxx
xmlsecurity/inc/xmlsecurity/xmlsignaturehelper.hxx
+3
-0
documentdigitalsignatures.cxx
xmlsecurity/source/component/documentdigitalsignatures.cxx
+6
-2
documentsignaturehelper.cxx
xmlsecurity/source/helper/documentsignaturehelper.cxx
+13
-0
xmlsignaturehelper.cxx
xmlsecurity/source/helper/xmlsignaturehelper.cxx
+5
-0
No files found.
xmlsecurity/inc/xmlsecurity/documentsignaturehelper.hxx
Dosyayı görüntüle @
e62ba5bb
...
...
@@ -60,6 +60,13 @@ struct SignatureStreamHelper
{
css
::
uno
::
Reference
<
css
::
embed
::
XStorage
>
xSignatureStorage
;
css
::
uno
::
Reference
<
css
::
io
::
XStream
>
xSignatureStream
;
/// If this is embed::StorageFormats::OFOPXML, then it's expected that xSignatureStream is an empty reference.
sal_Int32
nStorageFormat
;
SignatureStreamHelper
()
:
nStorageFormat
(
0
)
{
}
};
...
...
xmlsecurity/inc/xmlsecurity/xmlsignaturehelper.hxx
Dosyayı görüntüle @
e62ba5bb
...
...
@@ -177,6 +177,9 @@ public:
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
xml
::
sax
::
XWriter
>
CreateDocumentHandlerWithHeader
(
const
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
io
::
XOutputStream
>&
xOutputStream
);
static
void
CloseDocumentHandler
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
xml
::
sax
::
XDocumentHandler
>&
xDocumentHandler
);
static
void
ExportSignature
(
const
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
xml
::
sax
::
XDocumentHandler
>&
xDocumentHandler
,
const
SignatureInformation
&
signatureInfo
);
/// Read and verify an OOXML signature.
bool
ReadAndVerifySignatureStorage
(
const
css
::
uno
::
Reference
<
css
::
embed
::
XStorage
>&
xStorage
);
};
#endif // INCLUDED_XMLSECURITY_INC_XMLSECURITY_XMLSIGNATUREHELPER_HXX
...
...
xmlsecurity/source/component/documentdigitalsignatures.cxx
Dosyayı görüntüle @
e62ba5bb
...
...
@@ -29,6 +29,7 @@
#include <../dialogs/resourcemanager.hxx>
#include <com/sun/star/embed/XStorage.hpp>
#include <com/sun/star/embed/StorageFormats.hpp>
#include <com/sun/star/embed/XTransactedObject.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/ucb/XContent.hpp>
...
...
@@ -272,7 +273,7 @@ DocumentDigitalSignatures::ImplVerifySignatures(
xInputStream
.
set
(
aStreamHelper
.
xSignatureStream
,
UNO_QUERY
);
}
if
(
!
xInputStream
.
is
()
)
if
(
!
xInputStream
.
is
()
&&
aStreamHelper
.
nStorageFormat
!=
embed
::
StorageFormats
::
OFOPXML
)
return
Sequence
<
::
com
::
sun
::
star
::
security
::
DocumentSignatureInformation
>
(
0
);
...
...
@@ -289,7 +290,10 @@ DocumentDigitalSignatures::ImplVerifySignatures(
aSignatureHelper
.
StartMission
();
aSignatureHelper
.
ReadAndVerifySignature
(
xInputStream
);
if
(
xInputStream
.
is
())
aSignatureHelper
.
ReadAndVerifySignature
(
xInputStream
);
else
if
(
aStreamHelper
.
nStorageFormat
==
embed
::
StorageFormats
::
OFOPXML
)
aSignatureHelper
.
ReadAndVerifySignatureStorage
(
aStreamHelper
.
xSignatureStorage
);
aSignatureHelper
.
EndMission
();
...
...
xmlsecurity/source/helper/documentsignaturehelper.cxx
Dosyayı görüntüle @
e62ba5bb
...
...
@@ -24,6 +24,7 @@
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/embed/XStorage.hpp>
#include <com/sun/star/embed/StorageFormats.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
...
...
@@ -330,6 +331,18 @@ SignatureStreamHelper DocumentSignatureHelper::OpenSignatureStream(
DBG_ASSERT
(
nOpenMode
==
css
::
embed
::
ElementModes
::
READ
,
"Error creating signature stream..."
);
}
}
else
if
(
xNameAccess
->
hasByName
(
"_xmlsignatures"
))
{
try
{
aHelper
.
xSignatureStorage
=
rxStore
->
openStorageElement
(
"_xmlsignatures"
,
nSubStorageOpenMode
);
aHelper
.
nStorageFormat
=
embed
::
StorageFormats
::
OFOPXML
;
}
catch
(
const
io
::
IOException
&
rException
)
{
SAL_WARN
(
"xmlsecurity.helper"
,
"DocumentSignatureHelper::OpenSignatureStream: "
<<
rException
.
Message
);
}
}
return
aHelper
;
}
...
...
xmlsecurity/source/helper/xmlsignaturehelper.cxx
Dosyayı görüntüle @
e62ba5bb
...
...
@@ -301,6 +301,11 @@ bool XMLSignatureHelper::ReadAndVerifySignature( const com::sun::star::uno::Refe
return
!
mbError
;
}
bool
XMLSignatureHelper
::
ReadAndVerifySignatureStorage
(
const
css
::
uno
::
Reference
<
css
::
embed
::
XStorage
>&
/*xStorage*/
)
{
return
true
;
}
SignatureInformation
XMLSignatureHelper
::
GetSignatureInformation
(
sal_Int32
nSecurityId
)
const
{
return
mpXSecController
->
getSignatureInformation
(
nSecurityId
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment