diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2014-11-03 13:21:31 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2014-11-03 13:49:44 +0100 |
commit | e29d027872fb61a6e7117d3b920626bbc638ac64 (patch) | |
tree | 81e97de83099b9b0c52b930dd738d1cc886e3824 /lib/crypto-api.c | |
parent | 6378c46c9c39628e52c86dd652fa43b2bee1c9e5 (diff) | |
download | gnutls-e29d027872fb61a6e7117d3b920626bbc638ac64.tar.gz |
Made AEAD type an alternative to stream and block
That way the terminology becomes closer to the TLS rfc.
Diffstat (limited to 'lib/crypto-api.c')
-rw-r--r-- | lib/crypto-api.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/crypto-api.c b/lib/crypto-api.c index 70dbb772bb..c7add3e6b9 100644 --- a/lib/crypto-api.c +++ b/lib/crypto-api.c @@ -75,7 +75,7 @@ gnutls_cipher_init(gnutls_cipher_hd_t * handle, _gnutls_cipher_init(&h->ctx_enc, e, key, iv, 1); - if (ret >= 0 && _gnutls_cipher_is_block(e) != 0) + if (ret >= 0 && _gnutls_cipher_type(e) == CIPHER_BLOCK) ret = _gnutls_cipher_init(&h->ctx_dec, e, key, iv, 0); @@ -156,7 +156,7 @@ gnutls_cipher_set_iv(gnutls_cipher_hd_t handle, void *iv, size_t ivlen) _gnutls_cipher_setiv(&h->ctx_enc, iv, ivlen); - if (_gnutls_cipher_is_block(h->ctx_enc.e) != 0) + if (_gnutls_cipher_type(h->ctx_enc.e) == CIPHER_BLOCK) _gnutls_cipher_setiv(&h->ctx_dec, iv, ivlen); } @@ -204,7 +204,7 @@ gnutls_cipher_decrypt(gnutls_cipher_hd_t handle, void *ctext, { api_cipher_hd_st *h = handle; - if (_gnutls_cipher_is_block(h->ctx_enc.e) == 0) + if (_gnutls_cipher_type(h->ctx_enc.e) != CIPHER_BLOCK) return _gnutls_cipher_decrypt(&h->ctx_enc, ctext, ctext_len); else @@ -262,7 +262,7 @@ gnutls_cipher_decrypt2(gnutls_cipher_hd_t handle, const void *ctext, { api_cipher_hd_st *h = handle; - if (_gnutls_cipher_is_block(h->ctx_enc.e) == 0) + if (_gnutls_cipher_type(h->ctx_enc.e) != CIPHER_BLOCK) return _gnutls_cipher_decrypt2(&h->ctx_enc, ctext, ctext_len, ptext, ptext_len); @@ -286,7 +286,7 @@ void gnutls_cipher_deinit(gnutls_cipher_hd_t handle) api_cipher_hd_st *h = handle; _gnutls_cipher_deinit(&h->ctx_enc); - if (_gnutls_cipher_is_block(h->ctx_enc.e) != 0) + if (_gnutls_cipher_type(h->ctx_enc.e) == CIPHER_BLOCK) _gnutls_cipher_deinit(&h->ctx_dec); gnutls_free(handle); } @@ -646,7 +646,7 @@ int gnutls_aead_cipher_init(gnutls_aead_cipher_hd_t * handle, const cipher_entry_st* e; e = cipher_to_entry(cipher); - if (e == NULL || e->aead == 0) + if (e == NULL || e->type != CIPHER_AEAD) return gnutls_assert_val(GNUTLS_E_INVALID_REQUEST); if (tag_size == 0) |