summaryrefslogtreecommitdiffstats
path: root/test/evp_extra_test.c
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2019-09-11 17:52:30 +1000
committerShane Lontis <shane.lontis@oracle.com>2019-09-11 17:52:30 +1000
commitdc64dc2edd215d6cc5843c1bfe1f0b64bff26adc (patch)
tree2e2fb32d97e77ddc2cac66d0577dba3ddd73fa1c /test/evp_extra_test.c
parent64115f05ac950390e80e3993703513cda439fca0 (diff)
Add EVP_CIPHER_CTX_tag_length()
There is no deprecated CTRL support for this new field. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9698)
Diffstat (limited to 'test/evp_extra_test.c')
-rw-r--r--test/evp_extra_test.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/evp_extra_test.c b/test/evp_extra_test.c
index 7b7c632dd1..631ad65540 100644
--- a/test/evp_extra_test.c
+++ b/test/evp_extra_test.c
@@ -1241,10 +1241,13 @@ static int encrypt_decrypt(const EVP_CIPHER *cipher, const unsigned char *msg,
memset(key, 0, sizeof(key));
if (!TEST_ptr(ctx = EVP_CIPHER_CTX_new())
+ || !TEST_int_eq(EVP_CIPHER_CTX_tag_length(ctx), 0)
|| !TEST_true(EVP_CipherInit_ex(ctx, cipher, NULL, key, NULL, 1))
+ || !TEST_int_eq(EVP_CIPHER_CTX_tag_length(ctx), 0)
|| !TEST_true(EVP_CipherUpdate(ctx, ct, &ctlen, msg, len))
|| !TEST_true(EVP_CipherFinal_ex(ctx, ct, &ctlen))
|| !TEST_true(EVP_CipherInit_ex(ctx, cipher, NULL, key, NULL, 0))
+ || !TEST_int_eq(EVP_CIPHER_CTX_tag_length(ctx), 0)
|| !TEST_true(EVP_CipherUpdate(ctx, pt, &ptlen, ct, ctlen))
|| !TEST_true(EVP_CipherFinal_ex(ctx, pt, &ptlen))
|| !TEST_mem_eq(pt, ptlen, msg, len))