diff options
author | Matt Caswell <matt@openssl.org> | 2020-06-22 16:01:31 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2020-07-06 09:26:09 +0100 |
commit | ee0c849e5a1c26ed16c08311efdfd78c8e4c8221 (patch) | |
tree | 3d3826e5005ac5c2fe78fb47589e4b3cb3495f4d /providers | |
parent | 978cc3648d02551c6ada328708306dad2d3ce07a (diff) |
Ensure GCM "update" failures return 0 on error
EVP_CipherUpdate is supposed to return 1 for success or 0 for error.
However for GCM ciphers it was sometimes returning -1 for error.
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/12288)
Diffstat (limited to 'providers')
-rw-r--r-- | providers/implementations/ciphers/ciphercommon_gcm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/providers/implementations/ciphers/ciphercommon_gcm.c b/providers/implementations/ciphers/ciphercommon_gcm.c index 7daa8dce5b..080fcc9bc2 100644 --- a/providers/implementations/ciphers/ciphercommon_gcm.c +++ b/providers/implementations/ciphers/ciphercommon_gcm.c @@ -280,12 +280,12 @@ int gcm_stream_update(void *vctx, unsigned char *out, size_t *outl, 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) { ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_FAILED); - return -1; + return 0; } return 1; } |