From: Jerry Shih Date: Mon, 25 Sep 2023 01:13:07 +0000 (+0800) Subject: Minor changes of the GCM-related code. X-Git-Tag: openssl-3.3.0-alpha1~737 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7468a3db137bd22dacbcced379b0711986b57067;p=thirdparty%2Fopenssl.git Minor changes of the GCM-related code. Unify the return value for `CRYPTO_gcm128_decrypt` as `CRYPTO_gcm128_encrypt`. Signed-off-by: Jerry Shih Signed-off-by: Phoebe Chen Reviewed-by: Tomas Mraz Reviewed-by: Paul Dale Reviewed-by: Hugo Landau (Merged from https://github.com/openssl/openssl/pull/21923) --- diff --git a/providers/implementations/ciphers/cipher_aes_gcm_hw.c b/providers/implementations/ciphers/cipher_aes_gcm_hw.c index 4830cdc1b2d..8f3c4870fd1 100644 --- a/providers/implementations/ciphers/cipher_aes_gcm_hw.c +++ b/providers/implementations/ciphers/cipher_aes_gcm_hw.c @@ -99,7 +99,7 @@ static int generic_aes_gcm_cipher_update(PROV_GCM_CTX *ctx, const unsigned char size_t res = (16 - ctx->gcm.mres) % 16; if (CRYPTO_gcm128_decrypt(&ctx->gcm, in, out, res)) - return -1; + return 0; bulk = AES_gcm_decrypt(in + res, out + res, len - res, ctx->gcm.key,