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
f6572fa9
Kaydet (Commit)
f6572fa9
authored
Ock 19, 2017
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
tweak to avoid coverity#1371169 Missing move assignment operator
Change-Id: I0d29ce18c19c26a7526dad98d77db4670d0c5303
üst
0415cb33
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
33 deletions
+39
-33
iahndl-ssl.cxx
uui/source/iahndl-ssl.cxx
+15
-8
sanextension_nssimpl.cxx
xmlsecurity/source/xmlsec/nss/sanextension_nssimpl.cxx
+22
-24
sanextension_nssimpl.hxx
xmlsecurity/source/xmlsec/nss/sanextension_nssimpl.hxx
+2
-1
No files found.
uui/source/iahndl-ssl.cxx
Dosyayı görüntüle @
f6572fa9
...
...
@@ -28,6 +28,7 @@
#include <com/sun/star/ucb/CertificateValidationRequest.hpp>
#include <com/sun/star/uno/Reference.hxx>
#include <comphelper/sequence.hxx>
#include <osl/mutex.hxx>
#include <com/sun/star/uno/Sequence.hxx>
#include <svl/zforlist.hxx>
...
...
@@ -272,27 +273,33 @@ handleCertificateValidationRequest_(
}
uno
::
Sequence
<
uno
::
Reference
<
security
::
XCertificateExtension
>
>
extensions
=
rRequest
.
Certificate
->
getExtensions
();
uno
::
Sequence
<
security
::
CertAltNameEntry
>
altNames
;
for
(
sal_Int32
i
=
0
;
i
<
extensions
.
getLength
();
i
++
){
uno
::
Reference
<
security
::
XSanExtension
>
sanExtension
;
for
(
sal_Int32
i
=
0
;
i
<
extensions
.
getLength
();
++
i
)
{
uno
::
Reference
<
security
::
XCertificateExtension
>
element
=
extensions
[
i
];
OString
aId
(
reinterpret_cast
<
const
char
*>
(
element
->
getExtensionId
().
getConstArray
()),
element
->
getExtensionId
().
getLength
());
if
(
aId
.
equals
(
OID_SUBJECT_ALTERNATIVE_NAME
))
{
uno
::
Reference
<
security
::
XSanExtension
>
sanExtension
(
element
,
uno
::
UNO_QUERY
);
altNames
=
sanExtension
->
getAlternativeNames
();
sanExtension
=
uno
::
Reference
<
security
::
XSanExtension
>
(
element
,
uno
::
UNO_QUERY
);
break
;
}
}
std
::
vector
<
security
::
CertAltNameEntry
>
altNames
;
if
(
sanExtension
.
is
())
{
altNames
=
comphelper
::
sequenceToContainer
<
std
::
vector
<
security
::
CertAltNameEntry
>>
(
sanExtension
->
getAlternativeNames
());
}
OUString
certHostName
=
getContentPart
(
rRequest
.
Certificate
->
getSubjectName
()
);
uno
::
Sequence
<
OUString
>
certHostNames
(
altNames
.
getLength
()
+
1
);
uno
::
Sequence
<
OUString
>
certHostNames
(
altNames
.
size
()
+
1
);
certHostNames
[
0
]
=
certHostName
;
for
(
int
n
=
0
;
n
<
altNames
.
getLength
();
++
n
)
for
(
size_t
n
=
0
;
n
<
altNames
.
size
();
++
n
)
{
if
(
altNames
[
n
].
Type
==
security
::
ExtAltNameType_DNS_NAME
){
if
(
altNames
[
n
].
Type
==
security
::
ExtAltNameType_DNS_NAME
)
{
altNames
[
n
].
Value
>>=
certHostNames
[
n
+
1
];
}
}
...
...
xmlsecurity/source/xmlsec/nss/sanextension_nssimpl.cxx
Dosyayı görüntüle @
f6572fa9
...
...
@@ -58,9 +58,9 @@ namespace {
}
//Methods from XSanExtension
css
::
uno
::
Sequence
<
css
::
security
::
CertAltNameEntry
>
SAL_CALL
SanExtensionImpl
::
getAlternativeNames
()
throw
(
css
::
uno
::
RuntimeException
,
std
::
exception
)
{
if
(
!
m_Entries
.
hasElements
())
css
::
uno
::
Sequence
<
css
::
security
::
CertAltNameEntry
>
SAL_CALL
SanExtensionImpl
::
getAlternativeNames
()
throw
(
css
::
uno
::
RuntimeException
,
std
::
exception
)
{
if
(
m_Entries
.
empty
())
{
SECItem
item
;
...
...
@@ -73,18 +73,18 @@ css::uno::Sequence< css::security::CertAltNameEntry > SAL_CALL SanExtensionImpl:
arena
=
PORT_NewArena
(
DER_DEFAULT_CHUNKSIZE
);
if
(
!
arena
)
return
m_Entries
;
return
css
::
uno
::
Sequence
<
css
::
security
::
CertAltNameEntry
>
()
;
nameList
=
CERT_DecodeAltNameExtension
(
arena
,
&
item
);
CERTGeneralName
*
current
=
nameList
;
int
size
=
GetNamesLength
(
nameList
);
std
::
vector
<
CertAltNameEntry
>
arrCertAltNameEntry
(
size
);
for
(
int
i
=
0
;
i
<
size
;
i
++
){
m_Entries
.
resize
(
size
);
for
(
int
i
=
0
;
i
<
size
;
++
i
){
switch
(
current
->
type
)
{
case
certOtherName
:
{
arrCertAltNameEntry
[
i
].
Type
=
ExtAltNameType_OTHER_NAME
;
m_Entries
[
i
].
Type
=
ExtAltNameType_OTHER_NAME
;
css
::
beans
::
PropertyValue
otherNameProp
;
otherNameProp
.
Name
=
OUString
::
createFromAscii
(
CERT_GetOidString
(
&
current
->
name
.
OthName
.
oid
));
...
...
@@ -94,64 +94,62 @@ css::uno::Sequence< css::security::CertAltNameEntry > SAL_CALL SanExtensionImpl:
otherNameProp
.
Value
<<=
otherName
;
arrCertAltNameEntry
[
i
].
Value
<<=
otherNameProp
;
m_Entries
[
i
].
Value
<<=
otherNameProp
;
break
;
}
case
certRFC822Name
:
arrCertAltNameEntry
[
i
].
Type
=
ExtAltNameType_RFC822_NAME
;
arrCertAltNameEntry
[
i
].
Value
<<=
OUString
(
reinterpret_cast
<
char
*>
(
current
->
name
.
other
.
data
),
current
->
name
.
other
.
len
,
RTL_TEXTENCODING_ASCII_US
);
m_Entries
[
i
].
Type
=
ExtAltNameType_RFC822_NAME
;
m_Entries
[
i
].
Value
<<=
OUString
(
reinterpret_cast
<
char
*>
(
current
->
name
.
other
.
data
),
current
->
name
.
other
.
len
,
RTL_TEXTENCODING_ASCII_US
);
break
;
case
certDNSName
:
arrCertAltNameEntry
[
i
].
Type
=
ExtAltNameType_DNS_NAME
;
arrCertAltNameEntry
[
i
].
Value
<<=
OUString
(
reinterpret_cast
<
char
*>
(
current
->
name
.
other
.
data
),
current
->
name
.
other
.
len
,
RTL_TEXTENCODING_ASCII_US
);
m_Entries
[
i
].
Type
=
ExtAltNameType_DNS_NAME
;
m_Entries
[
i
].
Value
<<=
OUString
(
reinterpret_cast
<
char
*>
(
current
->
name
.
other
.
data
),
current
->
name
.
other
.
len
,
RTL_TEXTENCODING_ASCII_US
);
break
;
case
certX400Address
:
{
// unsupported
arrCertAltNameEntry
[
i
].
Type
=
ExtAltNameType_X400_ADDRESS
;
m_Entries
[
i
].
Type
=
ExtAltNameType_X400_ADDRESS
;
break
;
}
case
certDirectoryName
:
{
// unsupported
arrCertAltNameEntry
[
i
].
Type
=
ExtAltNameType_DIRECTORY_NAME
;
m_Entries
[
i
].
Type
=
ExtAltNameType_DIRECTORY_NAME
;
break
;
}
case
certEDIPartyName
:
{
// unsupported
arrCertAltNameEntry
[
i
].
Type
=
ExtAltNameType_EDI_PARTY_NAME
;
m_Entries
[
i
].
Type
=
ExtAltNameType_EDI_PARTY_NAME
;
break
;
}
case
certURI
:
arrCertAltNameEntry
[
i
].
Type
=
ExtAltNameType_URL
;
arrCertAltNameEntry
[
i
].
Value
<<=
OUString
(
reinterpret_cast
<
char
*>
(
current
->
name
.
other
.
data
),
current
->
name
.
other
.
len
,
RTL_TEXTENCODING_ASCII_US
);
m_Entries
[
i
].
Type
=
ExtAltNameType_URL
;
m_Entries
[
i
].
Value
<<=
OUString
(
reinterpret_cast
<
char
*>
(
current
->
name
.
other
.
data
),
current
->
name
.
other
.
len
,
RTL_TEXTENCODING_ASCII_US
);
break
;
case
certIPAddress
:
{
arrCertAltNameEntry
[
i
].
Type
=
ExtAltNameType_IP_ADDRESS
;
m_Entries
[
i
].
Type
=
ExtAltNameType_IP_ADDRESS
;
Sequence
<
sal_Int8
>
ipAddress
(
current
->
name
.
other
.
len
)
;
for
(
unsigned
int
r
=
0
;
r
<
current
->
name
.
other
.
len
;
r
++
)
ipAddress
[
r
]
=
*
(
current
->
name
.
other
.
data
+
r
)
;
arrCertAltNameEntry
[
i
].
Value
<<=
ipAddress
;
m_Entries
[
i
].
Value
<<=
ipAddress
;
break
;
}
case
certRegisterID
:
arrCertAltNameEntry
[
i
].
Type
=
ExtAltNameType_REGISTERED_ID
;
m_Entries
[
i
].
Type
=
ExtAltNameType_REGISTERED_ID
;
OString
nssOid
=
OString
(
CERT_GetOidString
(
&
current
->
name
.
other
));
OString
unoOid
=
removeOIDFromString
(
nssOid
);
arrCertAltNameEntry
[
i
].
Value
<<=
OStringToOUString
(
unoOid
,
RTL_TEXTENCODING_ASCII_US
);
m_Entries
[
i
].
Value
<<=
OStringToOUString
(
unoOid
,
RTL_TEXTENCODING_ASCII_US
);
break
;
}
current
=
CERT_GetNextGeneralName
(
current
);
}
m_Entries
=
::
comphelper
::
containerToSequence
<
css
::
security
::
CertAltNameEntry
>
(
arrCertAltNameEntry
);
PORT_FreeArena
(
arena
,
PR_FALSE
);
}
return
m_Entries
;
return
comphelper
::
containerToSequence
<
css
::
security
::
CertAltNameEntry
>
(
m_Entries
)
;
}
OString
SanExtensionImpl
::
removeOIDFromString
(
const
OString
&
oidString
)
...
...
xmlsecurity/source/xmlsec/nss/sanextension_nssimpl.hxx
Dosyayı görüntüle @
f6572fa9
...
...
@@ -30,13 +30,14 @@
#include <com/sun/star/security/XSanExtension.hpp>
#include <com/sun/star/security/CertAltNameEntry.hpp>
#include "certificateextension_certextn.hxx"
#include <vector>
class
SanExtensionImpl
:
public
::
cppu
::
WeakImplHelper
<
css
::
security
::
XSanExtension
>
{
private
:
CertificateExtension_CertExtn
m_Extn
;
css
::
uno
::
Sequence
<
css
::
security
::
CertAltNameEntry
>
m_Entries
;
std
::
vector
<
css
::
security
::
CertAltNameEntry
>
m_Entries
;
static
OString
removeOIDFromString
(
const
OString
&
oid
);
...
...
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