diff options
author | Richard Levitte <levitte@openssl.org> | 2019-10-10 18:14:33 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2019-10-11 15:55:36 +0200 |
commit | ff33581c67928d2c21f1e853bca3a561335d4c3e (patch) | |
tree | 13d6e996ba25e258f82862cbc7ce24be150bb95b /providers/common | |
parent | f7397f0d58ce7ddf4c5366cd1846f16b341fbe43 (diff) |
Providers: fix OSSL_FUNC_CIPHER_CIPHER functions
This involves gcm_cipher() (providers/common/ciphers/cipher_gcm.c),
ccm_cipher() (providers/common/ciphers/cipher_ccm.c), and
tdes_wrap_cipher() (providers/common/ciphers/cipher_tdes_wrap.c)
These are generic implementations of the OSSL_FUNC_CIPHER_CIPHER
function, which returned -1 on error when they should return 0.
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10137)
Diffstat (limited to 'providers/common')
-rw-r--r-- | providers/common/ciphers/cipher_ccm.c | 4 | ||||
-rw-r--r-- | providers/common/ciphers/cipher_gcm.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/providers/common/ciphers/cipher_ccm.c b/providers/common/ciphers/cipher_ccm.c index 904af3a5e0..021a004276 100644 --- a/providers/common/ciphers/cipher_ccm.c +++ b/providers/common/ciphers/cipher_ccm.c @@ -278,11 +278,11 @@ int ccm_cipher(void *vctx, if (outsize < inl) { ERR_raise(ERR_LIB_PROV, PROV_R_OUTPUT_BUFFER_TOO_SMALL); - return -1; + return 0; } if (ccm_cipher_internal(ctx, out, outl, in, inl) <= 0) - return -1; + return 0; *outl = inl; return 1; diff --git a/providers/common/ciphers/cipher_gcm.c b/providers/common/ciphers/cipher_gcm.c index 580928fdde..d7c67e8b6b 100644 --- a/providers/common/ciphers/cipher_gcm.c +++ b/providers/common/ciphers/cipher_gcm.c @@ -263,11 +263,11 @@ int gcm_cipher(void *vctx, if (outsize < inl) { ERR_raise(ERR_LIB_PROV, PROV_R_OUTPUT_BUFFER_TOO_SMALL); - return -1; + return 0; } if (gcm_cipher_internal(ctx, out, outl, in, inl) <= 0) - return -1; + return 0; *outl = inl; return 1; |