From: cantor Date: Wed, 17 Oct 2007 06:20:51 +0000 (+0000) Subject: Convert usage bits to a mask. X-Git-Tag: 2.4.1~301 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fopensaml2.git;a=commitdiff_plain;h=a674332b26800573103818eb0b3522ce47151714 Convert usage bits to a mask. git-svn-id: https://svn.middleware.georgetown.edu/cpp-opensaml2/trunk@319 fb386ef7-a10c-0410-8ebf-fd3f8e989ab0 --- 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; }