Import OpenSSL 1.1.1i

This commit is contained in:
Steve Dower
2021-01-05 19:44:35 +00:00
parent 7f34c3085f
commit ae8aba4cbc
344 changed files with 4257 additions and 4161 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2017-2019 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2017-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -856,6 +856,38 @@ static int test_uint64(void)
return test_intern(&uint64_test_package);
}
typedef struct {
ASN1_STRING *invalidDirString;
} INVALIDTEMPLATE;
ASN1_SEQUENCE(INVALIDTEMPLATE) = {
/*
* DirectoryString is a CHOICE type so it must use explicit tagging -
* but we deliberately use implicit here, which makes this template invalid.
*/
ASN1_IMP(INVALIDTEMPLATE, invalidDirString, DIRECTORYSTRING, 12)
} static_ASN1_SEQUENCE_END(INVALIDTEMPLATE)
IMPLEMENT_STATIC_ASN1_ENCODE_FUNCTIONS(INVALIDTEMPLATE)
IMPLEMENT_STATIC_ASN1_ALLOC_FUNCTIONS(INVALIDTEMPLATE)
static int test_invalid_template(void)
{
INVALIDTEMPLATE *temp = INVALIDTEMPLATE_new();
int ret;
if (!TEST_ptr(temp))
return 0;
ret = i2d_INVALIDTEMPLATE(temp, NULL);
INVALIDTEMPLATE_free(temp);
/* We expect the i2d operation to fail */
return ret < 0;
}
int setup_tests(void)
{
#if OPENSSL_API_COMPAT < 0x10200000L
@@ -866,5 +898,6 @@ int setup_tests(void)
ADD_TEST(test_uint32);
ADD_TEST(test_int64);
ADD_TEST(test_uint64);
ADD_TEST(test_invalid_template);
return 1;
}