diff options
Diffstat (limited to 'src/libcharon/plugins/tnc_tnccs/tnc_tnccs_manager.c')
-rw-r--r-- | src/libcharon/plugins/tnc_tnccs/tnc_tnccs_manager.c | 15 |
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))); |