Cloning chunk_t parameters in process message
authorSansar Choinyambuu <schoinya@hsr.ch>
Fri, 23 Sep 2011 14:05:21 +0000 (16:05 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Mon, 28 Nov 2011 13:34:20 +0000 (14:34 +0100)
src/libpts/tcg/tcg_pts_attr_dh_nonce_finish.c
src/libpts/tcg/tcg_pts_attr_dh_nonce_params_resp.c

index 945a426..3a40df0 100644 (file)
@@ -158,7 +158,9 @@ METHOD(pa_tnc_attr_t, process, status_t,
        this->hash_algo = hash_algo;
        reader->read_data(reader, reader->remaining(reader) - this->nonce_len,
                                                                                &this->initiator_pub_val);
+       this->initiator_pub_val = chunk_clone(this->initiator_pub_val);
        reader->read_data(reader, this->nonce_len, &this->initiator_nonce);
+       this->initiator_nonce = chunk_clone(this->initiator_nonce);
        
        reader->destroy(reader);
 
index 92d9cd7..d9954c2 100644 (file)
@@ -168,7 +168,9 @@ METHOD(pa_tnc_attr_t, process, status_t,
        reader->read_uint16(reader, &hash_algo_set);
        this->hash_algo_set = hash_algo_set;
        reader->read_data(reader, this->nonce_len, &this->responder_nonce);
+       this->responder_nonce = chunk_clone(this->responder_nonce);
        reader->read_data(reader, reader->remaining(reader), &this->responder_pub_val);
+       this->responder_pub_val = chunk_clone(this->responder_pub_val);
        reader->destroy(reader);
 
        return SUCCESS;