summaryrefslogtreecommitdiff
path: root/cipher/cipher.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2015-10-14 11:52:40 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2015-10-14 11:52:40 +0900
commit813565a07ca575c87e1252c6ed26018653ecd338 (patch)
tree6be01a85707031937e9967babfcde92b988d4918 /cipher/cipher.c
parentfa94b6111948a614ebdcb67f7942eced8b84c579 (diff)
downloadlibgcrypt-813565a07ca575c87e1252c6ed26018653ecd338.tar.gz
Fix gpg_error_t and gpg_err_code_t confusion.
* src/gcrypt-int.h (_gcry_sexp_extract_param): Revert the change. * cipher/dsa.c (dsa_check_secret_key): Ditto. * src/sexp.c (_gcry_sexp_extract_param): Return gpg_err_code_t. * src/gcrypt-int.h (_gcry_err_make_from_errno) (_gcry_error_from_errno): Return gpg_error_t. * cipher/cipher.c (_gcry_cipher_open_internal) (_gcry_cipher_ctl, _gcry_cipher_ctl): Don't use gcry_error. * src/global.c (_gcry_vcontrol): Likewise. * cipher/ecc-eddsa.c (_gcry_ecc_eddsa_genkey): Use gpg_err_code_from_syserror. * cipher/mac.c (mac_reset, mac_setkey, mac_setiv, mac_write) (mac_read, mac_verify): Return gcry_err_code_t. * cipher/rsa-common.c (mgf1): Use gcry_err_code_t for ERR. * src/visibility.c (gcry_error_from_errno): Return gpg_error_t. -- Reverting a part of 73374fdd and fix _gcry_sexp_extract_param return type, instead. Fix similar coding mistakes, throughout.
Diffstat (limited to 'cipher/cipher.c')
-rw-r--r--cipher/cipher.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/cipher/cipher.c b/cipher/cipher.c
index 30c2f489..ab9f0dc5 100644
--- a/cipher/cipher.c
+++ b/cipher/cipher.c
@@ -590,7 +590,7 @@ _gcry_cipher_open_internal (gcry_cipher_hd_t *handle,
*handle = err ? NULL : h;
- return gcry_error (err);
+ return err;
}
@@ -1271,10 +1271,10 @@ _gcry_cipher_ctl (gcry_cipher_hd_t h, int cmd, void *buffer, size_t buflen)
size_t authtaglen;
if (h->mode != GCRY_CIPHER_MODE_CCM)
- return gcry_error (GPG_ERR_INV_CIPHER_MODE);
+ return GPG_ERR_INV_CIPHER_MODE;
if (!buffer || buflen != 3 * sizeof(u64))
- return gcry_error (GPG_ERR_INV_ARG);
+ return GPG_ERR_INV_ARG;
/* This command is used to pass additional length parameters needed
by CCM mode to initialize CBC-MAC. */
@@ -1317,7 +1317,7 @@ _gcry_cipher_ctl (gcry_cipher_hd_t h, int cmd, void *buffer, size_t buflen)
/* This command expects NULL for H and BUFFER to point to an
integer with the algo number. */
if( h || !buffer || buflen != sizeof(int) )
- return gcry_error (GPG_ERR_CIPHER_ALGO);
+ return GPG_ERR_CIPHER_ALGO;
disable_cipher_algo( *(int*)buffer );
break;