diff options
author | Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 2019-10-18 13:19:04 +0300 |
---|---|---|
committer | Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 2019-10-21 14:16:24 +0300 |
commit | 9e6d30751c911a64cc0bbe37f65ca124a9ec51cc (patch) | |
tree | 99268b45584fc5ca0b1a8a8a7149105a7d3867fb /lib/crypto-api.c | |
parent | c6b6f3130d4b9c88a5471ff7f7b113be8e8c8411 (diff) | |
download | gnutls-9e6d30751c911a64cc0bbe37f65ca124a9ec51cc.tar.gz |
cipher: replace several bools with single flags instance
Replace bools in cipher_entry_st with flags field.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Diffstat (limited to 'lib/crypto-api.c')
-rw-r--r-- | lib/crypto-api.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/crypto-api.c b/lib/crypto-api.c index 7308d7e7bb..d3e8094563 100644 --- a/lib/crypto-api.c +++ b/lib/crypto-api.c @@ -67,7 +67,7 @@ gnutls_cipher_init(gnutls_cipher_hd_t * handle, return gnutls_assert_val(GNUTLS_E_UNWANTED_ALGORITHM); e = cipher_to_entry(cipher); - if (e == NULL || e->only_aead) + if (e == NULL || (e->flags & GNUTLS_CIPHER_FLAG_ONLY_AEAD)) return gnutls_assert_val(GNUTLS_E_INVALID_REQUEST); *handle = gnutls_calloc(1, sizeof(api_cipher_hd_st)); @@ -1006,7 +1006,7 @@ gnutls_aead_cipher_encryptv(gnutls_aead_cipher_hd_t handle, else if (tag_size > (unsigned)_gnutls_cipher_get_tag_size(h->ctx_enc.e)) return gnutls_assert_val(GNUTLS_E_INVALID_REQUEST); - if (handle->ctx_enc.e->only_aead || handle->ctx_enc.encrypt == NULL) { + if ((handle->ctx_enc.e->flags & GNUTLS_CIPHER_FLAG_ONLY_AEAD) || handle->ctx_enc.encrypt == NULL) { /* ciphertext cannot be produced in a piecemeal approach */ struct iov_store_st auth; struct iov_store_st ptext; @@ -1130,7 +1130,7 @@ gnutls_aead_cipher_encryptv2(gnutls_aead_cipher_hd_t handle, * AEAD ciphers. When an AEAD cipher is used registered with gnutls_crypto_register_aead_cipher(), * then this becomes a convenience function as it missed the lower-level primitives * necessary for piecemeal encryption. */ - if (handle->ctx_enc.e->only_aead || handle->ctx_enc.encrypt == NULL) { + if ((handle->ctx_enc.e->flags & GNUTLS_CIPHER_FLAG_ONLY_AEAD) || handle->ctx_enc.encrypt == NULL) { /* ciphertext cannot be produced in a piecemeal approach */ struct iov_store_st auth; struct iov_store_st ptext; @@ -1274,7 +1274,7 @@ gnutls_aead_cipher_decryptv2(gnutls_aead_cipher_hd_t handle, * AEAD ciphers. When an AEAD cipher is used registered with gnutls_crypto_register_aead_cipher(), * then this becomes a convenience function as it missed the lower-level primitives * necessary for piecemeal encryption. */ - if (handle->ctx_enc.e->only_aead || handle->ctx_enc.encrypt == NULL) { + if ((handle->ctx_enc.e->flags & GNUTLS_CIPHER_FLAG_ONLY_AEAD) || handle->ctx_enc.encrypt == NULL) { /* ciphertext cannot be produced in a piecemeal approach */ struct iov_store_st auth; struct iov_store_st ctext; |