Map auth_class to auth method and IKEv1 proposal attribute

This commit is contained in:
Martin Willi
2012-03-20 17:30:53 +01:00
parent eeca2af81c
commit b4e815354c
5 changed files with 31 additions and 2 deletions
@@ -73,6 +73,16 @@ enum auth_method_t {
* ECDSA with SHA-512 on the P-521 curve as specified in RFC 4754
*/
AUTH_ECDSA_521 = 11,
/**
* IKEv1 initiator XAUTH with PSK, outside of IANA range
*/
AUTH_XAUTH_INIT_PSK = 256,
/**
* IKEv1 initiator XAUTH with RSA, outside of IANA range
*/
AUTH_XAUTH_INIT_RSA,
};
/**
+5
View File
@@ -298,6 +298,10 @@ static auth_method_t get_auth_method(private_main_mode_t *this)
{
case AUTH_CLASS_PSK:
return AUTH_PSK;
case AUTH_CLASS_XAUTH_PSK:
return AUTH_XAUTH_INIT_PSK;
case AUTH_CLASS_XAUTH_PUBKEY:
return AUTH_XAUTH_INIT_RSA;
case AUTH_CLASS_PUBKEY:
/* TODO-IKEv1: look for a key, return RSA or ECDSA */
default:
@@ -586,6 +590,7 @@ static bool derive_keys(private_main_mode_t *this, chunk_t nonce_i,
switch (auth)
{
case AUTH_CLASS_PSK:
case AUTH_CLASS_XAUTH_PSK:
shared_key = lookup_shared_key(this);
break;
default: