gnutls_assert();
goto cleanup;
}
+#ifdef ENABLE_GOST
+ handle->continuous_mac = !!(me->flags & GNUTLS_MAC_FLAG_CONTINUOUS_MAC);
+#endif
handle->tag_size = _gnutls_mac_get_algo_len(me);
} else if (_gnutls_cipher_algo_is_aead(e)) {
{
if (handle->is_mac) {
#ifdef ENABLE_SSL3
- int ret;
-
if (handle->ssl_hmac) {
- ret =
+ int ret =
_gnutls_mac_output_ssl3(&handle->mac.dig, tag);
if (ret < 0)
return gnutls_assert_val(ret);
} else
+#endif
+#ifdef ENABLE_GOST
+ /* draft-smyshlyaev-tls12-gost-suites section 4.1.2 */
+ if (handle->continuous_mac) {
+ mac_hd_st temp_mac;
+ int ret = _gnutls_mac_copy(&handle->mac.mac, &temp_mac);
+ if (ret < 0)
+ return gnutls_assert_val(ret);
+ _gnutls_mac_deinit(&temp_mac, tag);
+ } else
#endif
_gnutls_mac_output(&handle->mac.mac, tag);
} else if (_gnutls_cipher_is_aead(&handle->cipher)) {
} gnutls_group_entry_st;
#define GNUTLS_MAC_FLAG_PREIMAGE_INSECURE 1 /* if this algorithm should not be trusted for pre-image attacks */
+#define GNUTLS_MAC_FLAG_CONTINUOUS_MAC (1 << 1) /* if this MAC should be used in a 'continuous' way in TLS */
/* This structure is used both for MACs and digests
*/
typedef struct mac_entry_st {