payload: Use common prefixes for all payload type identifiers
[strongswan.git] / src / libcharon / sa / authenticator.c
index 8d4b04b..8571274 100644 (file)
@@ -31,11 +31,12 @@ ENUM_BEGIN(auth_method_names, AUTH_RSA, AUTH_DSS,
        "RSA signature",
        "pre-shared key",
        "DSS signature");
-ENUM_NEXT(auth_method_names, AUTH_ECDSA_256, AUTH_ECDSA_521, AUTH_DSS,
+ENUM_NEXT(auth_method_names, AUTH_ECDSA_256, AUTH_GSPM, AUTH_DSS,
        "ECDSA-256 signature",
        "ECDSA-384 signature",
-       "ECDSA-521 signature");
-ENUM_NEXT(auth_method_names, AUTH_XAUTH_INIT_PSK, AUTH_HYBRID_RESP_RSA, AUTH_ECDSA_521,
+       "ECDSA-521 signature",
+       "secure password method");
+ENUM_NEXT(auth_method_names, AUTH_XAUTH_INIT_PSK, AUTH_HYBRID_RESP_RSA, AUTH_GSPM,
        "XAuthInitPSK",
        "XAuthRespPSK",
        "XAuthInitRSA",
@@ -85,7 +86,7 @@ authenticator_t *authenticator_create_verifier(
 {
        auth_payload_t *auth_payload;
 
-       auth_payload = (auth_payload_t*)message->get_payload(message, AUTHENTICATION);
+       auth_payload = (auth_payload_t*)message->get_payload(message, PLV2_AUTH);
        if (auth_payload == NULL)
        {
                return (authenticator_t*)eap_authenticator_create_verifier(ike_sa,
@@ -133,7 +134,13 @@ authenticator_t *authenticator_create_v1(ike_sa_t *ike_sa, bool initiator,
                case AUTH_XAUTH_RESP_RSA:
                        return (authenticator_t*)pubkey_v1_authenticator_create(ike_sa,
                                                                                initiator, dh, dh_value, sa_payload,
-                                                                               id_payload);
+                                                                               id_payload, KEY_RSA);
+               case AUTH_ECDSA_256:
+               case AUTH_ECDSA_384:
+               case AUTH_ECDSA_521:
+                       return (authenticator_t*)pubkey_v1_authenticator_create(ike_sa,
+                                                                               initiator, dh, dh_value, sa_payload,
+                                                                               id_payload, KEY_ECDSA);
                case AUTH_HYBRID_INIT_RSA:
                case AUTH_HYBRID_RESP_RSA:
                        return (authenticator_t*)hybrid_authenticator_create(ike_sa,