From 58624bfd86fc91c48f7c4f31c1f1736d924b1911 Mon Sep 17 00:00:00 2001 From: Scott Cantor Date: Wed, 17 Oct 2007 06:20:51 +0000 Subject: [PATCH] Convert usage bits to a mask. --- saml/saml2/metadata/MetadataCredentialCriteria.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/saml/saml2/metadata/MetadataCredentialCriteria.h b/saml/saml2/metadata/MetadataCredentialCriteria.h index 4aa54b8..7d57810 100644 --- a/saml/saml2/metadata/MetadataCredentialCriteria.h +++ b/saml/saml2/metadata/MetadataCredentialCriteria.h @@ -64,10 +64,10 @@ namespace opensaml { const MetadataCredentialContext* context = dynamic_cast(credential.getCredentalContext()); if (context) { // Check for a usage mismatch. - if ((getUsage()==xmltooling::Credential::SIGNING_CREDENTIAL || getUsage()==xmltooling::Credential::TLS_CREDENTIAL) && + if ((getUsage() | (xmltooling::Credential::SIGNING_CREDENTIAL & xmltooling::Credential::TLS_CREDENTIAL)) && XMLString::equals(context->getKeyDescriptor().getUse(),KeyDescriptor::KEYTYPE_ENCRYPTION)) return false; - else if (getUsage()==xmltooling::Credential::ENCRYPTION_CREDENTIAL && + else if ((getUsage() | xmltooling::Credential::ENCRYPTION_CREDENTIAL) && XMLString::equals(context->getKeyDescriptor().getUse(),KeyDescriptor::KEYTYPE_SIGNING)) return false; } -- 2.1.4