aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2011-11-02 18:48:51 +0100
committerTobias Brunner <tobias@strongswan.org>2011-11-02 20:27:55 +0100
commita8084ee011a74e308548ca73b014fe312d483ec0 (patch)
tree81d4b210d32520d54ed1975f1883a508267b220d
parent8859c1f26b06bfb92c0322b189acd5ede0aa0040 (diff)
downloadstrongswan-a8084ee011a74e308548ca73b014fe312d483ec0.tar.bz2
strongswan-a8084ee011a74e308548ca73b014fe312d483ec0.tar.xz
pkcs11: Store public key length in bits.
-rw-r--r--src/libstrongswan/plugins/pkcs11/pkcs11_public_key.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstrongswan/plugins/pkcs11/pkcs11_public_key.c b/src/libstrongswan/plugins/pkcs11/pkcs11_public_key.c
index 81ab6cb31..ee171ae18 100644
--- a/src/libstrongswan/plugins/pkcs11/pkcs11_public_key.c
+++ b/src/libstrongswan/plugins/pkcs11/pkcs11_public_key.c
@@ -42,7 +42,7 @@ struct private_pkcs11_public_key_t {
key_type_t type;
/**
- * Key size in bytes
+ * Key size in bits
*/
size_t k;
@@ -81,7 +81,7 @@ METHOD(public_key_t, get_type, key_type_t,
METHOD(public_key_t, get_keysize, int,
private_pkcs11_public_key_t *this)
{
- return this->k * 8;
+ return this->k;
}
METHOD(public_key_t, verify, bool,
@@ -276,7 +276,7 @@ static private_pkcs11_public_key_t *create(key_type_t type, size_t k,
},
},
.type = type,
- .k = k,
+ .k = k * 8,
.lib = p11,
.slot = slot,
.session = session,