diff options
| author | Andreas Steffen <andreas.steffen@strongswan.org> | 2013-03-22 10:37:49 +0100 |
|---|---|---|
| committer | Andreas Steffen <andreas.steffen@strongswan.org> | 2013-03-22 10:37:49 +0100 |
| commit | a1bc67d6c9ac3fc6ac7ea7fef63bb5528181b34c (patch) | |
| tree | 3e9a6d78da4b7a07349d19c9a0718afd42632526 /src/libimcv/plugins/imv_test | |
| parent | 3db17b0ccc80b8de9e170f41ba53c96a8ad5fd6a (diff) | |
| download | strongswan-a1bc67d6c9ac3fc6ac7ea7fef63bb5528181b34c.tar.bz2 strongswan-a1bc67d6c9ac3fc6ac7ea7fef63bb5528181b34c.tar.xz | |
Switch encoding of AR Identity Value from binary to UTF-8
Diffstat (limited to 'src/libimcv/plugins/imv_test')
| -rw-r--r-- | src/libimcv/plugins/imv_test/imv_test_state.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/libimcv/plugins/imv_test/imv_test_state.c b/src/libimcv/plugins/imv_test/imv_test_state.c index 385a37452..41da44d67 100644 --- a/src/libimcv/plugins/imv_test/imv_test_state.c +++ b/src/libimcv/plugins/imv_test/imv_test_state.c @@ -59,9 +59,14 @@ struct private_imv_test_state_t { u_int32_t max_msg_len; /** - * Access Requestor ID + * Access Requestor ID Type */ - identification_t *ar_id; + u_int32_t ar_id_type; + + /** + * Access Requestor ID Value + */ + chunk_t ar_id_value; /** * IMV action recommendation @@ -149,16 +154,20 @@ METHOD(imv_state_t, get_max_msg_len, u_int32_t, } METHOD(imv_state_t, set_ar_id, void, - private_imv_test_state_t *this, identification_t *ar_id) + private_imv_test_state_t *this, u_int32_t id_type, chunk_t id_value) { - /* no cloning, caller must not destroy object */ - this->ar_id = ar_id; + this->ar_id_type = id_type; + this->ar_id_value = chunk_clone(id_value); } -METHOD(imv_state_t, get_ar_id, identification_t*, - private_imv_test_state_t *this) +METHOD(imv_state_t, get_ar_id, chunk_t, + private_imv_test_state_t *this, u_int32_t *id_type) { - return this->ar_id; + if (id_type) + { + *id_type = this->ar_id_type; + } + return this->ar_id_value; } METHOD(imv_state_t, change_state, void, @@ -209,9 +218,9 @@ METHOD(imv_state_t, get_remediation_instructions, bool, METHOD(imv_state_t, destroy, void, private_imv_test_state_t *this) { - DESTROY_IF(this->ar_id); DESTROY_IF(this->reason_string); this->imcs->destroy_function(this->imcs, free); + free(this->ar_id_value.ptr); free(this); } |
