summaryrefslogtreecommitdiffstats
path: root/providers/implementations/ciphers
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2020-06-19 17:26:49 +0100
committerMatt Caswell <matt@openssl.org>2020-07-06 09:26:09 +0100
commit27d4c840fc399fe0d4550a5b88e91ecca887d1a4 (patch)
treeecbb43dcdbc63b48bafc84f548babc20eda9b75c /providers/implementations/ciphers
parent524cb684ac00922c4a21235a8ae2c66596893437 (diff)
Change ChaCha20-Poly1305 to be consistent with out ciphers
Other ciphers return the length of the Payload for TLS as a result of an EVP_DecryptUpdate() operation - but ChaCha20-Poly1305 did not. We change it so that it does. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12288)
Diffstat (limited to 'providers/implementations/ciphers')
-rw-r--r--providers/implementations/ciphers/cipher_chacha20_poly1305.c1
-rw-r--r--providers/implementations/ciphers/cipher_chacha20_poly1305_hw.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/providers/implementations/ciphers/cipher_chacha20_poly1305.c b/providers/implementations/ciphers/cipher_chacha20_poly1305.c
index c34ef320ab..3fa4684125 100644
--- a/providers/implementations/ciphers/cipher_chacha20_poly1305.c
+++ b/providers/implementations/ciphers/cipher_chacha20_poly1305.c
@@ -275,7 +275,6 @@ static int chacha20_poly1305_cipher(void *vctx, unsigned char *out,
if (!hw->aead_cipher(ctx, out, outl, in, inl))
return 0;
- *outl = inl;
return 1;
}
diff --git a/providers/implementations/ciphers/cipher_chacha20_poly1305_hw.c b/providers/implementations/ciphers/cipher_chacha20_poly1305_hw.c
index 74b8fb6586..70ffaf1588 100644
--- a/providers/implementations/ciphers/cipher_chacha20_poly1305_hw.c
+++ b/providers/implementations/ciphers/cipher_chacha20_poly1305_hw.c
@@ -252,6 +252,8 @@ static int chacha20_poly1305_tls_cipher(PROV_CIPHER_CTX *bctx,
len - POLY1305_BLOCK_SIZE);
return 0;
}
+ /* Strip the tag */
+ len -= POLY1305_BLOCK_SIZE;
}
*out_padlen = len;