From: Scott Cantor Date: Tue, 31 Aug 2010 22:05:25 +0000 (+0000) Subject: Fix incorrect RSA key size calculation. X-Git-Tag: 1.4RC1~36 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fcpp-xmltooling.git;a=commitdiff_plain;h=6d7bda066d7ffa09cd4606e70947d995b21d6e86 Fix incorrect RSA key size calculation. --- diff --git a/xmltooling/security/Credential.h b/xmltooling/security/Credential.h index 0d2362f..a334d62 100644 --- a/xmltooling/security/Credential.h +++ b/xmltooling/security/Credential.h @@ -95,7 +95,7 @@ namespace xmltooling { virtual const char* getAlgorithm() const=0; /** - * Returns the size of the key. + * Returns the size of the key in bits. * * @return the key size, or 0 if indeterminate */ diff --git a/xmltooling/security/impl/BasicX509Credential.cpp b/xmltooling/security/impl/BasicX509Credential.cpp index 1a2bbab..5d761ea 100644 --- a/xmltooling/security/impl/BasicX509Credential.cpp +++ b/xmltooling/security/impl/BasicX509Credential.cpp @@ -239,7 +239,7 @@ unsigned int BasicX509Credential::getKeySize() const case XSECCryptoKey::KEY_RSA_PUBLIC: case XSECCryptoKey::KEY_RSA_PAIR: { XSECCryptoKeyRSA* rkey = static_cast(m_key); - return rkey->getLength(); + return 8 * rkey->getLength(); } case XSECCryptoKey::KEY_SYMMETRIC: {