cosmetics
authorAndreas Steffen <andreas.steffen@strongswan.org>
Mon, 12 Jun 2006 07:55:37 +0000 (07:55 -0000)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Mon, 12 Jun 2006 07:55:37 +0000 (07:55 -0000)
src/charon/encoding/message.c
src/charon/encoding/payloads/certreq_payload.c
src/charon/sa/states/initiator_init.c
src/charon/sa/states/responder_init.c

index db6d6ea..0629fb7 100644 (file)
@@ -529,7 +529,7 @@ static void add_payload(private_message_t *this, payload_t *payload)
        payload->set_next_type(payload, NO_PAYLOAD);
        this->payloads->insert_last(this->payloads, (void*)payload);
 
-       this->logger->log(this->logger, CONTROL|LEVEL1, "Added payload of type %s to message", 
+       this->logger->log(this->logger, CONTROL|LEVEL1, "added payload of type %s to message", 
                                          mapping_find(payload_type_m, payload->get_type(payload)));
 }
 
@@ -587,14 +587,14 @@ static status_t generate(private_message_t *this, crypter_t *crypter, signer_t*
        status_t status;
        chunk_t packet_data;
        
-       this->logger->log(this->logger, CONTROL, "Generating %s %s, contains %d payloads",
+       this->logger->log(this->logger, CONTROL, "generating %s %s, contains %d payloads",
                                          mapping_find(exchange_type_m,this->exchange_type),
                                          this->is_request ? "request" : "response",
                                          this->payloads->get_count(this->payloads));
        
        if (this->exchange_type == EXCHANGE_TYPE_UNDEFINED)
        {
-               this->logger->log(this->logger, ERROR | LEVEL1, "Exchange type %s is not defined",
+               this->logger->log(this->logger, ERROR | LEVEL1, "exchange type %s is not defined",
                                                        mapping_find(exchange_type_m,this->exchange_type));
                return INVALID_STATE;
        }
@@ -611,7 +611,7 @@ static status_t generate(private_message_t *this, crypter_t *crypter, signer_t*
        status = this->set_message_rule(this);
        if (status != SUCCESS)
        {
-               this->logger->log(this->logger, ERROR, "No message rules specified for a %s %s",
+               this->logger->log(this->logger, ERROR, "no message rules specified for a %s %s",
                                                  mapping_find(exchange_type_m,this->exchange_type),
                                                  this->is_request ? "request" : "response");
                return NOT_SUPPORTED;
@@ -622,7 +622,7 @@ static status_t generate(private_message_t *this, crypter_t *crypter, signer_t*
        status = this->encrypt_payloads(this, crypter, signer);
        if (status != SUCCESS)
        {
-               this->logger->log(this->logger, ERROR | LEVEL1, "Could not encrypt payloads");
+               this->logger->log(this->logger, ERROR | LEVEL1, "could not encrypt payloads");
                return status;
        }
 
@@ -666,7 +666,7 @@ static status_t generate(private_message_t *this, crypter_t *crypter, signer_t*
        /* if last payload is of type encrypted, integrity checksum if necessary */
        if (payload->get_type(payload) == ENCRYPTED)
        {
-               this->logger->log(this->logger, CONTROL | LEVEL1, "Build signature on whole message");
+               this->logger->log(this->logger, CONTROL | LEVEL1, "build signature on whole message");
                encryption_payload_t *encryption_payload = (encryption_payload_t*)payload;
                status = encryption_payload->build_signature(encryption_payload, packet_data);
                if (status != SUCCESS)
@@ -680,7 +680,7 @@ static status_t generate(private_message_t *this, crypter_t *crypter, signer_t*
        /* clone packet for caller */
        *packet = this->packet->clone(this->packet);
        
-       this->logger->log(this->logger, CONTROL|LEVEL1, "Message of type %s generated successfully",
+       this->logger->log(this->logger, CONTROL|LEVEL1, "message of type %s generated successfully",
                                                mapping_find(exchange_type_m,this->exchange_type));
        return SUCCESS;
 }
@@ -716,7 +716,7 @@ static status_t parse_header(private_message_t *this)
        status = this->parser->parse_payload(this->parser,HEADER,(payload_t **) &ike_header);
        if (status != SUCCESS)
        {
-               this->logger->log(this->logger, ERROR | LEVEL1, "Header could not be parsed");
+               this->logger->log(this->logger, ERROR | LEVEL1, "header could not be parsed");
                return status;
                
        }
@@ -725,7 +725,7 @@ static status_t parse_header(private_message_t *this)
        status = ike_header->payload_interface.verify(&(ike_header->payload_interface));
        if (status != SUCCESS)
        {
-               this->logger->log(this->logger, ERROR | LEVEL1, "Header verification failed");
+               this->logger->log(this->logger, ERROR | LEVEL1, "header verification failed");
                ike_header->destroy(ike_header);
                return status;
        }       
@@ -746,7 +746,7 @@ static status_t parse_header(private_message_t *this)
        this->minor_version = ike_header->get_min_version(ike_header);
        this->first_payload = ike_header->payload_interface.get_next_type(&(ike_header->payload_interface));
        
-       this->logger->log(this->logger, CONTROL|LEVEL1, "Parsed a %s %s", 
+       this->logger->log(this->logger, CONTROL|LEVEL1, "parsed a %s %s", 
                                                mapping_find(exchange_type_m, this->exchange_type),
                                                this->is_request ? "request" : "response");
        
@@ -756,7 +756,7 @@ static status_t parse_header(private_message_t *this)
        status = this->set_message_rule(this);
        if (status != SUCCESS)
        {
-               this->logger->log(this->logger, ERROR, "No message rules specified for a %s %s",
+               this->logger->log(this->logger, ERROR, "no message rules specified for a %s %s",
                                                  mapping_find(exchange_type_m,this->exchange_type),
                                                  this->is_request ? "request" : "response");
        }
@@ -774,7 +774,7 @@ static status_t parse_body(private_message_t *this, crypter_t *crypter, signer_t
                
        current_payload_type = this->first_payload;     
                
-       this->logger->log(this->logger, CONTROL|LEVEL1, "Parsing body of message, first payload is %s",
+       this->logger->log(this->logger, CONTROL|LEVEL1, "parsing body of message, first payload is %s",
                                          mapping_find(payload_type_m, current_payload_type));
 
        /* parse payload for payload, while there are more available */
@@ -782,7 +782,7 @@ static status_t parse_body(private_message_t *this, crypter_t *crypter, signer_t
        {
                payload_t *current_payload;
                
-               this->logger->log(this->logger, CONTROL|LEVEL2, "Start parsing a %s payload", 
+               this->logger->log(this->logger, CONTROL|LEVEL2, "start parsing a %s payload", 
                                                        mapping_find(payload_type_m, current_payload_type));
                
                /* parse current payload */
@@ -790,12 +790,12 @@ static status_t parse_body(private_message_t *this, crypter_t *crypter, signer_t
                
                if (status != SUCCESS)
                {
-                       this->logger->log(this->logger, ERROR, "Payload type %s could not be parsed",
+                       this->logger->log(this->logger, ERROR, "payload type %s could not be parsed",
                                                                mapping_find(payload_type_m,current_payload_type));
                        return status;
                }
 
-               this->logger->log(this->logger, CONTROL|LEVEL2, "Verify payload of type %s", 
+               this->logger->log(this->logger, CONTROL|LEVEL2, "verify payload of type %s", 
                                                        mapping_find(payload_type_m, current_payload_type));
                
                /* verify it, stop parsig if its invalid */
@@ -829,17 +829,17 @@ static status_t parse_body(private_message_t *this, crypter_t *crypter, signer_t
        status = this->decrypt_payloads(this,crypter,signer);
        if (status != SUCCESS)
        {
-               this->logger->log(this->logger, ERROR, "Could not decrypt payloads");
+               this->logger->log(this->logger, ERROR, "could not decrypt payloads");
                return status;
        }
        
        status = this->verify(this);
        if (status != SUCCESS)
        {
-               this->logger->log(this->logger, ERROR, "Verification of message failed");
+               this->logger->log(this->logger, ERROR, "verification of message failed");
        }
        
-       this->logger->log(this->logger, CONTROL, "Parsed %s %s, contains %d payloads", 
+       this->logger->log(this->logger, CONTROL, "parsed %s %s, contains %d payloads", 
                                        mapping_find(exchange_type_m, this->exchange_type),
                                        this->is_request ? "request" : "response",
                                        this->payloads->get_count(this->payloads));
@@ -856,7 +856,7 @@ static status_t verify(private_message_t *this)
        iterator_t *iterator;
        size_t total_found_payloads = 0;
        
-       this->logger->log(this->logger, CONTROL|LEVEL1, "Verifying message structure");
+       this->logger->log(this->logger, CONTROL|LEVEL1, "verifying message structure");
 
        iterator = this->payloads->create_iterator(this->payloads,TRUE);
        /* check for payloads with wrong count*/
@@ -891,13 +891,13 @@ static status_t verify(private_message_t *this)
                        {
                                found_payloads++;
                                total_found_payloads++;
-                               this->logger->log(this->logger, CONTROL|LEVEL2, "Found payload of type %s",
+                               this->logger->log(this->logger, CONTROL|LEVEL2, "found payload of type %s",
                                                          mapping_find(payload_type_m, this->message_rule->payload_rules[i].payload_type));
        
                                /* as soon as ohe payload occures more then specified, the verification fails */
                                if (found_payloads > this->message_rule->payload_rules[i].max_occurence)
                                {
-                                       this->logger->log(this->logger, ERROR|LEVEL1, "Payload of type %s more than %d times (%d) occured in current message",
+                                       this->logger->log(this->logger, ERROR|LEVEL1, "payload of type %s more than %d times (%d) occured in current message",
                                                                          mapping_find(payload_type_m, current_payload_type),
                                                                          this->message_rule->payload_rules[i].max_occurence, found_payloads);
                                        iterator->destroy(iterator);
@@ -908,7 +908,7 @@ static status_t verify(private_message_t *this)
 
                if (found_payloads < this->message_rule->payload_rules[i].min_occurence)
                {
-                       this->logger->log(this->logger, ERROR|LEVEL1, "Payload of type %s not occured %d times (%d)",
+                       this->logger->log(this->logger, ERROR|LEVEL1, "payload of type %s not occured %d times (%d)",
                                                          mapping_find(payload_type_m, this->message_rule->payload_rules[i].payload_type),
                                                          this->message_rule->payload_rules[i].min_occurence, found_payloads);
                        iterator->destroy(iterator);
@@ -951,7 +951,7 @@ static status_t decrypt_payloads(private_message_t *this,crypter_t *crypter, sig
                /* needed to check */
                current_payload_type = current_payload->get_type(current_payload);
                
-               this->logger->log(this->logger, CONTROL|LEVEL2, "Process payload of type %s",
+               this->logger->log(this->logger, CONTROL|LEVEL2, "process payload of type %s",
                                                        mapping_find(payload_type_m,current_payload_type));
                
                if (current_payload_type == ENCRYPTED)
@@ -961,18 +961,18 @@ static status_t decrypt_payloads(private_message_t *this,crypter_t *crypter, sig
                        
                        encryption_payload = (encryption_payload_t*)current_payload;
                        
-                       this->logger->log(this->logger, CONTROL | LEVEL2, "Found an encryption payload");
+                       this->logger->log(this->logger, CONTROL | LEVEL2, "found an encryption payload");
 
                        if (payload_number != this->payloads->get_count(this->payloads))
                        {
                                /* encrypted payload is not last one */
-                               this->logger->log(this->logger, ERROR | LEVEL1, "Encrypted payload is not last payload");
+                               this->logger->log(this->logger, ERROR | LEVEL1, "encrypted payload is not last payload");
                                iterator->destroy(iterator);
                                return FAILED;
                        }
                        /* decrypt */
                        encryption_payload->set_transforms(encryption_payload, crypter, signer);
-                       this->logger->log(this->logger, CONTROL | LEVEL1, "Verify signature of encryption payload");
+                       this->logger->log(this->logger, CONTROL | LEVEL1, "verify signature of encryption payload");
                        status = encryption_payload->verify_signature(encryption_payload, this->packet->get_data(this->packet));
                        if (status != SUCCESS)
                        {
@@ -980,12 +980,12 @@ static status_t decrypt_payloads(private_message_t *this,crypter_t *crypter, sig
                                iterator->destroy(iterator);
                                return status;
                        }
-                       this->logger->log(this->logger, CONTROL | LEVEL2, "Decrypt content of encryption payload");
+                       this->logger->log(this->logger, CONTROL | LEVEL2, "decrypt content of encryption payload");
                        status = encryption_payload->decrypt(encryption_payload);
                        if (status != SUCCESS)
                        {
                                this->logger->log(this->logger, ERROR | LEVEL1, 
-                                                                 "Encrypted payload could not be decrypted and parsed: %s", 
+                                                                 "encrypted payload could not be decrypted and parsed: %s", 
                                                                  mapping_find(status_m, status));
                                iterator->destroy(iterator);
                                return status;
@@ -997,7 +997,7 @@ static status_t decrypt_payloads(private_message_t *this,crypter_t *crypter, sig
                        /* check if there are payloads contained in the encryption payload */
                        if (encryption_payload->get_payload_count(encryption_payload) == 0)
                        {
-                               this->logger->log(this->logger, CONTROL|LEVEL2, "Encrypted payload is empty");
+                               this->logger->log(this->logger, CONTROL|LEVEL2, "encrypted payload is empty");
                                /* remove the encryption payload, is not needed anymore */
                                iterator->remove(iterator);
                                /* encrypted payload contains no other payload */
@@ -1028,7 +1028,7 @@ static status_t decrypt_payloads(private_message_t *this,crypter_t *crypter, sig
                        {
                                encryption_payload->remove_first_payload(encryption_payload, &current_encrypted_payload);
                                this->logger->log(this->logger, CONTROL | LEVEL1, 
-                                                                 "Insert unencrypted payload of type %s at end of list.",
+                                                                 "insert unencrypted payload of type %s at end of list.",
                                                                   mapping_find(payload_type_m, current_encrypted_payload->get_type(current_encrypted_payload)));
                                this->payloads->insert_last(this->payloads,current_encrypted_payload);
                        }
@@ -1045,7 +1045,7 @@ static status_t decrypt_payloads(private_message_t *this,crypter_t *crypter, sig
                        if (status != SUCCESS)
                        {
                                /* payload is not allowed */
-                               this->logger->log(this->logger, ERROR | LEVEL1, "Payload type %s not allowed",
+                               this->logger->log(this->logger, ERROR | LEVEL1, "payload type %s not allowed",
                                                                  mapping_find(payload_type_m,current_payload_type));
                                iterator->destroy(iterator);
                                return status;
@@ -1055,7 +1055,7 @@ static status_t decrypt_payloads(private_message_t *this,crypter_t *crypter, sig
                        if (payload_rule->encrypted != current_payload_was_encrypted)
                        {
                                /* payload was not encrypted, but should have been. or vice-versa */
-                               this->logger->log(this->logger, ERROR | LEVEL1, "Payload type %s should be %s!", 
+                               this->logger->log(this->logger, ERROR | LEVEL1, "payload type %s should be %s!", 
                                                                        mapping_find(payload_type_m,current_payload_type),
                                                                        (payload_rule->encrypted) ? "encrypted" : "not encrypted");
                                iterator->destroy(iterator);
@@ -1082,12 +1082,12 @@ static status_t encrypt_payloads (private_message_t *this,crypter_t *crypter, si
        
        if (!this->message_rule->encrypted_content)
        {
-               this->logger->log(this->logger, CONTROL | LEVEL1, "Message doesn't have to be encrypted");
+               this->logger->log(this->logger, CONTROL | LEVEL1, "message doesn't have to be encrypted");
                /* message contains no content to encrypt */
                return SUCCESS;
        }
        
-       this->logger->log(this->logger, CONTROL | LEVEL2, "Copy all payloads to a temporary list");
+       this->logger->log(this->logger, CONTROL | LEVEL2, "copy all payloads to a temporary list");
        all_payloads = linked_list_create();
        
        /* first copy all payloads in a temporary list */
@@ -1100,7 +1100,7 @@ static status_t encrypt_payloads (private_message_t *this,crypter_t *crypter, si
        
        encryption_payload = encryption_payload_create();
 
-       this->logger->log(this->logger, CONTROL | LEVEL2, "Check each payloads if they have to get encrypted");
+       this->logger->log(this->logger, CONTROL | LEVEL2, "check each payloads if they have to get encrypted");
        while (all_payloads->get_count(all_payloads) > 0)
        {
                payload_rule_t *payload_rule;
@@ -1108,7 +1108,7 @@ static status_t encrypt_payloads (private_message_t *this,crypter_t *crypter, si
                bool to_encrypt = FALSE;
                
                all_payloads->remove_first(all_payloads,(void **)&current_payload);
-               this->logger->log(this->logger, CONTROL | LEVEL3, "Get rule for payload %s", 
+               this->logger->log(this->logger, CONTROL | LEVEL3, "get rule for payload %s", 
                                                        mapping_find(payload_type_m,current_payload->get_type(current_payload)));
                
                status = this->get_payload_rule(this,current_payload->get_type(current_payload),&payload_rule);
@@ -1116,38 +1116,38 @@ static status_t encrypt_payloads (private_message_t *this,crypter_t *crypter, si
                 * that they don't have to be encrypted */
                if ((status == SUCCESS) && (payload_rule->encrypted))
                {
-                       this->logger->log(this->logger, CONTROL | LEVEL2, "Payload %s has to get encrypted", 
+                       this->logger->log(this->logger, CONTROL | LEVEL2, "payload %s has to get encrypted", 
                                                          mapping_find(payload_type_m,current_payload->get_type(current_payload)));
                        to_encrypt = TRUE;
                }
                else if (status != SUCCESS)
                {
-                       this->logger->log(this->logger, CONTROL | LEVEL2, "Payload %s not defined for exchange type %s. Handle it anyway", 
+                       this->logger->log(this->logger, CONTROL | LEVEL2, "payload %s not defined for exchange type %s. Handle it anyway", 
                                                          mapping_find(payload_type_m,current_payload->get_type(current_payload)),
                                                          mapping_find(exchange_type_m,this->exchange_type));
                }
                
                if (to_encrypt)
                {
-                       this->logger->log(this->logger, CONTROL | LEVEL2, "Insert payload %s to encryption payload", 
+                       this->logger->log(this->logger, CONTROL | LEVEL2, "insert payload %s to encryption payload", 
                                                          mapping_find(payload_type_m,current_payload->get_type(current_payload)));
 
                        encryption_payload->add_payload(encryption_payload,current_payload);
                }
                else
                {
-                       this->logger->log(this->logger, CONTROL | LEVEL2, "Insert payload %s as payload wich does not have to be encrypted", 
+                       this->logger->log(this->logger, CONTROL | LEVEL2, "insert payload %s as payload wich does not have to be encrypted", 
                                                          mapping_find(payload_type_m,current_payload->get_type(current_payload)));
                        this->public.add_payload(&(this->public), (payload_t*)encryption_payload);
                }
        }
 
        status = SUCCESS;
-       this->logger->log(this->logger, CONTROL | LEVEL2, "Set transforms for encryption payload ");
+       this->logger->log(this->logger, CONTROL | LEVEL2, "set transforms for encryption payload ");
        encryption_payload->set_transforms(encryption_payload,crypter,signer);
-       this->logger->log(this->logger, CONTROL | LEVEL1, "Encrypt all payloads of encrypted payload");
+       this->logger->log(this->logger, CONTROL | LEVEL1, "encrypt all payloads of encrypted payload");
        status = encryption_payload->encrypt(encryption_payload);
-       this->logger->log(this->logger, CONTROL | LEVEL2, "Add encrypted payload to payload list");
+       this->logger->log(this->logger, CONTROL | LEVEL2, "add encrypted payload to payload list");
        this->public.add_payload(&(this->public), (payload_t*)encryption_payload);
        
        all_payloads->destroy(all_payloads);
@@ -1163,7 +1163,7 @@ static void destroy (private_message_t *this)
 {
        iterator_t *iterator;
        
-       this->logger->log(this->logger, CONTROL|LEVEL3, "Going to destroy message_t object");
+       this->logger->log(this->logger, CONTROL|LEVEL3, "going to destroy message_t object");
        
        this->packet->destroy(this->packet);
 
@@ -1177,7 +1177,7 @@ static void destroy (private_message_t *this)
        {
                payload_t *payload;
                iterator->current(iterator, (void**)&payload);  
-               this->logger->log(this->logger, CONTROL|LEVEL3, "Destroying payload of type %s", 
+               this->logger->log(this->logger, CONTROL|LEVEL3, "destroying payload of type %s", 
                                                        mapping_find(payload_type_m, payload->get_type(payload)));
                payload->destroy(payload);
        }
index cdab82b..6109566 100644 (file)
@@ -71,11 +71,11 @@ struct private_certreq_payload_t {
  * 
  */
 encoding_rule_t certreq_payload_encodings[] = {
-       /* 1 Byte next payload type, stored in the field next_payload */
+       /* 1 Byte next payload type, stored in the field next_payload */
        { U_INT_8,                      offsetof(private_certreq_payload_t, next_payload)       },
        /* the critical bit */
        { FLAG,                         offsetof(private_certreq_payload_t, critical)           },
-       /* 7 Bit reserved bits, nowhere stored */
+       /* 7 Bit reserved bits, nowhere stored */
        { RESERVED_BIT, 0                                                                                                               },
        { RESERVED_BIT, 0                                                                                                               },
        { RESERVED_BIT, 0                                                                                                               },
@@ -85,7 +85,7 @@ encoding_rule_t certreq_payload_encodings[] = {
        { RESERVED_BIT, 0                                                                                                               },
        /* Length of the whole payload*/
        { PAYLOAD_LENGTH,       offsetof(private_certreq_payload_t, payload_length)},
-       /* 1 Byte CERTREQ type*/
+       /* 1 Byte CERTREQ type*/
        { U_INT_8,                      offsetof(private_certreq_payload_t, cert_encoding)},
        /* some certreq data bytes, length is defined in PAYLOAD_LENGTH */
        { CERTREQ_DATA,                 offsetof(private_certreq_payload_t, certreq_data)}
index 8f27acf..eb8b33f 100644 (file)
@@ -172,7 +172,7 @@ status_t retry_initiate_connection (private_initiator_init_t *this, diffie_hellm
        ike_sa_id->set_responder_spi(ike_sa_id,0);
 
        /* going to build message */
-       this->logger->log(this->logger, CONTROL|LEVEL2, "Going to build message");
+       this->logger->log(this->logger, CONTROL|LEVEL2, "going to build message");
        this->ike_sa->build_message(this->ike_sa, IKE_SA_INIT, TRUE, &message);
        
        /* build SA payload */
@@ -183,7 +183,7 @@ status_t retry_initiate_connection (private_initiator_init_t *this, diffie_hellm
        status = this->build_nonce_payload(this, message);
        if (status != SUCCESS)
        {
-               this->logger->log(this->logger, ERROR, "Building nonce payload failed. Aborting");
+               this->logger->log(this->logger, ERROR, "building nonce payload failed, aborting");
                message->destroy(message);
                return DESTROY_ME;
        }
@@ -191,7 +191,7 @@ status_t retry_initiate_connection (private_initiator_init_t *this, diffie_hellm
        status = this->ike_sa->send_request(this->ike_sa, message);
        if (status != SUCCESS)
        {
-               this->logger->log(this->logger, AUDIT, "Unable to initiate connection, could not send message. Aborting");
+               this->logger->log(this->logger, AUDIT, "unable to initiate connection, could not send message, aborting");
                message->destroy(message);
                return DESTROY_ME;
        }
@@ -201,11 +201,11 @@ status_t retry_initiate_connection (private_initiator_init_t *this, diffie_hellm
        ike_sa_init_request_data = message->get_packet_data(message);
 
        /* state can now be changed */
-       this->logger->log(this->logger, CONTROL|LEVEL2, "Create next state object");
+       this->logger->log(this->logger, CONTROL|LEVEL2, "create next state object");
        next_state = ike_sa_init_requested_create(this->ike_sa, this->diffie_hellman, this->sent_nonce,ike_sa_init_request_data);
        this->ike_sa->set_new_state(this->ike_sa,(state_t *) next_state);
        
-       this->logger->log(this->logger, CONTROL|LEVEL2, "Destroy old sate object");
+       this->logger->log(this->logger, CONTROL|LEVEL2, "destroy old state object");
        this->destroy_after_state_change(this);
        return SUCCESS;
 }
@@ -219,7 +219,7 @@ static void build_sa_payload(private_initiator_init_t *this, message_t *request)
        linked_list_t *proposal_list;
        connection_t *connection;
        
-       this->logger->log(this->logger, CONTROL|LEVEL1, "Building SA payload");
+       this->logger->log(this->logger, CONTROL|LEVEL1, "building SA payload");
        
        connection = this->ike_sa->get_connection(this->ike_sa);
 
@@ -227,7 +227,7 @@ static void build_sa_payload(private_initiator_init_t *this, message_t *request)
        
        sa_payload = sa_payload_create_from_proposal_list(proposal_list);       
 
-       this->logger->log(this->logger, CONTROL|LEVEL2, "Add SA payload to message");
+       this->logger->log(this->logger, CONTROL|LEVEL2, "add SA payload to message");
        request->add_payload(request, (payload_t *) sa_payload);
 }
 
@@ -240,7 +240,7 @@ static void build_ke_payload(private_initiator_init_t *this, message_t *request)
        chunk_t key_data;
        diffie_hellman_group_t dh_group;
        
-       this->logger->log(this->logger, CONTROL|LEVEL1, "Building KE payload");
+       this->logger->log(this->logger, CONTROL|LEVEL1, "building KE payload");
        
        this->diffie_hellman->get_my_public_value(this->diffie_hellman, &key_data);
        dh_group = this->diffie_hellman->get_dh_group(this->diffie_hellman);
@@ -251,7 +251,7 @@ static void build_ke_payload(private_initiator_init_t *this, message_t *request)
        
        chunk_free(&key_data);
        
-       this->logger->log(this->logger, CONTROL|LEVEL2, "Add KE payload to message");
+       this->logger->log(this->logger, CONTROL|LEVEL2, "add KE payload to message");
        request->add_payload(request, (payload_t *) ke_payload);
 }
 
@@ -264,9 +264,9 @@ static status_t build_nonce_payload(private_initiator_init_t *this, message_t *r
        randomizer_t *randomizer;
        status_t status;
        
-       this->logger->log(this->logger, CONTROL|LEVEL1, "Building NONCE payload");
+       this->logger->log(this->logger, CONTROL|LEVEL1, "building NONCE payload");
        
-       this->logger->log(this->logger, CONTROL|LEVEL2, "Get pseudo random bytes for NONCE");
+       this->logger->log(this->logger, CONTROL|LEVEL2, "get pseudo random bytes for NONCE");
        randomizer = this->ike_sa->get_randomizer(this->ike_sa);
        
        status = randomizer->allocate_pseudo_random_bytes(randomizer, NONCE_SIZE, &(this->sent_nonce));
@@ -275,13 +275,13 @@ static status_t build_nonce_payload(private_initiator_init_t *this, message_t *r
                return status;
        }
 
-       this->logger->log(this->logger, RAW|LEVEL2, "Initiator NONCE",&(this->sent_nonce));
+       this->logger->log(this->logger, RAW|LEVEL2, "initiator NONCE",&(this->sent_nonce));
        
        nonce_payload = nonce_payload_create();
        
        nonce_payload->set_nonce(nonce_payload, this->sent_nonce);
        
-       this->logger->log(this->logger, CONTROL|LEVEL2, "Add NONCE payload to message");
+       this->logger->log(this->logger, CONTROL|LEVEL2, "add NONCE payload to message");
        request->add_payload(request, (payload_t *) nonce_payload);
        return SUCCESS;
 }
@@ -291,7 +291,7 @@ static status_t build_nonce_payload(private_initiator_init_t *this, message_t *r
  */
 static status_t process_message(private_initiator_init_t *this, message_t *message)
 {
-       this->logger->log(this->logger, ERROR, "In state INITIATOR_INIT, no message is processed");
+       this->logger->log(this->logger, ERROR, "in state INITIATOR_INIT, no message is processed");
        return FAILED;
 }
 
@@ -308,7 +308,7 @@ static ike_sa_state_t get_state(private_initiator_init_t *this)
  */
 static void destroy(private_initiator_init_t *this)
 {
-       this->logger->log(this->logger, CONTROL | LEVEL3, "Going to destroy initiator_init_t state object");
+       this->logger->log(this->logger, CONTROL | LEVEL3, "going to destroy initiator_init_t state object");
 
        /* destroy diffie hellman object */
        if (this->diffie_hellman != NULL)
@@ -327,7 +327,7 @@ static void destroy(private_initiator_init_t *this)
  */
 static void destroy_after_state_change (private_initiator_init_t *this)
 {
-       this->logger->log(this->logger, CONTROL | LEVEL3, "Going to destroy initiator_init_t state object");
+       this->logger->log(this->logger, CONTROL | LEVEL3, "going to destroy initiator_init_t state object");
        free(this);
 }
 
index 07fcaab..3f95229 100644 (file)
@@ -163,12 +163,13 @@ static status_t process_message(private_responder_init_t *this, message_t *messa
 
        if (message->get_exchange_type(message) != IKE_SA_INIT)
        {
-               this->logger->log(this->logger, ERROR | LEVEL1, "Message of type %s not supported in state responder_init",mapping_find(exchange_type_m,message->get_exchange_type(message)));
+               this->logger->log(this->logger, ERROR | LEVEL1, "message of type %s not supported in state responder_init",
+                                                 mapping_find(exchange_type_m,message->get_exchange_type(message)));
                return DESTROY_ME;
        }
        if (!message->get_request(message))
        {
-               this->logger->log(this->logger, ERROR | LEVEL1, "IKE_SA_INIT responses not allowed state ike_sa_init_responded");
+               this->logger->log(this->logger, ERROR | LEVEL1, "IKE_SA_INIT responses not allowed in state ike_sa_init_responded");
                return DESTROY_ME;
        }
        
@@ -180,7 +181,7 @@ static status_t process_message(private_responder_init_t *this, message_t *messa
        if (connection == NULL)
        {
                /* no configuration matches given hosts */
-               this->logger->log(this->logger, AUDIT, "IKE_SA_INIT request does not match any available connection. Deleting IKE_SA");
+               this->logger->log(this->logger, AUDIT, "IKE_SA_INIT request does not match any available connection, deleting IKE_SA");
                /* TODO: inform requestor */
                return DESTROY_ME;
        }
@@ -192,13 +193,13 @@ static status_t process_message(private_responder_init_t *this, message_t *messa
        {
                if (status == NOT_SUPPORTED)
                {
-                       this->logger->log(this->logger, AUDIT, "IKE_SA_INIT request contains unsupported payload with critical flag set. "
-                                                                                                       "Deleting IKE_SA");
+                       this->logger->log(this->logger, AUDIT, "IKE_SA_INIT request contains unsupported payload with critical flag set, "
+                                                                                                       "deleting IKE_SA");
                        this->ike_sa->send_notify(this->ike_sa, IKE_SA_INIT, UNSUPPORTED_CRITICAL_PAYLOAD, CHUNK_INITIALIZER);
                }
                else
                {
-                       this->logger->log(this->logger, AUDIT, "Unable to parse IKE_SA_INIT request. Deleting IKE_SA");
+                       this->logger->log(this->logger, AUDIT, "unable to parse IKE_SA_INIT request, deleting IKE_SA");
                }
                return DESTROY_ME;
        }
@@ -239,7 +240,7 @@ static status_t process_message(private_responder_init_t *this, message_t *messa
                        }
                        default:
                        {
-                               this->logger->log(this->logger, ERROR|LEVEL1, "Ignoring payload %s (%d)", 
+                               this->logger->log(this->logger, ERROR|LEVEL1, "ignoring payload %s (%d)", 
                                                                        mapping_find(payload_type_m, payload->get_type(payload)), payload->get_type(payload));
                                break;
                        }
@@ -250,7 +251,7 @@ static status_t process_message(private_responder_init_t *this, message_t *messa
        /* check if we have all payloads */
        if (!(sa_request && ke_request && nonce_request))
        {
-               this->logger->log(this->logger, AUDIT, "IKE_SA_INIT request did not contain all required payloads. Deleting IKE_SA");
+               this->logger->log(this->logger, AUDIT, "IKE_SA_INIT request did not contain all required payloads. deleting IKE_SA");
                return DESTROY_ME;
        }
        
@@ -281,7 +282,7 @@ static status_t process_message(private_responder_init_t *this, message_t *messa
        status = this->ike_sa->build_transforms(this->ike_sa, this->proposal, this->diffie_hellman, this->received_nonce, this->sent_nonce);
        if (status != SUCCESS)
        {
-               this->logger->log(this->logger, AUDIT, "Transform objects could not be created from selected proposal. Deleting IKE_SA");
+               this->logger->log(this->logger, AUDIT, "transform objects could not be created from selected proposal, deleting IKE_SA");
                return DESTROY_ME;
        }
        
@@ -289,13 +290,13 @@ static status_t process_message(private_responder_init_t *this, message_t *messa
        status = this->ike_sa->send_response(this->ike_sa, response);
        if (status != SUCCESS)
        {
-               this->logger->log(this->logger, AUDIT, "Unable to send IKE_SA_INIT response. Deleting IKE_SA");
+               this->logger->log(this->logger, AUDIT, "unable to send IKE_SA_INIT response, deleting IKE_SA");
                response->destroy(response);
                return DESTROY_ME;
        }
 
        /* state can now be changed */
-       this->logger->log(this->logger, CONTROL|LEVEL2, "Create next state object of type IKE_SA_INIT_RESPONDED");
+       this->logger->log(this->logger, CONTROL|LEVEL2, "create next state object of type IKE_SA_INIT_RESPONDED");
 
        response = this->ike_sa->get_last_responded_message(this->ike_sa);
        ike_sa_init_response_data = response->get_packet_data(response);
@@ -324,7 +325,7 @@ static status_t build_sa_payload(private_responder_init_t *this,sa_payload_t *sa
 
        connection = this->ike_sa->get_connection(this->ike_sa);
 
-       this->logger->log(this->logger, CONTROL | LEVEL2, "Process received SA payload");
+       this->logger->log(this->logger, CONTROL | LEVEL2, "process received SA payload");
        
        /* get the list of suggested proposals */ 
        proposal_list = sa_request->get_proposals (sa_request);
@@ -338,7 +339,7 @@ static status_t build_sa_payload(private_responder_init_t *this,sa_payload_t *sa
        proposal_list->destroy(proposal_list);
        if (this->proposal == NULL)
        {
-               this->logger->log(this->logger, AUDIT, "IKE_SA_INIT request did not contain any acceptable proposals. Deleting IKE_SA");
+               this->logger->log(this->logger, AUDIT, "IKE_SA_INIT request did not contain any acceptable proposals, deleting IKE_SA");
                this->ike_sa->send_notify(this->ike_sa, IKE_SA_INIT, NO_PROPOSAL_CHOSEN, CHUNK_INITIALIZER);
                return DESTROY_ME;
        }
@@ -348,7 +349,7 @@ static status_t build_sa_payload(private_responder_init_t *this,sa_payload_t *sa
        
        this->logger->log(this->logger, CONTROL | LEVEL2, "SA Payload processed");
        
-       this->logger->log(this->logger, CONTROL|LEVEL2, "Building SA payload");
+       this->logger->log(this->logger, CONTROL|LEVEL2, "building SA payload");
        sa_payload = sa_payload_create_from_proposal(this->proposal);   
        this->logger->log(this->logger, CONTROL|LEVEL2, "add SA payload to message");
        response->add_payload(response,(payload_t *) sa_payload);
@@ -366,12 +367,12 @@ static status_t build_ke_payload(private_responder_init_t *this,ke_payload_t *ke
        diffie_hellman_t *dh;
        chunk_t key_data;
                                
-       this->logger->log(this->logger, CONTROL | LEVEL2, "Process received KE payload");
+       this->logger->log(this->logger, CONTROL | LEVEL2, "process received KE payload");
        group = ke_request->get_dh_group_number(ke_request);
                                
        if (group == MODP_NONE)
        {
-               this->logger->log(this->logger, AUDIT, "No diffie hellman group to select. Deleting IKE_SA");
+               this->logger->log(this->logger, AUDIT, "no Diffie-Hellman group to select, deleting IKE_SA");
                return DESTROY_ME;
        }
        
@@ -381,7 +382,7 @@ static status_t build_ke_payload(private_responder_init_t *this,ke_payload_t *ke
                chunk_t accepted_group_chunk;
                /* group not same as selected one 
                 * Maybe key exchange payload is before SA payload */
-               this->logger->log(this->logger, AUDIT, "IKE_SA_INIT request did not contain a acceptable diffie hellman group. Deleting IKE_SA");
+               this->logger->log(this->logger, AUDIT, "IKE_SA_INIT request did not contain an acceptable Diffie-Hellman group, deleting IKE_SA");
                
                accepted_group = htons(this->dh_group_number);
                accepted_group_chunk.ptr = (u_int8_t*) &(accepted_group);
@@ -394,19 +395,19 @@ static status_t build_ke_payload(private_responder_init_t *this,ke_payload_t *ke
        dh = diffie_hellman_create(group);
        if (dh == NULL)
        {
-               this->logger->log(this->logger, AUDIT, "Could not generate DH object with group %d. Deleting IKE_SA",
+               this->logger->log(this->logger, AUDIT, "could not generate DH object with group %d, deleting IKE_SA",
                                                        mapping_find(diffie_hellman_group_m,group) );
                return DESTROY_ME;
        }
-       this->logger->log(this->logger, CONTROL | LEVEL2, "Set other DH public value");
+       this->logger->log(this->logger, CONTROL | LEVEL2, "set other DH public value");
        
        dh->set_other_public_value(dh, ke_request->get_key_exchange_data(ke_request));
 
        this->diffie_hellman = dh;
        
-       this->logger->log(this->logger, CONTROL | LEVEL2, "KE Payload processed.");
+       this->logger->log(this->logger, CONTROL | LEVEL2, "KE payload processed.");
 
-       this->logger->log(this->logger, CONTROL|LEVEL2, "Building KE payload");
+       this->logger->log(this->logger, CONTROL|LEVEL2, "building KE payload");
        this->diffie_hellman->get_my_public_value(this->diffie_hellman,&key_data);
 
        ke_payload = ke_payload_create();
@@ -414,7 +415,7 @@ static status_t build_ke_payload(private_responder_init_t *this,ke_payload_t *ke
        ke_payload->set_dh_group_number(ke_payload, this->dh_group_number);
        chunk_free(&key_data);
 
-       this->logger->log(this->logger, CONTROL|LEVEL2, "Add KE payload to message");
+       this->logger->log(this->logger, CONTROL|LEVEL2, "add KE payload to message");
        response->add_payload(response,(payload_t *) ke_payload);
        
        return SUCCESS;
@@ -429,14 +430,14 @@ static status_t build_nonce_payload(private_responder_init_t *this,nonce_payload
        randomizer_t *randomizer;
        status_t status;
 
-       this->logger->log(this->logger, CONTROL | LEVEL2, "Process received NONCE payload");
+       this->logger->log(this->logger, CONTROL | LEVEL2, "process received NONCE payload");
        free(this->received_nonce.ptr);
        this->received_nonce = CHUNK_INITIALIZER;
 
-       this->logger->log(this->logger, CONTROL | LEVEL2, "Get NONCE value and store it");
+       this->logger->log(this->logger, CONTROL | LEVEL2, "get NONCE value and store it");
        this->received_nonce = nonce_request->get_nonce(nonce_request);
        
-       this->logger->log(this->logger, CONTROL | LEVEL2, "Create new NONCE value.");   
+       this->logger->log(this->logger, CONTROL | LEVEL2, "create new NONCE value.");   
        
        randomizer = this->ike_sa->get_randomizer(this->ike_sa);
        status = randomizer->allocate_pseudo_random_bytes(randomizer, NONCE_SIZE, &(this->sent_nonce));
@@ -445,11 +446,11 @@ static status_t build_nonce_payload(private_responder_init_t *this,nonce_payload
                return status;
        }
        
-       this->logger->log(this->logger, CONTROL|LEVEL2, "Building NONCE payload");
+       this->logger->log(this->logger, CONTROL|LEVEL2, "building NONCE payload");
        nonce_payload = nonce_payload_create();
        nonce_payload->set_nonce(nonce_payload, this->sent_nonce);
        
-       this->logger->log(this->logger, CONTROL|LEVEL2, "Add NONCE payload to message");
+       this->logger->log(this->logger, CONTROL|LEVEL2, "add NONCE payload to message");
        response->add_payload(response,(payload_t *) nonce_payload);
        
        return SUCCESS;
@@ -462,12 +463,12 @@ static status_t process_notify_payload(private_responder_init_t *this, notify_pa
 {
        notify_message_type_t notify_message_type = notify_payload->get_notify_message_type(notify_payload);
        
-       this->logger->log(this->logger, CONTROL|LEVEL1, "Process notify type %s",
+       this->logger->log(this->logger, CONTROL|LEVEL1, "process notify type %s",
                                                  mapping_find(notify_message_type_m, notify_message_type));
                                                                  
        if (notify_payload->get_protocol_id(notify_payload) != PROTO_IKE)
        {
-               this->logger->log(this->logger, ERROR | LEVEL1, "Notify reply not for IKE protocol.");
+               this->logger->log(this->logger, ERROR | LEVEL1, "notify reply not for IKE protocol.");
                return FAILED;  
        }
        switch (notify_message_type)
@@ -494,23 +495,22 @@ static ike_sa_state_t get_state(private_responder_init_t *this)
  */
 static void destroy(private_responder_init_t *this)
 {
-       this->logger->log(this->logger, CONTROL | LEVEL1, "Going to destroy responder init state object");
+       this->logger->log(this->logger, CONTROL | LEVEL1, "going to destroy responder init state object");
        
-       this->logger->log(this->logger, CONTROL | LEVEL2, "Destroy sent nonce");
+       this->logger->log(this->logger, CONTROL | LEVEL2, "destroy nonces");
        chunk_free(&(this->sent_nonce));
-       this->logger->log(this->logger, CONTROL | LEVEL2, "Destroy received nonce");
        chunk_free(&(this->received_nonce));
 
        if (this->diffie_hellman != NULL)
        {
-               this->logger->log(this->logger, CONTROL | LEVEL2, "Destroy diffie_hellman_t hellman object");
+               this->logger->log(this->logger, CONTROL | LEVEL2, "destroy diffie_hellman_t hellman object");
                this->diffie_hellman->destroy(this->diffie_hellman);
        }
        if (this->proposal)
        {
                this->proposal->destroy(this->proposal);
        }
-       this->logger->log(this->logger, CONTROL | LEVEL2, "Destroy object");
+       this->logger->log(this->logger, CONTROL | LEVEL2, "destroy object");
        free(this);
 }
 
@@ -519,12 +519,12 @@ static void destroy(private_responder_init_t *this)
  */
 static void destroy_after_state_change (private_responder_init_t *this)
 {
-       this->logger->log(this->logger, CONTROL | LEVEL1, "Going to destroy responder_init_t state object");
+       this->logger->log(this->logger, CONTROL | LEVEL1, "going to destroy responder_init_t state object");
        
        /* destroy diffie hellman object */
        if (this->diffie_hellman != NULL)
        {
-               this->logger->log(this->logger, CONTROL | LEVEL2, "Destroy diffie_hellman_t object");
+               this->logger->log(this->logger, CONTROL | LEVEL2, "destroy diffie_hellman_t object");
                this->diffie_hellman->destroy(this->diffie_hellman);
        }
        if (this->proposal)
@@ -532,7 +532,7 @@ static void destroy_after_state_change (private_responder_init_t *this)
                this->proposal->destroy(this->proposal);
        }
        
-       this->logger->log(this->logger, CONTROL | LEVEL2, "Destroy object");    
+       this->logger->log(this->logger, CONTROL | LEVEL2, "destroy object");    
        free(this);
 }