From 91caea7b06b517e7cf46e83d624d1f49ed3432fa Mon Sep 17 00:00:00 2001 From: cantor Date: Tue, 31 Aug 2010 22:05:25 +0000 Subject: [PATCH] Fix incorrect RSA key size calculation. git-svn-id: https://svn.middleware.georgetown.edu/cpp-xmltooling/branches/REL_1@782 de75baf8-a10c-0410-a50a-987c0e22f00f --- xmltooling/security/Credential.h | 2 +- xmltooling/security/impl/BasicX509Credential.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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: { -- 2.1.4