Adding support for AES GMAC (RFC4543).
This commit is contained in:
@@ -269,6 +269,7 @@ static bool is_authenticated_encryption(u_int16_t alg)
|
||||
case ENCR_CAMELLIA_CCM_ICV8:
|
||||
case ENCR_CAMELLIA_CCM_ICV12:
|
||||
case ENCR_CAMELLIA_CCM_ICV16:
|
||||
case ENCR_NULL_AUTH_AES_GMAC:
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
|
||||
@@ -181,7 +181,7 @@ static kernel_algorithm_t encryption_algs[] = {
|
||||
{ENCR_AES_GCM_ICV8, "rfc4106(gcm(aes))" },
|
||||
{ENCR_AES_GCM_ICV12, "rfc4106(gcm(aes))" },
|
||||
{ENCR_AES_GCM_ICV16, "rfc4106(gcm(aes))" },
|
||||
/* {ENCR_NULL_AUTH_AES_GMAC, "***" }, */
|
||||
{ENCR_NULL_AUTH_AES_GMAC, "rfc4543(gcm(aes))" },
|
||||
{ENCR_CAMELLIA_CBC, "cbc(camellia)" },
|
||||
/* {ENCR_CAMELLIA_CTR, "***" }, */
|
||||
/* {ENCR_CAMELLIA_CCM_ICV8, "***" }, */
|
||||
@@ -1007,6 +1007,7 @@ static status_t add_sa(private_kernel_netlink_ipsec_t *this,
|
||||
break;
|
||||
case ENCR_AES_CCM_ICV16:
|
||||
case ENCR_AES_GCM_ICV16:
|
||||
case ENCR_NULL_AUTH_AES_GMAC:
|
||||
case ENCR_CAMELLIA_CCM_ICV16:
|
||||
icv_size += 32;
|
||||
/* FALL */
|
||||
|
||||
@@ -99,8 +99,8 @@ struct keylen_entry_t {
|
||||
* Keylen for encryption algos
|
||||
*/
|
||||
keylen_entry_t keylen_enc[] = {
|
||||
{ENCR_DES, 64},
|
||||
{ENCR_3DES, 192},
|
||||
{ENCR_DES, 64},
|
||||
{ENCR_3DES, 192},
|
||||
{END_OF_LIST, 0}
|
||||
};
|
||||
|
||||
@@ -108,7 +108,7 @@ keylen_entry_t keylen_enc[] = {
|
||||
* Keylen for integrity algos
|
||||
*/
|
||||
keylen_entry_t keylen_int[] = {
|
||||
{AUTH_HMAC_MD5_96, 128},
|
||||
{AUTH_HMAC_MD5_96, 128},
|
||||
{AUTH_HMAC_SHA1_96, 160},
|
||||
{AUTH_HMAC_SHA2_256_96, 256},
|
||||
{AUTH_HMAC_SHA2_256_128, 256},
|
||||
@@ -414,7 +414,7 @@ static bool derive_child_keys(private_keymat_t *this,
|
||||
/* to bytes */
|
||||
enc_size /= 8;
|
||||
|
||||
/* CCM/GCM/CTR needs additional bytes */
|
||||
/* CCM/GCM/CTR/GMAC needs additional bytes */
|
||||
switch (enc_alg)
|
||||
{
|
||||
case ENCR_AES_CCM_ICV8:
|
||||
@@ -429,6 +429,7 @@ static bool derive_child_keys(private_keymat_t *this,
|
||||
case ENCR_AES_GCM_ICV12:
|
||||
case ENCR_AES_GCM_ICV16:
|
||||
case ENCR_AES_CTR:
|
||||
case ENCR_NULL_AUTH_AES_GMAC:
|
||||
enc_size += 4;
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user