aboutsummaryrefslogtreecommitdiffstats
path: root/src/medsrv/controller
diff options
context:
space:
mode:
authorMartin Willi <martin@strongswan.org>2009-08-11 16:24:01 +0200
committerMartin Willi <martin@strongswan.org>2009-08-26 11:23:48 +0200
commit160f4c225db0deacc3670c4cff0609bda8e29f73 (patch)
tree4405b13114c9cba9f8f949ec2cb626b758e6b448 /src/medsrv/controller
parent5672eae131e834acacc12ffbf08b5a4486affc96 (diff)
downloadstrongswan-160f4c225db0deacc3670c4cff0609bda8e29f73.tar.bz2
strongswan-160f4c225db0deacc3670c4cff0609bda8e29f73.tar.xz
moved PEM parsing functionality to its own plugin
Diffstat (limited to 'src/medsrv/controller')
-rwxr-xr-xsrc/medsrv/controller/peer_controller.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/medsrv/controller/peer_controller.c b/src/medsrv/controller/peer_controller.c
index 01ba0c8cc..5166a420c 100755
--- a/src/medsrv/controller/peer_controller.c
+++ b/src/medsrv/controller/peer_controller.c
@@ -122,15 +122,18 @@ static bool parse_public_key(private_peer_controller_t *this,
{
public_key_t *public;
identification_t *id;
+ chunk_t blob;
if (!public_key || *public_key == '\0')
{
request->setf(request, "error=Public key is missing.");
return FALSE;
}
+ blob = chunk_clone(chunk_create(public_key, strlen(public_key)));
public = lib->creds->create(lib->creds, CRED_PUBLIC_KEY, KEY_ANY,
- BUILD_BLOB_ASN1_PEM, public_key,
+ BUILD_BLOB_PEM, blob,
BUILD_END);
+ chunk_free(&blob);
if (!public)
{
request->setf(request, "error=Parsing public key failed.");