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
64b49f20
Kaydet (Commit)
64b49f20
authored
Ock 13, 2016
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
xmlsecurity: read OOXML signature relations
Change-Id: I9d2f6e6285e3db6c72d298a7d0b4ebb321936506
üst
e62ba5bb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
5 deletions
+37
-5
xmlsignaturehelper.cxx
xmlsecurity/source/helper/xmlsignaturehelper.cxx
+37
-5
No files found.
xmlsecurity/source/helper/xmlsignaturehelper.cxx
Dosyayı görüntüle @
64b49f20
...
@@ -35,12 +35,17 @@
...
@@ -35,12 +35,17 @@
#include <com/sun/star/io/XActiveDataSource.hpp>
#include <com/sun/star/io/XActiveDataSource.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/StringPair.hpp>
#include <com/sun/star/xml/sax/Parser.hpp>
#include <com/sun/star/xml/sax/Parser.hpp>
#include <com/sun/star/xml/sax/Writer.hpp>
#include <com/sun/star/xml/sax/Writer.hpp>
#include <com/sun/star/xml/crypto/SEInitializer.hpp>
#include <com/sun/star/xml/crypto/SEInitializer.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/embed/XStorage.hpp>
#include <tools/date.hxx>
#include <tools/date.hxx>
#include <tools/time.hxx>
#include <tools/time.hxx>
#include <comphelper/ofopxmlhelper.hxx>
#include <comphelper/sequence.hxx>
#define TAG_DOCUMENTSIGNATURES "document-signatures"
#define TAG_DOCUMENTSIGNATURES "document-signatures"
#define NS_DOCUMENTSIGNATURES "http://openoffice.org/2004/documentsignatures"
#define NS_DOCUMENTSIGNATURES "http://openoffice.org/2004/documentsignatures"
...
@@ -301,11 +306,6 @@ bool XMLSignatureHelper::ReadAndVerifySignature( const com::sun::star::uno::Refe
...
@@ -301,11 +306,6 @@ bool XMLSignatureHelper::ReadAndVerifySignature( const com::sun::star::uno::Refe
return
!
mbError
;
return
!
mbError
;
}
}
bool
XMLSignatureHelper
::
ReadAndVerifySignatureStorage
(
const
css
::
uno
::
Reference
<
css
::
embed
::
XStorage
>&
/*xStorage*/
)
{
return
true
;
}
SignatureInformation
XMLSignatureHelper
::
GetSignatureInformation
(
sal_Int32
nSecurityId
)
const
SignatureInformation
XMLSignatureHelper
::
GetSignatureInformation
(
sal_Int32
nSecurityId
)
const
{
{
return
mpXSecController
->
getSignatureInformation
(
nSecurityId
);
return
mpXSecController
->
getSignatureInformation
(
nSecurityId
);
...
@@ -344,4 +344,36 @@ IMPL_LINK_NOARG_TYPED( XMLSignatureHelper, StartVerifySignatureElement, LinkPara
...
@@ -344,4 +344,36 @@ IMPL_LINK_NOARG_TYPED( XMLSignatureHelper, StartVerifySignatureElement, LinkPara
}
}
}
}
namespace
{
bool
lcl_isSignatureType
(
const
beans
::
StringPair
&
rPair
)
{
return
rPair
.
First
==
"Type"
&&
rPair
.
Second
==
"http://schemas.openxmlformats.org/package/2006/relationships/digital-signature/signature"
;
}
}
bool
XMLSignatureHelper
::
ReadAndVerifySignatureStorage
(
const
uno
::
Reference
<
embed
::
XStorage
>&
xStorage
)
{
sal_Int32
nOpenMode
=
embed
::
ElementModes
::
READ
;
uno
::
Reference
<
embed
::
XStorage
>
xSubStorage
=
xStorage
->
openStorageElement
(
"_rels"
,
nOpenMode
);
uno
::
Reference
<
io
::
XInputStream
>
xRelStream
(
xSubStorage
->
openStreamElement
(
"origin.sigs.rels"
,
nOpenMode
),
uno
::
UNO_QUERY
);
uno
::
Sequence
<
uno
::
Sequence
<
beans
::
StringPair
>
>
aRelationsInfo
;
aRelationsInfo
=
comphelper
::
OFOPXMLHelper
::
ReadRelationsInfoSequence
(
xRelStream
,
"origin.sigs.rels"
,
mxCtx
);
for
(
const
uno
::
Sequence
<
beans
::
StringPair
>&
rRelation
:
aRelationsInfo
)
{
auto
aRelation
=
comphelper
::
sequenceToContainer
<
std
::
vector
<
beans
::
StringPair
>
>
(
rRelation
);
if
(
std
::
find_if
(
aRelation
.
begin
(),
aRelation
.
end
(),
lcl_isSignatureType
)
!=
aRelation
.
end
())
{
std
::
vector
<
beans
::
StringPair
>::
iterator
it
=
std
::
find_if
(
aRelation
.
begin
(),
aRelation
.
end
(),
[](
const
beans
::
StringPair
&
rPair
)
{
return
rPair
.
First
==
"Target"
;
});
if
(
it
!=
aRelation
.
end
())
{
// TODO now handle it->Second
}
}
}
return
true
;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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