summaryrefslogtreecommitdiff
path: root/deps/openssl/openssl/test/evp_test.c
diff options
context:
space:
mode:
authorSam Roberts <vieuxtech@gmail.com>2019-06-12 13:43:44 -0700
committerRuben Bridgewater <ruben@bridgewater.de>2019-06-17 11:55:44 +0200
commit4c8fe4a96fddc66a18a33e7d8ae22ea10436ecb8 (patch)
tree165630be149e639f99070b5e4a5b3ec4fab21920 /deps/openssl/openssl/test/evp_test.c
parent5990c4d453b8fc8453a26566bb7ac680a76bd83f (diff)
downloadandroid-node-v8-4c8fe4a96fddc66a18a33e7d8ae22ea10436ecb8.tar.gz
android-node-v8-4c8fe4a96fddc66a18a33e7d8ae22ea10436ecb8.tar.bz2
android-node-v8-4c8fe4a96fddc66a18a33e7d8ae22ea10436ecb8.zip
deps: upgrade openssl sources to 1.1.1c
This updates all sources in deps/openssl/openssl by: $ cd deps/openssl/ $ rm -rf openssl $ tar zxf ~/tmp/openssl-1.1.1c.tar.gz $ mv openssl-1.1.1c openssl $ git add --all openssl $ git commit openssl PR-URL: https://github.com/nodejs/node/pull/28211 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Diffstat (limited to 'deps/openssl/openssl/test/evp_test.c')
-rw-r--r--deps/openssl/openssl/test/evp_test.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/deps/openssl/openssl/test/evp_test.c b/deps/openssl/openssl/test/evp_test.c
index 85c1552a7a..7a3e41c885 100644
--- a/deps/openssl/openssl/test/evp_test.c
+++ b/deps/openssl/openssl/test/evp_test.c
@@ -462,6 +462,7 @@ typedef struct cipher_data_st {
size_t aad_len;
unsigned char *tag;
size_t tag_len;
+ int tag_late;
} CIPHER_DATA;
static int cipher_test_init(EVP_TEST *t, const char *alg)
@@ -525,6 +526,15 @@ static int cipher_test_parse(EVP_TEST *t, const char *keyword,
return parse_bin(value, &cdat->aad, &cdat->aad_len);
if (strcmp(keyword, "Tag") == 0)
return parse_bin(value, &cdat->tag, &cdat->tag_len);
+ if (strcmp(keyword, "SetTagLate") == 0) {
+ if (strcmp(value, "TRUE") == 0)
+ cdat->tag_late = 1;
+ else if (strcmp(value, "FALSE") == 0)
+ cdat->tag_late = 0;
+ else
+ return 0;
+ return 1;
+ }
}
if (strcmp(keyword, "Operation") == 0) {
@@ -610,7 +620,7 @@ static int cipher_test_enc(EVP_TEST *t, int enc,
* If encrypting or OCB just set tag length initially, otherwise
* set tag length and value.
*/
- if (enc || expected->aead == EVP_CIPH_OCB_MODE) {
+ if (enc || expected->aead == EVP_CIPH_OCB_MODE || expected->tag_late) {
t->err = "TAG_LENGTH_SET_ERROR";
tag = NULL;
} else {
@@ -633,14 +643,6 @@ static int cipher_test_enc(EVP_TEST *t, int enc,
goto err;
}
- if (!enc && expected->aead == EVP_CIPH_OCB_MODE) {
- if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG,
- expected->tag_len, expected->tag)) {
- t->err = "TAG_SET_ERROR";
- goto err;
- }
- }
-
if (expected->aead == EVP_CIPH_CCM_MODE) {
if (!EVP_CipherUpdate(ctx, NULL, &tmplen, NULL, out_len)) {
t->err = "CCM_PLAINTEXT_LENGTH_SET_ERROR";
@@ -675,6 +677,15 @@ static int cipher_test_enc(EVP_TEST *t, int enc,
goto err;
}
}
+
+ if (!enc && (expected->aead == EVP_CIPH_OCB_MODE || expected->tag_late)) {
+ if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG,
+ expected->tag_len, expected->tag)) {
+ t->err = "TAG_SET_ERROR";
+ goto err;
+ }
+ }
+
EVP_CIPHER_CTX_set_padding(ctx, 0);
t->err = "CIPHERUPDATE_ERROR";
tmplen = 0;