From: cantor Date: Wed, 26 Sep 2007 20:14:05 +0000 (+0000) Subject: Add consts. X-Git-Tag: 1.4.1~431 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fxmltooling.git;a=commitdiff_plain;h=f04b928d8c658590bb39ae1adb37e1951b7a45cc Add consts. git-svn-id: https://svn.middleware.georgetown.edu/cpp-xmltooling/trunk@395 de75baf8-a10c-0410-a50a-987c0e22f00f --- diff --git a/xmltooling/security/impl/CredentialCriteria.cpp b/xmltooling/security/impl/CredentialCriteria.cpp index e229a06..ae4f1ea 100644 --- a/xmltooling/security/impl/CredentialCriteria.cpp +++ b/xmltooling/security/impl/CredentialCriteria.cpp @@ -65,11 +65,11 @@ bool CredentialCriteria::matches(const Credential& credential) const } // See if we have to match a specific key. - XSECCryptoKey* key1 = getPublicKey(); + const XSECCryptoKey* key1 = getPublicKey(); if (!key1) return true; // no key to compare against, so we're done - XSECCryptoKey* key2 = credential.getPublicKey(); + const XSECCryptoKey* key2 = credential.getPublicKey(); if (!key2) return true; // no key here, so we can't test it @@ -82,16 +82,16 @@ bool CredentialCriteria::matches(const Credential& credential) const if (key1->getKeyType()==XSECCryptoKey::KEY_RSA_PUBLIC || key1->getKeyType()==XSECCryptoKey::KEY_RSA_PAIR) { if (key2->getKeyType()!=XSECCryptoKey::KEY_RSA_PUBLIC && key2->getKeyType()!=XSECCryptoKey::KEY_RSA_PAIR) return false; - RSA* rsa1 = static_cast(key1)->getOpenSSLRSA(); - RSA* rsa2 = static_cast(key2)->getOpenSSLRSA(); + const RSA* rsa1 = static_cast(key1)->getOpenSSLRSA(); + const RSA* rsa2 = static_cast(key2)->getOpenSSLRSA(); return (BN_cmp(rsa1->n,rsa2->n) == 0 && BN_cmp(rsa1->e,rsa2->e) == 0); } if (key1->getKeyType()==XSECCryptoKey::KEY_DSA_PUBLIC || key1->getKeyType()==XSECCryptoKey::KEY_DSA_PAIR) { if (key2->getKeyType()!=XSECCryptoKey::KEY_DSA_PUBLIC && key2->getKeyType()!=XSECCryptoKey::KEY_DSA_PAIR) return false; - DSA* dsa1 = static_cast(key1)->getOpenSSLDSA(); - DSA* dsa2 = static_cast(key2)->getOpenSSLDSA(); + const DSA* dsa1 = static_cast(key1)->getOpenSSLDSA(); + const DSA* dsa2 = static_cast(key2)->getOpenSSLDSA(); return (BN_cmp(dsa1->pub_key,dsa2->pub_key) == 0); }