aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2010-08-10 15:56:10 +0200
committerMartin Willi <martin@revosec.ch>2010-08-10 18:46:30 +0200
commita944d2092bb8663be21f863bbe27fa475966c9d9 (patch)
tree7a3d6f2c612f7e9e229c0e8be2fa21fb05d3db2e /src/libcharon
parent33ddaaabec136e358bf38a6aeb7855f466603007 (diff)
downloadstrongswan-a944d2092bb8663be21f863bbe27fa475966c9d9.tar.bz2
strongswan-a944d2092bb8663be21f863bbe27fa475966c9d9.tar.xz
Use bits instead of bytes for a private/public key
Diffstat (limited to 'src/libcharon')
-rw-r--r--src/libcharon/plugins/stroke/stroke_list.c2
-rw-r--r--src/libcharon/plugins/unit_tester/tests/test_rsa_gen.c2
-rw-r--r--src/libcharon/sa/authenticators/pubkey_authenticator.c6
3 files changed, 5 insertions, 5 deletions
diff --git a/src/libcharon/plugins/stroke/stroke_list.c b/src/libcharon/plugins/stroke/stroke_list.c
index a6de35466..f4ffa94c9 100644
--- a/src/libcharon/plugins/stroke/stroke_list.c
+++ b/src/libcharon/plugins/stroke/stroke_list.c
@@ -638,7 +638,7 @@ static void list_public_key(public_key_t *public, FILE *out)
fprintf(out, " pubkey: %N %d bits%s\n",
key_type_names, public->get_type(public),
- public->get_keysize(public) * 8,
+ public->get_keysize(public),
private ? ", has private key" : "");
if (public->get_fingerprint(public, KEYID_PUBKEY_INFO_SHA1, &keyid))
{
diff --git a/src/libcharon/plugins/unit_tester/tests/test_rsa_gen.c b/src/libcharon/plugins/unit_tester/tests/test_rsa_gen.c
index 43688f60a..6ba5769b5 100644
--- a/src/libcharon/plugins/unit_tester/tests/test_rsa_gen.c
+++ b/src/libcharon/plugins/unit_tester/tests/test_rsa_gen.c
@@ -110,7 +110,7 @@ bool test_rsa_load_any()
public = lib->creds->create(lib->creds, CRED_PUBLIC_KEY, KEY_ANY,
BUILD_BLOB_ASN1_DER, chunk,
BUILD_END);
- if (!public || public->get_keysize(public) != 256)
+ if (!public || public->get_keysize(public) != 2048)
{
return FALSE;
}
diff --git a/src/libcharon/sa/authenticators/pubkey_authenticator.c b/src/libcharon/sa/authenticators/pubkey_authenticator.c
index 3c67f6db6..54b4338bb 100644
--- a/src/libcharon/sa/authenticators/pubkey_authenticator.c
+++ b/src/libcharon/sa/authenticators/pubkey_authenticator.c
@@ -84,15 +84,15 @@ static status_t build(private_pubkey_authenticator_t *this, message_t *message)
/* we try to deduct the signature scheme from the keysize */
switch (private->get_keysize(private))
{
- case 32:
+ case 256:
scheme = SIGN_ECDSA_256;
auth_method = AUTH_ECDSA_256;
break;
- case 48:
+ case 384:
scheme = SIGN_ECDSA_384;
auth_method = AUTH_ECDSA_384;
break;
- case 66:
+ case 521:
scheme = SIGN_ECDSA_521;
auth_method = AUTH_ECDSA_521;
break;