Handle invalid IKEv1 hashes more specifically.

This commit is contained in:
Tobias Brunner
2012-03-20 17:31:08 +01:00
parent 29a5e0707e
commit 37639e94fb
3 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -1942,7 +1942,7 @@ METHOD(message_t, parse_body, status_t,
DBG1(DBG_ENC, "our hash does not match received %B", DBG1(DBG_ENC, "our hash does not match received %B",
&other_hash); &other_hash);
chunk_free(&hash); chunk_free(&hash);
return VERIFY_ERROR; return FAILED;
} }
DBG2(DBG_ENC, "verified IKEv1 message with hash %B", &hash); DBG2(DBG_ENC, "verified IKEv1 message with hash %B", &hash);
chunk_free(&hash); chunk_free(&hash);
@@ -51,6 +51,8 @@ enum notify_type_t {
/* IKEv1 only */ /* IKEv1 only */
PAYLOAD_MALFORMED = 16, PAYLOAD_MALFORMED = 16,
INVALID_KE_PAYLOAD = 17, INVALID_KE_PAYLOAD = 17,
/* IKEv1 only */
INVALID_HASH_INFORMATION = 23,
AUTHENTICATION_FAILED = 24, AUTHENTICATION_FAILED = 24,
SINGLE_PAIR_REQUIRED = 34, SINGLE_PAIR_REQUIRED = 34,
NO_ADDITIONAL_SAS = 35, NO_ADDITIONAL_SAS = 35,
+1 -1
View File
@@ -717,7 +717,7 @@ static status_t parse_message(private_task_manager_t *this, message_t *msg)
case FAILED: case FAILED:
DBG1(DBG_IKE, "integrity check failed"); DBG1(DBG_IKE, "integrity check failed");
send_notify_response(this, msg, send_notify_response(this, msg,
PAYLOAD_MALFORMED, chunk_empty); INVALID_HASH_INFORMATION, chunk_empty);
break; break;
case INVALID_STATE: case INVALID_STATE:
DBG1(DBG_IKE, "found encrypted message, but no keys available"); DBG1(DBG_IKE, "found encrypted message, but no keys available");