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
3155a8e6
Kaydet (Commit)
3155a8e6
authored
May 06, 2013
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
xmlsecurity: drop no longer needed RTL_ASCII_USTRINGPARAM macro
Change-Id: Ia08688ef3c262ba4379213231032c73404ae748b
üst
5aa9cfed
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
62 deletions
+51
-62
xsecctl.hxx
xmlsecurity/source/helper/xsecctl.hxx
+0
-2
xsecparser.cxx
xmlsecurity/source/helper/xsecparser.cxx
+24
-32
xmldocumentwrapper_xmlsecimpl.cxx
xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx
+27
-28
No files found.
xmlsecurity/source/helper/xsecctl.hxx
Dosyayı görüntüle @
3155a8e6
...
...
@@ -108,8 +108,6 @@
#define INITIALIZED 1
#define FAILTOINITIALIZED 2
#define RTL_ASCII_USTRINGPARAM( asciiStr ) asciiStr, strlen( asciiStr ), RTL_TEXTENCODING_ASCII_US
// forward declaration
class
XSecParser
;
...
...
xmlsecurity/source/helper/xsecparser.cxx
Dosyayı görüntüle @
3155a8e6
...
...
@@ -27,8 +27,6 @@
namespace
cssu
=
com
::
sun
::
star
::
uno
;
namespace
cssxs
=
com
::
sun
::
star
::
xml
::
sax
;
#define RTL_ASCII_USTRINGPARAM( asciiStr ) asciiStr, strlen( asciiStr ), RTL_TEXTENCODING_ASCII_US
XSecParser
::
XSecParser
(
XSecController
*
pXSecController
,
const
cssu
::
Reference
<
cssxs
::
XDocumentHandler
>&
xNextHandler
)
...
...
@@ -40,13 +38,11 @@ XSecParser::XSecParser(
OUString
XSecParser
::
getIdAttr
(
const
cssu
::
Reference
<
cssxs
::
XAttributeList
>&
xAttribs
)
{
OUString
ouIdAttr
=
xAttribs
->
getValueByName
(
OUString
(
RTL_ASCII_USTRINGPARAM
(
"id"
)));
OUString
ouIdAttr
=
xAttribs
->
getValueByName
(
OUString
(
"id"
));
if
(
ouIdAttr
==
NULL
)
{
ouIdAttr
=
xAttribs
->
getValueByName
(
OUString
(
RTL_ASCII_USTRINGPARAM
(
"Id"
)));
ouIdAttr
=
xAttribs
->
getValueByName
(
OUString
(
"Id"
));
}
return
ouIdAttr
;
...
...
@@ -93,7 +89,7 @@ void SAL_CALL XSecParser::startElement(
m_pXSecController
->
collectToVerify
(
ouIdAttr
);
}
if
(
aName
==
OUString
(
RTL_ASCII_USTRINGPARAM
(
TAG_SIGNATURE
))
)
if
(
aName
==
TAG_SIGNATURE
)
{
m_pXSecController
->
addSignature
();
if
(
ouIdAttr
!=
NULL
)
...
...
@@ -101,9 +97,9 @@ void SAL_CALL XSecParser::startElement(
m_pXSecController
->
setId
(
ouIdAttr
);
}
}
else
if
(
aName
==
OUString
(
RTL_ASCII_USTRINGPARAM
(
TAG_REFERENCE
))
)
else
if
(
aName
==
TAG_REFERENCE
)
{
OUString
ouUri
=
xAttribs
->
getValueByName
(
OUString
(
RTL_ASCII_USTRINGPARAM
(
ATTR_URI
))
);
OUString
ouUri
=
xAttribs
->
getValueByName
(
ATTR_URI
);
DBG_ASSERT
(
ouUri
!=
NULL
,
"URI == NULL"
);
if
(
ouUri
.
startsWith
(
CHAR_FRAGMENT
))
...
...
@@ -122,13 +118,13 @@ void SAL_CALL XSecParser::startElement(
m_bReferenceUnresolved
=
true
;
}
}
else
if
(
aName
==
OUString
(
RTL_ASCII_USTRINGPARAM
(
TAG_TRANSFORM
))
)
else
if
(
aName
==
TAG_TRANSFORM
)
{
if
(
m_bReferenceUnresolved
)
{
OUString
ouAlgorithm
=
xAttribs
->
getValueByName
(
OUString
(
RTL_ASCII_USTRINGPARAM
(
ATTR_ALGORITHM
))
);
OUString
ouAlgorithm
=
xAttribs
->
getValueByName
(
ATTR_ALGORITHM
);
if
(
ouAlgorithm
!=
NULL
&&
ouAlgorithm
==
OUString
(
RTL_ASCII_USTRINGPARAM
(
ALGO_C14N
))
)
if
(
ouAlgorithm
!=
NULL
&&
ouAlgorithm
==
ALGO_C14N
)
/*
* a xml stream
*/
...
...
@@ -138,41 +134,39 @@ void SAL_CALL XSecParser::startElement(
}
}
}
else
if
(
aName
==
OUString
(
RTL_ASCII_USTRINGPARAM
(
TAG_X509ISSUERNAME
))
)
else
if
(
aName
==
TAG_X509ISSUERNAME
)
{
m_ouX509IssuerName
=
OUString
();
m_bInX509IssuerName
=
true
;
}
else
if
(
aName
==
OUString
(
RTL_ASCII_USTRINGPARAM
(
TAG_X509SERIALNUMBER
))
)
else
if
(
aName
==
TAG_X509SERIALNUMBER
)
{
m_ouX509SerialNumber
=
OUString
();
m_bInX509SerialNumber
=
true
;
}
else
if
(
aName
==
OUString
(
RTL_ASCII_USTRINGPARAM
(
TAG_X509CERTIFICATE
))
)
else
if
(
aName
==
TAG_X509CERTIFICATE
)
{
m_ouX509Certificate
=
OUString
();
m_bInX509Certificate
=
true
;
}
else
if
(
aName
==
OUString
(
RTL_ASCII_USTRINGPARAM
(
TAG_SIGNATUREVALUE
))
)
else
if
(
aName
==
TAG_SIGNATUREVALUE
)
{
m_ouSignatureValue
=
OUString
();
m_bInSignatureValue
=
true
;
}
else
if
(
aName
==
OUString
(
RTL_ASCII_USTRINGPARAM
(
TAG_DIGESTVALUE
))
)
else
if
(
aName
==
TAG_DIGESTVALUE
)
{
m_ouDigestValue
=
OUString
()
;
m_ouDigestValue
=
""
;
m_bInDigestValue
=
true
;
}
else
if
(
aName
==
OUString
(
RTL_ASCII_USTRINGPARAM
(
TAG_SIGNATUREPROPERTY
))
)
else
if
(
aName
==
TAG_SIGNATUREPROPERTY
)
{
if
(
ouIdAttr
!=
NULL
)
{
m_pXSecController
->
setPropertyId
(
ouIdAttr
);
}
}
else
if
(
aName
==
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
NSTAG_DC
))
+
OUString
(
":"
)
+
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
TAG_DATE
)))
else
if
(
aName
==
NSTAG_DC
":"
TAG_DATE
)
{
m_ouDate
=
OUString
();
m_bInDate
=
true
;
...
...
@@ -204,11 +198,11 @@ void SAL_CALL XSecParser::endElement( const OUString& aName )
{
try
{
if
(
aName
==
OUString
(
RTL_ASCII_USTRINGPARAM
(
TAG_DIGESTVALUE
))
)
if
(
aName
==
TAG_DIGESTVALUE
)
{
m_bInDigestValue
=
false
;
}
else
if
(
aName
==
OUString
(
RTL_ASCII_USTRINGPARAM
(
TAG_REFERENCE
))
)
else
if
(
aName
==
TAG_REFERENCE
)
{
if
(
m_bReferenceUnresolved
)
/*
...
...
@@ -221,33 +215,31 @@ void SAL_CALL XSecParser::endElement( const OUString& aName )
m_pXSecController
->
setDigestValue
(
m_ouDigestValue
);
}
else
if
(
aName
==
OUString
(
RTL_ASCII_USTRINGPARAM
(
TAG_SIGNEDINFO
))
)
else
if
(
aName
==
TAG_SIGNEDINFO
)
{
m_pXSecController
->
setReferenceCount
();
}
else
if
(
aName
==
OUString
(
RTL_ASCII_USTRINGPARAM
(
TAG_SIGNATUREVALUE
))
)
else
if
(
aName
==
TAG_SIGNATUREVALUE
)
{
m_pXSecController
->
setSignatureValue
(
m_ouSignatureValue
);
m_bInSignatureValue
=
false
;
}
else
if
(
aName
==
OUString
(
RTL_ASCII_USTRINGPARAM
(
TAG_X509ISSUERNAME
))
)
else
if
(
aName
==
TAG_X509ISSUERNAME
)
{
m_pXSecController
->
setX509IssuerName
(
m_ouX509IssuerName
);
m_bInX509IssuerName
=
false
;
}
else
if
(
aName
==
OUString
(
RTL_ASCII_USTRINGPARAM
(
TAG_X509SERIALNUMBER
))
)
else
if
(
aName
==
TAG_X509SERIALNUMBER
)
{
m_pXSecController
->
setX509SerialNumber
(
m_ouX509SerialNumber
);
m_bInX509SerialNumber
=
false
;
}
else
if
(
aName
==
OUString
(
RTL_ASCII_USTRINGPARAM
(
TAG_X509CERTIFICATE
))
)
else
if
(
aName
==
TAG_X509CERTIFICATE
)
{
m_pXSecController
->
setX509Certificate
(
m_ouX509Certificate
);
m_bInX509Certificate
=
false
;
}
else
if
(
aName
==
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
NSTAG_DC
))
+
OUString
(
":"
)
+
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
TAG_DATE
)))
else
if
(
aName
==
NSTAG_DC
":"
TAG_DATE
)
{
m_pXSecController
->
setDate
(
m_ouDate
);
m_bInDate
=
false
;
...
...
xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx
Dosyayı görüntüle @
3155a8e6
...
...
@@ -48,8 +48,7 @@ namespace cssxw = com::sun::star::xml::wrapper;
#define STRXMLNS "xmlns"
#define RTL_ASCII_USTRINGPARAM( asciiStr ) asciiStr, strlen( asciiStr ), RTL_TEXTENCODING_ASCII_US
#define RTL_UTF8_USTRINGPARAM( asciiStr ) asciiStr, strlen( asciiStr ), RTL_TEXTENCODING_UTF8
#define C2U( asciiStr ) asciiStr, strlen( asciiStr ), RTL_TEXTENCODING_UTF8
/* used by the recursiveDelete method */
#define NODE_REMOVED 0
...
...
@@ -64,7 +63,7 @@ XMLDocumentWrapper_XmlSecImpl::XMLDocumentWrapper_XmlSecImpl( )
/*
* creates the virtual root element
*/
saxHelper
.
startElement
(
OUString
(
RTL_UTF8_USTRINGPARAM
(
"root"
)),
cssu
::
Sequence
<
cssxcsax
::
XMLAttribute
>
());
saxHelper
.
startElement
(
OUString
(
C2U
(
"root"
)),
cssu
::
Sequence
<
cssxcsax
::
XMLAttribute
>
());
m_pRootElement
=
saxHelper
.
getCurrentNode
();
m_pCurrentElement
=
m_pRootElement
;
...
...
@@ -221,16 +220,16 @@ void XMLDocumentWrapper_XmlSecImpl::sendStartElement(
if
(
pNsDef
->
prefix
==
NULL
)
{
pAttributeList
->
AddAttribute
(
OUString
(
RTL_UTF8_USTRINGPARAM
(
STRXMLNS
)),
OUString
(
RTL_UTF8_USTRINGPARAM
(
(
sal_Char
*
)
pNsHref
)));
OUString
(
C2U
(
STRXMLNS
)),
OUString
(
C2U
(
(
sal_Char
*
)
pNsHref
)));
}
else
{
pAttributeList
->
AddAttribute
(
OUString
(
RTL_UTF8_USTRINGPARAM
(
STRXMLNS
))
+
OUString
(
RTL_UTF8_USTRINGPARAM
(
":"
))
+
OUString
(
RTL_UTF8_USTRINGPARAM
(
(
sal_Char
*
)
pNsPrefix
)),
OUString
(
RTL_UTF8_USTRINGPARAM
(
(
sal_Char
*
)
pNsHref
)));
OUString
(
C2U
(
STRXMLNS
))
+
OUString
(
C2U
(
":"
))
+
OUString
(
C2U
(
(
sal_Char
*
)
pNsPrefix
)),
OUString
(
C2U
(
(
sal_Char
*
)
pNsHref
)));
}
pNsDef
=
pNsDef
->
next
;
...
...
@@ -246,18 +245,18 @@ void XMLDocumentWrapper_XmlSecImpl::sendStartElement(
OUString
ouAttrName
;
if
(
pAttrNs
==
NULL
)
{
ouAttrName
=
OUString
(
RTL_UTF8_USTRINGPARAM
(
(
sal_Char
*
)
pAttrName
));
ouAttrName
=
OUString
(
C2U
(
(
sal_Char
*
)
pAttrName
));
}
else
{
ouAttrName
=
OUString
(
RTL_UTF8_USTRINGPARAM
(
(
sal_Char
*
)
pAttrNs
->
prefix
))
+
OUString
(
RTL_UTF8_USTRINGPARAM
(
(
sal_Char
*
)
":"
))
+
OUString
(
RTL_UTF8_USTRINGPARAM
(
(
sal_Char
*
)
pAttrName
));
ouAttrName
=
OUString
(
C2U
(
(
sal_Char
*
)
pAttrNs
->
prefix
))
+
OUString
(
C2U
(
(
sal_Char
*
)
":"
))
+
OUString
(
C2U
(
(
sal_Char
*
)
pAttrName
));
}
pAttributeList
->
AddAttribute
(
ouAttrName
,
OUString
(
RTL_UTF8_USTRINGPARAM
(
(
sal_Char
*
)(
pAttr
->
children
->
content
))));
OUString
(
C2U
(
(
sal_Char
*
)(
pAttr
->
children
->
content
))));
pAttr
=
pAttr
->
next
;
}
...
...
@@ -266,12 +265,12 @@ void XMLDocumentWrapper_XmlSecImpl::sendStartElement(
if
(
xHandler
.
is
())
{
xHandler
->
startElement
(
OUString
(
RTL_UTF8_USTRINGPARAM
(
((
sal_Char
*
)(
sNodeName
.
getStr
()))
)),
OUString
(
C2U
(
((
sal_Char
*
)(
sNodeName
.
getStr
()))
)),
xAttrList
);
}
xHandler2
->
startElement
(
OUString
(
RTL_UTF8_USTRINGPARAM
(
((
sal_Char
*
)(
sNodeName
.
getStr
()))
)),
OUString
(
C2U
(
((
sal_Char
*
)(
sNodeName
.
getStr
()))
)),
xAttrList
);
}
...
...
@@ -313,10 +312,10 @@ void XMLDocumentWrapper_XmlSecImpl::sendEndElement(
if
(
xHandler
.
is
())
{
xHandler
->
endElement
(
OUString
(
RTL_UTF8_USTRINGPARAM
(
((
sal_Char
*
)(
sNodeName
.
getStr
()))
)));
xHandler
->
endElement
(
OUString
(
C2U
(
((
sal_Char
*
)(
sNodeName
.
getStr
()))
)));
}
xHandler2
->
endElement
(
OUString
(
RTL_UTF8_USTRINGPARAM
(
((
sal_Char
*
)(
sNodeName
.
getStr
()))
)));
xHandler2
->
endElement
(
OUString
(
C2U
(
((
sal_Char
*
)(
sNodeName
.
getStr
()))
)));
}
void
XMLDocumentWrapper_XmlSecImpl
::
sendNode
(
...
...
@@ -363,23 +362,23 @@ void XMLDocumentWrapper_XmlSecImpl::sendNode(
{
if
(
xHandler
.
is
())
{
xHandler
->
characters
(
OUString
(
RTL_UTF8_USTRINGPARAM
(
((
sal_Char
*
)(
pNode
->
content
))
)));
xHandler
->
characters
(
OUString
(
C2U
(
((
sal_Char
*
)(
pNode
->
content
))
)));
}
xHandler2
->
characters
(
OUString
(
RTL_UTF8_USTRINGPARAM
(
((
sal_Char
*
)(
pNode
->
content
))
)));
xHandler2
->
characters
(
OUString
(
C2U
(
((
sal_Char
*
)(
pNode
->
content
))
)));
}
else
if
(
type
==
XML_PI_NODE
)
{
if
(
xHandler
.
is
())
{
xHandler
->
processingInstruction
(
OUString
(
RTL_UTF8_USTRINGPARAM
(
((
sal_Char
*
)(
pNode
->
name
))
)),
OUString
(
RTL_UTF8_USTRINGPARAM
(
((
sal_Char
*
)(
pNode
->
content
))
)));
OUString
(
C2U
(
((
sal_Char
*
)(
pNode
->
name
))
)),
OUString
(
C2U
(
((
sal_Char
*
)(
pNode
->
content
))
)));
}
xHandler2
->
processingInstruction
(
OUString
(
RTL_UTF8_USTRINGPARAM
(
((
sal_Char
*
)(
pNode
->
name
))
)),
OUString
(
RTL_UTF8_USTRINGPARAM
(
((
sal_Char
*
)(
pNode
->
content
))
)));
OUString
(
C2U
(
((
sal_Char
*
)(
pNode
->
name
))
)),
OUString
(
C2U
(
((
sal_Char
*
)(
pNode
->
content
))
)));
}
}
...
...
@@ -745,7 +744,7 @@ void SAL_CALL XMLDocumentWrapper_XmlSecImpl::removeCurrentElement( )
*/
saxHelper
.
endElement
(
OUString
(
RTL_UTF8_USTRINGPARAM
(
C2U
(
(
sal_Char
*
)(
pOldCurrentElement
->
name
)
)));
m_pCurrentElement
=
saxHelper
.
getCurrentNode
();
...
...
@@ -780,7 +779,7 @@ OUString SAL_CALL XMLDocumentWrapper_XmlSecImpl::getNodeName( const cssu::Refere
throw
(
cssu
::
RuntimeException
)
{
xmlNodePtr
pNode
=
checkElement
(
node
);
return
OUString
(
RTL_UTF8_USTRINGPARAM
(
(
sal_Char
*
)
pNode
->
name
));
return
OUString
(
C2U
(
(
sal_Char
*
)
pNode
->
name
));
}
void
SAL_CALL
XMLDocumentWrapper_XmlSecImpl
::
clearUselessData
(
...
...
@@ -1055,7 +1054,7 @@ void SAL_CALL XMLDocumentWrapper_XmlSecImpl::_setDocumentLocator( sal_Int32 /*co
OUString
XMLDocumentWrapper_XmlSecImpl_getImplementationName
()
throw
(
cssu
::
RuntimeException
)
{
return
OUString
(
RTL_ASCII_USTRINGPARAM
(
IMPLEMENTATION_NAME
)
);
return
OUString
(
IMPLEMENTATION_NAME
);
}
sal_Bool
SAL_CALL
XMLDocumentWrapper_XmlSecImpl_supportsService
(
const
OUString
&
ServiceName
)
...
...
@@ -1069,7 +1068,7 @@ cssu::Sequence< OUString > SAL_CALL XMLDocumentWrapper_XmlSecImpl_getSupportedSe
{
cssu
::
Sequence
<
OUString
>
aRet
(
1
);
OUString
*
pArray
=
aRet
.
getArray
();
pArray
[
0
]
=
OUString
(
RTL_ASCII_USTRINGPARAM
(
SERVICE_NAME
)
);
pArray
[
0
]
=
OUString
(
SERVICE_NAME
);
return
aRet
;
}
#undef SERVICE_NAME
...
...
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