summaryrefslogtreecommitdiff
path: root/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx')
-rw-r--r--xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx38
1 files changed, 29 insertions, 9 deletions
diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
index f18460033..e128faf59 100644
--- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
@@ -89,7 +89,29 @@ extern X509Certificate_NssImpl* NssPrivKeyToXCert( SECKEYPrivateKey* ) ;
struct UsageDescription
{
SECCertificateUsage usage;
- char const * const description;
+ char const* description;
+
+ UsageDescription()
+ : usage( certificateUsageCheckAllUsages )
+ , description( NULL )
+ {}
+
+ UsageDescription( SECCertificateUsage i_usage, char const* i_description )
+ : usage( i_usage )
+ , description( i_description )
+ {}
+
+ UsageDescription( const UsageDescription& aDescription )
+ : usage( aDescription.usage )
+ , description( aDescription.description )
+ {}
+
+ UsageDescription& operator =( const UsageDescription& aDescription )
+ {
+ usage = aDescription.usage;
+ description = aDescription.description;
+ return *this;
+ }
};
@@ -868,14 +890,12 @@ verifyCertificate( const Reference< csss::XCertificate >& aCert,
// certificateUsageAnyCA
// certificateUsageProtectedObjectSigner
- UsageDescription arUsages[] =
- {
- {certificateUsageSSLClient, "certificateUsageSSLClient" },
- {certificateUsageSSLServer, "certificateUsageSSLServer" },
- {certificateUsageSSLCA, "certificateUsageSSLCA" },
- {certificateUsageEmailSigner, "certificateUsageEmailSigner"}, //only usable for end certs
- {certificateUsageEmailRecipient, "certificateUsageEmailRecipient"}
- };
+ UsageDescription arUsages[5];
+ arUsages[0] = UsageDescription( certificateUsageSSLClient, "certificateUsageSSLClient" );
+ arUsages[1] = UsageDescription( certificateUsageSSLServer, "certificateUsageSSLServer" );
+ arUsages[2] = UsageDescription( certificateUsageSSLCA, "certificateUsageSSLCA" );
+ arUsages[3] = UsageDescription( certificateUsageEmailSigner, "certificateUsageEmailSigner" );
+ arUsages[4] = UsageDescription( certificateUsageEmailRecipient, "certificateUsageEmailRecipient" );
int numUsages = SAL_N_ELEMENTS(arUsages);
for (int i = 0; i < numUsages; i++)