diff options
author | Martin Willi <martin@strongswan.org> | 2009-08-11 16:24:01 +0200 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2009-08-26 11:23:48 +0200 |
commit | 160f4c225db0deacc3670c4cff0609bda8e29f73 (patch) | |
tree | 4405b13114c9cba9f8f949ec2cb626b758e6b448 /src/medsrv/controller | |
parent | 5672eae131e834acacc12ffbf08b5a4486affc96 (diff) | |
download | strongswan-160f4c225db0deacc3670c4cff0609bda8e29f73.tar.bz2 strongswan-160f4c225db0deacc3670c4cff0609bda8e29f73.tar.xz |
moved PEM parsing functionality to its own plugin
Diffstat (limited to 'src/medsrv/controller')
-rwxr-xr-x | src/medsrv/controller/peer_controller.c | 5 |
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."); |