Browse Source

Minor changes of the GCM-related code.

Unify the return value for `CRYPTO_gcm128_decrypt` as `CRYPTO_gcm128_encrypt`.

Signed-off-by: Jerry Shih <jerry.shih@sifive.com>
Signed-off-by: Phoebe Chen <phoebe.chen@sifive.com>

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21923)
Jerry Shih 8 months ago
parent
commit
7468a3db13
1 changed files with 1 additions and 1 deletions
  1. 1 1
      providers/implementations/ciphers/cipher_aes_gcm_hw.c

+ 1 - 1
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,