That is, there are AEAD modes like CCM that can only be used through
the AEAD API. Always refuse calls to gnutls_cipher_init() in these
modes.
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
.implicit_iv = 4,
.explicit_iv = 8,
.cipher_iv = 12,
+ .only_aead = 1,
.tagsize = 16},
{ .name = "AES-256-CCM",
.id = GNUTLS_CIPHER_AES_256_CCM,
.implicit_iv = 4,
.explicit_iv = 8,
.cipher_iv = 12,
+ .only_aead = 1,
.tagsize = 16},
{ .name = "AES-128-CCM-8",
.id = GNUTLS_CIPHER_AES_128_CCM_8,
.implicit_iv = 4,
.explicit_iv = 8,
.cipher_iv = 12,
+ .only_aead = 1,
.tagsize = 8},
{ .name = "AES-256-CCM-8",
.id = GNUTLS_CIPHER_AES_256_CCM_8,
.implicit_iv = 4,
.explicit_iv = 8,
.cipher_iv = 12,
+ .only_aead = 1,
.tagsize = 8},
{ .name = "ARCFOUR-128",
.id = GNUTLS_CIPHER_ARCFOUR_128,
const cipher_entry_st* e;
e = cipher_to_entry(cipher);
- if (e == NULL)
+ if (e == NULL || e->only_aead)
return gnutls_assert_val(GNUTLS_E_INVALID_REQUEST);
*handle = gnutls_calloc(1, sizeof(api_cipher_hd_st));
uint16_t explicit_iv; /* the size of explicit IV - the IV stored in record */
uint16_t cipher_iv; /* the size of IV needed by the cipher */
uint16_t tagsize;
- bool xor_nonce; /* In this TLS AEAD cipher xor the implicit_iv with the nonce */
+ bool xor_nonce; /* In this TLS AEAD cipher xor the implicit_iv with the nonce */
+ bool only_aead; /* When set, this cipher is only available through the new AEAD API */
} cipher_entry_st;
typedef struct gnutls_cipher_suite_entry_st {