aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/plugins
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2013-03-22 10:37:49 +0100
committerAndreas Steffen <andreas.steffen@strongswan.org>2013-03-22 10:37:49 +0100
commita1bc67d6c9ac3fc6ac7ea7fef63bb5528181b34c (patch)
tree3e9a6d78da4b7a07349d19c9a0718afd42632526 /src/libcharon/plugins
parent3db17b0ccc80b8de9e170f41ba53c96a8ad5fd6a (diff)
downloadstrongswan-a1bc67d6c9ac3fc6ac7ea7fef63bb5528181b34c.tar.bz2
strongswan-a1bc67d6c9ac3fc6ac7ea7fef63bb5528181b34c.tar.xz
Switch encoding of AR Identity Value from binary to UTF-8
Diffstat (limited to 'src/libcharon/plugins')
-rw-r--r--src/libcharon/plugins/tnc_tnccs/tnc_tnccs_manager.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/libcharon/plugins/tnc_tnccs/tnc_tnccs_manager.c b/src/libcharon/plugins/tnc_tnccs/tnc_tnccs_manager.c
index 6ddda594d..76d5e1d9f 100644
--- a/src/libcharon/plugins/tnc_tnccs/tnc_tnccs_manager.c
+++ b/src/libcharon/plugins/tnc_tnccs/tnc_tnccs_manager.c
@@ -30,6 +30,8 @@
#include <collections/linked_list.h>
#include <threading/rwlock.h>
+#include <stdio.h>
+
typedef struct private_tnc_tnccs_manager_t private_tnc_tnccs_manager_t;
typedef struct tnccs_entry_t tnccs_entry_t;
typedef struct tnccs_connection_entry_t tnccs_connection_entry_t;
@@ -716,6 +718,7 @@ METHOD(tnccs_manager_t, get_attribute, TNC_Result,
tnccs_t *tnccs;
tncif_identity_t *tnc_id;
u_int32_t id_type, subject_type;
+ chunk_t id_value;
TNC_Result result;
list = linked_list_create();
@@ -734,7 +737,7 @@ METHOD(tnccs_manager_t, get_attribute, TNC_Result,
subject_type = TNC_SUBJECT_MACHINE;
break;
case ID_FQDN:
- id_type = TNC_ID_USER_NAME;
+ id_type = TNC_ID_USERNAME;
subject_type = TNC_SUBJECT_USER;
break;
case ID_RFC822_ADDR:
@@ -742,22 +745,18 @@ METHOD(tnccs_manager_t, get_attribute, TNC_Result,
subject_type = TNC_SUBJECT_USER;
break;
case ID_DER_ASN1_DN:
- id_type = TNC_ID_DER_ASN1_DN;
+ id_type = TNC_ID_ASN1_DN;
subject_type = TNC_SUBJECT_USER;
break;
- case ID_DER_ASN1_GN:
- id_type = TNC_ID_DER_ASN1_GN;
- subject_type = TNC_SUBJECT_UNKNOWN;
- break;
default:
id_type = TNC_ID_UNKNOWN;
subject_type = TNC_SUBJECT_UNKNOWN;
}
if (id_type != TNC_ID_UNKNOWN)
{
+ id_value.len = asprintf(&id_value.ptr, "%Y", peer);
tnc_id = tncif_identity_create(
- pen_type_create(PEN_TCG, id_type),
- peer->get_encoding(peer),
+ pen_type_create(PEN_TCG, id_type), id_value,
pen_type_create(PEN_TCG, subject_type),
pen_type_create(PEN_TCG,
tnccs->get_auth_type(tnccs)));