3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-25 17:59:25 +01:00

ie: Add support for GCMP|CCMP-256

This commit is contained in:
Denis Kenzior 2022-10-21 10:42:45 -05:00
parent e30298d957
commit 5998043bd2
2 changed files with 28 additions and 0 deletions

View File

@ -432,6 +432,10 @@ uint32_t ie_rsn_cipher_suite_to_cipher(enum ie_rsn_cipher_suite suite)
return CRYPTO_CIPHER_BIP_CMAC; return CRYPTO_CIPHER_BIP_CMAC;
case IE_RSN_CIPHER_SUITE_GCMP: case IE_RSN_CIPHER_SUITE_GCMP:
return CRYPTO_CIPHER_GCMP; return CRYPTO_CIPHER_GCMP;
case IE_RSN_CIPHER_SUITE_GCMP_256:
return CRYPTO_CIPHER_GCMP_256;
case IE_RSN_CIPHER_SUITE_CCMP_256:
return CRYPTO_CIPHER_CCMP_256;
default: default:
return 0; return 0;
} }
@ -452,6 +456,10 @@ const char *ie_rsn_cipher_suite_to_string(enum ie_rsn_cipher_suite suite)
return "BIP-CMAC-128"; return "BIP-CMAC-128";
case IE_RSN_CIPHER_SUITE_GCMP: case IE_RSN_CIPHER_SUITE_GCMP:
return "GCMP-128"; return "GCMP-128";
case IE_RSN_CIPHER_SUITE_GCMP_256:
return "GCMP-256";
case IE_RSN_CIPHER_SUITE_CCMP_256:
return "CCMP-256";
case IE_RSN_CIPHER_SUITE_NO_GROUP_TRAFFIC: case IE_RSN_CIPHER_SUITE_NO_GROUP_TRAFFIC:
return "NO-TRAFFIC"; return "NO-TRAFFIC";
case IE_RSN_CIPHER_SUITE_USE_GROUP_CIPHER: case IE_RSN_CIPHER_SUITE_USE_GROUP_CIPHER:
@ -496,6 +504,12 @@ static bool ie_parse_cipher_suite(const uint8_t *data,
case 8: case 8:
*out = IE_RSN_CIPHER_SUITE_GCMP; *out = IE_RSN_CIPHER_SUITE_GCMP;
return true; return true;
case 9:
*out = IE_RSN_CIPHER_SUITE_GCMP_256;
return true;
case 10:
*out = IE_RSN_CIPHER_SUITE_CCMP_256;
return true;
default: default:
return false; return false;
} }
@ -610,6 +624,8 @@ static bool ie_parse_group_cipher(const uint8_t *data,
case IE_RSN_CIPHER_SUITE_WEP40: case IE_RSN_CIPHER_SUITE_WEP40:
case IE_RSN_CIPHER_SUITE_NO_GROUP_TRAFFIC: case IE_RSN_CIPHER_SUITE_NO_GROUP_TRAFFIC:
case IE_RSN_CIPHER_SUITE_GCMP: case IE_RSN_CIPHER_SUITE_GCMP:
case IE_RSN_CIPHER_SUITE_GCMP_256:
case IE_RSN_CIPHER_SUITE_CCMP_256:
break; break;
default: default:
return false; return false;
@ -635,6 +651,8 @@ static int ie_parse_pairwise_cipher(const uint8_t *data,
case IE_RSN_CIPHER_SUITE_WEP40: case IE_RSN_CIPHER_SUITE_WEP40:
case IE_RSN_CIPHER_SUITE_USE_GROUP_CIPHER: case IE_RSN_CIPHER_SUITE_USE_GROUP_CIPHER:
case IE_RSN_CIPHER_SUITE_GCMP: case IE_RSN_CIPHER_SUITE_GCMP:
case IE_RSN_CIPHER_SUITE_GCMP_256:
case IE_RSN_CIPHER_SUITE_CCMP_256:
break; break;
default: default:
return -ERANGE; return -ERANGE;
@ -945,6 +963,12 @@ static bool ie_build_cipher_suite(uint8_t *data, const uint8_t *oui,
case IE_RSN_CIPHER_SUITE_GCMP: case IE_RSN_CIPHER_SUITE_GCMP:
selector = 8; selector = 8;
goto done; goto done;
case IE_RSN_CIPHER_SUITE_GCMP_256:
selector = 9;
goto done;
case IE_RSN_CIPHER_SUITE_CCMP_256:
selector = 10;
goto done;
} }
return false; return false;
@ -1034,6 +1058,8 @@ static int build_ciphers_common(const struct ie_rsn_info *info, uint8_t *to,
IE_RSN_CIPHER_SUITE_WEP40, IE_RSN_CIPHER_SUITE_WEP40,
IE_RSN_CIPHER_SUITE_USE_GROUP_CIPHER, IE_RSN_CIPHER_SUITE_USE_GROUP_CIPHER,
IE_RSN_CIPHER_SUITE_GCMP, IE_RSN_CIPHER_SUITE_GCMP,
IE_RSN_CIPHER_SUITE_GCMP_256,
IE_RSN_CIPHER_SUITE_CCMP_256,
}; };
unsigned int pos = 0; unsigned int pos = 0;
unsigned int i; unsigned int i;

View File

@ -332,6 +332,8 @@ enum ie_rsn_cipher_suite {
IE_RSN_CIPHER_SUITE_BIP_CMAC = 0x0020, IE_RSN_CIPHER_SUITE_BIP_CMAC = 0x0020,
IE_RSN_CIPHER_SUITE_NO_GROUP_TRAFFIC = 0x0040, IE_RSN_CIPHER_SUITE_NO_GROUP_TRAFFIC = 0x0040,
IE_RSN_CIPHER_SUITE_GCMP = 0x0080, IE_RSN_CIPHER_SUITE_GCMP = 0x0080,
IE_RSN_CIPHER_SUITE_GCMP_256 = 0x0100,
IE_RSN_CIPHER_SUITE_CCMP_256 = 0x0200,
}; };
enum ie_rsn_akm_suite { enum ie_rsn_akm_suite {