]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
Raise an alert of generating local authentication data fails
authorMartin Willi <martin@revosec.ch>
Mon, 5 Nov 2012 14:33:34 +0000 (15:33 +0100)
committerMartin Willi <martin@revosec.ch>
Wed, 19 Dec 2012 09:40:32 +0000 (10:40 +0100)
src/libcharon/bus/bus.h
src/libcharon/sa/ikev2/tasks/ike_auth.c

index cc378b496304a50968125e000336eeb553867a48..4f2412707e3263c8bac31e30fe202be7261a5da3 100644 (file)
@@ -86,6 +86,8 @@ enum alert_t {
        ALERT_RADIUS_NOT_RESPONDING,
        /** a shutdown signal has been received, argument is the signal (int) */
        ALERT_SHUTDOWN_SIGNAL,
+       /** creating local authentication data failed, no arguments */
+       ALERT_LOCAL_AUTH_FAILED,
        /** peer authentication failed, no arguments */
        ALERT_PEER_AUTH_FAILED,
        /** failed to resolve peer address, no arguments */
index b80bc6c806af3428de1e8335abcd5106a2ab5170..432edc3bcd9c2b48e904a151630784a01581cab9 100644 (file)
@@ -457,6 +457,7 @@ METHOD(task_t, build_i, status_t,
                                                        this->reserved);
                if (!this->my_auth)
                {
+                       charon->bus->alert(charon->bus, ALERT_LOCAL_AUTH_FAILED);
                        return FAILED;
                }
        }
@@ -473,6 +474,7 @@ METHOD(task_t, build_i, status_t,
                case NEED_MORE:
                        break;
                default:
+                       charon->bus->alert(charon->bus, ALERT_LOCAL_AUTH_FAILED);
                        return FAILED;
        }
 
@@ -748,7 +750,7 @@ METHOD(task_t, build_r, status_t,
                                                                this->reserved);
                        if (!this->my_auth)
                        {
-                               goto peer_auth_failed;
+                               goto local_auth_failed;
                        }
                }
        }
@@ -786,9 +788,7 @@ METHOD(task_t, build_r, status_t,
                        case NEED_MORE:
                                break;
                        default:
-                               message->add_notify(message, TRUE, AUTHENTICATION_FAILED,
-                                                                       chunk_empty);
-                               return FAILED;
+                               goto local_auth_failed;
                }
        }
 
@@ -830,11 +830,14 @@ METHOD(task_t, build_r, status_t,
        return NEED_MORE;
 
 peer_auth_failed:
-       message->add_notify(message, TRUE, AUTHENTICATION_FAILED,
-                                               chunk_empty);
+       message->add_notify(message, TRUE, AUTHENTICATION_FAILED, chunk_empty);
 peer_auth_failed_no_notify:
        charon->bus->alert(charon->bus, ALERT_PEER_AUTH_FAILED);
        return FAILED;
+local_auth_failed:
+       message->add_notify(message, TRUE, AUTHENTICATION_FAILED, chunk_empty);
+       charon->bus->alert(charon->bus, ALERT_LOCAL_AUTH_FAILED);
+       return FAILED;
 }
 
 METHOD(task_t, process_i, status_t,
@@ -987,6 +990,7 @@ METHOD(task_t, process_i, status_t,
                        case NEED_MORE:
                                break;
                        default:
+                               charon->bus->alert(charon->bus, ALERT_LOCAL_AUTH_FAILED);
                                return FAILED;
                }
        }