aboutsummaryrefslogtreecommitdiffstats
path: root/src/libpttls/pt_tls_client.c
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2013-02-27 14:11:00 +0100
committerMartin Willi <martin@revosec.ch>2013-02-28 16:46:07 +0100
commit806126eab2b0a0b0170a6eef70a30856f4fc947f (patch)
tree9db8602d73a43e762d855c9c49df3e326c9dc789 /src/libpttls/pt_tls_client.c
parent55854ecc25c0984a39ed6ff247c7ba772d0fbe11 (diff)
downloadstrongswan-806126eab2b0a0b0170a6eef70a30856f4fc947f.tar.bz2
strongswan-806126eab2b0a0b0170a6eef70a30856f4fc947f.tar.xz
Pass a client identity to pt_tls_client, usable for TLS or SASL authentication
Diffstat (limited to 'src/libpttls/pt_tls_client.c')
-rw-r--r--src/libpttls/pt_tls_client.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/libpttls/pt_tls_client.c b/src/libpttls/pt_tls_client.c
index 7f91ae691..2f695ee99 100644
--- a/src/libpttls/pt_tls_client.c
+++ b/src/libpttls/pt_tls_client.c
@@ -48,7 +48,12 @@ struct private_pt_tls_client_t {
/**
* Server identity
*/
- identification_t *id;
+ identification_t *server;
+
+ /**
+ * Client authentication identity
+ */
+ identification_t *client;
/**
* Current PT-TLS message identifier
@@ -77,7 +82,7 @@ static bool make_connection(private_pt_tls_client_t *this)
return FALSE;
}
- this->tls = tls_socket_create(FALSE, this->id, NULL, fd, NULL);
+ this->tls = tls_socket_create(FALSE, this->server, this->client, fd, NULL);
if (!this->tls)
{
close(fd);
@@ -283,14 +288,16 @@ METHOD(pt_tls_client_t, destroy, void,
close(fd);
}
this->address->destroy(this->address);
- this->id->destroy(this->id);
+ this->server->destroy(this->server);
+ this->client->destroy(this->client);
free(this);
}
/**
* See header
*/
-pt_tls_client_t *pt_tls_client_create(host_t *address, identification_t *id)
+pt_tls_client_t *pt_tls_client_create(host_t *address, identification_t *server,
+ identification_t *client)
{
private_pt_tls_client_t *this;
@@ -300,7 +307,8 @@ pt_tls_client_t *pt_tls_client_create(host_t *address, identification_t *id)
.destroy = _destroy,
},
.address = address,
- .id = id,
+ .server = server,
+ .client = client,
);
return &this->public;