Latest update.
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#include <openssl/bn.h>
|
||||
#include "internal/asn1_dsa.h"
|
||||
#include "crypto/asn1_dsa.h"
|
||||
#include "testutil.h"
|
||||
|
||||
static unsigned char t_dsa_sig[] = {
|
||||
|
||||
@@ -59,7 +59,7 @@ static int test_tbl_standard(void)
|
||||
*
|
||||
***/
|
||||
|
||||
#include "internal/asn1_int.h"
|
||||
#include "crypto/asn1.h"
|
||||
#include "../crypto/asn1/standard_methods.h"
|
||||
|
||||
static int test_standard_methods(void)
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "internal/numbers.h"
|
||||
#include "testutil.h"
|
||||
#include "bn_prime.h"
|
||||
#include "internal/bn_int.h"
|
||||
#include "crypto/bn.h"
|
||||
|
||||
static BN_CTX *ctx;
|
||||
|
||||
|
||||
+56
-2
@@ -1634,6 +1634,30 @@ static int file_modsqrt(STANZA *s)
|
||||
return st;
|
||||
}
|
||||
|
||||
static int file_gcd(STANZA *s)
|
||||
{
|
||||
BIGNUM *a = NULL, *b = NULL, *gcd = NULL, *ret = NULL;
|
||||
int st = 0;
|
||||
|
||||
if (!TEST_ptr(a = getBN(s, "A"))
|
||||
|| !TEST_ptr(b = getBN(s, "B"))
|
||||
|| !TEST_ptr(gcd = getBN(s, "GCD"))
|
||||
|| !TEST_ptr(ret = BN_new()))
|
||||
goto err;
|
||||
|
||||
if (!TEST_true(BN_gcd(ret, a, b, ctx))
|
||||
|| !equalBN("gcd(A,B)", gcd, ret))
|
||||
goto err;
|
||||
|
||||
st = 1;
|
||||
err:
|
||||
BN_free(a);
|
||||
BN_free(b);
|
||||
BN_free(gcd);
|
||||
BN_free(ret);
|
||||
return st;
|
||||
}
|
||||
|
||||
static int test_bn2padded(void)
|
||||
{
|
||||
#if HAVE_BN_PADDED
|
||||
@@ -2312,7 +2336,7 @@ static int test_is_prime(int i)
|
||||
|
||||
for (trial = 0; trial <= 1; ++trial) {
|
||||
if (!TEST_true(BN_set_word(r, primes[i]))
|
||||
|| !TEST_int_eq(BN_is_prime_fasttest_ex(r, 1, ctx, trial, NULL),
|
||||
|| !TEST_int_eq(BN_check_prime(r, ctx, NULL),
|
||||
1))
|
||||
goto err;
|
||||
}
|
||||
@@ -2336,7 +2360,7 @@ static int test_not_prime(int i)
|
||||
|
||||
for (trial = 0; trial <= 1; ++trial) {
|
||||
if (!TEST_true(BN_set_word(r, not_primes[i]))
|
||||
|| !TEST_false(BN_is_prime_fasttest_ex(r, 1, ctx, trial, NULL)))
|
||||
|| !TEST_false(BN_check_prime(r, ctx, NULL)))
|
||||
goto err;
|
||||
}
|
||||
|
||||
@@ -2432,6 +2456,34 @@ static int test_ctx_consttime_flag(void)
|
||||
return st;
|
||||
}
|
||||
|
||||
static int test_gcd_prime(void)
|
||||
{
|
||||
BIGNUM *a = NULL, *b = NULL, *gcd = NULL;
|
||||
int i, st = 0;
|
||||
|
||||
if (!TEST_ptr(a = BN_new())
|
||||
|| !TEST_ptr(b = BN_new())
|
||||
|| !TEST_ptr(gcd = BN_new()))
|
||||
goto err;
|
||||
|
||||
if (!TEST_true(BN_generate_prime_ex(a, 1024, 0, NULL, NULL, NULL)))
|
||||
goto err;
|
||||
for (i = 0; i < NUM0; i++) {
|
||||
if (!TEST_true(BN_generate_prime_ex(b, 1024, 0,
|
||||
NULL, NULL, NULL))
|
||||
|| !TEST_true(BN_gcd(gcd, a, b, ctx))
|
||||
|| !TEST_true(BN_is_one(gcd)))
|
||||
goto err;
|
||||
}
|
||||
|
||||
st = 1;
|
||||
err:
|
||||
BN_free(a);
|
||||
BN_free(b);
|
||||
BN_free(gcd);
|
||||
return st;
|
||||
}
|
||||
|
||||
static int file_test_run(STANZA *s)
|
||||
{
|
||||
static const FILETEST filetests[] = {
|
||||
@@ -2446,6 +2498,7 @@ static int file_test_run(STANZA *s)
|
||||
{"ModExp", file_modexp},
|
||||
{"Exp", file_exp},
|
||||
{"ModSqrt", file_modsqrt},
|
||||
{"GCD", file_gcd},
|
||||
};
|
||||
int numtests = OSSL_NELEM(filetests);
|
||||
const FILETEST *tp = filetests;
|
||||
@@ -2567,6 +2620,7 @@ int setup_tests(void)
|
||||
#endif
|
||||
ADD_ALL_TESTS(test_is_prime, (int)OSSL_NELEM(primes));
|
||||
ADD_ALL_TESTS(test_not_prime, (int)OSSL_NELEM(not_primes));
|
||||
ADD_TEST(test_gcd_prime);
|
||||
if (stochastic)
|
||||
ADD_TEST(test_rand_range);
|
||||
} else {
|
||||
|
||||
+16
-3
@@ -302,6 +302,7 @@ IF[{- !$disabled{tests} -}]
|
||||
INCLUDE[ssl_test_ctx.o]=../include
|
||||
INCLUDE[handshake_helper.o]=.. ../include
|
||||
INCLUDE[ssltestlib.o]=.. ../include
|
||||
INCLUDE[cmp_testlib.o]=.. ../include ../apps/include
|
||||
|
||||
SOURCE[x509aux]=x509aux.c
|
||||
INCLUDE[x509aux]=../include ../apps/include
|
||||
@@ -468,6 +469,18 @@ IF[{- !$disabled{tests} -}]
|
||||
INCLUDE[conf_include_test]=../include ../apps/include
|
||||
DEPEND[conf_include_test]=../libcrypto libtestutil.a
|
||||
|
||||
IF[{- !$disabled{cmp} -}]
|
||||
PROGRAMS{noinst}=cmp_asn_test cmp_ctx_test
|
||||
ENDIF
|
||||
|
||||
SOURCE[cmp_asn_test]=cmp_asn_test.c cmp_testlib.c
|
||||
INCLUDE[cmp_asn_test]=.. ../include ../apps/include
|
||||
DEPEND[cmp_asn_test]=../libcrypto.a libtestutil.a
|
||||
|
||||
SOURCE[cmp_ctx_test]=cmp_ctx_test.c cmp_testlib.c
|
||||
INCLUDE[cmp_ctx_test]=.. ../include ../apps/include
|
||||
DEPEND[cmp_ctx_test]=../libcrypto.a libtestutil.a
|
||||
|
||||
# Internal test programs. These are essentially a collection of internal
|
||||
# test routines. Some of them need to reach internal symbols that aren't
|
||||
# available through the shared library (at least on Linux, Solaris, Windows
|
||||
@@ -533,7 +546,7 @@ IF[{- !$disabled{tests} -}]
|
||||
DEPEND[property_test]=../libcrypto.a libtestutil.a
|
||||
|
||||
SOURCE[ctype_internal_test]=ctype_internal_test.c
|
||||
INCLUDE[ctype_internal_test]=.. ../crypto/include ../include ../apps/include
|
||||
INCLUDE[ctype_internal_test]=.. ../include ../apps/include
|
||||
DEPEND[ctype_internal_test]=../libcrypto.a libtestutil.a
|
||||
|
||||
SOURCE[sparse_array_test]=sparse_array_test.c
|
||||
@@ -565,11 +578,11 @@ IF[{- !$disabled{tests} -}]
|
||||
DEPEND[rdrand_sanitytest]=../libcrypto.a libtestutil.a
|
||||
|
||||
SOURCE[rsa_sp800_56b_test]=rsa_sp800_56b_test.c
|
||||
INCLUDE[rsa_sp800_56b_test]=.. ../include ../crypto/include ../crypto/rsa ../apps/include
|
||||
INCLUDE[rsa_sp800_56b_test]=.. ../include ../crypto/rsa ../apps/include
|
||||
DEPEND[rsa_sp800_56b_test]=../libcrypto.a libtestutil.a
|
||||
|
||||
SOURCE[bn_internal_test]=bn_internal_test.c
|
||||
INCLUDE[bn_internal_test]=.. ../include ../crypto/include ../crypto/bn ../apps/include
|
||||
INCLUDE[bn_internal_test]=.. ../include ../crypto/bn ../apps/include
|
||||
DEPEND[bn_internal_test]=../libcrypto.a libtestutil.a
|
||||
|
||||
SOURCE[asn1_dsa_internal_test]=asn1_dsa_internal_test.c
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <string.h>
|
||||
#include <openssl/opensslconf.h>
|
||||
#include "testutil.h"
|
||||
#include "internal/chacha.h"
|
||||
#include "crypto/chacha.h"
|
||||
|
||||
static const unsigned int key[] = {
|
||||
0x03020100, 0x07060504, 0x0b0a0908, 0x0f0e0d0c,
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#include "internal/nelem.h"
|
||||
#include "testutil.h"
|
||||
#include "../ssl/ssl_locl.h"
|
||||
#include "../ssl/ssl_local.h"
|
||||
|
||||
static int cipher_overhead(void)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
/*
|
||||
* Copyright 2007-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright Nokia 2007-2019
|
||||
* Copyright Siemens AG 2015-2019
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#include "cmp_testlib.h"
|
||||
|
||||
static unsigned char rand_data[OSSL_CMP_TRANSACTIONID_LENGTH];
|
||||
|
||||
typedef struct test_fixture {
|
||||
const char *test_case_name;
|
||||
int expected;
|
||||
ASN1_OCTET_STRING *src_string;
|
||||
ASN1_OCTET_STRING *tgt_string;
|
||||
|
||||
} CMP_ASN_TEST_FIXTURE;
|
||||
|
||||
static CMP_ASN_TEST_FIXTURE *set_up(const char *const test_case_name)
|
||||
{
|
||||
CMP_ASN_TEST_FIXTURE *fixture;
|
||||
int setup_ok = 0;
|
||||
|
||||
/* Allocate memory owned by the fixture, exit on error */
|
||||
if (!TEST_ptr(fixture = OPENSSL_zalloc(sizeof(*fixture))))
|
||||
goto err;
|
||||
fixture->test_case_name = test_case_name;
|
||||
setup_ok = 1;
|
||||
|
||||
err:
|
||||
if (!setup_ok) {
|
||||
#ifndef OPENSSL_NO_STDIO
|
||||
ERR_print_errors_fp(stderr);
|
||||
#endif
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
return fixture;
|
||||
}
|
||||
|
||||
static void tear_down(CMP_ASN_TEST_FIXTURE *fixture)
|
||||
{
|
||||
ASN1_OCTET_STRING_free(fixture->src_string);
|
||||
if (fixture->tgt_string != fixture->src_string)
|
||||
ASN1_OCTET_STRING_free(fixture->tgt_string);
|
||||
|
||||
OPENSSL_free(fixture);
|
||||
}
|
||||
|
||||
static int execute_cmp_asn1_get_int_test(CMP_ASN_TEST_FIXTURE *
|
||||
fixture)
|
||||
{
|
||||
ASN1_INTEGER *asn1integer = ASN1_INTEGER_new();
|
||||
ASN1_INTEGER_set(asn1integer, 77);
|
||||
if (!TEST_int_eq(77, ossl_cmp_asn1_get_int(asn1integer)))
|
||||
return 0;
|
||||
ASN1_INTEGER_free(asn1integer);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int test_cmp_asn1_get_int(void)
|
||||
{
|
||||
SETUP_TEST_FIXTURE(CMP_ASN_TEST_FIXTURE, set_up);
|
||||
fixture->expected = 1;
|
||||
EXECUTE_TEST(execute_cmp_asn1_get_int_test, tear_down);
|
||||
return result;
|
||||
}
|
||||
|
||||
static int execute_CMP_ASN1_OCTET_STRING_set1_test(CMP_ASN_TEST_FIXTURE *
|
||||
fixture)
|
||||
{
|
||||
if (!TEST_int_eq(fixture->expected,
|
||||
ossl_cmp_asn1_octet_string_set1(&fixture->tgt_string,
|
||||
fixture->src_string)))
|
||||
return 0;
|
||||
if (fixture->expected != 0)
|
||||
return TEST_int_eq(0, ASN1_OCTET_STRING_cmp(fixture->tgt_string,
|
||||
fixture->src_string));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int test_ASN1_OCTET_STRING_set(void)
|
||||
{
|
||||
SETUP_TEST_FIXTURE(CMP_ASN_TEST_FIXTURE, set_up);
|
||||
fixture->expected = 1;
|
||||
if (!TEST_ptr(fixture->tgt_string = ASN1_OCTET_STRING_new())
|
||||
|| !TEST_ptr(fixture->src_string = ASN1_OCTET_STRING_new())
|
||||
|| !TEST_true(ASN1_OCTET_STRING_set(fixture->src_string, rand_data,
|
||||
sizeof(rand_data)))) {
|
||||
tear_down(fixture);
|
||||
fixture = NULL;
|
||||
}
|
||||
EXECUTE_TEST(execute_CMP_ASN1_OCTET_STRING_set1_test, tear_down);
|
||||
return result;
|
||||
}
|
||||
|
||||
static int test_ASN1_OCTET_STRING_set_tgt_is_src(void)
|
||||
{
|
||||
SETUP_TEST_FIXTURE(CMP_ASN_TEST_FIXTURE, set_up);
|
||||
fixture->expected = 1;
|
||||
if (!TEST_ptr(fixture->src_string = ASN1_OCTET_STRING_new())
|
||||
|| !(fixture->tgt_string = fixture->src_string)
|
||||
|| !TEST_true(ASN1_OCTET_STRING_set(fixture->src_string, rand_data,
|
||||
sizeof(rand_data)))) {
|
||||
tear_down(fixture);
|
||||
fixture = NULL;
|
||||
}
|
||||
EXECUTE_TEST(execute_CMP_ASN1_OCTET_STRING_set1_test, tear_down);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
void cleanup_tests(void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int setup_tests(void)
|
||||
{
|
||||
/* ASN.1 related tests */
|
||||
ADD_TEST(test_cmp_asn1_get_int);
|
||||
ADD_TEST(test_ASN1_OCTET_STRING_set);
|
||||
ADD_TEST(test_ASN1_OCTET_STRING_set_tgt_is_src);
|
||||
/* TODO make sure that total number of tests (here currently 24) is shown,
|
||||
also for other cmp_*text.c. Currently the test drivers always show 1. */
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -0,0 +1,865 @@
|
||||
/*
|
||||
* Copyright 2007-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright Nokia 2007-2019
|
||||
* Copyright Siemens AG 2015-2019
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#include "cmp_testlib.h"
|
||||
|
||||
#include <openssl/x509_vfy.h>
|
||||
|
||||
typedef struct test_fixture {
|
||||
const char *test_case_name;
|
||||
OSSL_CMP_CTX *ctx;
|
||||
} OSSL_CMP_CTX_TEST_FIXTURE;
|
||||
|
||||
static void tear_down(OSSL_CMP_CTX_TEST_FIXTURE *fixture)
|
||||
{
|
||||
if (fixture != NULL)
|
||||
OSSL_CMP_CTX_free(fixture->ctx);
|
||||
OPENSSL_free(fixture);
|
||||
}
|
||||
|
||||
static OSSL_CMP_CTX_TEST_FIXTURE *set_up(const char *const test_case_name)
|
||||
{
|
||||
OSSL_CMP_CTX_TEST_FIXTURE *fixture;
|
||||
|
||||
if (!TEST_ptr(fixture = OPENSSL_zalloc(sizeof(*fixture)))
|
||||
|| !TEST_ptr(fixture->ctx = OSSL_CMP_CTX_new())) {
|
||||
tear_down(fixture);
|
||||
return NULL;
|
||||
}
|
||||
fixture->test_case_name = test_case_name;
|
||||
return fixture;
|
||||
}
|
||||
|
||||
static STACK_OF(X509) *sk_X509_new_1(void) {
|
||||
STACK_OF(X509) *sk = sk_X509_new_null();
|
||||
X509 *x = X509_new();
|
||||
|
||||
if (x == NULL || !sk_X509_push(sk, x)) {
|
||||
sk_X509_free(sk);
|
||||
X509_free(x);
|
||||
sk = NULL;
|
||||
}
|
||||
return sk;
|
||||
}
|
||||
|
||||
static void sk_X509_pop_X509_free(STACK_OF(X509) *sk) {
|
||||
sk_X509_pop_free(sk, X509_free);
|
||||
}
|
||||
|
||||
static int execute_CTX_reinit_test(OSSL_CMP_CTX_TEST_FIXTURE *fixture)
|
||||
{
|
||||
OSSL_CMP_CTX *ctx = fixture->ctx;
|
||||
ASN1_OCTET_STRING *bytes = NULL;
|
||||
STACK_OF(X509) *certs = NULL;
|
||||
int res = 0;
|
||||
|
||||
/* set non-default values in all relevant fields */
|
||||
ctx->status = 1;
|
||||
ctx->failInfoCode = 1;
|
||||
if (!ossl_cmp_ctx_set0_statusString(ctx, sk_ASN1_UTF8STRING_new_null())
|
||||
|| !ossl_cmp_ctx_set0_newCert(ctx, X509_new())
|
||||
|| !TEST_ptr(certs = sk_X509_new_1())
|
||||
|| !ossl_cmp_ctx_set1_caPubs(ctx, certs)
|
||||
|| !ossl_cmp_ctx_set1_extraCertsIn(ctx, certs)
|
||||
|| !ossl_cmp_ctx_set0_validatedSrvCert(ctx, X509_new())
|
||||
|| !TEST_ptr(bytes = ASN1_OCTET_STRING_new())
|
||||
|| !OSSL_CMP_CTX_set1_transactionID(ctx, bytes)
|
||||
|| !OSSL_CMP_CTX_set1_senderNonce(ctx, bytes)
|
||||
|| !ossl_cmp_ctx_set1_recipNonce(ctx, bytes))
|
||||
|
||||
goto err;
|
||||
|
||||
if (!TEST_true(OSSL_CMP_CTX_reinit(ctx)))
|
||||
goto err;
|
||||
|
||||
/* check whether values have been reset to default in all relevant fields */
|
||||
if (!TEST_true(ctx->status == -1
|
||||
&& ctx->failInfoCode == -1
|
||||
&& ctx->statusString == NULL
|
||||
&& ctx->newCert == NULL
|
||||
&& ctx->caPubs == NULL
|
||||
&& ctx->extraCertsIn == NULL
|
||||
&& ctx->validatedSrvCert == NULL
|
||||
&& ctx->transactionID == NULL
|
||||
&& ctx->senderNonce == NULL
|
||||
&& ctx->recipNonce == NULL))
|
||||
goto err;
|
||||
|
||||
/* this does not check that all remaining fields are untouched */
|
||||
res = 1;
|
||||
|
||||
err:
|
||||
sk_X509_pop_X509_free(certs);
|
||||
ASN1_OCTET_STRING_free(bytes);
|
||||
return res;
|
||||
}
|
||||
|
||||
static int test_CTX_reinit(void)
|
||||
{
|
||||
SETUP_TEST_FIXTURE(OSSL_CMP_CTX_TEST_FIXTURE, set_up);
|
||||
EXECUTE_TEST(execute_CTX_reinit_test, tear_down);
|
||||
return result;
|
||||
}
|
||||
|
||||
#if !defined(OPENSSL_NO_ERR) && !defined(OPENSSL_NO_AUTOERRINIT)
|
||||
|
||||
static int msg_total_size = 0;
|
||||
static int msg_total_size_log_cb(const char *func, const char *file, int line,
|
||||
OSSL_CMP_severity level, const char *msg)
|
||||
{
|
||||
msg_total_size += strlen(msg);
|
||||
return 1;
|
||||
}
|
||||
|
||||
# define STR64 "This is a 64 bytes looooooooooooooooooooooooooooooooong string.\n"
|
||||
/* max string length ISO C90 compilers are required to support is 509. */
|
||||
# define STR509 STR64 STR64 STR64 STR64 STR64 STR64 STR64 \
|
||||
"This is a 61 bytes loooooooooooooooooooooooooooooong string.\n"
|
||||
static const char *const max_str_literal = STR509;
|
||||
# define STR_SEP "<SEP>"
|
||||
|
||||
static int execute_CTX_print_errors_test(OSSL_CMP_CTX_TEST_FIXTURE *fixture)
|
||||
{
|
||||
OSSL_CMP_CTX *ctx = fixture->ctx;
|
||||
int base_err_msg_size, expected_size;
|
||||
int res = 1;
|
||||
|
||||
if (!TEST_true(OSSL_CMP_CTX_set_log_cb(ctx, NULL)))
|
||||
res = 0;
|
||||
if (!TEST_true(ctx->log_cb == NULL))
|
||||
res = 0;
|
||||
|
||||
# ifndef OPENSSL_NO_STDIO
|
||||
CMPerr(0, CMP_R_MULTIPLE_SAN_SOURCES);
|
||||
OSSL_CMP_CTX_print_errors(ctx); /* should print above error to STDERR */
|
||||
# endif
|
||||
|
||||
/* this should work regardless of OPENSSL_NO_STDIO and OPENSSL_NO_TRACE: */
|
||||
if (!TEST_true(OSSL_CMP_CTX_set_log_cb(ctx, msg_total_size_log_cb)))
|
||||
res = 0;
|
||||
if (!TEST_true(ctx->log_cb == msg_total_size_log_cb)) {
|
||||
res = 0;
|
||||
} else {
|
||||
CMPerr(0, CMP_R_INVALID_ARGS);
|
||||
base_err_msg_size = strlen("INVALID_ARGS");
|
||||
CMPerr(0, CMP_R_NULL_ARGUMENT);
|
||||
base_err_msg_size += strlen("NULL_ARGUMENT");
|
||||
expected_size = base_err_msg_size;
|
||||
ossl_cmp_add_error_data("data1"); /* should prepend separator " : " */
|
||||
expected_size += strlen(" : " "data1");
|
||||
ossl_cmp_add_error_data("data2"); /* should prepend separator " : " */
|
||||
expected_size += strlen(" : " "data2");
|
||||
ossl_cmp_add_error_line("new line"); /* should prepend separator "\n" */
|
||||
expected_size += strlen("\n" "new line");
|
||||
OSSL_CMP_CTX_print_errors(ctx);
|
||||
if (!TEST_int_eq(msg_total_size, expected_size))
|
||||
res = 0;
|
||||
|
||||
CMPerr(0, CMP_R_INVALID_ARGS);
|
||||
base_err_msg_size = strlen("INVALID_ARGS") + strlen(" : ");
|
||||
expected_size = base_err_msg_size;
|
||||
while (expected_size < 4096) { /* force split */
|
||||
ossl_cmp_add_error_txt(STR_SEP, max_str_literal);
|
||||
expected_size += strlen(STR_SEP) + strlen(max_str_literal);
|
||||
}
|
||||
expected_size += base_err_msg_size - 2 * strlen(STR_SEP);
|
||||
msg_total_size = 0;
|
||||
OSSL_CMP_CTX_print_errors(ctx);
|
||||
if (!TEST_int_eq(msg_total_size, expected_size))
|
||||
res = 0;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
static int test_CTX_print_errors(void)
|
||||
{
|
||||
SETUP_TEST_FIXTURE(OSSL_CMP_CTX_TEST_FIXTURE, set_up);
|
||||
EXECUTE_TEST(execute_CTX_print_errors_test, tear_down);
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int execute_CTX_reqExtensions_have_SAN_test(
|
||||
OSSL_CMP_CTX_TEST_FIXTURE *fixture)
|
||||
{
|
||||
OSSL_CMP_CTX *ctx = fixture->ctx;
|
||||
const int len = 16;
|
||||
unsigned char str[16 /* = len */ ];
|
||||
ASN1_OCTET_STRING *data = NULL;
|
||||
X509_EXTENSION *ext = NULL;
|
||||
X509_EXTENSIONS *exts = NULL;
|
||||
int res = 0;
|
||||
|
||||
if (!TEST_false(OSSL_CMP_CTX_reqExtensions_have_SAN(ctx)))
|
||||
return 0;
|
||||
|
||||
if (!TEST_int_eq(1, RAND_bytes(str, len))
|
||||
|| !TEST_ptr(data = ASN1_OCTET_STRING_new())
|
||||
|| !TEST_true(ASN1_OCTET_STRING_set(data, str, len)))
|
||||
goto err;
|
||||
ext = X509_EXTENSION_create_by_NID(NULL, NID_subject_alt_name, 0, data);
|
||||
if (!TEST_ptr(ext)
|
||||
|| !TEST_ptr(exts = sk_X509_EXTENSION_new_null())
|
||||
|| !TEST_true(sk_X509_EXTENSION_push(exts, ext))
|
||||
|| !TEST_true(OSSL_CMP_CTX_set0_reqExtensions(ctx, exts))) {
|
||||
X509_EXTENSION_free(ext);
|
||||
sk_X509_EXTENSION_free(exts);
|
||||
goto err;
|
||||
}
|
||||
if (TEST_int_eq(OSSL_CMP_CTX_reqExtensions_have_SAN(ctx), 1)) {
|
||||
ext = sk_X509_EXTENSION_pop(exts);
|
||||
res = TEST_false(OSSL_CMP_CTX_reqExtensions_have_SAN(ctx));
|
||||
X509_EXTENSION_free(ext);
|
||||
}
|
||||
err:
|
||||
ASN1_OCTET_STRING_free(data);
|
||||
return res;
|
||||
}
|
||||
|
||||
static int test_CTX_reqExtensions_have_SAN(void)
|
||||
{
|
||||
SETUP_TEST_FIXTURE(OSSL_CMP_CTX_TEST_FIXTURE, set_up);
|
||||
EXECUTE_TEST(execute_CTX_reqExtensions_have_SAN_test, tear_down);
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifndef OPENSSL_NO_TRACE
|
||||
static int test_log_line;
|
||||
static int test_log_cb_res = 0;
|
||||
static int test_log_cb(const char *func, const char *file, int line,
|
||||
OSSL_CMP_severity level, const char *msg)
|
||||
{
|
||||
test_log_cb_res =
|
||||
# ifndef PEDANTIC
|
||||
(strcmp(func, "execute_cmp_ctx_log_cb_test") == 0
|
||||
|| strcmp(func, "(unknown function)") == 0) &&
|
||||
# endif
|
||||
(strcmp(file, OPENSSL_FILE) == 0 || strcmp(file, "(no file)") == 0)
|
||||
&& (line == test_log_line || line == 0)
|
||||
&& (level == OSSL_CMP_LOG_INFO || level == -1)
|
||||
&& strcmp(msg, "ok\n") == 0;
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int execute_cmp_ctx_log_cb_test(OSSL_CMP_CTX_TEST_FIXTURE *fixture)
|
||||
{
|
||||
int res = 1;
|
||||
#if !defined OPENSSL_NO_TRACE && !defined OPENSSL_NO_STDIO
|
||||
OSSL_CMP_CTX *ctx = fixture->ctx;
|
||||
|
||||
OSSL_TRACE(ALL, "this general trace message is not shown by default\n");
|
||||
|
||||
OSSL_CMP_log_open();
|
||||
OSSL_CMP_log_open(); /* multiple calls should be harmless */
|
||||
|
||||
if (!TEST_true(OSSL_CMP_CTX_set_log_cb(ctx, NULL))) {
|
||||
res = 0;
|
||||
} else {
|
||||
OSSL_CMP_err("this should be printed as CMP error message");
|
||||
OSSL_CMP_warn("this should be printed as CMP warning message");
|
||||
OSSL_CMP_debug("this should not be printed");
|
||||
TEST_true(OSSL_CMP_CTX_set_log_verbosity(ctx, OSSL_CMP_LOG_DEBUG));
|
||||
OSSL_CMP_debug("this should be printed as CMP debug message");
|
||||
TEST_true(OSSL_CMP_CTX_set_log_verbosity(ctx, OSSL_CMP_LOG_INFO));
|
||||
}
|
||||
if (!TEST_true(OSSL_CMP_CTX_set_log_cb(ctx, test_log_cb))) {
|
||||
res = 0;
|
||||
} else {
|
||||
test_log_line = OPENSSL_LINE + 1;
|
||||
OSSL_CMP_log2(INFO, "%s%c", "o", 'k');
|
||||
if (!TEST_int_eq(test_log_cb_res, 1))
|
||||
res = 0;
|
||||
OSSL_CMP_CTX_set_log_verbosity(ctx, OSSL_CMP_LOG_ERR);
|
||||
test_log_cb_res = -1; /* callback should not be called at all */
|
||||
test_log_line = OPENSSL_LINE + 1;
|
||||
OSSL_CMP_log2(INFO, "%s%c", "o", 'k');
|
||||
if (!TEST_int_eq(test_log_cb_res, -1))
|
||||
res = 0;
|
||||
}
|
||||
OSSL_CMP_log_close();
|
||||
OSSL_CMP_log_close(); /* multiple calls should be harmless */
|
||||
#endif
|
||||
return res;
|
||||
}
|
||||
|
||||
static int test_cmp_ctx_log_cb(void)
|
||||
{
|
||||
SETUP_TEST_FIXTURE(OSSL_CMP_CTX_TEST_FIXTURE, set_up);
|
||||
EXECUTE_TEST(execute_cmp_ctx_log_cb_test, tear_down);
|
||||
return result;
|
||||
}
|
||||
|
||||
static BIO *test_http_cb(OSSL_CMP_CTX *ctx, BIO *hbio, unsigned long detail)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int test_transfer_cb(OSSL_CMP_CTX *ctx, const OSSL_CMP_MSG *req,
|
||||
OSSL_CMP_MSG **res)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int test_certConf_cb(OSSL_CMP_CTX *ctx, X509 *cert, int fail_info,
|
||||
const char **txt)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
typedef OSSL_CMP_CTX CMP_CTX; /* prevents rewriting type name by below macro */
|
||||
#define OSSL_CMP_CTX 1 /* name prefix for exported setter functions */
|
||||
#define ossl_cmp_ctx 0 /* name prefix for internal setter functions */
|
||||
#define set 0
|
||||
#define set0 0
|
||||
#define set1 1
|
||||
#define get 0
|
||||
#define get0 0
|
||||
#define get1 1
|
||||
|
||||
#define DEFINE_SET_GET_BASE_TEST(PREFIX, SETN, GETN, DUP, FIELD, TYPE, ERR, \
|
||||
DEFAULT, NEW, FREE) \
|
||||
static int execute_CTX_##SETN##_##GETN##_##FIELD( \
|
||||
OSSL_CMP_CTX_TEST_FIXTURE *fixture) \
|
||||
{ \
|
||||
CMP_CTX *ctx = fixture->ctx; \
|
||||
int (*set_fn)(CMP_CTX *ctx, TYPE) = \
|
||||
(int (*)(CMP_CTX *ctx, TYPE))PREFIX##_##SETN##_##FIELD; \
|
||||
/* need type cast in above assignment because TYPE arg sometimes is const */ \
|
||||
TYPE (*get_fn)(const CMP_CTX *ctx) = OSSL_CMP_CTX_##GETN##_##FIELD; \
|
||||
TYPE val1_to_free = NEW; \
|
||||
TYPE val1 = val1_to_free; \
|
||||
TYPE val1_read = 0; /* 0 works for any type */ \
|
||||
TYPE val2_to_free = NEW; \
|
||||
TYPE val2 = val2_to_free; \
|
||||
TYPE val2_read = 0; \
|
||||
TYPE val3_read = 0; \
|
||||
int res = 1; \
|
||||
\
|
||||
if (!TEST_int_eq(ERR_peek_error(), 0)) \
|
||||
res = 0; \
|
||||
if (PREFIX == 1) { /* exported setter functions must test ctx == NULL */ \
|
||||
if ((*set_fn)(NULL, val1) || ERR_peek_error() == 0) { \
|
||||
TEST_error("setter did not return error on ctx == NULL"); \
|
||||
res = 0; \
|
||||
} \
|
||||
} \
|
||||
ERR_clear_error(); \
|
||||
\
|
||||
if ((*get_fn)(NULL) != ERR || ERR_peek_error() == 0) { \
|
||||
TEST_error("getter did not return error on ctx == NULL"); \
|
||||
res = 0; \
|
||||
} \
|
||||
ERR_clear_error(); \
|
||||
\
|
||||
val1_read = (*get_fn)(ctx); \
|
||||
if (!DEFAULT(val1_read)) { \
|
||||
TEST_error("did not get default value"); \
|
||||
res = 0; \
|
||||
} \
|
||||
if (!(*set_fn)(ctx, val1)) { \
|
||||
TEST_error("setting first value failed"); \
|
||||
res = 0; \
|
||||
} \
|
||||
if (SETN == 0) \
|
||||
val1_to_free = 0; /* 0 works for any type */ \
|
||||
\
|
||||
if (GETN == 1) \
|
||||
FREE(val1_read); \
|
||||
val1_read = (*get_fn)(ctx); \
|
||||
if (SETN == 0) { \
|
||||
if (val1_read != val1) { \
|
||||
TEST_error("set/get first value did not match"); \
|
||||
res = 0; \
|
||||
} \
|
||||
} else { \
|
||||
if (DUP && val1_read == val1) { \
|
||||
TEST_error("first set did not dup the value"); \
|
||||
res = 0; \
|
||||
} \
|
||||
if (DEFAULT(val1_read)) { \
|
||||
TEST_error("first set had no effect"); \
|
||||
res = 0; \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
if (!(*set_fn)(ctx, val2)) { \
|
||||
TEST_error("setting second value failed"); \
|
||||
res = 0; \
|
||||
} \
|
||||
if (SETN == 0) \
|
||||
val2_to_free = 0; \
|
||||
\
|
||||
val2_read = (*get_fn)(ctx); \
|
||||
if (DEFAULT(val2_read)) { \
|
||||
TEST_error("second set reset the value"); \
|
||||
res = 0; \
|
||||
} \
|
||||
if (SETN == 0 && GETN == 0) { \
|
||||
if (val2_read != val2) { \
|
||||
TEST_error("set/get second value did not match"); \
|
||||
res = 0; \
|
||||
} \
|
||||
} else { \
|
||||
if (DUP && val2_read == val2) { \
|
||||
TEST_error("second set did not dup the value"); \
|
||||
res = 0; \
|
||||
} \
|
||||
if (val2 == val1) { \
|
||||
TEST_error("second value is same as first value"); \
|
||||
res = 0; \
|
||||
} \
|
||||
if (GETN == 1 && val2_read == val1_read) { \
|
||||
/* \
|
||||
* Note that if GETN == 0 then possibly val2_read == val1_read \
|
||||
* because set1 may allocate the new copy at the same location. \
|
||||
*/ \
|
||||
TEST_error("second get returned same as first get"); \
|
||||
res = 0; \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
val3_read = (*get_fn)(ctx); \
|
||||
if (DEFAULT(val3_read)) { \
|
||||
TEST_error("third set reset the value"); \
|
||||
res = 0; \
|
||||
} \
|
||||
if (GETN == 0) { \
|
||||
if (val3_read != val2_read) { \
|
||||
TEST_error("third get gave different value"); \
|
||||
res = 0; \
|
||||
} \
|
||||
} else { \
|
||||
if (DUP && val3_read == val2_read) { \
|
||||
TEST_error("third get did not create a new dup"); \
|
||||
res = 0; \
|
||||
} \
|
||||
} \
|
||||
/* this does not check that all remaining fields are untouched */ \
|
||||
\
|
||||
if (!TEST_int_eq(ERR_peek_error(), 0)) \
|
||||
res = 0; \
|
||||
\
|
||||
FREE(val1_to_free); \
|
||||
FREE(val2_to_free); \
|
||||
if (GETN == 1) { \
|
||||
FREE(val1_read); \
|
||||
FREE(val2_read); \
|
||||
FREE(val3_read); \
|
||||
} \
|
||||
return TEST_true(res); \
|
||||
} \
|
||||
\
|
||||
static int test_CTX_##SETN##_##GETN##_##FIELD(void) \
|
||||
{ \
|
||||
SETUP_TEST_FIXTURE(OSSL_CMP_CTX_TEST_FIXTURE, set_up); \
|
||||
EXECUTE_TEST(execute_CTX_##SETN##_##GETN##_##FIELD, tear_down); \
|
||||
return result; \
|
||||
}
|
||||
|
||||
static char *char_new(void) {
|
||||
return OPENSSL_strdup("test");
|
||||
}
|
||||
|
||||
static void char_free(char *val) {
|
||||
OPENSSL_free(val);
|
||||
}
|
||||
|
||||
#define EMPTY_SK_X509(x) ((x) == NULL || sk_X509_num(x) == 0)
|
||||
|
||||
static X509_STORE *X509_STORE_new_1(void) {
|
||||
X509_STORE *store = X509_STORE_new();
|
||||
|
||||
if (store != NULL)
|
||||
X509_VERIFY_PARAM_set_flags(X509_STORE_get0_param(store), 1);
|
||||
return store;
|
||||
}
|
||||
|
||||
#define DEFAULT_STORE(x) ((x) == NULL \
|
||||
|| X509_VERIFY_PARAM_get_flags(X509_STORE_get0_param(x)) == 0)
|
||||
|
||||
#define IS_NEG(x) ((x) < 0)
|
||||
#define IS_0(x) ((x) == 0) /* for any type */
|
||||
#define IS_DEFAULT_PORT(x) ((x) == OSSL_CMP_DEFAULT_PORT)
|
||||
#define DROP(x) (void)(x) /* dummy free() for non-pointer and function types */
|
||||
|
||||
#define ERR(x) (CMPerr(0, CMP_R_NULL_ARGUMENT), x)
|
||||
|
||||
#define DEFINE_SET_GET_TEST(OSSL_CMP, CTX, N, M, DUP, FIELD, TYPE) \
|
||||
DEFINE_SET_GET_BASE_TEST(OSSL_CMP##_##CTX, set##N, get##M, DUP, FIELD, \
|
||||
TYPE*, NULL, IS_0, TYPE##_new(), TYPE##_free)
|
||||
|
||||
#define DEFINE_SET_GET_SK_TEST_DEFAULT(OSSL_CMP, CTX, N, M, FIELD, ELEM_TYPE, \
|
||||
DEFAULT, NEW, FREE) \
|
||||
DEFINE_SET_GET_BASE_TEST(OSSL_CMP##_##CTX, set##N, get##M, 1, FIELD, \
|
||||
STACK_OF(ELEM_TYPE)*, NULL, DEFAULT, NEW, FREE)
|
||||
#define DEFINE_SET_GET_SK_TEST(OSSL_CMP, CTX, N, M, FIELD, T) \
|
||||
DEFINE_SET_GET_SK_TEST_DEFAULT(OSSL_CMP, CTX, N, M, FIELD, T, \
|
||||
IS_0, sk_##T##_new_null(), sk_##T##_free)
|
||||
#define DEFINE_SET_GET_SK_X509_TEST(OSSL_CMP, CTX, N, M, FNAME) \
|
||||
DEFINE_SET_GET_SK_TEST_DEFAULT(OSSL_CMP, CTX, N, M, FNAME, X509, \
|
||||
EMPTY_SK_X509, \
|
||||
sk_X509_new_1(), sk_X509_pop_X509_free)
|
||||
|
||||
#define DEFINE_SET_GET_TEST_DEFAULT(OSSL_CMP, CTX, N, M, DUP, FIELD, TYPE, \
|
||||
DEFAULT) \
|
||||
DEFINE_SET_GET_BASE_TEST(OSSL_CMP##_##CTX, set##N, get##M, DUP, FIELD, \
|
||||
TYPE*, NULL, DEFAULT, TYPE##_new(), TYPE##_free)
|
||||
#define DEFINE_SET_TEST_DEFAULT(OSSL_CMP, CTX, N, DUP, FIELD, TYPE, DEFAULT) \
|
||||
static TYPE *OSSL_CMP_CTX_get0_##FIELD(const CMP_CTX *ctx) \
|
||||
{ \
|
||||
return ctx == NULL ? ERR(NULL) : ctx->FIELD; \
|
||||
} \
|
||||
DEFINE_SET_GET_TEST_DEFAULT(OSSL_CMP, CTX, N, 0, DUP, FIELD, TYPE, DEFAULT)
|
||||
#define DEFINE_SET_TEST(OSSL_CMP, CTX, N, DUP, FIELD, TYPE) \
|
||||
DEFINE_SET_TEST_DEFAULT(OSSL_CMP, CTX, N, DUP, FIELD, TYPE, IS_0)
|
||||
|
||||
#define DEFINE_SET_SK_TEST(OSSL_CMP, CTX, N, FIELD, TYPE) \
|
||||
static STACK_OF(TYPE) *OSSL_CMP_CTX_get0_##FIELD(const CMP_CTX *ctx) \
|
||||
{ \
|
||||
return ctx == NULL ? ERR(NULL) : ctx->FIELD; \
|
||||
} \
|
||||
DEFINE_SET_GET_BASE_TEST(OSSL_CMP##_##CTX, set##N, get0, 1, FIELD, \
|
||||
STACK_OF(TYPE)*, NULL, IS_0, \
|
||||
sk_##TYPE##_new_null(), sk_##TYPE##_free)
|
||||
|
||||
#define DEFINE_SET_CB_TEST(FIELD) \
|
||||
static OSSL_cmp_##FIELD##_t \
|
||||
OSSL_CMP_CTX_get_##FIELD(const CMP_CTX *ctx) \
|
||||
{ \
|
||||
if (ctx == NULL) \
|
||||
CMPerr(0, CMP_R_NULL_ARGUMENT); \
|
||||
return ctx == NULL ? NULL /* cannot use ERR(NULL) here */ : ctx->FIELD;\
|
||||
} \
|
||||
DEFINE_SET_GET_BASE_TEST(OSSL_CMP_CTX, set, get, 0, FIELD, \
|
||||
OSSL_cmp_##FIELD##_t, NULL, IS_0, \
|
||||
test_##FIELD, DROP)
|
||||
#define DEFINE_SET_GET_P_VOID_TEST(FIELD) \
|
||||
DEFINE_SET_GET_BASE_TEST(OSSL_CMP_CTX, set, get, 0, FIELD, void*, \
|
||||
NULL, IS_0, ((void *)1), DROP)
|
||||
|
||||
#define DEFINE_SET_GET_INT_TEST_DEFAULT(OSSL_CMP, CTX, FIELD, DEFAULT) \
|
||||
DEFINE_SET_GET_BASE_TEST(OSSL_CMP##_##CTX, set, get, 0, FIELD, int, -1, \
|
||||
DEFAULT, 1, DROP)
|
||||
#define DEFINE_SET_GET_INT_TEST(OSSL_CMP, CTX, FIELD) \
|
||||
DEFINE_SET_GET_INT_TEST_DEFAULT(OSSL_CMP, CTX, FIELD, IS_NEG)
|
||||
#define DEFINE_SET_PORT_TEST(FIELD) \
|
||||
static int OSSL_CMP_CTX_get_##FIELD(const CMP_CTX *ctx) \
|
||||
{ \
|
||||
return ctx == NULL ? ERR(-1) : ctx->FIELD; \
|
||||
} \
|
||||
DEFINE_SET_GET_INT_TEST_DEFAULT(OSSL_CMP, CTX, FIELD, IS_DEFAULT_PORT)
|
||||
|
||||
#define DEFINE_SET_GET_ARG_FN(SETN, GETN, FIELD, ARG, T) \
|
||||
static int OSSL_CMP_CTX_##SETN##_##FIELD##_##ARG(CMP_CTX *ctx, T val) \
|
||||
{ \
|
||||
return OSSL_CMP_CTX_##SETN##_##FIELD(ctx, ARG, val); \
|
||||
} \
|
||||
\
|
||||
static T OSSL_CMP_CTX_##GETN##_##FIELD##_##ARG(const CMP_CTX *ctx) \
|
||||
{ \
|
||||
return OSSL_CMP_CTX_##GETN##_##FIELD(ctx, ARG); \
|
||||
}
|
||||
|
||||
#define DEFINE_SET_GET1_STR_FN(SETN, FIELD) \
|
||||
static int OSSL_CMP_CTX_##SETN##_##FIELD##_str(CMP_CTX *ctx, char *val)\
|
||||
{ \
|
||||
return OSSL_CMP_CTX_##SETN##_##FIELD(ctx, (unsigned char *)val, \
|
||||
strlen(val)); \
|
||||
} \
|
||||
\
|
||||
static char *OSSL_CMP_CTX_get1_##FIELD##_str(const CMP_CTX *ctx) \
|
||||
{ \
|
||||
const ASN1_OCTET_STRING *bytes = ctx == NULL ? ERR(NULL) : ctx->FIELD; \
|
||||
\
|
||||
return bytes == NULL ? NULL : \
|
||||
OPENSSL_strndup((char *)bytes->data, bytes->length); \
|
||||
}
|
||||
|
||||
#define push 0
|
||||
#define push0 0
|
||||
#define push1 1
|
||||
#define DEFINE_PUSH_BASE_TEST(PUSHN, DUP, FIELD, ELEM, TYPE, T, \
|
||||
DEFAULT, NEW, FREE) \
|
||||
static TYPE sk_top_##FIELD(const CMP_CTX *ctx) { \
|
||||
return sk_##T##_value(ctx->FIELD, sk_##T##_num(ctx->FIELD) - 1); \
|
||||
} \
|
||||
\
|
||||
static int execute_CTX_##PUSHN##_##ELEM(OSSL_CMP_CTX_TEST_FIXTURE *fixture) \
|
||||
{ \
|
||||
CMP_CTX *ctx = fixture->ctx; \
|
||||
int (*push_fn)(CMP_CTX *ctx, TYPE) = \
|
||||
(int (*)(CMP_CTX *ctx, TYPE))OSSL_CMP_CTX_##PUSHN##_##ELEM; \
|
||||
/* need type cast in above assignment because TYPE arg sometimes is const */ \
|
||||
int n_elem = sk_##T##_num(ctx->FIELD); \
|
||||
STACK_OF(TYPE) field_read; \
|
||||
TYPE val1_to_free = NEW; \
|
||||
TYPE val1 = val1_to_free; \
|
||||
TYPE val1_read = 0; /* 0 works for any type */ \
|
||||
TYPE val2_to_free = NEW; \
|
||||
TYPE val2 = val2_to_free; \
|
||||
TYPE val2_read = 0; \
|
||||
int res = 1; \
|
||||
\
|
||||
if (!TEST_int_eq(ERR_peek_error(), 0)) \
|
||||
res = 0; \
|
||||
if ((*push_fn)(NULL, val1) || ERR_peek_error() == 0) { \
|
||||
TEST_error("pusher did not return error on ctx == NULL"); \
|
||||
res = 0; \
|
||||
} \
|
||||
ERR_clear_error(); \
|
||||
\
|
||||
if (n_elem < 0) /* can happen for NULL stack */ \
|
||||
n_elem = 0; \
|
||||
field_read = ctx->FIELD; \
|
||||
if (!DEFAULT(field_read)) { \
|
||||
TEST_error("did not get default value for stack field"); \
|
||||
res = 0; \
|
||||
} \
|
||||
if (!(*push_fn)(ctx, val1)) { \
|
||||
TEST_error("pushing first value failed"); \
|
||||
res = 0; \
|
||||
} \
|
||||
if (PUSHN == 0) \
|
||||
val1_to_free = 0; /* 0 works for any type */ \
|
||||
\
|
||||
if (sk_##T##_num(ctx->FIELD) != ++n_elem) { \
|
||||
TEST_error("pushing first value did not increment number"); \
|
||||
res = 0; \
|
||||
} \
|
||||
val1_read = sk_top_##FIELD(ctx); \
|
||||
if (PUSHN == 0) { \
|
||||
if (val1_read != val1) { \
|
||||
TEST_error("push/sk_top first value did not match"); \
|
||||
res = 0; \
|
||||
} \
|
||||
} else { \
|
||||
if (DUP && val1_read == val1) { \
|
||||
TEST_error("first push did not dup the value"); \
|
||||
res = 0; \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
if (!(*push_fn)(ctx, val2)) { \
|
||||
TEST_error("pushting second value failed"); \
|
||||
res = 0; \
|
||||
} \
|
||||
if (PUSHN == 0) \
|
||||
val2_to_free = 0; \
|
||||
\
|
||||
if (sk_##T##_num(ctx->FIELD) != ++n_elem) { \
|
||||
TEST_error("pushing second value did not increment number"); \
|
||||
res = 0; \
|
||||
} \
|
||||
val2_read = sk_top_##FIELD(ctx); \
|
||||
if (PUSHN == 0) { \
|
||||
if (val2_read != val2) { \
|
||||
TEST_error("push/sk_top second value did not match"); \
|
||||
res = 0; \
|
||||
} \
|
||||
} else { \
|
||||
if (DUP && val2_read == val2) { \
|
||||
TEST_error("second push did not dup the value"); \
|
||||
res = 0; \
|
||||
} \
|
||||
if (val2 == val1) { \
|
||||
TEST_error("second value is same as first value"); \
|
||||
res = 0; \
|
||||
} \
|
||||
} \
|
||||
/* this does not check that all remaining fields and elems are untouched */\
|
||||
\
|
||||
if (!TEST_int_eq(ERR_peek_error(), 0)) \
|
||||
res = 0; \
|
||||
\
|
||||
FREE(val1_to_free); \
|
||||
FREE(val2_to_free); \
|
||||
return TEST_true(res); \
|
||||
} \
|
||||
\
|
||||
static int test_CTX_##PUSHN##_##ELEM(void) \
|
||||
{ \
|
||||
SETUP_TEST_FIXTURE(OSSL_CMP_CTX_TEST_FIXTURE, set_up); \
|
||||
EXECUTE_TEST(execute_CTX_##PUSHN##_##ELEM, tear_down); \
|
||||
return result; \
|
||||
} \
|
||||
|
||||
#define DEFINE_PUSH_TEST(N, DUP, FIELD, ELEM, TYPE) \
|
||||
DEFINE_PUSH_BASE_TEST(push##N, DUP, FIELD, ELEM, TYPE*, TYPE, \
|
||||
IS_0, TYPE##_new(), TYPE##_free)
|
||||
|
||||
void cleanup_tests(void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
DEFINE_SET_GET_ARG_FN(set, get, option, 16, int)
|
||||
/* option == OSSL_CMP_OPT_IGNORE_KEYUSAGE */
|
||||
DEFINE_SET_GET_BASE_TEST(OSSL_CMP_CTX, set, get, 0, option_16, int, -1, IS_0, \
|
||||
1 /* true */, DROP)
|
||||
|
||||
#ifndef OPENSSL_NO_TRACE
|
||||
DEFINE_SET_CB_TEST(log_cb)
|
||||
#endif
|
||||
|
||||
DEFINE_SET_TEST_DEFAULT(OSSL_CMP, CTX, 1, 1, serverPath, char, IS_0)
|
||||
DEFINE_SET_TEST(OSSL_CMP, CTX, 1, 1, serverName, char)
|
||||
DEFINE_SET_PORT_TEST(serverPort)
|
||||
DEFINE_SET_TEST(OSSL_CMP, CTX, 1, 1, proxyName, char)
|
||||
DEFINE_SET_PORT_TEST(proxyPort)
|
||||
DEFINE_SET_CB_TEST(http_cb)
|
||||
DEFINE_SET_GET_P_VOID_TEST(http_cb_arg)
|
||||
DEFINE_SET_CB_TEST(transfer_cb)
|
||||
DEFINE_SET_GET_P_VOID_TEST(transfer_cb_arg)
|
||||
|
||||
DEFINE_SET_TEST(OSSL_CMP, CTX, 1, 0, srvCert, X509)
|
||||
DEFINE_SET_TEST(ossl_cmp, ctx, 0, 0, validatedSrvCert, X509)
|
||||
DEFINE_SET_TEST(OSSL_CMP, CTX, 1, 1, expected_sender, X509_NAME)
|
||||
DEFINE_SET_GET_BASE_TEST(OSSL_CMP_CTX, set0, get0, 0, trustedStore,
|
||||
X509_STORE*, NULL,
|
||||
DEFAULT_STORE, X509_STORE_new_1(), X509_STORE_free)
|
||||
DEFINE_SET_GET_SK_X509_TEST(OSSL_CMP, CTX, 1, 0, untrusted_certs)
|
||||
|
||||
DEFINE_SET_TEST(OSSL_CMP, CTX, 1, 0, clCert, X509)
|
||||
DEFINE_SET_TEST(OSSL_CMP, CTX, 1, 0, pkey, EVP_PKEY)
|
||||
|
||||
DEFINE_SET_TEST(OSSL_CMP, CTX, 1, 1, recipient, X509_NAME)
|
||||
DEFINE_PUSH_TEST(0, 0, geninfo_ITAVs, geninfo_ITAV, OSSL_CMP_ITAV)
|
||||
DEFINE_SET_SK_TEST(OSSL_CMP, CTX, 1, extraCertsOut, X509)
|
||||
DEFINE_SET_GET_ARG_FN(set0, get0, newPkey, 1, EVP_PKEY*) /* priv == 1 */
|
||||
DEFINE_SET_GET_TEST(OSSL_CMP, CTX, 0, 0, 0, newPkey_1, EVP_PKEY)
|
||||
DEFINE_SET_GET_ARG_FN(set0, get0, newPkey, 0, EVP_PKEY*) /* priv == 0 */
|
||||
DEFINE_SET_GET_TEST(OSSL_CMP, CTX, 0, 0, 0, newPkey_0, EVP_PKEY)
|
||||
DEFINE_SET_GET1_STR_FN(set1, referenceValue)
|
||||
DEFINE_SET_GET_TEST_DEFAULT(OSSL_CMP, CTX, 1, 1, 1, referenceValue_str,
|
||||
char, IS_0)
|
||||
DEFINE_SET_GET1_STR_FN(set1, secretValue)
|
||||
DEFINE_SET_GET_TEST_DEFAULT(OSSL_CMP, CTX, 1, 1, 1, secretValue_str,
|
||||
char, IS_0)
|
||||
DEFINE_SET_TEST(OSSL_CMP, CTX, 1, 1, issuer, X509_NAME)
|
||||
DEFINE_SET_TEST(OSSL_CMP, CTX, 1, 1, subjectName, X509_NAME)
|
||||
#ifdef ISSUE_9504_RESOLVED
|
||||
DEFINE_PUSH_TEST(1, 1, subjectAltNames, subjectAltName, GENERAL_NAME)
|
||||
#endif
|
||||
DEFINE_SET_SK_TEST(OSSL_CMP, CTX, 0, reqExtensions, X509_EXTENSION)
|
||||
DEFINE_PUSH_TEST(0, 0, policies, policy, POLICYINFO)
|
||||
DEFINE_SET_TEST(OSSL_CMP, CTX, 1, 0, oldCert, X509)
|
||||
#ifdef ISSUE_9504_RESOLVED
|
||||
DEFINE_SET_TEST(OSSL_CMP, CTX, 1, 1, p10CSR, X509_REQ)
|
||||
#endif
|
||||
DEFINE_PUSH_TEST(0, 0, genm_ITAVs, genm_ITAV, OSSL_CMP_ITAV)
|
||||
DEFINE_SET_CB_TEST(certConf_cb)
|
||||
DEFINE_SET_GET_P_VOID_TEST(certConf_cb_arg)
|
||||
|
||||
DEFINE_SET_GET_INT_TEST(ossl_cmp, ctx, status)
|
||||
DEFINE_SET_GET_SK_TEST(ossl_cmp, ctx, 0, 0, statusString, ASN1_UTF8STRING)
|
||||
DEFINE_SET_GET_INT_TEST(ossl_cmp, ctx, failInfoCode)
|
||||
DEFINE_SET_GET_TEST(ossl_cmp, ctx, 0, 0, 0, newCert, X509)
|
||||
DEFINE_SET_GET_SK_X509_TEST(ossl_cmp, ctx, 1, 1, caPubs)
|
||||
DEFINE_SET_GET_SK_X509_TEST(ossl_cmp, ctx, 1, 1, extraCertsIn)
|
||||
|
||||
DEFINE_SET_TEST_DEFAULT(OSSL_CMP, CTX, 1, 1, transactionID,
|
||||
ASN1_OCTET_STRING, IS_0)
|
||||
DEFINE_SET_TEST(OSSL_CMP, CTX, 1, 1, senderNonce, ASN1_OCTET_STRING)
|
||||
DEFINE_SET_TEST(ossl_cmp, ctx, 1, 1, recipNonce, ASN1_OCTET_STRING)
|
||||
|
||||
int setup_tests(void)
|
||||
{
|
||||
/* OSSL_CMP_CTX_new() is tested by set_up() */
|
||||
/* OSSL_CMP_CTX_free() is tested by tear_down() */
|
||||
ADD_TEST(test_CTX_reinit);
|
||||
|
||||
/* various CMP options: */
|
||||
ADD_TEST(test_CTX_set_get_option_16);
|
||||
/* CMP-specific callback for logging and outputting the error queue: */
|
||||
#ifndef OPENSSL_NO_TRACE
|
||||
ADD_TEST(test_CTX_set_get_log_cb);
|
||||
#endif
|
||||
/*
|
||||
* also tests OSSL_CMP_log_open(), OSSL_CMP_CTX_set_log_verbosity(),
|
||||
* OSSL_CMP_err(), OSSL_CMP_warn(), * OSSL_CMP_debug(),
|
||||
* OSSL_CMP_log2(), ossl_cmp_log_parse_metadata(), and OSSL_CMP_log_close()
|
||||
* with OSSL_CMP_severity OSSL_CMP_LOG_ERR/WARNING/DEBUG/INFO:
|
||||
*/
|
||||
ADD_TEST(test_cmp_ctx_log_cb);
|
||||
#if !defined(OPENSSL_NO_ERR) && !defined(OPENSSL_NO_AUTOERRINIT)
|
||||
/* also tests OSSL_CMP_CTX_set_log_cb(), OSSL_CMP_print_errors_cb(),
|
||||
ossl_cmp_add_error_txt(), and the macros
|
||||
ossl_cmp_add_error_data and ossl_cmp_add_error_line:
|
||||
*/
|
||||
ADD_TEST(test_CTX_print_errors);
|
||||
#endif
|
||||
/* message transfer: */
|
||||
ADD_TEST(test_CTX_set1_get0_serverPath);
|
||||
ADD_TEST(test_CTX_set1_get0_serverName);
|
||||
ADD_TEST(test_CTX_set_get_serverPort);
|
||||
ADD_TEST(test_CTX_set1_get0_proxyName);
|
||||
ADD_TEST(test_CTX_set_get_proxyPort);
|
||||
ADD_TEST(test_CTX_set_get_http_cb);
|
||||
ADD_TEST(test_CTX_set_get_http_cb_arg);
|
||||
ADD_TEST(test_CTX_set_get_transfer_cb);
|
||||
ADD_TEST(test_CTX_set_get_transfer_cb_arg);
|
||||
/* server authentication: */
|
||||
ADD_TEST(test_CTX_set1_get0_srvCert);
|
||||
ADD_TEST(test_CTX_set0_get0_validatedSrvCert);
|
||||
ADD_TEST(test_CTX_set1_get0_expected_sender);
|
||||
ADD_TEST(test_CTX_set0_get0_trustedStore);
|
||||
ADD_TEST(test_CTX_set1_get0_untrusted_certs);
|
||||
/* client authentication: */
|
||||
ADD_TEST(test_CTX_set1_get0_clCert);
|
||||
ADD_TEST(test_CTX_set1_get0_pkey);
|
||||
/* the following two also test ossl_cmp_asn1_octet_string_set1_bytes(): */
|
||||
ADD_TEST(test_CTX_set1_get1_referenceValue_str);
|
||||
ADD_TEST(test_CTX_set1_get1_secretValue_str);
|
||||
/* CMP message header and extra certificates: */
|
||||
ADD_TEST(test_CTX_set1_get0_recipient);
|
||||
ADD_TEST(test_CTX_push0_geninfo_ITAV);
|
||||
ADD_TEST(test_CTX_set1_get0_extraCertsOut);
|
||||
/* certificate template: */
|
||||
ADD_TEST(test_CTX_set0_get0_newPkey_1);
|
||||
ADD_TEST(test_CTX_set0_get0_newPkey_0);
|
||||
ADD_TEST(test_CTX_set1_get0_issuer);
|
||||
ADD_TEST(test_CTX_set1_get0_subjectName);
|
||||
#ifdef ISSUE_9504_RESOLVED
|
||||
/* test currently fails, see https://github.com/openssl/openssl/issues/9504 */
|
||||
ADD_TEST(test_CTX_push1_subjectAltName);
|
||||
#endif
|
||||
ADD_TEST(test_CTX_set0_get0_reqExtensions);
|
||||
ADD_TEST(test_CTX_reqExtensions_have_SAN);
|
||||
ADD_TEST(test_CTX_push0_policy);
|
||||
ADD_TEST(test_CTX_set1_get0_oldCert);
|
||||
#ifdef ISSUE_9504_RESOLVED
|
||||
/* test currently fails, see https://github.com/openssl/openssl/issues/9504 */
|
||||
ADD_TEST(test_CTX_set1_get0_p10CSR);
|
||||
#endif
|
||||
/* misc body contents: */
|
||||
ADD_TEST(test_CTX_push0_genm_ITAV);
|
||||
/* certificate confirmation: */
|
||||
ADD_TEST(test_CTX_set_get_certConf_cb);
|
||||
ADD_TEST(test_CTX_set_get_certConf_cb_arg);
|
||||
/* result fetching: */
|
||||
ADD_TEST(test_CTX_set_get_status);
|
||||
ADD_TEST(test_CTX_set0_get0_statusString);
|
||||
ADD_TEST(test_CTX_set_get_failInfoCode);
|
||||
ADD_TEST(test_CTX_set0_get0_newCert);
|
||||
ADD_TEST(test_CTX_set1_get1_caPubs);
|
||||
ADD_TEST(test_CTX_set1_get1_extraCertsIn);
|
||||
/* exported for testing and debugging purposes: */
|
||||
/* the following three also test ossl_cmp_asn1_octet_string_set1(): */
|
||||
ADD_TEST(test_CTX_set1_get0_transactionID);
|
||||
ADD_TEST(test_CTX_set1_get0_senderNonce);
|
||||
ADD_TEST(test_CTX_set1_get0_recipNonce);
|
||||
|
||||
/* TODO ossl_cmp_build_cert_chain() will be tested with cmp_protect.c*/
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
* Copyright 2007-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright Nokia 2007-2019
|
||||
* Copyright Siemens AG 2015-2019
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#include "cmp_testlib.h"
|
||||
#include <openssl/rsa.h> /* needed in case config no-deprecated */
|
||||
|
||||
EVP_PKEY *load_pem_key(const char *file)
|
||||
{
|
||||
EVP_PKEY *key = NULL;
|
||||
BIO *bio = NULL;
|
||||
|
||||
if (!TEST_ptr(bio = BIO_new(BIO_s_file())))
|
||||
return NULL;
|
||||
if (TEST_int_gt(BIO_read_filename(bio, file), 0))
|
||||
(void)TEST_ptr(key = PEM_read_bio_PrivateKey(bio, NULL, NULL, NULL));
|
||||
|
||||
BIO_free(bio);
|
||||
return key;
|
||||
}
|
||||
|
||||
X509 *load_pem_cert(const char *file)
|
||||
{
|
||||
X509 *cert = NULL;
|
||||
BIO *bio = NULL;
|
||||
|
||||
if (!TEST_ptr(bio = BIO_new(BIO_s_file())))
|
||||
return NULL;
|
||||
if (TEST_int_gt(BIO_read_filename(bio, file), 0))
|
||||
(void)TEST_ptr(cert = PEM_read_bio_X509(bio, NULL, NULL, NULL));
|
||||
|
||||
BIO_free(bio);
|
||||
return cert;
|
||||
}
|
||||
|
||||
X509_REQ *load_csr(const char *file)
|
||||
{
|
||||
X509_REQ *csr = NULL;
|
||||
BIO *bio = NULL;
|
||||
|
||||
if (!TEST_ptr(file) || !TEST_ptr(bio = BIO_new_file(file, "rb")))
|
||||
return NULL;
|
||||
(void)TEST_ptr(csr = d2i_X509_REQ_bio(bio, NULL));
|
||||
BIO_free(bio);
|
||||
return csr;
|
||||
}
|
||||
|
||||
EVP_PKEY *gen_rsa(void)
|
||||
{
|
||||
EVP_PKEY_CTX *ctx = NULL;
|
||||
EVP_PKEY *pkey = NULL;
|
||||
|
||||
(void)(TEST_ptr(ctx = EVP_PKEY_CTX_new_id(EVP_PKEY_RSA, NULL))
|
||||
&& TEST_int_gt(EVP_PKEY_keygen_init(ctx), 0)
|
||||
&& TEST_int_gt(EVP_PKEY_CTX_set_rsa_keygen_bits(ctx, 2048), 0)
|
||||
&& TEST_int_gt(EVP_PKEY_keygen(ctx, &pkey), 0));
|
||||
EVP_PKEY_CTX_free(ctx);
|
||||
return pkey;
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks whether the syntax of msg conforms to ASN.1
|
||||
*/
|
||||
int valid_asn1_encoding(const OSSL_CMP_MSG *msg)
|
||||
{
|
||||
return msg != NULL ? i2d_OSSL_CMP_MSG(msg, NULL) > 0 : 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Compares two stacks of certificates in the order of their elements.
|
||||
* Returns 0 if sk1 and sk2 are equal and another value otherwise
|
||||
*/
|
||||
int STACK_OF_X509_cmp(const STACK_OF(X509) *sk1, const STACK_OF(X509) *sk2)
|
||||
{
|
||||
int i, res;
|
||||
X509 *a, *b;
|
||||
|
||||
if (sk1 == sk2)
|
||||
return 0;
|
||||
if (sk1 == NULL)
|
||||
return -1;
|
||||
if (sk2 == NULL)
|
||||
return 1;
|
||||
if ((res = sk_X509_num(sk1) - sk_X509_num(sk2)))
|
||||
return res;
|
||||
for (i = 0; i < sk_X509_num(sk1); i++) {
|
||||
a = sk_X509_value(sk1, i);
|
||||
b = sk_X509_value(sk2, i);
|
||||
if (a != b)
|
||||
if ((res = X509_cmp(a, b)) != 0)
|
||||
return res;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Up refs and push a cert onto sk.
|
||||
* Returns the number of certificates on the stack on success
|
||||
* Returns -1 or 0 on error
|
||||
*/
|
||||
int STACK_OF_X509_push1(STACK_OF(X509) *sk, X509 *cert)
|
||||
{
|
||||
int res;
|
||||
|
||||
if (sk == NULL || cert == NULL)
|
||||
return -1;
|
||||
if (!X509_up_ref(cert))
|
||||
return -1;
|
||||
res = sk_X509_push(sk, cert);
|
||||
if (res <= 0)
|
||||
X509_free(cert); /* down-ref */
|
||||
return res;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright 2007-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright Nokia 2007-2019
|
||||
* Copyright Siemens AG 2015-2019
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef OSSL_TEST_CMP_TESTLIB_H
|
||||
# define OSSL_TEST_CMP_TESTLIB_H
|
||||
|
||||
# include <openssl/cmp.h>
|
||||
# include <openssl/pem.h>
|
||||
# include <openssl/rand.h>
|
||||
|
||||
#include "../crypto/cmp/cmp_local.h"
|
||||
|
||||
# include "testutil.h"
|
||||
|
||||
# ifndef OPENSSL_NO_CMP
|
||||
# define CMP_TEST_REFVALUE_LENGTH 15 /* arbitrary value */
|
||||
EVP_PKEY *load_pem_key(const char *file);
|
||||
X509 *load_pem_cert(const char *file);
|
||||
X509_REQ *load_csr(const char *file);
|
||||
int valid_asn1_encoding(const OSSL_CMP_MSG *msg);
|
||||
EVP_PKEY *gen_rsa(void);
|
||||
int STACK_OF_X509_cmp(const STACK_OF(X509) *sk1, const STACK_OF(X509) *sk2);
|
||||
int STACK_OF_X509_push1(STACK_OF(X509) *sk, X509 *cert);
|
||||
# endif
|
||||
|
||||
#endif /* OSSL_TEST_CMP_TESTLIB_H */
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "internal/nelem.h"
|
||||
#include "internal/constant_time_locl.h"
|
||||
#include "internal/constant_time.h"
|
||||
#include "testutil.h"
|
||||
#include "internal/numbers.h"
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "testutil.h"
|
||||
#include "internal/ctype.h"
|
||||
#include "crypto/ctype.h"
|
||||
#include "internal/nelem.h"
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <string.h>
|
||||
#include <openssl/e_os2.h>
|
||||
#include <openssl/evp.h>
|
||||
#include "curve448_lcl.h"
|
||||
#include "curve448_local.h"
|
||||
#include "testutil.h"
|
||||
|
||||
static unsigned int max = 1000;
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#ifndef DRBG_CAVS_DATA_H
|
||||
# define DRBG_CAVS_DATA_H
|
||||
#ifndef OSSL_TEST_DRBG_CAVS_DATA_H
|
||||
# define OSSL_TEST_DRBG_CAVS_DATA_H
|
||||
|
||||
enum drbg_kat_type {
|
||||
NO_RESEED,
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <openssl/obj_mac.h>
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/aes.h>
|
||||
#include "../crypto/rand/rand_lcl.h"
|
||||
#include "../crypto/rand/rand_local.h"
|
||||
|
||||
#include "testutil.h"
|
||||
#include "drbg_cavs_data.h"
|
||||
|
||||
+2
-2
@@ -15,8 +15,8 @@
|
||||
#include <openssl/obj_mac.h>
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/aes.h>
|
||||
#include "../crypto/rand/rand_lcl.h"
|
||||
#include "../crypto/include/internal/rand_int.h"
|
||||
#include "../crypto/rand/rand_local.h"
|
||||
#include "../include/crypto/rand.h"
|
||||
|
||||
#if defined(_WIN32)
|
||||
# include <windows.h>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include "testutil.h"
|
||||
|
||||
/* for SSL_READ_ETM() */
|
||||
#include "../ssl/ssl_locl.h"
|
||||
#include "../ssl/ssl_local.h"
|
||||
|
||||
static int debug = 0;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "internal/nelem.h"
|
||||
#include "testutil.h"
|
||||
#include <openssl/ec.h>
|
||||
#include "ec_lcl.h"
|
||||
#include "ec_local.h"
|
||||
#include <openssl/objects.h>
|
||||
|
||||
static size_t crv_len = 0;
|
||||
|
||||
+3
-3
@@ -7,8 +7,8 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef ECDSATEST_CAVS_H
|
||||
# define ECDSATEST_CAVS_H
|
||||
#ifndef OSSL_TEST_ECDSATEST_H
|
||||
# define OSSL_TEST_ECDSATEST_H
|
||||
|
||||
/*-
|
||||
* NIST CAVP ECDSA KATs:
|
||||
@@ -10211,4 +10211,4 @@ static const ecdsa_cavs_kat_t ecdsa_cavs_kats[] = {
|
||||
"1c8c4343a8ecbf7c4d4e48f7d76d5658bc027c77086ec8b10097deb307d6"}
|
||||
# endif /* OPENSSL_NO_EC2M */
|
||||
};
|
||||
#endif /* ECDSATEST_CAVS_H */
|
||||
#endif /* OSSL_TEST_ECDSATEST_H */
|
||||
+7
-7
@@ -287,7 +287,7 @@ static int prime_field_tests(void)
|
||||
|
||||
|| !TEST_true(BN_hex2bn(&p, "FFFFFFFF"
|
||||
"FFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF"))
|
||||
|| !TEST_int_eq(1, BN_is_prime_ex(p, BN_prime_checks, ctx, NULL))
|
||||
|| !TEST_int_eq(1, BN_check_prime(p, ctx, NULL))
|
||||
|| !TEST_true(BN_hex2bn(&a, "FFFFFFFF"
|
||||
"FFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC"))
|
||||
|| !TEST_true(BN_hex2bn(&b, "1C97BEFC"
|
||||
@@ -327,7 +327,7 @@ static int prime_field_tests(void)
|
||||
|
||||
|| !TEST_true(BN_hex2bn(&p, "FFFFFFFFFFFFFFFF"
|
||||
"FFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF"))
|
||||
|| !TEST_int_eq(1, BN_is_prime_ex(p, BN_prime_checks, ctx, NULL))
|
||||
|| !TEST_int_eq(1, BN_check_prime(p, ctx, NULL))
|
||||
|| !TEST_true(BN_hex2bn(&a, "FFFFFFFFFFFFFFFF"
|
||||
"FFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC"))
|
||||
|| !TEST_true(BN_hex2bn(&b, "64210519E59C80E7"
|
||||
@@ -366,7 +366,7 @@ static int prime_field_tests(void)
|
||||
|
||||
|| !TEST_true(BN_hex2bn(&p, "FFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
"FFFFFFFF000000000000000000000001"))
|
||||
|| !TEST_int_eq(1, BN_is_prime_ex(p, BN_prime_checks, ctx, NULL))
|
||||
|| !TEST_int_eq(1, BN_check_prime(p, ctx, NULL))
|
||||
|| !TEST_true(BN_hex2bn(&a, "FFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
"FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE"))
|
||||
|| !TEST_true(BN_hex2bn(&b, "B4050A850C04B3ABF5413256"
|
||||
@@ -405,7 +405,7 @@ static int prime_field_tests(void)
|
||||
|
||||
|| !TEST_true(BN_hex2bn(&p, "FFFFFFFF000000010000000000000000"
|
||||
"00000000FFFFFFFFFFFFFFFFFFFFFFFF"))
|
||||
|| !TEST_int_eq(1, BN_is_prime_ex(p, BN_prime_checks, ctx, NULL))
|
||||
|| !TEST_int_eq(1, BN_check_prime(p, ctx, NULL))
|
||||
|| !TEST_true(BN_hex2bn(&a, "FFFFFFFF000000010000000000000000"
|
||||
"00000000FFFFFFFFFFFFFFFFFFFFFFFC"))
|
||||
|| !TEST_true(BN_hex2bn(&b, "5AC635D8AA3A93E7B3EBBD55769886BC"
|
||||
@@ -446,7 +446,7 @@ static int prime_field_tests(void)
|
||||
|| !TEST_true(BN_hex2bn(&p, "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE"
|
||||
"FFFFFFFF0000000000000000FFFFFFFF"))
|
||||
|| !TEST_int_eq(1, BN_is_prime_ex(p, BN_prime_checks, ctx, NULL))
|
||||
|| !TEST_int_eq(1, BN_check_prime(p, ctx, NULL))
|
||||
|| !TEST_true(BN_hex2bn(&a, "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE"
|
||||
"FFFFFFFF0000000000000000FFFFFFFC"))
|
||||
@@ -493,7 +493,7 @@ static int prime_field_tests(void)
|
||||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"))
|
||||
|| !TEST_int_eq(1, BN_is_prime_ex(p, BN_prime_checks, ctx, NULL))
|
||||
|| !TEST_int_eq(1, BN_check_prime(p, ctx, NULL))
|
||||
|| !TEST_true(BN_hex2bn(&a, "1FF"
|
||||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
@@ -1328,7 +1328,7 @@ static int nistp_single_test(int idx)
|
||||
|
||||
|| !TEST_ptr(NISTP = EC_GROUP_new(test->meth()))
|
||||
|| !TEST_true(BN_hex2bn(&p, test->p))
|
||||
|| !TEST_int_eq(1, BN_is_prime_ex(p, BN_prime_checks, ctx, NULL))
|
||||
|| !TEST_int_eq(1, BN_check_prime(p, ctx, NULL))
|
||||
|| !TEST_true(BN_hex2bn(&a, test->a))
|
||||
|| !TEST_true(BN_hex2bn(&b, test->b))
|
||||
|| !TEST_true(EC_GROUP_set_curve(NISTP, p, a, b, ctx))
|
||||
|
||||
+178
-23
@@ -24,7 +24,7 @@
|
||||
#include <openssl/dsa.h>
|
||||
#include "testutil.h"
|
||||
#include "internal/nelem.h"
|
||||
#include "internal/evp_int.h"
|
||||
#include "crypto/evp.h"
|
||||
|
||||
/*
|
||||
* kExampleRSAKeyDER is an RSA private key in ASN.1, DER format. Of course, you
|
||||
@@ -84,6 +84,51 @@ static const unsigned char kExampleRSAKeyDER[] = {
|
||||
0x2d, 0x86, 0x9d, 0xa5, 0x20, 0x1b, 0xe5, 0xdf,
|
||||
};
|
||||
|
||||
/*
|
||||
* kExampleDSAKeyDER is a DSA private key in ASN.1, DER format. Of course, you
|
||||
* should never use this key anywhere but in an example.
|
||||
*/
|
||||
static const unsigned char kExampleDSAKeyDER[] = {
|
||||
0x30, 0x82, 0x01, 0xba, 0x02, 0x01, 0x00, 0x02, 0x81, 0x81, 0x00, 0x9a,
|
||||
0x05, 0x6d, 0x33, 0xcd, 0x5d, 0x78, 0xa1, 0xbb, 0xcb, 0x7d, 0x5b, 0x8d,
|
||||
0xb4, 0xcc, 0xbf, 0x03, 0x99, 0x64, 0xde, 0x38, 0x78, 0x06, 0x15, 0x2f,
|
||||
0x86, 0x26, 0x77, 0xf3, 0xb1, 0x85, 0x00, 0xed, 0xfc, 0x28, 0x3a, 0x42,
|
||||
0x4d, 0xab, 0xab, 0xdf, 0xbc, 0x9c, 0x16, 0xd0, 0x22, 0x50, 0xd1, 0x38,
|
||||
0xdd, 0x3f, 0x64, 0x05, 0x9e, 0x68, 0x7a, 0x1e, 0xf1, 0x56, 0xbf, 0x1e,
|
||||
0x2c, 0xc5, 0x97, 0x2a, 0xfe, 0x7a, 0x22, 0xdc, 0x6c, 0x68, 0xb8, 0x2e,
|
||||
0x06, 0xdb, 0x41, 0xca, 0x98, 0xd8, 0x54, 0xc7, 0x64, 0x48, 0x24, 0x04,
|
||||
0x20, 0xbc, 0x59, 0xe3, 0x6b, 0xea, 0x7e, 0xfc, 0x7e, 0xc5, 0x4e, 0xd4,
|
||||
0xd8, 0x3a, 0xed, 0xcd, 0x5d, 0x99, 0xb8, 0x5c, 0xa2, 0x8b, 0xbb, 0x0b,
|
||||
0xac, 0xe6, 0x8e, 0x25, 0x56, 0x22, 0x3a, 0x2d, 0x3a, 0x56, 0x41, 0x14,
|
||||
0x1f, 0x1c, 0x8f, 0x53, 0x46, 0x13, 0x85, 0x02, 0x15, 0x00, 0x98, 0x7e,
|
||||
0x92, 0x81, 0x88, 0xc7, 0x3f, 0x70, 0x49, 0x54, 0xf6, 0x76, 0xb4, 0xa3,
|
||||
0x9e, 0x1d, 0x45, 0x98, 0x32, 0x7f, 0x02, 0x81, 0x80, 0x69, 0x4d, 0xef,
|
||||
0x55, 0xff, 0x4d, 0x59, 0x2c, 0x01, 0xfa, 0x6a, 0x38, 0xe0, 0x70, 0x9f,
|
||||
0x9e, 0x66, 0x8e, 0x3e, 0x8c, 0x52, 0x22, 0x9d, 0x15, 0x7e, 0x3c, 0xef,
|
||||
0x4c, 0x7a, 0x61, 0x26, 0xe0, 0x2b, 0x81, 0x3f, 0xeb, 0xaf, 0x35, 0x38,
|
||||
0x8d, 0xfe, 0xed, 0x46, 0xff, 0x5f, 0x03, 0x9b, 0x81, 0x92, 0xe7, 0x6f,
|
||||
0x76, 0x4f, 0x1d, 0xd9, 0xbb, 0x89, 0xc9, 0x3e, 0xd9, 0x0b, 0xf9, 0xf4,
|
||||
0x78, 0x11, 0x59, 0xc0, 0x1d, 0xcd, 0x0e, 0xa1, 0x6f, 0x15, 0xf1, 0x4d,
|
||||
0xc1, 0xc9, 0x22, 0xed, 0x8d, 0xad, 0x67, 0xc5, 0x4b, 0x95, 0x93, 0x86,
|
||||
0xa6, 0xaf, 0x8a, 0xee, 0x06, 0x89, 0x2f, 0x37, 0x7e, 0x64, 0xaa, 0xf6,
|
||||
0xe7, 0xb1, 0x5a, 0x0a, 0x93, 0x95, 0x5d, 0x3e, 0x53, 0x9a, 0xde, 0x8a,
|
||||
0xc2, 0x95, 0x45, 0x81, 0xbe, 0x5c, 0x2f, 0xc2, 0xb2, 0x92, 0x58, 0x19,
|
||||
0x72, 0x80, 0xe9, 0x79, 0xa1, 0x02, 0x81, 0x80, 0x07, 0xd7, 0x62, 0xff,
|
||||
0xdf, 0x1a, 0x3f, 0xed, 0x32, 0xd4, 0xd4, 0x88, 0x7b, 0x2c, 0x63, 0x7f,
|
||||
0x97, 0xdc, 0x44, 0xd4, 0x84, 0xa2, 0xdd, 0x17, 0x16, 0x85, 0x13, 0xe0,
|
||||
0xac, 0x51, 0x8d, 0x29, 0x1b, 0x75, 0x9a, 0xe4, 0xe3, 0x8a, 0x92, 0x69,
|
||||
0x09, 0x03, 0xc5, 0x68, 0xae, 0x5e, 0x94, 0xfe, 0xc9, 0x92, 0x6c, 0x07,
|
||||
0xb4, 0x1e, 0x64, 0x62, 0x87, 0xc6, 0xa4, 0xfd, 0x0d, 0x5f, 0xe5, 0xf9,
|
||||
0x1b, 0x4f, 0x85, 0x5f, 0xae, 0xf3, 0x11, 0xe5, 0x18, 0xd4, 0x4d, 0x79,
|
||||
0x9f, 0xc4, 0x79, 0x26, 0x04, 0x27, 0xf0, 0x0b, 0xee, 0x2b, 0x86, 0x9f,
|
||||
0x86, 0x61, 0xe6, 0x51, 0xce, 0x04, 0x9b, 0x5d, 0x6b, 0x34, 0x43, 0x8c,
|
||||
0x85, 0x3c, 0xf1, 0x51, 0x9b, 0x08, 0x23, 0x1b, 0xf5, 0x7e, 0x33, 0x12,
|
||||
0xea, 0xab, 0x1f, 0xb7, 0x2d, 0xe2, 0x5f, 0xe6, 0x97, 0x99, 0xb5, 0x45,
|
||||
0x16, 0x5b, 0xc3, 0x41, 0x02, 0x14, 0x61, 0xbf, 0x51, 0x60, 0xcf, 0xc8,
|
||||
0xf1, 0x8c, 0x82, 0x97, 0xf2, 0xf4, 0x19, 0xba, 0x2b, 0xf3, 0x16, 0xbe,
|
||||
0x40, 0x48
|
||||
};
|
||||
|
||||
/*
|
||||
* kExampleBadRSAKeyDER is an RSA private key in ASN.1, DER format. The private
|
||||
* components are not correct.
|
||||
@@ -377,6 +422,31 @@ end:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static EVP_PKEY *load_example_dsa_key(void)
|
||||
{
|
||||
EVP_PKEY *ret = NULL;
|
||||
const unsigned char *derp = kExampleDSAKeyDER;
|
||||
EVP_PKEY *pkey = NULL;
|
||||
DSA *dsa = NULL;
|
||||
|
||||
if (!TEST_true(d2i_DSAPrivateKey(&dsa, &derp, sizeof(kExampleDSAKeyDER))))
|
||||
return NULL;
|
||||
|
||||
if (!TEST_ptr(pkey = EVP_PKEY_new())
|
||||
|| !TEST_true(EVP_PKEY_set1_DSA(pkey, dsa)))
|
||||
goto end;
|
||||
|
||||
ret = pkey;
|
||||
pkey = NULL;
|
||||
|
||||
end:
|
||||
EVP_PKEY_free(pkey);
|
||||
DSA_free(dsa);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static int test_EVP_Enveloped(void)
|
||||
{
|
||||
int ret = 0;
|
||||
@@ -420,23 +490,55 @@ err:
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static int test_EVP_DigestSignInit(void)
|
||||
/*
|
||||
* Test 0: Standard calls to EVP_DigestSignInit/Update/Final (RSA)
|
||||
* Test 1: Standard calls to EVP_DigestSignInit/Update/Final (DSA)
|
||||
* Test 2: Use an MD BIO to do the Update calls instead (RSA)
|
||||
* Test 3: Use an MD BIO to do the Update calls instead (DSA)
|
||||
*/
|
||||
static int test_EVP_DigestSignInit(int tst)
|
||||
{
|
||||
int ret = 0;
|
||||
EVP_PKEY *pkey = NULL;
|
||||
unsigned char *sig = NULL;
|
||||
size_t sig_len = 0;
|
||||
EVP_MD_CTX *md_ctx, *md_ctx_verify = NULL;
|
||||
EVP_MD_CTX *md_ctx = NULL, *md_ctx_verify = NULL;
|
||||
EVP_MD_CTX *a_md_ctx = NULL, *a_md_ctx_verify = NULL;
|
||||
BIO *mdbio = NULL, *membio = NULL;
|
||||
size_t written;
|
||||
|
||||
if (!TEST_ptr(md_ctx = EVP_MD_CTX_new())
|
||||
|| !TEST_ptr(md_ctx_verify = EVP_MD_CTX_new())
|
||||
|| !TEST_ptr(pkey = load_example_rsa_key()))
|
||||
if (tst >= 2) {
|
||||
membio = BIO_new(BIO_s_mem());
|
||||
mdbio = BIO_new(BIO_f_md());
|
||||
if (!TEST_ptr(membio) || !TEST_ptr(mdbio))
|
||||
goto out;
|
||||
BIO_push(mdbio, membio);
|
||||
if (!TEST_int_gt(BIO_get_md_ctx(mdbio, &md_ctx), 0))
|
||||
goto out;
|
||||
} else {
|
||||
if (!TEST_ptr(a_md_ctx = md_ctx = EVP_MD_CTX_new())
|
||||
|| !TEST_ptr(a_md_ctx_verify = md_ctx_verify = EVP_MD_CTX_new()))
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (tst == 0 || tst == 2) {
|
||||
if (!TEST_ptr(pkey = load_example_rsa_key()))
|
||||
goto out;
|
||||
} else {
|
||||
if (!TEST_ptr(pkey = load_example_dsa_key()))
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!TEST_true(EVP_DigestSignInit(md_ctx, NULL, EVP_sha256(), NULL, pkey)))
|
||||
goto out;
|
||||
|
||||
if (!TEST_true(EVP_DigestSignInit(md_ctx, NULL, EVP_sha256(), NULL, pkey))
|
||||
|| !TEST_true(EVP_DigestSignUpdate(md_ctx, kMsg, sizeof(kMsg))))
|
||||
goto out;
|
||||
if (tst >= 2) {
|
||||
if (!BIO_write_ex(mdbio, kMsg, sizeof(kMsg), &written))
|
||||
goto out;
|
||||
} else {
|
||||
if (!TEST_true(EVP_DigestSignUpdate(md_ctx, kMsg, sizeof(kMsg))))
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Determine the size of the signature. */
|
||||
if (!TEST_true(EVP_DigestSignFinal(md_ctx, NULL, &sig_len))
|
||||
@@ -447,19 +549,35 @@ static int test_EVP_DigestSignInit(void)
|
||||
|| !TEST_true(EVP_DigestSignFinal(md_ctx, sig, &sig_len)))
|
||||
goto out;
|
||||
|
||||
if (tst >= 2) {
|
||||
if (!TEST_int_gt(BIO_reset(mdbio), 0)
|
||||
|| !TEST_int_gt(BIO_get_md_ctx(mdbio, &md_ctx_verify), 0))
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Ensure that the signature round-trips. */
|
||||
if (!TEST_true(EVP_DigestVerifyInit(md_ctx_verify, NULL, EVP_sha256(),
|
||||
NULL, pkey))
|
||||
|| !TEST_true(EVP_DigestVerifyUpdate(md_ctx_verify,
|
||||
kMsg, sizeof(kMsg)))
|
||||
|| !TEST_true(EVP_DigestVerifyFinal(md_ctx_verify, sig, sig_len)))
|
||||
NULL, pkey)))
|
||||
goto out;
|
||||
|
||||
if (tst >= 2) {
|
||||
if (!BIO_write_ex(mdbio, kMsg, sizeof(kMsg), &written))
|
||||
goto out;
|
||||
} else {
|
||||
if (!TEST_true(EVP_DigestVerifyUpdate(md_ctx_verify, kMsg,
|
||||
sizeof(kMsg))))
|
||||
goto out;
|
||||
}
|
||||
if (!TEST_true(EVP_DigestVerifyFinal(md_ctx_verify, sig, sig_len)))
|
||||
goto out;
|
||||
|
||||
ret = 1;
|
||||
|
||||
out:
|
||||
EVP_MD_CTX_free(md_ctx);
|
||||
EVP_MD_CTX_free(md_ctx_verify);
|
||||
BIO_free(membio);
|
||||
BIO_free(mdbio);
|
||||
EVP_MD_CTX_free(a_md_ctx);
|
||||
EVP_MD_CTX_free(a_md_ctx_verify);
|
||||
EVP_PKEY_free(pkey);
|
||||
OPENSSL_free(sig);
|
||||
|
||||
@@ -1077,33 +1195,38 @@ done:
|
||||
/* Test getting and setting parameters on an EVP_PKEY_CTX */
|
||||
static int test_EVP_PKEY_CTX_get_set_params(void)
|
||||
{
|
||||
EVP_MD_CTX *mdctx = NULL;
|
||||
EVP_PKEY_CTX *ctx = NULL;
|
||||
EVP_SIGNATURE *dsaimpl = NULL;
|
||||
const OSSL_PARAM *params;
|
||||
OSSL_PARAM ourparams[2], *param = ourparams;
|
||||
DSA *dsa = NULL;
|
||||
BIGNUM *p = NULL, *q = NULL, *g = NULL;
|
||||
BIGNUM *p = NULL, *q = NULL, *g = NULL, *pub = NULL, *priv = NULL;
|
||||
EVP_PKEY *pkey = NULL;
|
||||
int ret = 0;
|
||||
const EVP_MD *md;
|
||||
size_t mdsize = SHA512_DIGEST_LENGTH;
|
||||
char ssl3ms[48];
|
||||
|
||||
/*
|
||||
* Setup the parameters for our DSA object. For our purposes they don't have
|
||||
* to actually be *valid* parameters. We just need to set something. We
|
||||
* don't even need a pub_key/priv_key.
|
||||
* Setup the parameters for our DSA object. For our purposes they don't
|
||||
* have to actually be *valid* parameters. We just need to set something.
|
||||
*/
|
||||
dsa = DSA_new();
|
||||
p = BN_new();
|
||||
q = BN_new();
|
||||
g = BN_new();
|
||||
pub = BN_new();
|
||||
priv = BN_new();
|
||||
if (!TEST_ptr(dsa)
|
||||
|| !TEST_ptr(p)
|
||||
|| !TEST_ptr(q)
|
||||
|| !TEST_ptr(g)
|
||||
|| !DSA_set0_pqg(dsa, p, q, g))
|
||||
|| !TEST_ptr(pub)
|
||||
|| !DSA_set0_pqg(dsa, p, q, g)
|
||||
|| !DSA_set0_key(dsa, pub, priv))
|
||||
goto err;
|
||||
p = q = g = NULL;
|
||||
p = q = g = pub = priv = NULL;
|
||||
|
||||
pkey = EVP_PKEY_new();
|
||||
if (!TEST_ptr(pkey)
|
||||
@@ -1171,9 +1294,39 @@ static int test_EVP_PKEY_CTX_get_set_params(void)
|
||||
|| !TEST_ptr_eq(md, EVP_sha256()))
|
||||
goto err;
|
||||
|
||||
/*
|
||||
* Test getting MD parameters via an associated EVP_PKEY_CTX
|
||||
*/
|
||||
mdctx = EVP_MD_CTX_new();
|
||||
if (!TEST_ptr(mdctx)
|
||||
|| !TEST_true(EVP_DigestSignInit_ex(mdctx, NULL, "SHA1", NULL,
|
||||
pkey, dsaimpl)))
|
||||
goto err;
|
||||
|
||||
/*
|
||||
* We now have an EVP_MD_CTX with an EVP_PKEY_CTX inside it. We should be
|
||||
* able to obtain the digest's settable parameters from the provider.
|
||||
*/
|
||||
params = EVP_MD_CTX_settable_params(mdctx);
|
||||
if (!TEST_ptr(params)
|
||||
|| !TEST_int_eq(strcmp(params[0].key, OSSL_DIGEST_PARAM_SSL3_MS), 0)
|
||||
/* The final key should be NULL */
|
||||
|| !TEST_ptr_null(params[1].key))
|
||||
goto err;
|
||||
|
||||
param = ourparams;
|
||||
memset(ssl3ms, 0, sizeof(ssl3ms));
|
||||
*param++ = OSSL_PARAM_construct_octet_string(OSSL_DIGEST_PARAM_SSL3_MS,
|
||||
ssl3ms, sizeof(ssl3ms));
|
||||
*param++ = OSSL_PARAM_construct_end();
|
||||
|
||||
if (!TEST_true(EVP_MD_CTX_set_params(mdctx, ourparams)))
|
||||
goto err;
|
||||
|
||||
ret = 1;
|
||||
|
||||
err:
|
||||
EVP_MD_CTX_free(mdctx);
|
||||
EVP_PKEY_CTX_free(ctx);
|
||||
EVP_SIGNATURE_free(dsaimpl);
|
||||
EVP_PKEY_free(pkey);
|
||||
@@ -1181,6 +1334,8 @@ static int test_EVP_PKEY_CTX_get_set_params(void)
|
||||
BN_free(p);
|
||||
BN_free(q);
|
||||
BN_free(g);
|
||||
BN_free(pub);
|
||||
BN_free(priv);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1188,7 +1343,7 @@ static int test_EVP_PKEY_CTX_get_set_params(void)
|
||||
|
||||
int setup_tests(void)
|
||||
{
|
||||
ADD_TEST(test_EVP_DigestSignInit);
|
||||
ADD_ALL_TESTS(test_EVP_DigestSignInit, 4);
|
||||
ADD_TEST(test_EVP_DigestVerifyInit);
|
||||
ADD_TEST(test_EVP_Enveloped);
|
||||
ADD_ALL_TESTS(test_d2i_AutoPrivateKey, OSSL_NELEM(keydata));
|
||||
|
||||
@@ -297,6 +297,219 @@ static int test_kdf_x963(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* KBKDF test vectors from RFC 6803 (Camellia Encryption for Kerberos 5)
|
||||
* section 10.
|
||||
*/
|
||||
static int test_kdf_kbkdf_6803_128(void)
|
||||
{
|
||||
int ret = 0, i, p;
|
||||
EVP_KDF_CTX *kctx;
|
||||
OSSL_PARAM params[7];
|
||||
static unsigned char input_key[] = {
|
||||
0x57, 0xD0, 0x29, 0x72, 0x98, 0xFF, 0xD9, 0xD3,
|
||||
0x5D, 0xE5, 0xA4, 0x7F, 0xB4, 0xBD, 0xE2, 0x4B,
|
||||
};
|
||||
static unsigned char constants[][5] = {
|
||||
{ 0x00, 0x00, 0x00, 0x02, 0x99 },
|
||||
{ 0x00, 0x00, 0x00, 0x02, 0xaa },
|
||||
{ 0x00, 0x00, 0x00, 0x02, 0x55 },
|
||||
};
|
||||
static unsigned char outputs[][16] = {
|
||||
{0xD1, 0x55, 0x77, 0x5A, 0x20, 0x9D, 0x05, 0xF0,
|
||||
0x2B, 0x38, 0xD4, 0x2A, 0x38, 0x9E, 0x5A, 0x56},
|
||||
{0x64, 0xDF, 0x83, 0xF8, 0x5A, 0x53, 0x2F, 0x17,
|
||||
0x57, 0x7D, 0x8C, 0x37, 0x03, 0x57, 0x96, 0xAB},
|
||||
{0x3E, 0x4F, 0xBD, 0xF3, 0x0F, 0xB8, 0x25, 0x9C,
|
||||
0x42, 0x5C, 0xB6, 0xC9, 0x6F, 0x1F, 0x46, 0x35}
|
||||
};
|
||||
static unsigned char iv[16] = { 0 };
|
||||
unsigned char result[16] = { 0 };
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
p = 0;
|
||||
params[p++] = OSSL_PARAM_construct_utf8_string(
|
||||
OSSL_KDF_PARAM_CIPHER, "CAMELLIA-128-CBC", 0);
|
||||
params[p++] = OSSL_PARAM_construct_utf8_string(
|
||||
OSSL_KDF_PARAM_MAC, "CMAC", 0);
|
||||
params[p++] = OSSL_PARAM_construct_utf8_string(
|
||||
OSSL_KDF_PARAM_MODE, "FEEDBACK", 0);
|
||||
params[p++] = OSSL_PARAM_construct_octet_string(
|
||||
OSSL_KDF_PARAM_KEY, input_key, sizeof(input_key));
|
||||
params[p++] = OSSL_PARAM_construct_octet_string(
|
||||
OSSL_KDF_PARAM_SALT, constants[i], sizeof(constants[i]));
|
||||
params[p++] = OSSL_PARAM_construct_octet_string(
|
||||
OSSL_KDF_PARAM_SEED, iv, sizeof(iv));
|
||||
params[p] = OSSL_PARAM_construct_end();
|
||||
|
||||
kctx = get_kdfbyname("KBKDF");
|
||||
ret = TEST_ptr(kctx)
|
||||
&& TEST_true(EVP_KDF_CTX_set_params(kctx, params))
|
||||
&& TEST_int_gt(EVP_KDF_derive(kctx, result, sizeof(result)), 0)
|
||||
&& TEST_mem_eq(result, sizeof(result), outputs[i],
|
||||
sizeof(outputs[i]));
|
||||
EVP_KDF_CTX_free(kctx);
|
||||
if (ret != 1)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int test_kdf_kbkdf_6803_256(void)
|
||||
{
|
||||
int ret = 0, i, p;
|
||||
EVP_KDF_CTX *kctx;
|
||||
OSSL_PARAM params[7];
|
||||
static unsigned char input_key[] = {
|
||||
0xB9, 0xD6, 0x82, 0x8B, 0x20, 0x56, 0xB7, 0xBE,
|
||||
0x65, 0x6D, 0x88, 0xA1, 0x23, 0xB1, 0xFA, 0xC6,
|
||||
0x82, 0x14, 0xAC, 0x2B, 0x72, 0x7E, 0xCF, 0x5F,
|
||||
0x69, 0xAF, 0xE0, 0xC4, 0xDF, 0x2A, 0x6D, 0x2C,
|
||||
};
|
||||
static unsigned char constants[][5] = {
|
||||
{ 0x00, 0x00, 0x00, 0x02, 0x99 },
|
||||
{ 0x00, 0x00, 0x00, 0x02, 0xaa },
|
||||
{ 0x00, 0x00, 0x00, 0x02, 0x55 },
|
||||
};
|
||||
static unsigned char outputs[][32] = {
|
||||
{0xE4, 0x67, 0xF9, 0xA9, 0x55, 0x2B, 0xC7, 0xD3,
|
||||
0x15, 0x5A, 0x62, 0x20, 0xAF, 0x9C, 0x19, 0x22,
|
||||
0x0E, 0xEE, 0xD4, 0xFF, 0x78, 0xB0, 0xD1, 0xE6,
|
||||
0xA1, 0x54, 0x49, 0x91, 0x46, 0x1A, 0x9E, 0x50,
|
||||
},
|
||||
{0x41, 0x2A, 0xEF, 0xC3, 0x62, 0xA7, 0x28, 0x5F,
|
||||
0xC3, 0x96, 0x6C, 0x6A, 0x51, 0x81, 0xE7, 0x60,
|
||||
0x5A, 0xE6, 0x75, 0x23, 0x5B, 0x6D, 0x54, 0x9F,
|
||||
0xBF, 0xC9, 0xAB, 0x66, 0x30, 0xA4, 0xC6, 0x04,
|
||||
},
|
||||
{0xFA, 0x62, 0x4F, 0xA0, 0xE5, 0x23, 0x99, 0x3F,
|
||||
0xA3, 0x88, 0xAE, 0xFD, 0xC6, 0x7E, 0x67, 0xEB,
|
||||
0xCD, 0x8C, 0x08, 0xE8, 0xA0, 0x24, 0x6B, 0x1D,
|
||||
0x73, 0xB0, 0xD1, 0xDD, 0x9F, 0xC5, 0x82, 0xB0,
|
||||
},
|
||||
};
|
||||
static unsigned char iv[16] = { 0 };
|
||||
unsigned char result[32] = { 0 };
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
p = 0;
|
||||
params[p++] = OSSL_PARAM_construct_utf8_string(
|
||||
OSSL_KDF_PARAM_CIPHER, "CAMELLIA-256-CBC", 0);
|
||||
params[p++] = OSSL_PARAM_construct_utf8_string(
|
||||
OSSL_KDF_PARAM_MAC, "CMAC", 0);
|
||||
params[p++] = OSSL_PARAM_construct_utf8_string(
|
||||
OSSL_KDF_PARAM_MODE, "FEEDBACK", 0);
|
||||
params[p++] = OSSL_PARAM_construct_octet_string(
|
||||
OSSL_KDF_PARAM_KEY, input_key, sizeof(input_key));
|
||||
params[p++] = OSSL_PARAM_construct_octet_string(
|
||||
OSSL_KDF_PARAM_SALT, constants[i], sizeof(constants[i]));
|
||||
params[p++] = OSSL_PARAM_construct_octet_string(
|
||||
OSSL_KDF_PARAM_SEED, iv, sizeof(iv));
|
||||
params[p] = OSSL_PARAM_construct_end();
|
||||
|
||||
kctx = get_kdfbyname("KBKDF");
|
||||
ret = TEST_ptr(kctx)
|
||||
&& TEST_true(EVP_KDF_CTX_set_params(kctx, params))
|
||||
&& TEST_int_gt(EVP_KDF_derive(kctx, result, sizeof(result)), 0)
|
||||
&& TEST_mem_eq(result, sizeof(result), outputs[i],
|
||||
sizeof(outputs[i]));
|
||||
EVP_KDF_CTX_free(kctx);
|
||||
if (ret != 1)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Two test vectors from RFC 8009 (AES Encryption with HMAC-SHA2 for Kerberos
|
||||
* 5) appendix A. */
|
||||
static int test_kdf_kbkdf_8009_prf1(void)
|
||||
{
|
||||
int ret, i = 0;
|
||||
EVP_KDF_CTX *kctx;
|
||||
OSSL_PARAM params[6];
|
||||
char *label = "prf", *digest = "sha256", *prf_input = "test",
|
||||
*mac = "HMAC";
|
||||
static unsigned char input_key[] = {
|
||||
0x37, 0x05, 0xD9, 0x60, 0x80, 0xC1, 0x77, 0x28,
|
||||
0xA0, 0xE8, 0x00, 0xEA, 0xB6, 0xE0, 0xD2, 0x3C,
|
||||
};
|
||||
static unsigned char output[] = {
|
||||
0x9D, 0x18, 0x86, 0x16, 0xF6, 0x38, 0x52, 0xFE,
|
||||
0x86, 0x91, 0x5B, 0xB8, 0x40, 0xB4, 0xA8, 0x86,
|
||||
0xFF, 0x3E, 0x6B, 0xB0, 0xF8, 0x19, 0xB4, 0x9B,
|
||||
0x89, 0x33, 0x93, 0xD3, 0x93, 0x85, 0x42, 0x95,
|
||||
};
|
||||
unsigned char result[sizeof(output)] = { 0 };
|
||||
|
||||
params[i++] = OSSL_PARAM_construct_utf8_string(
|
||||
OSSL_KDF_PARAM_DIGEST, digest, strlen(digest) + 1);
|
||||
params[i++] = OSSL_PARAM_construct_utf8_string(
|
||||
OSSL_KDF_PARAM_MAC, mac, strlen(mac) + 1);
|
||||
params[i++] = OSSL_PARAM_construct_octet_string(
|
||||
OSSL_KDF_PARAM_KEY, input_key, sizeof(input_key));
|
||||
params[i++] = OSSL_PARAM_construct_octet_string(
|
||||
OSSL_KDF_PARAM_SALT, label, strlen(label));
|
||||
params[i++] = OSSL_PARAM_construct_octet_string(
|
||||
OSSL_KDF_PARAM_INFO, prf_input, strlen(prf_input));
|
||||
params[i] = OSSL_PARAM_construct_end();
|
||||
|
||||
kctx = get_kdfbyname("KBKDF");
|
||||
ret = TEST_ptr(kctx)
|
||||
&& TEST_true(EVP_KDF_CTX_set_params(kctx, params))
|
||||
&& TEST_int_gt(EVP_KDF_derive(kctx, result, sizeof(result)), 0)
|
||||
&& TEST_mem_eq(result, sizeof(result), output, sizeof(output));
|
||||
|
||||
EVP_KDF_CTX_free(kctx);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int test_kdf_kbkdf_8009_prf2(void)
|
||||
{
|
||||
int ret, i = 0;
|
||||
EVP_KDF_CTX *kctx;
|
||||
OSSL_PARAM params[6];
|
||||
char *label = "prf", *digest = "sha384", *prf_input = "test",
|
||||
*mac = "HMAC";
|
||||
static unsigned char input_key[] = {
|
||||
0x6D, 0x40, 0x4D, 0x37, 0xFA, 0xF7, 0x9F, 0x9D,
|
||||
0xF0, 0xD3, 0x35, 0x68, 0xD3, 0x20, 0x66, 0x98,
|
||||
0x00, 0xEB, 0x48, 0x36, 0x47, 0x2E, 0xA8, 0xA0,
|
||||
0x26, 0xD1, 0x6B, 0x71, 0x82, 0x46, 0x0C, 0x52,
|
||||
};
|
||||
static unsigned char output[] = {
|
||||
0x98, 0x01, 0xF6, 0x9A, 0x36, 0x8C, 0x2B, 0xF6,
|
||||
0x75, 0xE5, 0x95, 0x21, 0xE1, 0x77, 0xD9, 0xA0,
|
||||
0x7F, 0x67, 0xEF, 0xE1, 0xCF, 0xDE, 0x8D, 0x3C,
|
||||
0x8D, 0x6F, 0x6A, 0x02, 0x56, 0xE3, 0xB1, 0x7D,
|
||||
0xB3, 0xC1, 0xB6, 0x2A, 0xD1, 0xB8, 0x55, 0x33,
|
||||
0x60, 0xD1, 0x73, 0x67, 0xEB, 0x15, 0x14, 0xD2,
|
||||
};
|
||||
unsigned char result[sizeof(output)] = { 0 };
|
||||
|
||||
params[i++] = OSSL_PARAM_construct_utf8_string(
|
||||
OSSL_KDF_PARAM_DIGEST, digest, strlen(digest) + 1);
|
||||
params[i++] = OSSL_PARAM_construct_utf8_string(
|
||||
OSSL_KDF_PARAM_MAC, mac, strlen(mac) + 1);
|
||||
params[i++] = OSSL_PARAM_construct_octet_string(
|
||||
OSSL_KDF_PARAM_KEY, input_key, sizeof(input_key));
|
||||
params[i++] = OSSL_PARAM_construct_octet_string(
|
||||
OSSL_KDF_PARAM_SALT, label, strlen(label));
|
||||
params[i++] = OSSL_PARAM_construct_octet_string(
|
||||
OSSL_KDF_PARAM_INFO, prf_input, strlen(prf_input));
|
||||
params[i] = OSSL_PARAM_construct_end();
|
||||
|
||||
kctx = get_kdfbyname("KBKDF");
|
||||
ret = TEST_ptr(kctx)
|
||||
&& TEST_true(EVP_KDF_CTX_set_params(kctx, params))
|
||||
&& TEST_int_gt(EVP_KDF_derive(kctx, result, sizeof(result)), 0)
|
||||
&& TEST_mem_eq(result, sizeof(result), output, sizeof(output));
|
||||
|
||||
EVP_KDF_CTX_free(kctx);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int test_kdf_ss_hmac(void)
|
||||
{
|
||||
int ret;
|
||||
@@ -521,6 +734,10 @@ static int test_kdf_x942_asn1(void)
|
||||
|
||||
int setup_tests(void)
|
||||
{
|
||||
ADD_TEST(test_kdf_kbkdf_6803_128);
|
||||
ADD_TEST(test_kdf_kbkdf_6803_256);
|
||||
ADD_TEST(test_kdf_kbkdf_8009_prf1);
|
||||
ADD_TEST(test_kdf_kbkdf_8009_prf2);
|
||||
ADD_TEST(test_kdf_get_kdf);
|
||||
ADD_TEST(test_kdf_tls1_prf);
|
||||
ADD_TEST(test_kdf_hkdf);
|
||||
|
||||
+41
-4
@@ -485,7 +485,9 @@ typedef struct cipher_data_st {
|
||||
int aead;
|
||||
unsigned char *key;
|
||||
size_t key_len;
|
||||
size_t key_bits; /* Used by RC2 */
|
||||
unsigned char *iv;
|
||||
unsigned int rounds;
|
||||
size_t iv_len;
|
||||
unsigned char *plaintext;
|
||||
size_t plaintext_len;
|
||||
@@ -559,12 +561,26 @@ static int cipher_test_parse(EVP_TEST *t, const char *keyword,
|
||||
|
||||
if (strcmp(keyword, "Key") == 0)
|
||||
return parse_bin(value, &cdat->key, &cdat->key_len);
|
||||
if (strcmp(keyword, "Rounds") == 0) {
|
||||
i = atoi(value);
|
||||
if (i < 0)
|
||||
return -1;
|
||||
cdat->rounds = (unsigned int)i;
|
||||
return 1;
|
||||
}
|
||||
if (strcmp(keyword, "IV") == 0)
|
||||
return parse_bin(value, &cdat->iv, &cdat->iv_len);
|
||||
if (strcmp(keyword, "Plaintext") == 0)
|
||||
return parse_bin(value, &cdat->plaintext, &cdat->plaintext_len);
|
||||
if (strcmp(keyword, "Ciphertext") == 0)
|
||||
return parse_bin(value, &cdat->ciphertext, &cdat->ciphertext_len);
|
||||
if (strcmp(keyword, "KeyBits") == 0) {
|
||||
i = atoi(value);
|
||||
if (i < 0)
|
||||
return -1;
|
||||
cdat->key_bits = (size_t)i;
|
||||
return 1;
|
||||
}
|
||||
if (cdat->aead) {
|
||||
if (strcmp(keyword, "AAD") == 0) {
|
||||
for (i = 0; i < AAD_NUM; i++) {
|
||||
@@ -683,14 +699,32 @@ static int cipher_test_enc(EVP_TEST *t, int enc,
|
||||
}
|
||||
}
|
||||
|
||||
if (expected->rounds > 0) {
|
||||
int rounds = (int)expected->rounds;
|
||||
|
||||
if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_SET_RC5_ROUNDS, rounds, NULL)) {
|
||||
t->err = "INVALID_ROUNDS";
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
||||
if (!EVP_CIPHER_CTX_set_key_length(ctx, expected->key_len)) {
|
||||
t->err = "INVALID_KEY_LENGTH";
|
||||
goto err;
|
||||
}
|
||||
if (expected->key_bits > 0) {
|
||||
int bits = (int)expected->key_bits;
|
||||
|
||||
if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_SET_RC2_KEY_BITS, bits, NULL)) {
|
||||
t->err = "INVALID KEY BITS";
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
if (!EVP_CipherInit_ex(ctx, NULL, NULL, expected->key, expected->iv, -1)) {
|
||||
t->err = "KEY_SET_ERROR";
|
||||
goto err;
|
||||
}
|
||||
|
||||
/* Check that we get the same IV back */
|
||||
if (expected->iv != NULL
|
||||
&& (EVP_CIPHER_flags(expected->cipher) & EVP_CIPH_CUSTOM_IV) == 0
|
||||
@@ -904,6 +938,7 @@ static const EVP_TEST_METHOD cipher_test_method = {
|
||||
|
||||
typedef struct mac_data_st {
|
||||
/* MAC type in one form or another */
|
||||
char *mac_name;
|
||||
EVP_MAC *mac; /* for mac_test_run_mac */
|
||||
int type; /* for mac_test_run_pkey */
|
||||
/* Algorithm string for this MAC */
|
||||
@@ -987,6 +1022,7 @@ static int mac_test_init(EVP_TEST *t, const char *alg)
|
||||
|
||||
mdat = OPENSSL_zalloc(sizeof(*mdat));
|
||||
mdat->type = type;
|
||||
mdat->mac_name = OPENSSL_strdup(alg);
|
||||
mdat->mac = mac;
|
||||
mdat->controls = sk_OPENSSL_STRING_new_null();
|
||||
t->data = mdat;
|
||||
@@ -1004,6 +1040,7 @@ static void mac_test_cleanup(EVP_TEST *t)
|
||||
MAC_DATA *mdat = t->data;
|
||||
|
||||
EVP_MAC_free(mdat->mac);
|
||||
OPENSSL_free(mdat->mac_name);
|
||||
sk_OPENSSL_STRING_pop_free(mdat->controls, openssl_free);
|
||||
OPENSSL_free(mdat->alg);
|
||||
OPENSSL_free(mdat->key);
|
||||
@@ -1161,13 +1198,13 @@ static int mac_test_run_mac(EVP_TEST *t)
|
||||
size_t params_n = 0;
|
||||
size_t params_n_allocstart = 0;
|
||||
const OSSL_PARAM *defined_params =
|
||||
EVP_MAC_CTX_settable_params(expected->mac);
|
||||
EVP_MAC_settable_ctx_params(expected->mac);
|
||||
|
||||
if (expected->alg == NULL)
|
||||
TEST_info("Trying the EVP_MAC %s test", EVP_MAC_name(expected->mac));
|
||||
TEST_info("Trying the EVP_MAC %s test", expected->mac_name);
|
||||
else
|
||||
TEST_info("Trying the EVP_MAC %s test with %s",
|
||||
EVP_MAC_name(expected->mac), expected->alg);
|
||||
expected->mac_name, expected->alg);
|
||||
|
||||
#ifdef OPENSSL_NO_DES
|
||||
if (expected->alg != NULL && strstr(expected->alg, "DES") != NULL) {
|
||||
@@ -2054,7 +2091,7 @@ static int kdf_test_ctrl(EVP_TEST *t, EVP_KDF_CTX *kctx,
|
||||
KDF_DATA *kdata = t->data;
|
||||
int rv;
|
||||
char *p, *name;
|
||||
const OSSL_PARAM *defs = EVP_KDF_CTX_settable_params(EVP_KDF_CTX_kdf(kctx));
|
||||
const OSSL_PARAM *defs = EVP_KDF_settable_ctx_params(EVP_KDF_CTX_kdf(kctx));
|
||||
|
||||
if (!TEST_ptr(name = OPENSSL_strdup(value)))
|
||||
return 0;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <openssl/srp.h>
|
||||
#endif
|
||||
|
||||
#include "../ssl/ssl_locl.h"
|
||||
#include "../ssl/ssl_local.h"
|
||||
#include "internal/sockets.h"
|
||||
#include "internal/nelem.h"
|
||||
#include "handshake_helper.h"
|
||||
@@ -877,7 +877,7 @@ static void do_app_data_step(PEER *peer)
|
||||
* to read gives us somewhat better guarantees that all data sent is in fact
|
||||
* received.
|
||||
*/
|
||||
if (!peer->bytes_to_write && !peer->bytes_to_read) {
|
||||
if (peer->bytes_to_write == 0 && peer->bytes_to_read == 0) {
|
||||
peer->status = PEER_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_HANDSHAKE_HELPER_H
|
||||
#define HEADER_HANDSHAKE_HELPER_H
|
||||
#ifndef OSSL_TEST_HANDSHAKE_HELPER_H
|
||||
#define OSSL_TEST_HANDSHAKE_HELPER_H
|
||||
|
||||
#include "ssl_test_ctx.h"
|
||||
|
||||
@@ -78,4 +78,4 @@ HANDSHAKE_RESULT *do_handshake(SSL_CTX *server_ctx, SSL_CTX *server2_ctx,
|
||||
SSL_CTX *resume_client_ctx,
|
||||
const SSL_TEST_CTX *test_ctx);
|
||||
|
||||
#endif /* HEADER_HANDSHAKE_HELPER_H */
|
||||
#endif /* OSSL_TEST_HANDSHAKE_HELPER_H */
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
#include <string.h>
|
||||
#include <openssl/provider.h>
|
||||
#include <openssl/params.h>
|
||||
#include <openssl/ossl_typ.h>
|
||||
#include <openssl/types.h>
|
||||
#include <openssl/core_names.h>
|
||||
#include "internal/nelem.h"
|
||||
#include "testutil.h"
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <openssl/aes.h>
|
||||
#include <openssl/modes.h>
|
||||
#include "testutil.h"
|
||||
#include "internal/modes_int.h"
|
||||
#include "crypto/modes.h"
|
||||
#include "internal/nelem.h"
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_ASYNC_BIO
|
||||
#define HEADER_ASYNC_BIO
|
||||
#ifndef OSSL_TEST_SHIM_ASYNC_BIO_H
|
||||
#define OSSL_TEST_SHIM_ASYNC_BIO_H
|
||||
|
||||
#include <openssl/base.h>
|
||||
#include <openssl/bio.h>
|
||||
@@ -36,4 +36,4 @@ void AsyncBioAllowWrite(BIO *bio, size_t count);
|
||||
void AsyncBioEnforceWriteQuota(BIO *bio, bool enforce);
|
||||
|
||||
|
||||
#endif // HEADER_ASYNC_BIO
|
||||
#endif // OSSL_TEST_SHIM_ASYNC_BIO_H
|
||||
@@ -7,8 +7,8 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef OPENSSL_HEADER_BASE_H
|
||||
#define OPENSSL_HEADER_BASE_H
|
||||
#ifndef OSSL_TEST_SHIM_INCLUDE_OPENSSL_BASE_H
|
||||
#define OSSL_TEST_SHIM_INCLUDE_OPENSSL_BASE_H
|
||||
|
||||
/* Needed for BORINGSSL_MAKE_DELETER */
|
||||
# include <openssl/bio.h>
|
||||
@@ -108,4 +108,4 @@ BORINGSSL_MAKE_DELETER(SSL_SESSION, SSL_SESSION_free)
|
||||
} /* extern C++ */
|
||||
|
||||
|
||||
#endif /* OPENSSL_HEADER_BASE_H */
|
||||
#endif /* OSSL_TEST_SHIM_INCLUDE_OPENSSL_BASE_H */
|
||||
@@ -7,8 +7,8 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_PACKETED_BIO
|
||||
#define HEADER_PACKETED_BIO
|
||||
#ifndef OSSL_TEST_SHIM_PACKETED_BIO_H
|
||||
#define OSSL_TEST_SHIM_PACKETED_BIO_H
|
||||
|
||||
#include <openssl/base.h>
|
||||
#include <openssl/bio.h>
|
||||
@@ -32,4 +32,4 @@ timeval PacketedBioGetClock(const BIO *bio);
|
||||
bool PacketedBioAdvanceClock(BIO *bio);
|
||||
|
||||
|
||||
#endif // HEADER_PACKETED_BIO
|
||||
#endif // OSSL_TEST_SHIM_PACKETED_BIO_H
|
||||
@@ -7,8 +7,8 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_TEST_CONFIG
|
||||
#define HEADER_TEST_CONFIG
|
||||
#ifndef OSSL_TEST_SHIM_TEST_CONFIG_H
|
||||
#define OSSL_TEST_SHIM_TEST_CONFIG_H
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@@ -85,4 +85,4 @@ struct TestConfig {
|
||||
bool ParseConfig(int argc, char **argv, TestConfig *out_config);
|
||||
|
||||
|
||||
#endif // HEADER_TEST_CONFIG
|
||||
#endif // OSSL_TEST_SHIM_TEST_CONFIG_H
|
||||
@@ -7,8 +7,8 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_INTERNAL_ENDIAN_H
|
||||
# define HEADER_INTERNAL_ENDIAN_H
|
||||
#ifndef OSSL_TEST_OSSL_TEST_ENDIAN_H
|
||||
# define OSSL_TEST_OSSL_TEST_ENDIAN_H
|
||||
|
||||
# define DECLARE_IS_ENDIAN \
|
||||
const union { \
|
||||
|
||||
@@ -13,8 +13,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "testutil.h"
|
||||
#include "internal/poly1305.h"
|
||||
#include "../crypto/poly1305/poly1305_local.h"
|
||||
#include "crypto/poly1305.h"
|
||||
#include "internal/nelem.h"
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "testutil.h"
|
||||
#include "internal/nelem.h"
|
||||
#include "internal/property.h"
|
||||
#include "../crypto/property/property_lcl.h"
|
||||
#include "../crypto/property/property_local.h"
|
||||
|
||||
static int add_property_names(const char *n, ...)
|
||||
{
|
||||
|
||||
@@ -16,9 +16,8 @@ use OpenSSL::Test qw/:DEFAULT data_file/;
|
||||
|
||||
setup("test_bn");
|
||||
|
||||
my @files = (
|
||||
"bnexp.txt", "bnmod.txt", "bnmul.txt", "bnshift.txt", "bnsum.txt"
|
||||
);
|
||||
my @files = qw( bnexp.txt bnmod.txt bnmul.txt bnshift.txt bnsum.txt bngcd.txt );
|
||||
|
||||
plan tests => 1 + scalar(@files);
|
||||
|
||||
foreach my $f ( @files ) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+33
-11
@@ -21,12 +21,15 @@ use lib srctop_dir('Configurations');
|
||||
use lib bldtop_dir('.');
|
||||
use platform;
|
||||
|
||||
my $no_fips = disabled('fips') || ($ENV{NO_FIPS} // 0);
|
||||
my $no_legacy = disabled('legacy') || ($ENV{NO_LEGACY} // 0);
|
||||
|
||||
# Default config depends on if the legacy module is built or not
|
||||
my $defaultcnf = disabled('legacy') ? 'default.cnf' : 'default-and-legacy.cnf';
|
||||
my $defaultcnf = $no_legacy ? 'default.cnf' : 'default-and-legacy.cnf';
|
||||
|
||||
my @configs = ( $defaultcnf );
|
||||
# Only add the FIPS config if the FIPS module has been built
|
||||
push @configs, 'fips.cnf' unless disabled('fips');
|
||||
push @configs, 'fips.cnf' unless $no_fips;
|
||||
|
||||
my @files = qw( evpciph.txt evpdigest.txt );
|
||||
my @defltfiles = qw( evpencod.txt evpkdf.txt evppkey_kdf.txt evpmac.txt
|
||||
@@ -47,17 +50,36 @@ push @defltfiles, @sm4files unless disabled("sm4");
|
||||
my @desfiles = qw( evpciph_des.txt );
|
||||
push @defltfiles, @desfiles unless disabled("des");
|
||||
|
||||
plan tests => (scalar(@configs) * scalar(@files)) + scalar(@defltfiles) + 1;
|
||||
my @rc4files = qw( evpciph_rc4.txt );
|
||||
push @defltfiles, @rc4files unless disabled("rc4");
|
||||
|
||||
my $infile = bldtop_file('providers', platform->dso('fips'));
|
||||
$ENV{OPENSSL_MODULES} = bldtop_dir("providers");
|
||||
$ENV{OPENSSL_CONF_INCLUDE} = bldtop_dir("providers");
|
||||
my @rc5files = qw( evpciph_rc5.txt );
|
||||
push @defltfiles, @rc5files unless disabled("rc5");
|
||||
|
||||
ok(run(app(['openssl', 'fipsinstall', '-out', bldtop_file('providers', 'fipsinstall.conf'),
|
||||
'-module', $infile,
|
||||
'-provider_name', 'fips', '-mac_name', 'HMAC',
|
||||
'-macopt', 'digest:SHA256', '-macopt', 'hexkey:00',
|
||||
'-section_name', 'fips_sect'])), "fipinstall");
|
||||
my @rc2files = qw( evpciph_rc2.txt );
|
||||
push @defltfiles, @rc2files unless disabled("rc2");
|
||||
|
||||
my @chachafiles = qw( evpciph_chacha.txt );
|
||||
push @defltfiles, @chachafiles unless disabled("chacha");
|
||||
|
||||
plan tests =>
|
||||
($no_fips ? 0 : 1) # FIPS install test
|
||||
+ (scalar(@configs) * scalar(@files))
|
||||
+ scalar(@defltfiles);
|
||||
|
||||
unless ($no_fips) {
|
||||
my $infile = bldtop_file('providers', platform->dso('fips'));
|
||||
$ENV{OPENSSL_MODULES} = bldtop_dir("providers");
|
||||
$ENV{OPENSSL_CONF_INCLUDE} = bldtop_dir("providers");
|
||||
|
||||
ok(run(app(['openssl', 'fipsinstall',
|
||||
'-out', bldtop_file('providers', 'fipsinstall.conf'),
|
||||
'-module', $infile,
|
||||
'-provider_name', 'fips', '-mac_name', 'HMAC',
|
||||
'-macopt', 'digest:SHA256', '-macopt', 'hexkey:00',
|
||||
'-section_name', 'fips_sect'])),
|
||||
"fipinstall");
|
||||
}
|
||||
|
||||
foreach (@configs) {
|
||||
$ENV{OPENSSL_CONF} = srctop_file("test", $_);
|
||||
|
||||
@@ -1503,38 +1503,6 @@ Key = 5840df6e29b02af1ab493b705bf16ea1ae8338f4dcc176a8
|
||||
Plaintext = 466f7250617369
|
||||
Ciphertext = afbeb0f07dfbf5419200f2ccb50bb24f
|
||||
|
||||
Title = RC4 tests
|
||||
|
||||
Cipher = RC4
|
||||
Key = 0123456789abcdef0123456789abcdef
|
||||
Plaintext = 0123456789abcdef
|
||||
Ciphertext = 75b7878099e0c596
|
||||
|
||||
Cipher = RC4
|
||||
Key = 0123456789abcdef0123456789abcdef
|
||||
Plaintext = 0000000000000000
|
||||
Ciphertext = 7494c2e7104b0879
|
||||
|
||||
Cipher = RC4
|
||||
Key = 00000000000000000000000000000000
|
||||
Plaintext = 0000000000000000
|
||||
Ciphertext = de188941a3375d3a
|
||||
|
||||
Cipher = RC4
|
||||
Key = ef012345ef012345ef012345ef012345
|
||||
Plaintext = 0000000000000000000000000000000000000000
|
||||
Ciphertext = d6a141a7ec3c38dfbd615a1162e1c7ba36b67858
|
||||
|
||||
Cipher = RC4
|
||||
Key = 0123456789abcdef0123456789abcdef
|
||||
Plaintext = 123456789ABCDEF0123456789ABCDEF0123456789ABCDEF012345678
|
||||
Ciphertext = 66a0949f8af7d6891f7f832ba833c00c892ebe30143ce28740011ecf
|
||||
|
||||
Cipher = RC4
|
||||
Key = ef012345ef012345ef012345ef012345
|
||||
Plaintext = 00000000000000000000
|
||||
Ciphertext = d6a141a7ec3c38dfbd61
|
||||
|
||||
Title = Camellia tests from RFC3713
|
||||
|
||||
# For all ECB encrypts and decrypts, the transformed sequence is
|
||||
@@ -2494,190 +2462,3 @@ AAD = 8008315ebf2e6fe020e8f5eb
|
||||
Tag = 3615b7f90a651de15da20fb6
|
||||
Plaintext = f57af5fd4ae19562976ec57a5a7ad55a5af5c5e5c5fdf5c55ad57a4a7272d57262e9729566ed66e97ac54a4a5a7ad5e15ae5fdd5fd5ac5d56ae56ad5c572d54ae54ac55a956afd6aed5a4ac562957a9516991691d572fd14e97ae962ed7a9f4a955af572e162f57a956666e17ae1f54a95f566d54a66e16e4afd6a9f7ae1c5c55ae5d56afde916c5e94a6ec56695e14afde1148416e94ad57ac5146ed59d1cc5
|
||||
Ciphertext = ff78128ee18ee3cb9fb0d20726a017ff67fbd09d3a4c38aa32f6d306d3fdda378e459b83ed005507449d6cd981a4c1e3ff4193870c276ef09b6317a01a2283206ae4b4be0d0b235422c8abb00122410656b75e1ffc7fb49c0d0c5d6169aa7623610579968037aee8e83fc26264ea866590fd620aa3c0a5f323d953aa7f8defb0d0d60ab5a9de44dbaf8eae74ea3ab5f30594154f405fd630aa4c4d5603efdfa1
|
||||
|
||||
|
||||
Title = Chacha20 test vectors from RFC7539
|
||||
|
||||
# A.1 Test Vector 1
|
||||
Cipher = chacha20
|
||||
Key = 0000000000000000000000000000000000000000000000000000000000000000
|
||||
IV = 00000000000000000000000000000000
|
||||
Plaintext = 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
Ciphertext = 76b8e0ada0f13d90405d6ae55386bd28bdd219b8a08ded1aa836efcc8b770dc7da41597c5157488d7724e03fb8d84a376a43b8f41518a11cc387b669b2ee6586
|
||||
|
||||
# A.1 Test Vector 2
|
||||
Cipher = chacha20
|
||||
Key = 0000000000000000000000000000000000000000000000000000000000000000
|
||||
IV = 01000000000000000000000000000000
|
||||
Plaintext = 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
Ciphertext = 9f07e7be5551387a98ba977c732d080dcb0f29a048e3656912c6533e32ee7aed29b721769ce64e43d57133b074d839d531ed1f28510afb45ace10a1f4b794d6f
|
||||
|
||||
# A.2 Test Vector 1 is the same as A.1 Test Vector 1
|
||||
# A.2 Test Vector 2
|
||||
Cipher = chacha20
|
||||
Key = 0000000000000000000000000000000000000000000000000000000000000001
|
||||
#Counter (first 4 bytes) expressed in little-endian order
|
||||
IV = 01000000000000000000000000000002
|
||||
Plaintext = 416e79207375626d697373696f6e20746f20746865204945544620696e74656e6465642062792074686520436f6e7472696275746f7220666f72207075626c69636174696f6e20617320616c6c206f722070617274206f6620616e204945544620496e7465726e65742d4472616674206f722052464320616e6420616e792073746174656d656e74206d6164652077697468696e2074686520636f6e74657874206f6620616e204945544620616374697669747920697320636f6e7369646572656420616e20224945544620436f6e747269627574696f6e222e20537563682073746174656d656e747320696e636c756465206f72616c2073746174656d656e747320696e20494554462073657373696f6e732c2061732077656c6c206173207772697474656e20616e6420656c656374726f6e696320636f6d6d756e69636174696f6e73206d61646520617420616e792074696d65206f7220706c6163652c207768696368206172652061646472657373656420746f
|
||||
Ciphertext = a3fbf07df3fa2fde4f376ca23e82737041605d9f4f4f57bd8cff2c1d4b7955ec2a97948bd3722915c8f3d337f7d370050e9e96d647b7c39f56e031ca5eb6250d4042e02785ececfa4b4bb5e8ead0440e20b6e8db09d881a7c6132f420e52795042bdfa7773d8a9051447b3291ce1411c680465552aa6c405b7764d5e87bea85ad00f8449ed8f72d0d662ab052691ca66424bc86d2df80ea41f43abf937d3259dc4b2d0dfb48a6c9139ddd7f76966e928e635553ba76c5c879d7b35d49eb2e62b0871cdac638939e25e8a1e0ef9d5280fa8ca328b351c3c765989cbcf3daa8b6ccc3aaf9f3979c92b3720fc88dc95ed84a1be059c6499b9fda236e7e818b04b0bc39c1e876b193bfe5569753f88128cc08aaa9b63d1a16f80ef2554d7189c411f5869ca52c5b83fa36ff216b9c1d30062bebcfd2dc5bce0911934fda79a86f6e698ced759c3ff9b6477338f3da4f9cd8514ea9982ccafb341b2384dd902f3d1ab7ac61dd29c6f21ba5b862f3730e37cfdc4fd806c22f221
|
||||
|
||||
# A.2 Test Vector 3
|
||||
Cipher = chacha20
|
||||
Key = 1c9240a5eb55d38af333888604f6b5f0473917c1402b80099dca5cbc207075c0
|
||||
#Counter (first 4 bytes) expressed in little-endian order
|
||||
IV = 2a000000000000000000000000000002
|
||||
Plaintext = 2754776173206272696c6c69672c20616e642074686520736c6974687920746f7665730a446964206779726520616e642067696d626c6520696e2074686520776162653a0a416c6c206d696d737920776572652074686520626f726f676f7665732c0a416e6420746865206d6f6d65207261746873206f757467726162652e
|
||||
Ciphertext = 62e6347f95ed87a45ffae7426f27a1df5fb69110044c0d73118effa95b01e5cf166d3df2d721caf9b21e5fb14c616871fd84c54f9d65b283196c7fe4f60553ebf39c6402c42234e32a356b3e764312a61a5532055716ead6962568f87d3f3f7704c6a8d1bcd1bf4d50d6154b6da731b187b58dfd728afa36757a797ac188d1
|
||||
|
||||
Title = Chacha20
|
||||
|
||||
Cipher = chacha20
|
||||
Key = 0000000000000000000000000000000000000000000000000000000000000001
|
||||
IV = 00000000000000000000000000000000
|
||||
Plaintext = 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
Ciphertext = 4540f05a9f1fb296d7736e7b208e3c96eb4fe1834688d2604f450952ed432d41bbe2a0b6ea7566d2a5d1e7e20d42af2c53d792b1c43fea817e9ad275ae546963
|
||||
|
||||
Cipher = chacha20
|
||||
Key = 0000000000000000000000000000000000000000000000000000000000000000
|
||||
IV = 00000000000000000000000000000001
|
||||
Plaintext = 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
Ciphertext = de9cba7bf3d69ef5e786dc63973f653a0b49e015adbff7134fcb7df137821031e85a050278a7084527214f73efc7fa5b5277062eb7a0433e445f41e31afab757
|
||||
|
||||
Cipher = chacha20
|
||||
Key = 0000000000000000000000000000000000000000000000000000000000000000
|
||||
IV = 00000000000000000100000000000000
|
||||
Plaintext = 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
Ciphertext = ef3fdfd6c61578fbf5cf35bd3dd33b8009631634d21e42ac33960bd138e50d32111e4caf237ee53ca8ad6426194a88545ddc497a0b466e7d6bbdb0041b2f586b
|
||||
|
||||
Cipher = chacha20
|
||||
Key = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
|
||||
IV = 00000000000000000001020304050607
|
||||
Plaintext = 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
Ciphertext = f798a189f195e66982105ffb640bb7757f579da31602fc93ec01ac56f85ac3c134a4547b733b46413042c9440049176905d3be59ea1c53f15916155c2be8241a38008b9a26bc35941e2444177c8ade6689de95264986d95889fb60e84629c9bd9a5acb1cc118be563eb9b3a4a472f82e09a7e778492b562ef7130e88dfe031c79db9d4f7c7a899151b9a475032b63fc385245fe054e3dd5a97a5f576fe064025d3ce042c566ab2c507b138db853e3d6959660996546cc9c4a6eafdc777c040d70eaf46f76dad3979e5c5360c3317166a1c894c94a371876a94df7628fe4eaaf2ccb27d5aaae0ad7ad0f9d4b6ad3b54098746d4524d38407a6deb
|
||||
|
||||
Cipher = chacha20
|
||||
Key = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
|
||||
IV = 00000000000000000001020304050607
|
||||
Plaintext = 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
Ciphertext = f798a189f195e66982105ffb640bb7757f579da31602fc93ec01ac56f85ac3c134a4547b733b46413042c9440049176905d3be59ea1c53f15916155c2be8241a38008b9a26bc35941e2444177c8ade6689de95264986d95889fb60e84629c9bd9a5acb1cc118be563eb9b3a4a472f82e09a7e778492b562ef7130e88dfe031c79db9d4f7c7a899151b9a475032b63fc385245fe054e3dd5a97a5f576fe064025d3ce042c566ab2c507b138db853e3d6959660996546cc9c4a6eafdc777c040d70eaf46f76dad3979e5c5360c3317166a1c894c94a371876a94df7628fe4eaaf2ccb27d5aaae0ad7ad0f9d4b6ad3b54098746d4524d38407a6deb3ab78fab78c9
|
||||
|
||||
Cipher = chacha20
|
||||
Key = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
|
||||
IV = 00000000000000000001020304050607
|
||||
Plaintext = 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
Ciphertext = f798a189f195e66982105ffb640bb7757f579da31602fc93ec01ac56f85ac3c134a4547b733b46413042c9440049176905d3be59ea1c53f15916155c2be8241a38008b9a26bc35941e2444177c8ade6689de95264986d95889fb60e84629c9bd9a5acb1cc118be563eb9b3a4a472f82e09a7e778492b562ef7130e88dfe031c79db9d4f7c7a899151b9a475032b63fc385245fe054e3dd5a97a5f576fe064025d3ce042c566ab2c507b138db853e3d6959660996546cc9c4a6eafdc777c040d70eaf46f76dad3979e5c5360c3317166a1c894c94a371876a94df7628fe4eaaf2ccb27d5aaae0ad7ad0f9d4b6ad3b54098746d4524d38407a6deb3ab78fab78c94213668bbbd394c5de93b853178addd6b97f9fa1ec3e56c00c9ddff0a44a204241175a4cab0f961ba53ede9bdf960b94f9829b1f3414726429b362c5b538e391520f489b7ed8d20ae3fd49e9e259e44397514d618c96c4846be3c680bdc11c71dcbbe29ccf80d62a0938fa549391e6ea57ecbe2606790ec15d2224ae307c144226b7c4e8c2f97d2a1d67852d29beba110edd445197012062a393a9c92803ad3b4f31d7bc6033ccf7932cfed3f019044d25905916777286f82f9a4cc1ffe430ffd1dcfc27deed327b9f9630d2fa969fb6f0603cd19dd9a9519e673bcfcd9014125291a44669ef7285e74ed3729b677f801c3cdf058c50963168b496043716c730
|
||||
|
||||
Cipher = chacha20
|
||||
Key = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
|
||||
IV = 00000000000000000001020304050607
|
||||
Plaintext = 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
Ciphertext = f798a189f195e66982105ffb640bb7757f579da31602fc93ec01ac56f85ac3c134a4547b733b46413042c9440049176905d3be59ea1c53f15916155c2be8241a38008b9a26bc35941e2444177c8ade6689de95264986d95889fb60e84629c9bd9a5acb1cc118be563eb9b3a4a472f82e09a7e778492b562ef7130e88dfe031c79db9d4f7c7a899151b9a475032b63fc385245fe054e3dd5a97a5f576fe064025d3ce042c566ab2c507b138db853e3d6959660996546cc9c4a6eafdc777c040d70eaf46f76dad3979e5c5360c3317166a1c894c94a371876a94df7628fe4eaaf2ccb27d5aaae0ad7ad0f9d4b6ad3b54098746d4524d38407a6deb3ab78fab78c94213668bbbd394c5de93b853178addd6b97f9fa1ec3e56c00c9ddff0a44a204241175a4cab0f961ba53ede9bdf960b94f9829b1f3414726429b362c5b538e391520f489b7ed8d20ae3fd49e9e259e44397514d618c96c4846be3c680bdc11c71dcbbe29ccf80d62a0938fa549391e6ea57ecbe2606790ec15d2224ae307c144226b7c4e8c2f97d2a1d67852d29beba110edd445197012062a393a9c92803ad3b4f31d7bc6033ccf7932cfed3f019044d25905916777286f82f9a4cc1ffe430ffd1dcfc27deed327b9f9630d2fa969fb6f0603cd19dd9a9519e673bcfcd9014125291a44669ef7285e74ed3729b677f801c3cdf058c50963168b496043716c7307cd9e0cdd137fccb0f05b47cdbb95c5f54831622c3652a32b2531fe326bcd6e2bbf56a194fa196fbd1a54952110f51c73433865f7664b836685e3664b3d8444aF89A242805E18C975F1146324996FDE17007CF3E6E8F4E764022533EDBFE07D4733E48BB372D75B0EF48EC983EB78532161CC529E5ABB89837DFCCA6261DBB37
|
||||
|
||||
Cipher = chacha20
|
||||
Key = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
|
||||
IV = 00000000000000000001020304050607
|
||||
Plaintext = 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
Ciphertext = f798a189f195e66982105ffb640bb7757f579da31602fc93ec01ac56f85ac3c134a4547b733b46413042c9440049176905d3be59ea1c53f15916155c2be8241a38008b9a26bc35941e2444177c8ade6689de95264986d95889fb60e84629c9bd9a5acb1cc118be563eb9b3a4a472f82e09a7e778492b562ef7130e88dfe031c79db9d4f7c7a899151b9a475032b63fc385245fe054e3dd5a97a5f576fe064025d3ce042c566ab2c507b138db853e3d6959660996546cc9c4a6eafdc777c040d70eaf46f76dad3979e5c5360c3317166a1c894c94a371876a94df7628fe4eaaf2ccb27d5aaae0ad7ad0f9d4b6ad3b54098746d4524d38407a6deb3ab78fab78c94213668bbbd394c5de93b853178addd6b97f9fa1ec3e56c00c9ddff0a44a204241175a4cab0f961ba53ede9bdf960b94f9829b1f3414726429b362c5b538e391520f489b7ed8d20ae3fd49e9e259e44397514d618c96c4846be3c680bdc11c71dcbbe29ccf80d62a0938fa549391e6ea57ecbe2606790ec15d2224ae307c144226b7c4e8c2f97d2a1d67852d29beba110edd445197012062a393a9c92803ad3b4f31d7bc6033ccf7932cfed3f019044d25905916777286f82f9a4cc1ffe430ffd1dcfc27deed327b9f9630d2fa969fb6f0603cd19dd9a9519e673bcfcd9014125291a44669ef7285e74ed3729b677f801c3cdf058c50963168b496043716c7307cd9e0cdd137fccb0f05b47cdbb95c5f54831622c3652a32b2531fe326bcd6e2bbf56a194fa196fbd1a54952110f51c73433865f7664b836685e3664b3d8444a
|
||||
|
||||
Cipher = chacha20
|
||||
Key = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
|
||||
IV = 00000000000000000001020304050607
|
||||
Plaintext = 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
Ciphertext = f798a189f195e66982105ffb640bb7757f579da31602fc93ec01ac56f85ac3c134a4547b733b46413042c9440049176905d3be59ea1c53f15916155c2be8241a38008b9a26bc35941e2444177c8ade6689de95264986d95889fb60e84629c9bd9a5acb1cc118be563eb9b3a4a472f82e09a7e778492b562ef7130e88dfe031c79db9d4f7c7a899151b9a475032b63fc385245fe054e3dd5a97a5f576fe064025d3ce042c566ab2c507b138db853e3d6959660996546cc9c4a6eafdc777c040d70eaf46f76dad3979e5c5360c3317166a1c894c94a371876a94df7628fe4eaaf2ccb27d5aaae0ad7ad0f9d4b6ad3b54098746d4524d38407a6deb3ab78fab78c94213668bbbd394c5de93b853178addd6b97f9fa1ec3e56c00c9ddff0a44a204241175a4cab0f961ba53ede9bdf960b94f9829b1f3414726429b362c5b538e391520f489b7ed8d20ae3fd49e9e259e44397514d618c96c4846be3c680bdc11c71dcbbe29ccf80d62a0938fa549391e6ea57ecbe2606790ec15d2224ae307c144226b7c4e8c2f97d2a1d67852d29beba110edd445197012062a393a9c92803ad3b4f31d7bc6033ccf7932cfed3f019044d25905916777286f82f9a4cc1ffe430ffd1dcfc27deed327b9f9630d2fa969fb6f0603cd19dd9a9519e673bcfcd9014125291a44669ef7285e74ed3729b677f801c3cdf058c50963168b496043716c7307cd9e0cdd137fccb0f05b47cdbb95c5f54831622c3652a32b2531fe326bcd6e2bbf56a194fa196fbd1a54952110f51c73433865f7664b836685e3664b3d8444aF89A242805E18C975F1146324996FDE17007CF3E6E8F4E764022533EDBFE07D4733E48BB372D75B0EF48EC983EB78532161CC529E5ABB89837DFCCA6261DBB37C7C5E6A87478BF41EE85A518C0F4EFA9BDE828C5A71B8E46597B634AFD204D3C501334239C3414285ED72D3A9169EABBD4DC25D52BB7516D3BA712D75AD8C0AE
|
||||
|
||||
Cipher = chacha20
|
||||
Key = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
|
||||
IV = 00000000000000000001020304050607
|
||||
Plaintext = 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
Ciphertext = f798a189f195e66982105ffb640bb7757f579da31602fc93ec01ac56f85ac3c134a4547b733b46413042c9440049176905d3be59ea1c53f15916155c2be8241a38008b9a26bc35941e2444177c8ade6689de95264986d95889fb60e84629c9bd9a5acb1cc118be563eb9b3a4a472f82e09a7e778492b562ef7130e88dfe031c79db9d4f7c7a899151b9a475032b63fc385245fe054e3dd5a97a5f576fe064025d3ce042c566ab2c507b138db853e3d6959660996546cc9c4a6eafdc777c040d70eaf46f76dad3979e5c5360c3317166a1c894c94a371876a94df7628fe4eaaf2ccb27d5aaae0ad7ad0f9d4b6ad3b54098746d4524d38407a6deb3ab78fab78c94213668bbbd394c5de93b853178addd6b97f9fa1ec3e56c00c9ddff0a44a204241175a4cab0f961ba53ede9bdf960b94f9829b1f3414726429b362c5b538e391520f489b7ed8d20ae3fd49e9e259e44397514d618c96c4846be3c680bdc11c71dcbbe29ccf80d62a0938fa549391e6ea57ecbe2606790ec15d2224ae307c144226b7c4e8c2f97d2a1d67852d29beba110edd445197012062a393a9c92803ad3b4f31d7bc6033ccf7932cfed3f019044d25905916777286f82f9a4cc1ffe430ffd1dcfc27deed327b9f9630d2fa969fb6f0603cd19dd9a9519e673bcfcd9014125291a44669ef7285e74ed3729b677f801c3cdf058c50963168b496043716c7307cd9e0cdd137fccb0f05b47cdbb95c5f54831622c3652a32b2531fe326bcd6e2bbf56a194fa196fbd1a54952110f51c73433865f7664b836685e3664b3d8444aF89A242805E18C975F1146324996FDE17007CF3E6E8F4E764022533EDBFE07D4733E48BB372D75B0EF48EC983EB78532161CC529E5ABB89837DFCCA6261DBB37C7C5E6A87478BF41EE85A518C0F4EFA9BDE828C5A71B8E46597B634AFD204D3C501334239C3414285ED72D3A9169EABBD4DC25D52BB7516D3BA712D75AD8C0AE5D493C19E38A77939E7A058D713E9CCCCA58045F436B434B1C80D365472406E392951987DB6905C80D431DA18451135BE7E82BCAB358CB3971E61405B2FF1798
|
||||
|
||||
Cipher = chacha20
|
||||
Key = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
|
||||
IV = 00000000000000000001020304050607
|
||||
Plaintext = 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
Ciphertext = f798a189f195e66982105ffb640bb7757f579da31602fc93ec01ac56f85ac3c134a4547b733b46413042c9440049176905d3be59ea1c53f15916155c2be8241a38008b9a26bc35941e2444177c8ade6689de95264986d95889fb60e84629c9bd9a5acb1cc118be563eb9b3a4a472f82e09a7e778492b562ef7130e88dfe031c79db9d4f7c7a899151b9a475032b63fc385245fe054e3dd5a97a5f576fe064025d3ce042c566ab2c507b138db853e3d6959660996546cc9c4a6eafdc777c040d70eaf46f76dad3979e5c5360c3317166a1c894c94a371876a94df7628fe4eaaf2ccb27d5aaae0ad7ad0f9d4b6ad3b54098746d4524d38407a6deb3ab78fab78c94213668bbbd394c5de93b853178addd6b97f9fa1ec3e56c00c9ddff0a44a204241175a4cab0f961ba53ede9bdf960b94f9829b1f3414726429b362c5b538e391520f489b7ed8d20ae3fd49e9e259e44397514d618c96c4846be3c680bdc11c71dcbbe29ccf80d62a0938fa549391e6ea57ecbe2606790ec15d2224ae307c144226b7c4e8c2f97d2a1d67852d29beba110edd445197012062a393a9c92803ad3b4f31d7bc6033ccf7932cfed3f019044d25905916777286f82f9a4cc1ffe430ffd1dcfc27deed327b9f9630d2fa969fb6f0603cd19dd9a9519e673bcfcd9014125291a44669ef7285e74ed3729b677f801c3cdf058c50963168b496043716c7307cd9e0cdd137fccb0f05b47cdbb95c5f54831622c3652a32b2531fe326bcd6e2bbf56a194fa196fbd1a54952110f51c73433865f7664b836685e3664b3d8444aF89A242805E18C975F1146324996FDE17007CF3E6E8F4E764022533EDBFE07D4733E48BB372D75B0EF48EC983EB78532161CC529E5ABB89837DFCCA6261DBB37C7C5E6A87478BF41EE85A518C0F4EFA9BDE828C5A71B8E46597B634AFD204D3C501334239C3414285ED72D3A9169EABBD4DC25D52BB7516D3BA712D75AD8C0AE5D493C19E38A77939E7A058D713E9CCCCA58045F436B434B1C80D365472406E392951987DB6905C80D431DA18451135BE7E82BCAB358CB3971E61405B2FF17980D6E7E67E861E28201C1EE30B441040FD06878D65042C95582A4318207BFC700BE0CE32889AEC2FFE5085E8967910D879FA0E8C0FF85FDC510B9FF2FBF87CFCB
|
||||
|
||||
Cipher = chacha20
|
||||
Key = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
|
||||
IV = 00000000000000000001020304050607
|
||||
Plaintext = 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
Ciphertext = f798a189f195e66982105ffb640bb7757f579da31602fc93ec01ac56f85ac3c134a4547b733b46413042c9440049176905d3be59ea1c53f15916155c2be8241a38008b9a26bc35941e2444177c8ade6689de95264986d95889fb60e84629c9bd9a5acb1cc118be563eb9b3a4a472f82e09a7e778492b562ef7130e88dfe031c79db9d4f7c7a899151b9a475032b63fc385245fe054e3dd5a97a5f576fe064025d3ce042c566ab2c507b138db853e3d6959660996546cc9c4a6eafdc777c040d70eaf46f76dad3979e5c5360c3317166a1c894c94a371876a94df7628fe4eaaf2ccb27d5aaae0ad7ad0f9d4b6ad3b54098746d4524d38407a6deb3ab78fab78c94213668bbbd394c5de93b853178addd6b97f9fa1ec3e56c00c9ddff0a44a204241175a4cab0f961ba53ede9bdf960b94f9829b1f3414726429b362c5b538e391520f489b7ed8d20ae3fd49e9e259e44397514d618c96c4846be3c680bdc11c71dcbbe29ccf80d62a0938fa549391e6ea57ecbe2606790ec15d2224ae307c144226b7c4e8c2f97d2a1d67852d29beba110edd445197012062a393a9c92803ad3b4f31d7bc6033ccf7932cfed3f019044d25905916777286f82f9a4cc1ffe430ffd1dcfc27deed327b9f9630d2fa969fb6f0603cd19dd9a9519e673bcfcd9014125291a44669ef7285e74ed3729b677f801c3cdf058c50963168b496043716c7307cd9e0cdd137fccb0f05b47cdbb95c5f54831622c3652a32b2531fe326bcd6e2bbf56a194fa196fbd1a54952110f51c73433865f7664b836685e3664b3d8444aF89A242805E18C975F1146324996FDE17007CF3E6E8F4E764022533EDBFE07D4733E48BB372D75B0EF48EC983EB78532161CC529E5ABB89837DFCCA6261DBB37C7C5E6A87478BF41EE85A518C0F4EFA9BDE828C5A71B8E46597B634AFD204D3C501334239C3414285ED72D3A9169EABBD4DC25D52BB7516D3BA712D75AD8C0AE5D493C19E38A77939E7A058D713E9CCCCA58045F436B434B1C80D365472406E392951987DB6905C80D431DA18451135BE7E82BCAB358CB3971E61405B2FF17980D6E7E67E861E28201C1EE30B441040FD06878D65042C95582A4318207BFC700BE0CE32889AEC2FFE5085E8967910D879FA0E8C0FF85FDC510B9FF2FBF87CFCB29577D68099E04FFA05F752A73D377C70D3A8BC2DA80E6E780EC057182C33AD1DE387252258A1E18E6FAD910327CE7F42FD1E1E0515F9586E2F2EFCB9F472B1D
|
||||
|
||||
Cipher = chacha20
|
||||
Key = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
|
||||
IV = 00000000000000000001020304050607
|
||||
Plaintext = 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
Ciphertext = f798a189f195e66982105ffb640bb7757f579da31602fc93ec01ac56f85ac3c134a4547b733b46413042c9440049176905d3be59ea1c53f15916155c2be8241a38008b9a26bc35941e2444177c8ade6689de95264986d95889fb60e84629c9bd9a5acb1cc118be563eb9b3a4a472f82e09a7e778492b562ef7130e88dfe031c79db9d4f7c7a899151b9a475032b63fc385245fe054e3dd5a97a5f576fe064025d3ce042c566ab2c507b138db853e3d6959660996546cc9c4a6eafdc777c040d70eaf46f76dad3979e5c5360c3317166a1c894c94a371876a94df7628fe4eaaf2ccb27d5aaae0ad7ad0f9d4b6ad3b54098746d4524d38407a6deb3ab78fab78c94213668bbbd394c5de93b853178addd6b97f9fa1ec3e56c00c9ddff0a44a204241175a4cab0f961ba53ede9bdf960b94f9829b1f3414726429b362c5b538e391520f489b7ed8d20ae3fd49e9e259e44397514d618c96c4846be3c680bdc11c71dcbbe29ccf80d62a0938fa549391e6ea57ecbe2606790ec15d2224ae307c144226b7c4e8c2f97d2a1d67852d29beba110edd445197012062a393a9c92803ad3b4f31d7bc6033ccf7932cfed3f019044d25905916777286f82f9a4cc1ffe430ffd1dcfc27deed327b9f9630d2fa969fb6f0603cd19dd9a9519e673bcfcd9014125291a44669ef7285e74ed3729b677f801c3cdf058c50963168b496043716c7307cd9e0cdd137fccb0f05b47cdbb95c5f54831622c3652a32b2531fe326bcd6e2bbf56a194fa196fbd1a54952110f51c73433865f7664b836685e3664b3d8444aF89A242805E18C975F1146324996FDE17007CF3E6E8F4E764022533EDBFE07D4733E48BB372D75B0EF48EC983EB78532161CC529E5ABB89837DFCCA6261DBB37C7C5E6A87478BF41EE85A518C0F4EFA9BDE828C5A71B8E46597B634AFD204D3C501334239C3414285ED72D3A9169EABBD4DC25D52BB7516D3BA712D75AD8C0AE5D493C19E38A77939E7A058D713E9CCCCA58045F436B434B1C80D365472406E392951987DB6905C80D431DA18451135BE7E82BCAB358CB3971E61405B2FF17980D6E7E67E861E28201C1EE30B441040FD06878D65042C95582A4318207BFC700BE0CE32889AEC2FFE5085E8967910D879FA0E8C0FF85FDC510B9FF2FBF87CFCB29577D68099E04FFA05F752A73D377C70D3A8BC2DA80E6E780EC057182C33AD1DE387252258A1E18E6FAD910327CE7F42FD1E1E0515F9586E2F2EFCB9F472B1DBDBAC354A4162151E9D92C79FB08BB4DDC56F19448C0175A46E2E6C491FEC71419AA43A349BEA768A92C75DE68FD9591E68067F3197094D3FB87ED81785EA075
|
||||
|
||||
Cipher = chacha20
|
||||
Key = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
|
||||
IV = 00000000000000000001020304050607
|
||||
Plaintext = 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
Ciphertext = f798a189f195e66982105ffb640bb7757f579da31602fc93ec01ac56f85ac3c134a4547b733b46413042c9440049176905d3be59ea1c53f15916155c2be8241a38008b9a26bc35941e2444177c8ade6689de95264986d95889fb60e84629c9bd9a5acb1cc118be563eb9b3a4a472f82e09a7e778492b562ef7130e88dfe031c79db9d4f7c7a899151b9a475032b63fc385245fe054e3dd5a97a5f576fe064025d3ce042c566ab2c507b138db853e3d6959660996546cc9c4a6eafdc777c040d70eaf46f76dad3979e5c5360c3317166a1c894c94a371876a94df7628fe4eaaf2ccb27d5aaae0ad7ad0f9d4b6ad3b54098746d4524d38407a6deb3ab78fab78c94213668bbbd394c5de93b853178addd6b97f9fa1ec3e56c00c9ddff0a44a204241175a4cab0f961ba53ede9bdf960b94f9829b1f3414726429b362c5b538e391520f489b7ed8d20ae3fd49e9e259e44397514d618c96c4846be3c680bdc11c71dcbbe29ccf80d62a0938fa549391e6ea57ecbe2606790ec15d2224ae307c144226b7c4e8c2f97d2a1d67852d29beba110edd445197012062a393a9c92803ad3b4f31d7bc6033ccf7932cfed3f019044d25905916777286f82f9a4cc1ffe430ffd1dcfc27deed327b9f9630d2fa969fb6f0603cd19dd9a9519e673bcfcd9014125291a44669ef7285e74ed3729b677f801c3cdf058c50963168b496043716c7307cd9e0cdd137fccb0f05b47cdbb95c5f54831622c3652a32b2531fe326bcd6e2bbf56a194fa196fbd1a54952110f51c73433865f7664b836685e3664b3d8444aF89A242805E18C975F1146324996FDE17007CF3E6E8F4E764022533EDBFE07D4733E48BB372D75B0EF48EC983EB78532161CC529E5ABB89837DFCCA6261DBB37C7C5E6A87478BF41EE85A518C0F4EFA9BDE828C5A71B8E46597B634AFD204D3C501334239C3414285ED72D3A9169EABBD4DC25D52BB7516D3BA712D75AD8C0AE5D493C19E38A77939E7A058D713E9CCCCA58045F436B434B1C80D365472406E392951987DB6905C80D431DA18451135BE7E82BCAB358CB3971E61405B2FF17980D6E7E67E861E28201C1EE30B441040FD06878D65042C95582A4318207BFC700BE0CE32889AEC2FFE5085E8967910D879FA0E8C0FF85FDC510B9FF2FBF87CFCB29577D68099E04FFA05F752A73D377C70D3A8BC2DA80E6E780EC057182C33AD1DE387252258A1E18E6FAD910327CE7F42FD1E1E0515F9586E2F2EFCB9F472B1DBDBAC354A4162151E9D92C79FB08BB4DDC56F19448C0175A46E2E6C491FEC71419AA43A349BEA768A92C75DE68FD9591E68067F3197094D3FB87ED81785EA075E4B65E3E4C78F81DA9B751C5EFE024152301C48E63245B556C4C67AFF857E5EA15A908D83A1D9704F8E55E7352B20B694BF9970298E6B5AAD33EA2155D105D4E
|
||||
|
||||
Cipher = chacha20
|
||||
Key = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
|
||||
IV = 00000000000000000001020304050607
|
||||
Plaintext = 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
Ciphertext = f798a189f195e66982105ffb640bb7757f579da31602fc93ec01ac56f85ac3c134a4547b733b46413042c9440049176905d3be59ea1c53f15916155c2be8241a38008b9a26bc35941e2444177c8ade6689de95264986d95889fb60e84629c9bd9a5acb1cc118be563eb9b3a4a472f82e09a7e778492b562ef7130e88dfe031c79db9d4f7c7a899151b9a475032b63fc385245fe054e3dd5a97a5f576fe064025d3ce042c566ab2c507b138db853e3d6959660996546cc9c4a6eafdc777c040d70eaf46f76dad3979e5c5360c3317166a1c894c94a371876a94df7628fe4eaaf2ccb27d5aaae0ad7ad0f9d4b6ad3b54098746d4524d38407a6deb3ab78fab78c94213668bbbd394c5de93b853178addd6b97f9fa1ec3e56c00c9ddff0a44a204241175a4cab0f961ba53ede9bdf960b94f9829b1f3414726429b362c5b538e391520f489b7ed8d20ae3fd49e9e259e44397514d618c96c4846be3c680bdc11c71dcbbe29ccf80d62a0938fa549391e6ea57ecbe2606790ec15d2224ae307c144226b7c4e8c2f97d2a1d67852d29beba110edd445197012062a393a9c92803ad3b4f31d7bc6033ccf7932cfed3f019044d25905916777286f82f9a4cc1ffe430ffd1dcfc27deed327b9f9630d2fa969fb6f0603cd19dd9a9519e673bcfcd9014125291a44669ef7285e74ed3729b677f801c3cdf058c50963168b496043716c7307cd9e0cdd137fccb0f05b47cdbb95c5f54831622c3652a32b2531fe326bcd6e2bbf56a194fa196fbd1a54952110f51c73433865f7664b836685e3664b3d8444aF89A242805E18C975F1146324996FDE17007CF3E6E8F4E764022533EDBFE07D4733E48BB372D75B0EF48EC983EB78532161CC529E5ABB89837DFCCA6261DBB37C7C5E6A87478BF41EE85A518C0F4EFA9BDE828C5A71B8E46597B634AFD204D3C501334239C3414285ED72D3A9169EABBD4DC25D52BB7516D3BA712D75AD8C0AE5D493C19E38A77939E7A058D713E9CCCCA58045F436B434B1C80D365472406E392951987DB6905C80D431DA18451135BE7E82BCAB358CB3971E61405B2FF17980D6E7E67E861E28201C1EE30B441040FD06878D65042C95582A4318207BFC700BE0CE32889AEC2FFE5085E8967910D879FA0E8C0FF85FDC510B9FF2FBF87CFCB29577D68099E04FFA05F752A73D377C70D3A8BC2DA80E6E780EC057182C33AD1DE387252258A1E18E6FAD910327CE7F42FD1E1E0515F9586E2F2EFCB9F472B1DBDBAC354A4162151E9D92C79FB08BB4DDC56F19448C0175A46E2E6C491FEC71419AA43A349BEA768A92C75DE68FD9591E68067F3197094D3FB87ED81785EA075E4B65E3E4C78F81DA9B751C5EFE024152301C48E63245B556C4C67AFF857E5EA15A908D83A1D9704F8E55E7352B20B694BF9970298E6B5AAD33EA2155D105D4E637D1E87C40A8E5F4E8C5A16A4B8F3DC27B31721D77A65FD1ED6F86BE25FB95DB29B1988493770A7C60E451FF97DD241A236851FC425691979FE30226559AD95
|
||||
|
||||
# RFC7539
|
||||
Cipher = chacha20-poly1305
|
||||
Key = 808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f
|
||||
IV = 070000004041424344454647
|
||||
AAD = 50515253c0c1c2c3c4c5c6c7
|
||||
Tag = 1ae10b594f09e26a7e902ecbd0600691
|
||||
Plaintext = 4c616469657320616e642047656e746c656d656e206f662074686520636c617373206f66202739393a204966204920636f756c64206f6666657220796f75206f6e6c79206f6e652074697020666f7220746865206675747572652c2073756e73637265656e20776f756c642062652069742e
|
||||
Ciphertext = d31a8d34648e60db7b86afbc53ef7ec2a4aded51296e08fea9e2b5a736ee62d63dbea45e8ca9671282fafb69da92728b1a71de0a9e060b2905d6a5b67ecd3b3692ddbd7f2d778b8c9803aee328091b58fab324e4fad675945585808b4831d7bc3ff4def08e4b7a9de576d26586cec64b6116
|
||||
|
||||
Cipher = chacha20-poly1305
|
||||
Key = 1c9240a5eb55d38af333888604f6b5f0473917c1402b80099dca5cbc207075c0
|
||||
IV = 000000000102030405060708
|
||||
AAD = f33388860000000000004e91
|
||||
Tag = eead9d67890cbb22392336fea1851f38
|
||||
Plaintext = 496e7465726e65742d4472616674732061726520647261667420646f63756d656e74732076616c696420666f722061206d6178696d756d206f6620736978206d6f6e74687320616e64206d617920626520757064617465642c207265706c616365642c206f72206f62736f6c65746564206279206f7468657220646f63756d656e747320617420616e792074696d652e20497420697320696e617070726f70726961746520746f2075736520496e7465726e65742d447261667473206173207265666572656e6365206d6174657269616c206f7220746f2063697465207468656d206f74686572207468616e206173202fe2809c776f726b20696e2070726f67726573732e2fe2809d
|
||||
Ciphertext = 64a0861575861af460f062c79be643bd5e805cfd345cf389f108670ac76c8cb24c6cfc18755d43eea09ee94e382d26b0bdb7b73c321b0100d4f03b7f355894cf332f830e710b97ce98c8a84abd0b948114ad176e008d33bd60f982b1ff37c8559797a06ef4f0ef61c186324e2b3506383606907b6a7c02b0f9f6157b53c867e4b9166c767b804d46a59b5216cde7a4e99040c5a40433225ee282a1b0a06c523eaf4534d7f83fa1155b0047718cbc546a0d072b04b3564eea1b422273f548271a0bb2316053fa76991955ebd63159434ecebb4e466dae5a1073a6727627097a1049e617d91d361094fa68f0ff77987130305beaba2eda04df997b714d6c6f2c29a6ad5cb4022b02709b
|
||||
|
||||
Cipher = chacha20-poly1305
|
||||
Key = 1c9240a5eb55d38af333888604f6b5f0473917c1402b80099dca5cbc207075c0
|
||||
IV = 000000000102030405060708
|
||||
AAD = f33388860000000000004e91
|
||||
Tag = eead9d67890cbb22392336fea1851f39
|
||||
Plaintext = 496e7465726e65742d4472616674732061726520647261667420646f63756d656e74732076616c696420666f722061206d6178696d756d206f6620736978206d6f6e74687320616e64206d617920626520757064617465642c207265706c616365642c206f72206f62736f6c65746564206279206f7468657220646f63756d656e747320617420616e792074696d652e20497420697320696e617070726f70726961746520746f2075736520496e7465726e65742d447261667473206173207265666572656e6365206d6174657269616c206f7220746f2063697465207468656d206f74686572207468616e206173202fe2809c776f726b20696e2070726f67726573732e2fe2809d
|
||||
Ciphertext = 64a0861575861af460f062c79be643bd5e805cfd345cf389f108670ac76c8cb24c6cfc18755d43eea09ee94e382d26b0bdb7b73c321b0100d4f03b7f355894cf332f830e710b97ce98c8a84abd0b948114ad176e008d33bd60f982b1ff37c8559797a06ef4f0ef61c186324e2b3506383606907b6a7c02b0f9f6157b53c867e4b9166c767b804d46a59b5216cde7a4e99040c5a40433225ee282a1b0a06c523eaf4534d7f83fa1155b0047718cbc546a0d072b04b3564eea1b422273f548271a0bb2316053fa76991955ebd63159434ecebb4e466dae5a1073a6727627097a1049e617d91d361094fa68f0ff77987130305beaba2eda04df997b714d6c6f2c29a6ad5cb4022b02709b
|
||||
Operation = DECRYPT
|
||||
Result = CIPHERFINAL_ERROR
|
||||
|
||||
# self-generated vectors
|
||||
Cipher = chacha20-poly1305
|
||||
Key = 1c9240a5eb55d38af333888604f6b5f0473917c1402b80099dca5cbc207075c0
|
||||
IV = 000000000102030405060708
|
||||
AAD = f33388860000000000004e91
|
||||
Tag = d96119a40cd17f2527306866a3ef0413
|
||||
Plaintext = 496e7465726e65742d4472616674732061726520647261667420646f63756d656e74732076616c696420666f722061206d6178696d756d206f6620736978206d6f6e74687320616e64206d617920626520757064617465642c207265706c616365642c206f72206f62736f6c65746564206279206f7468657220646f63756d656e747320617420616e792074696d652e20497420697320696e617070726f70726961746520746f2075736520496e7465726e65742d4472616674732061732072
|
||||
Ciphertext = 64a0861575861af460f062c79be643bd5e805cfd345cf389f108670ac76c8cb24c6cfc18755d43eea09ee94e382d26b0bdb7b73c321b0100d4f03b7f355894cf332f830e710b97ce98c8a84abd0b948114ad176e008d33bd60f982b1ff37c8559797a06ef4f0ef61c186324e2b3506383606907b6a7c02b0f9f6157b53c867e4b9166c767b804d46a59b5216cde7a4e99040c5a40433225ee282a1b0a06c523eaf4534d7f83fa1155b0047718cbc546a0d072b04b3564eea1b422273f548271a
|
||||
|
||||
Cipher = chacha20-poly1305
|
||||
Key = 1c9240a5eb55d38af333888604f6b5f0473917c1402b80099dca5cbc207075c0
|
||||
IV = 000000000102030405060708
|
||||
AAD = f33388860000000000004e91
|
||||
Tag = 53aee3189d2b747032378a6186feb43f
|
||||
Plaintext = 496e7465726e65742d4472616674732061726520647261667420646f63756d656e74732076616c696420666f722061206d6178696d756d206f6620736978206d6f6e74687320616e64206d617920626520757064617465642c207265706c616365642c206f72206f62736f6c65746564206279206f7468657220646f63756d656e747320617420616e792074696d652e20497420697320696e617070726f70726961746520746f2075736520496e7465726e65742d447261667473206173207265666572656e6365206d6174657269616c206f7220746f2063697465207468656d206f74686572207468616e206173202fe2809c776f726b20696e2070726f67496e7465726e65742d4472616674732061726520647261667420646f63756d656e74732076616c696420666f722061206d6178696d756d206f6620736978206d6f6e74687320616e64206d617920626520757064617465642c207265706c616365642c206f72206f62736f6c65746564206279206f7468657220646f63756d656e747320617420616e792074696d652e20497420697320696e617070726f70726961746520746f2075736520496e7465726e65742d447261667473206173207265666572656e6365206d6174657269616c206f7220746f2063697465207468656d206f74686572207468616e206173202fe2809c776f726b20696e2070726f67
|
||||
Ciphertext = 64a0861575861af460f062c79be643bd5e805cfd345cf389f108670ac76c8cb24c6cfc18755d43eea09ee94e382d26b0bdb7b73c321b0100d4f03b7f355894cf332f830e710b97ce98c8a84abd0b948114ad176e008d33bd60f982b1ff37c8559797a06ef4f0ef61c186324e2b3506383606907b6a7c02b0f9f6157b53c867e4b9166c767b804d46a59b5216cde7a4e99040c5a40433225ee282a1b0a06c523eaf4534d7f83fa1155b0047718cbc546a0d072b04b3564eea1b422273f548271a0bb2316053fa76991955ebd63159434ecebb4e466dae5a1073a6727627097a1049e617d91d361094fa68f0ff77987130305beaba2eda04df997b714d6c6f2c299da65ba25e6a85842bf0440fd98a9a2266b061c4b3a13327c090f9a0789f58aad805275e4378a525f19232bfbfb749ede38480f405cf43ec2f1f8619ebcbc80a89e92a859c7911e674977ab17d4a7126a6b8a477358ff14a344d276ef6e504e10268ac3619fcf90c2d6c03fc2e3d1f290d9bf26c1fa1495dd8f97eec6229a55c2354e4524143551a5cc370a1c622c9390530cff21c3e1ed50c5e3daf97518ccce34156bdbd7eafab8bd417aef25c6c927301731bd319d247a1d5c3186ed10bfd9a7a24bac30e3e4503ed9204154d338b79ea276e7058e7f20f4d4fd1ac93d63f611af7b6d006c2a72add0eedc497b19cb30a198816664f0da00155f2e2d6ac61
|
||||
|
||||
Cipher = chacha20-poly1305
|
||||
Key = 1c9240a5eb55d38af333888604f6b5f0473917c1402b80099dca5cbc207075c0
|
||||
IV = 000000000102030405060708
|
||||
AAD = f33388860000000000004e91
|
||||
Tag = e0723bce23528ce6ccb10ff9627038bf
|
||||
Plaintext = 496e7465726e65742d4472616674732061726520647261667420646f63756d656e74732076616c696420666f722061206d6178696d756d206f6620736978206d6f6e74687320616e64206d617920626520757064617465642c207265706c616365642c206f72206f62736f6c65746564206279206f7468657220646f63756d656e747320617420616e792074696d652e20497420697320696e617070726f70726961746520746f2075736520496e7465726e65742d447261667473206173207265666572656e6365206d6174657269616c206f7220746f2063697465207468656d206f74686572207468616e206173202fe2809c776f726b20696e2070726f67496e7465726e65742d4472616674732061726520647261667420646f63756d656e74732076616c696420666f722061206d6178696d756d206f6620736978206d6f6e74687320616e64206d617920626520757064617465642c207265706c616365642c206f72206f62736f6c65746564206279206f7468657220646f63756d656e747320617420616e792074696d652e20497420697320696e617070726f70726961746520746f2075736520496e7465726e65742d447261667473206173207265666572656e6365206d6174657269616c206f7220746f2063697465207468656d206f74686572207468616e206173202fe2809c776f726b20696e2070726f67496e7465726e65742d4472616674732061726520647261667420646f63756d656e74732076616c696420666f722061206d6178696d756d206f6620736978206d
|
||||
Ciphertext = 64a0861575861af460f062c79be643bd5e805cfd345cf389f108670ac76c8cb24c6cfc18755d43eea09ee94e382d26b0bdb7b73c321b0100d4f03b7f355894cf332f830e710b97ce98c8a84abd0b948114ad176e008d33bd60f982b1ff37c8559797a06ef4f0ef61c186324e2b3506383606907b6a7c02b0f9f6157b53c867e4b9166c767b804d46a59b5216cde7a4e99040c5a40433225ee282a1b0a06c523eaf4534d7f83fa1155b0047718cbc546a0d072b04b3564eea1b422273f548271a0bb2316053fa76991955ebd63159434ecebb4e466dae5a1073a6727627097a1049e617d91d361094fa68f0ff77987130305beaba2eda04df997b714d6c6f2c299da65ba25e6a85842bf0440fd98a9a2266b061c4b3a13327c090f9a0789f58aad805275e4378a525f19232bfbfb749ede38480f405cf43ec2f1f8619ebcbc80a89e92a859c7911e674977ab17d4a7126a6b8a477358ff14a344d276ef6e504e10268ac3619fcf90c2d6c03fc2e3d1f290d9bf26c1fa1495dd8f97eec6229a55c2354e4524143551a5cc370a1c622c9390530cff21c3e1ed50c5e3daf97518ccce34156bdbd7eafab8bd417aef25c6c927301731bd319d247a1d5c3186ed10bfd9a7a24bac30e3e4503ed9204154d338b79ea276e7058e7f20f4d4fd1ac93d63f611af7b6d006c2a72add0eedc497b19cb30a198816664f0da00155f2e2d6ac61045b296d614301e0ad4983308028850dd4feffe3a8163970306e4047f5a165cb4befbc129729cd2e286e837e9b606486d402acc3dec5bf8b92387f6e486f2140
|
||||
|
||||
Cipher = chacha20-poly1305
|
||||
Key = 1c9240a5eb55d38af333888604f6b5f0473917c1402b80099dca5cbc207075c0
|
||||
IV = ff000000000102030405060708
|
||||
AAD = f33388860000000000004e91
|
||||
Tag = e0723bce23528ce6ccb10ff9627038bf
|
||||
Plaintext = 496e7465726e65742d4472616674732061726520647261667420646f63756d656e74732076616c696420666f722061206d6178696d756d206f6620736978206d6f6e74687320616e64206d617920626520757064617465642c207265706c616365642c206f72206f62736f6c65746564206279206f7468657220646f63756d656e747320617420616e792074696d652e20497420697320696e617070726f70726961746520746f2075736520496e7465726e65742d447261667473206173207265666572656e6365206d6174657269616c206f7220746f2063697465207468656d206f74686572207468616e206173202fe2809c776f726b20696e2070726f67496e7465726e65742d4472616674732061726520647261667420646f63756d656e74732076616c696420666f722061206d6178696d756d206f6620736978206d6f6e74687320616e64206d617920626520757064617465642c207265706c616365642c206f72206f62736f6c65746564206279206f7468657220646f63756d656e747320617420616e792074696d652e20497420697320696e617070726f70726961746520746f2075736520496e7465726e65742d447261667473206173207265666572656e6365206d6174657269616c206f7220746f2063697465207468656d206f74686572207468616e206173202fe2809c776f726b20696e2070726f67496e7465726e65742d4472616674732061726520647261667420646f63756d656e74732076616c696420666f722061206d6178696d756d206f6620736978206d
|
||||
Ciphertext = 64a0861575861af460f062c79be643bd5e805cfd345cf389f108670ac76c8cb24c6cfc18755d43eea09ee94e382d26b0bdb7b73c321b0100d4f03b7f355894cf332f830e710b97ce98c8a84abd0b948114ad176e008d33bd60f982b1ff37c8559797a06ef4f0ef61c186324e2b3506383606907b6a7c02b0f9f6157b53c867e4b9166c767b804d46a59b5216cde7a4e99040c5a40433225ee282a1b0a06c523eaf4534d7f83fa1155b0047718cbc546a0d072b04b3564eea1b422273f548271a0bb2316053fa76991955ebd63159434ecebb4e466dae5a1073a6727627097a1049e617d91d361094fa68f0ff77987130305beaba2eda04df997b714d6c6f2c299da65ba25e6a85842bf0440fd98a9a2266b061c4b3a13327c090f9a0789f58aad805275e4378a525f19232bfbfb749ede38480f405cf43ec2f1f8619ebcbc80a89e92a859c7911e674977ab17d4a7126a6b8a477358ff14a344d276ef6e504e10268ac3619fcf90c2d6c03fc2e3d1f290d9bf26c1fa1495dd8f97eec6229a55c2354e4524143551a5cc370a1c622c9390530cff21c3e1ed50c5e3daf97518ccce34156bdbd7eafab8bd417aef25c6c927301731bd319d247a1d5c3186ed10bfd9a7a24bac30e3e4503ed9204154d338b79ea276e7058e7f20f4d4fd1ac93d63f611af7b6d006c2a72add0eedc497b19cb30a198816664f0da00155f2e2d6ac61045b296d614301e0ad4983308028850dd4feffe3a8163970306e4047f5a165cb4befbc129729cd2e286e837e9b606486d402acc3dec5bf8b92387f6e486f2140
|
||||
Result = INVALID_IV_LENGTH
|
||||
@@ -0,0 +1,199 @@
|
||||
#
|
||||
# Copyright 2001-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
# this file except in compliance with the License. You can obtain a copy
|
||||
# in the file LICENSE in the source distribution or at
|
||||
# https://www.openssl.org/source/license.html
|
||||
|
||||
# Tests start with one of these keywords
|
||||
# Cipher Decrypt Derive Digest Encoding KDF MAC PBE
|
||||
# PrivPubKeyPair Sign Verify VerifyRecover
|
||||
# and continue until a blank line. Lines starting with a pound sign,
|
||||
# like this prolog, are ignored.
|
||||
|
||||
Title = Chacha20 test vectors from RFC7539
|
||||
|
||||
# A.1 Test Vector 1
|
||||
Cipher = chacha20
|
||||
Key = 0000000000000000000000000000000000000000000000000000000000000000
|
||||
IV = 00000000000000000000000000000000
|
||||
Plaintext = 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
Ciphertext = 76b8e0ada0f13d90405d6ae55386bd28bdd219b8a08ded1aa836efcc8b770dc7da41597c5157488d7724e03fb8d84a376a43b8f41518a11cc387b669b2ee6586
|
||||
|
||||
# A.1 Test Vector 2
|
||||
Cipher = chacha20
|
||||
Key = 0000000000000000000000000000000000000000000000000000000000000000
|
||||
IV = 01000000000000000000000000000000
|
||||
Plaintext = 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
Ciphertext = 9f07e7be5551387a98ba977c732d080dcb0f29a048e3656912c6533e32ee7aed29b721769ce64e43d57133b074d839d531ed1f28510afb45ace10a1f4b794d6f
|
||||
|
||||
# A.2 Test Vector 1 is the same as A.1 Test Vector 1
|
||||
# A.2 Test Vector 2
|
||||
Cipher = chacha20
|
||||
Key = 0000000000000000000000000000000000000000000000000000000000000001
|
||||
#Counter (first 4 bytes) expressed in little-endian order
|
||||
IV = 01000000000000000000000000000002
|
||||
Plaintext = 416e79207375626d697373696f6e20746f20746865204945544620696e74656e6465642062792074686520436f6e7472696275746f7220666f72207075626c69636174696f6e20617320616c6c206f722070617274206f6620616e204945544620496e7465726e65742d4472616674206f722052464320616e6420616e792073746174656d656e74206d6164652077697468696e2074686520636f6e74657874206f6620616e204945544620616374697669747920697320636f6e7369646572656420616e20224945544620436f6e747269627574696f6e222e20537563682073746174656d656e747320696e636c756465206f72616c2073746174656d656e747320696e20494554462073657373696f6e732c2061732077656c6c206173207772697474656e20616e6420656c656374726f6e696320636f6d6d756e69636174696f6e73206d61646520617420616e792074696d65206f7220706c6163652c207768696368206172652061646472657373656420746f
|
||||
Ciphertext = a3fbf07df3fa2fde4f376ca23e82737041605d9f4f4f57bd8cff2c1d4b7955ec2a97948bd3722915c8f3d337f7d370050e9e96d647b7c39f56e031ca5eb6250d4042e02785ececfa4b4bb5e8ead0440e20b6e8db09d881a7c6132f420e52795042bdfa7773d8a9051447b3291ce1411c680465552aa6c405b7764d5e87bea85ad00f8449ed8f72d0d662ab052691ca66424bc86d2df80ea41f43abf937d3259dc4b2d0dfb48a6c9139ddd7f76966e928e635553ba76c5c879d7b35d49eb2e62b0871cdac638939e25e8a1e0ef9d5280fa8ca328b351c3c765989cbcf3daa8b6ccc3aaf9f3979c92b3720fc88dc95ed84a1be059c6499b9fda236e7e818b04b0bc39c1e876b193bfe5569753f88128cc08aaa9b63d1a16f80ef2554d7189c411f5869ca52c5b83fa36ff216b9c1d30062bebcfd2dc5bce0911934fda79a86f6e698ced759c3ff9b6477338f3da4f9cd8514ea9982ccafb341b2384dd902f3d1ab7ac61dd29c6f21ba5b862f3730e37cfdc4fd806c22f221
|
||||
|
||||
# A.2 Test Vector 3
|
||||
Cipher = chacha20
|
||||
Key = 1c9240a5eb55d38af333888604f6b5f0473917c1402b80099dca5cbc207075c0
|
||||
#Counter (first 4 bytes) expressed in little-endian order
|
||||
IV = 2a000000000000000000000000000002
|
||||
Plaintext = 2754776173206272696c6c69672c20616e642074686520736c6974687920746f7665730a446964206779726520616e642067696d626c6520696e2074686520776162653a0a416c6c206d696d737920776572652074686520626f726f676f7665732c0a416e6420746865206d6f6d65207261746873206f757467726162652e
|
||||
Ciphertext = 62e6347f95ed87a45ffae7426f27a1df5fb69110044c0d73118effa95b01e5cf166d3df2d721caf9b21e5fb14c616871fd84c54f9d65b283196c7fe4f60553ebf39c6402c42234e32a356b3e764312a61a5532055716ead6962568f87d3f3f7704c6a8d1bcd1bf4d50d6154b6da731b187b58dfd728afa36757a797ac188d1
|
||||
|
||||
Title = Chacha20
|
||||
|
||||
Cipher = chacha20
|
||||
Key = 0000000000000000000000000000000000000000000000000000000000000001
|
||||
IV = 00000000000000000000000000000000
|
||||
Plaintext = 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
Ciphertext = 4540f05a9f1fb296d7736e7b208e3c96eb4fe1834688d2604f450952ed432d41bbe2a0b6ea7566d2a5d1e7e20d42af2c53d792b1c43fea817e9ad275ae546963
|
||||
|
||||
Cipher = chacha20
|
||||
Key = 0000000000000000000000000000000000000000000000000000000000000000
|
||||
IV = 00000000000000000000000000000001
|
||||
Plaintext = 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
Ciphertext = de9cba7bf3d69ef5e786dc63973f653a0b49e015adbff7134fcb7df137821031e85a050278a7084527214f73efc7fa5b5277062eb7a0433e445f41e31afab757
|
||||
|
||||
Cipher = chacha20
|
||||
Key = 0000000000000000000000000000000000000000000000000000000000000000
|
||||
IV = 00000000000000000100000000000000
|
||||
Plaintext = 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
Ciphertext = ef3fdfd6c61578fbf5cf35bd3dd33b8009631634d21e42ac33960bd138e50d32111e4caf237ee53ca8ad6426194a88545ddc497a0b466e7d6bbdb0041b2f586b
|
||||
|
||||
Cipher = chacha20
|
||||
Key = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
|
||||
IV = 00000000000000000001020304050607
|
||||
Plaintext = 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
Ciphertext = f798a189f195e66982105ffb640bb7757f579da31602fc93ec01ac56f85ac3c134a4547b733b46413042c9440049176905d3be59ea1c53f15916155c2be8241a38008b9a26bc35941e2444177c8ade6689de95264986d95889fb60e84629c9bd9a5acb1cc118be563eb9b3a4a472f82e09a7e778492b562ef7130e88dfe031c79db9d4f7c7a899151b9a475032b63fc385245fe054e3dd5a97a5f576fe064025d3ce042c566ab2c507b138db853e3d6959660996546cc9c4a6eafdc777c040d70eaf46f76dad3979e5c5360c3317166a1c894c94a371876a94df7628fe4eaaf2ccb27d5aaae0ad7ad0f9d4b6ad3b54098746d4524d38407a6deb
|
||||
|
||||
Cipher = chacha20
|
||||
Key = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
|
||||
IV = 00000000000000000001020304050607
|
||||
Plaintext = 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
Ciphertext = f798a189f195e66982105ffb640bb7757f579da31602fc93ec01ac56f85ac3c134a4547b733b46413042c9440049176905d3be59ea1c53f15916155c2be8241a38008b9a26bc35941e2444177c8ade6689de95264986d95889fb60e84629c9bd9a5acb1cc118be563eb9b3a4a472f82e09a7e778492b562ef7130e88dfe031c79db9d4f7c7a899151b9a475032b63fc385245fe054e3dd5a97a5f576fe064025d3ce042c566ab2c507b138db853e3d6959660996546cc9c4a6eafdc777c040d70eaf46f76dad3979e5c5360c3317166a1c894c94a371876a94df7628fe4eaaf2ccb27d5aaae0ad7ad0f9d4b6ad3b54098746d4524d38407a6deb3ab78fab78c9
|
||||
|
||||
Cipher = chacha20
|
||||
Key = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
|
||||
IV = 00000000000000000001020304050607
|
||||
Plaintext = 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
Ciphertext = f798a189f195e66982105ffb640bb7757f579da31602fc93ec01ac56f85ac3c134a4547b733b46413042c9440049176905d3be59ea1c53f15916155c2be8241a38008b9a26bc35941e2444177c8ade6689de95264986d95889fb60e84629c9bd9a5acb1cc118be563eb9b3a4a472f82e09a7e778492b562ef7130e88dfe031c79db9d4f7c7a899151b9a475032b63fc385245fe054e3dd5a97a5f576fe064025d3ce042c566ab2c507b138db853e3d6959660996546cc9c4a6eafdc777c040d70eaf46f76dad3979e5c5360c3317166a1c894c94a371876a94df7628fe4eaaf2ccb27d5aaae0ad7ad0f9d4b6ad3b54098746d4524d38407a6deb3ab78fab78c94213668bbbd394c5de93b853178addd6b97f9fa1ec3e56c00c9ddff0a44a204241175a4cab0f961ba53ede9bdf960b94f9829b1f3414726429b362c5b538e391520f489b7ed8d20ae3fd49e9e259e44397514d618c96c4846be3c680bdc11c71dcbbe29ccf80d62a0938fa549391e6ea57ecbe2606790ec15d2224ae307c144226b7c4e8c2f97d2a1d67852d29beba110edd445197012062a393a9c92803ad3b4f31d7bc6033ccf7932cfed3f019044d25905916777286f82f9a4cc1ffe430ffd1dcfc27deed327b9f9630d2fa969fb6f0603cd19dd9a9519e673bcfcd9014125291a44669ef7285e74ed3729b677f801c3cdf058c50963168b496043716c730
|
||||
|
||||
Cipher = chacha20
|
||||
Key = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
|
||||
IV = 00000000000000000001020304050607
|
||||
Plaintext = 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
Ciphertext = f798a189f195e66982105ffb640bb7757f579da31602fc93ec01ac56f85ac3c134a4547b733b46413042c9440049176905d3be59ea1c53f15916155c2be8241a38008b9a26bc35941e2444177c8ade6689de95264986d95889fb60e84629c9bd9a5acb1cc118be563eb9b3a4a472f82e09a7e778492b562ef7130e88dfe031c79db9d4f7c7a899151b9a475032b63fc385245fe054e3dd5a97a5f576fe064025d3ce042c566ab2c507b138db853e3d6959660996546cc9c4a6eafdc777c040d70eaf46f76dad3979e5c5360c3317166a1c894c94a371876a94df7628fe4eaaf2ccb27d5aaae0ad7ad0f9d4b6ad3b54098746d4524d38407a6deb3ab78fab78c94213668bbbd394c5de93b853178addd6b97f9fa1ec3e56c00c9ddff0a44a204241175a4cab0f961ba53ede9bdf960b94f9829b1f3414726429b362c5b538e391520f489b7ed8d20ae3fd49e9e259e44397514d618c96c4846be3c680bdc11c71dcbbe29ccf80d62a0938fa549391e6ea57ecbe2606790ec15d2224ae307c144226b7c4e8c2f97d2a1d67852d29beba110edd445197012062a393a9c92803ad3b4f31d7bc6033ccf7932cfed3f019044d25905916777286f82f9a4cc1ffe430ffd1dcfc27deed327b9f9630d2fa969fb6f0603cd19dd9a9519e673bcfcd9014125291a44669ef7285e74ed3729b677f801c3cdf058c50963168b496043716c7307cd9e0cdd137fccb0f05b47cdbb95c5f54831622c3652a32b2531fe326bcd6e2bbf56a194fa196fbd1a54952110f51c73433865f7664b836685e3664b3d8444aF89A242805E18C975F1146324996FDE17007CF3E6E8F4E764022533EDBFE07D4733E48BB372D75B0EF48EC983EB78532161CC529E5ABB89837DFCCA6261DBB37
|
||||
|
||||
Cipher = chacha20
|
||||
Key = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
|
||||
IV = 00000000000000000001020304050607
|
||||
Plaintext = 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
Ciphertext = f798a189f195e66982105ffb640bb7757f579da31602fc93ec01ac56f85ac3c134a4547b733b46413042c9440049176905d3be59ea1c53f15916155c2be8241a38008b9a26bc35941e2444177c8ade6689de95264986d95889fb60e84629c9bd9a5acb1cc118be563eb9b3a4a472f82e09a7e778492b562ef7130e88dfe031c79db9d4f7c7a899151b9a475032b63fc385245fe054e3dd5a97a5f576fe064025d3ce042c566ab2c507b138db853e3d6959660996546cc9c4a6eafdc777c040d70eaf46f76dad3979e5c5360c3317166a1c894c94a371876a94df7628fe4eaaf2ccb27d5aaae0ad7ad0f9d4b6ad3b54098746d4524d38407a6deb3ab78fab78c94213668bbbd394c5de93b853178addd6b97f9fa1ec3e56c00c9ddff0a44a204241175a4cab0f961ba53ede9bdf960b94f9829b1f3414726429b362c5b538e391520f489b7ed8d20ae3fd49e9e259e44397514d618c96c4846be3c680bdc11c71dcbbe29ccf80d62a0938fa549391e6ea57ecbe2606790ec15d2224ae307c144226b7c4e8c2f97d2a1d67852d29beba110edd445197012062a393a9c92803ad3b4f31d7bc6033ccf7932cfed3f019044d25905916777286f82f9a4cc1ffe430ffd1dcfc27deed327b9f9630d2fa969fb6f0603cd19dd9a9519e673bcfcd9014125291a44669ef7285e74ed3729b677f801c3cdf058c50963168b496043716c7307cd9e0cdd137fccb0f05b47cdbb95c5f54831622c3652a32b2531fe326bcd6e2bbf56a194fa196fbd1a54952110f51c73433865f7664b836685e3664b3d8444a
|
||||
|
||||
Cipher = chacha20
|
||||
Key = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
|
||||
IV = 00000000000000000001020304050607
|
||||
Plaintext = 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
Ciphertext = f798a189f195e66982105ffb640bb7757f579da31602fc93ec01ac56f85ac3c134a4547b733b46413042c9440049176905d3be59ea1c53f15916155c2be8241a38008b9a26bc35941e2444177c8ade6689de95264986d95889fb60e84629c9bd9a5acb1cc118be563eb9b3a4a472f82e09a7e778492b562ef7130e88dfe031c79db9d4f7c7a899151b9a475032b63fc385245fe054e3dd5a97a5f576fe064025d3ce042c566ab2c507b138db853e3d6959660996546cc9c4a6eafdc777c040d70eaf46f76dad3979e5c5360c3317166a1c894c94a371876a94df7628fe4eaaf2ccb27d5aaae0ad7ad0f9d4b6ad3b54098746d4524d38407a6deb3ab78fab78c94213668bbbd394c5de93b853178addd6b97f9fa1ec3e56c00c9ddff0a44a204241175a4cab0f961ba53ede9bdf960b94f9829b1f3414726429b362c5b538e391520f489b7ed8d20ae3fd49e9e259e44397514d618c96c4846be3c680bdc11c71dcbbe29ccf80d62a0938fa549391e6ea57ecbe2606790ec15d2224ae307c144226b7c4e8c2f97d2a1d67852d29beba110edd445197012062a393a9c92803ad3b4f31d7bc6033ccf7932cfed3f019044d25905916777286f82f9a4cc1ffe430ffd1dcfc27deed327b9f9630d2fa969fb6f0603cd19dd9a9519e673bcfcd9014125291a44669ef7285e74ed3729b677f801c3cdf058c50963168b496043716c7307cd9e0cdd137fccb0f05b47cdbb95c5f54831622c3652a32b2531fe326bcd6e2bbf56a194fa196fbd1a54952110f51c73433865f7664b836685e3664b3d8444aF89A242805E18C975F1146324996FDE17007CF3E6E8F4E764022533EDBFE07D4733E48BB372D75B0EF48EC983EB78532161CC529E5ABB89837DFCCA6261DBB37C7C5E6A87478BF41EE85A518C0F4EFA9BDE828C5A71B8E46597B634AFD204D3C501334239C3414285ED72D3A9169EABBD4DC25D52BB7516D3BA712D75AD8C0AE
|
||||
|
||||
Cipher = chacha20
|
||||
Key = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
|
||||
IV = 00000000000000000001020304050607
|
||||
Plaintext = 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
Ciphertext = f798a189f195e66982105ffb640bb7757f579da31602fc93ec01ac56f85ac3c134a4547b733b46413042c9440049176905d3be59ea1c53f15916155c2be8241a38008b9a26bc35941e2444177c8ade6689de95264986d95889fb60e84629c9bd9a5acb1cc118be563eb9b3a4a472f82e09a7e778492b562ef7130e88dfe031c79db9d4f7c7a899151b9a475032b63fc385245fe054e3dd5a97a5f576fe064025d3ce042c566ab2c507b138db853e3d6959660996546cc9c4a6eafdc777c040d70eaf46f76dad3979e5c5360c3317166a1c894c94a371876a94df7628fe4eaaf2ccb27d5aaae0ad7ad0f9d4b6ad3b54098746d4524d38407a6deb3ab78fab78c94213668bbbd394c5de93b853178addd6b97f9fa1ec3e56c00c9ddff0a44a204241175a4cab0f961ba53ede9bdf960b94f9829b1f3414726429b362c5b538e391520f489b7ed8d20ae3fd49e9e259e44397514d618c96c4846be3c680bdc11c71dcbbe29ccf80d62a0938fa549391e6ea57ecbe2606790ec15d2224ae307c144226b7c4e8c2f97d2a1d67852d29beba110edd445197012062a393a9c92803ad3b4f31d7bc6033ccf7932cfed3f019044d25905916777286f82f9a4cc1ffe430ffd1dcfc27deed327b9f9630d2fa969fb6f0603cd19dd9a9519e673bcfcd9014125291a44669ef7285e74ed3729b677f801c3cdf058c50963168b496043716c7307cd9e0cdd137fccb0f05b47cdbb95c5f54831622c3652a32b2531fe326bcd6e2bbf56a194fa196fbd1a54952110f51c73433865f7664b836685e3664b3d8444aF89A242805E18C975F1146324996FDE17007CF3E6E8F4E764022533EDBFE07D4733E48BB372D75B0EF48EC983EB78532161CC529E5ABB89837DFCCA6261DBB37C7C5E6A87478BF41EE85A518C0F4EFA9BDE828C5A71B8E46597B634AFD204D3C501334239C3414285ED72D3A9169EABBD4DC25D52BB7516D3BA712D75AD8C0AE5D493C19E38A77939E7A058D713E9CCCCA58045F436B434B1C80D365472406E392951987DB6905C80D431DA18451135BE7E82BCAB358CB3971E61405B2FF1798
|
||||
|
||||
Cipher = chacha20
|
||||
Key = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
|
||||
IV = 00000000000000000001020304050607
|
||||
Plaintext = 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
Ciphertext = f798a189f195e66982105ffb640bb7757f579da31602fc93ec01ac56f85ac3c134a4547b733b46413042c9440049176905d3be59ea1c53f15916155c2be8241a38008b9a26bc35941e2444177c8ade6689de95264986d95889fb60e84629c9bd9a5acb1cc118be563eb9b3a4a472f82e09a7e778492b562ef7130e88dfe031c79db9d4f7c7a899151b9a475032b63fc385245fe054e3dd5a97a5f576fe064025d3ce042c566ab2c507b138db853e3d6959660996546cc9c4a6eafdc777c040d70eaf46f76dad3979e5c5360c3317166a1c894c94a371876a94df7628fe4eaaf2ccb27d5aaae0ad7ad0f9d4b6ad3b54098746d4524d38407a6deb3ab78fab78c94213668bbbd394c5de93b853178addd6b97f9fa1ec3e56c00c9ddff0a44a204241175a4cab0f961ba53ede9bdf960b94f9829b1f3414726429b362c5b538e391520f489b7ed8d20ae3fd49e9e259e44397514d618c96c4846be3c680bdc11c71dcbbe29ccf80d62a0938fa549391e6ea57ecbe2606790ec15d2224ae307c144226b7c4e8c2f97d2a1d67852d29beba110edd445197012062a393a9c92803ad3b4f31d7bc6033ccf7932cfed3f019044d25905916777286f82f9a4cc1ffe430ffd1dcfc27deed327b9f9630d2fa969fb6f0603cd19dd9a9519e673bcfcd9014125291a44669ef7285e74ed3729b677f801c3cdf058c50963168b496043716c7307cd9e0cdd137fccb0f05b47cdbb95c5f54831622c3652a32b2531fe326bcd6e2bbf56a194fa196fbd1a54952110f51c73433865f7664b836685e3664b3d8444aF89A242805E18C975F1146324996FDE17007CF3E6E8F4E764022533EDBFE07D4733E48BB372D75B0EF48EC983EB78532161CC529E5ABB89837DFCCA6261DBB37C7C5E6A87478BF41EE85A518C0F4EFA9BDE828C5A71B8E46597B634AFD204D3C501334239C3414285ED72D3A9169EABBD4DC25D52BB7516D3BA712D75AD8C0AE5D493C19E38A77939E7A058D713E9CCCCA58045F436B434B1C80D365472406E392951987DB6905C80D431DA18451135BE7E82BCAB358CB3971E61405B2FF17980D6E7E67E861E28201C1EE30B441040FD06878D65042C95582A4318207BFC700BE0CE32889AEC2FFE5085E8967910D879FA0E8C0FF85FDC510B9FF2FBF87CFCB
|
||||
|
||||
Cipher = chacha20
|
||||
Key = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
|
||||
IV = 00000000000000000001020304050607
|
||||
Plaintext = 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
Ciphertext = f798a189f195e66982105ffb640bb7757f579da31602fc93ec01ac56f85ac3c134a4547b733b46413042c9440049176905d3be59ea1c53f15916155c2be8241a38008b9a26bc35941e2444177c8ade6689de95264986d95889fb60e84629c9bd9a5acb1cc118be563eb9b3a4a472f82e09a7e778492b562ef7130e88dfe031c79db9d4f7c7a899151b9a475032b63fc385245fe054e3dd5a97a5f576fe064025d3ce042c566ab2c507b138db853e3d6959660996546cc9c4a6eafdc777c040d70eaf46f76dad3979e5c5360c3317166a1c894c94a371876a94df7628fe4eaaf2ccb27d5aaae0ad7ad0f9d4b6ad3b54098746d4524d38407a6deb3ab78fab78c94213668bbbd394c5de93b853178addd6b97f9fa1ec3e56c00c9ddff0a44a204241175a4cab0f961ba53ede9bdf960b94f9829b1f3414726429b362c5b538e391520f489b7ed8d20ae3fd49e9e259e44397514d618c96c4846be3c680bdc11c71dcbbe29ccf80d62a0938fa549391e6ea57ecbe2606790ec15d2224ae307c144226b7c4e8c2f97d2a1d67852d29beba110edd445197012062a393a9c92803ad3b4f31d7bc6033ccf7932cfed3f019044d25905916777286f82f9a4cc1ffe430ffd1dcfc27deed327b9f9630d2fa969fb6f0603cd19dd9a9519e673bcfcd9014125291a44669ef7285e74ed3729b677f801c3cdf058c50963168b496043716c7307cd9e0cdd137fccb0f05b47cdbb95c5f54831622c3652a32b2531fe326bcd6e2bbf56a194fa196fbd1a54952110f51c73433865f7664b836685e3664b3d8444aF89A242805E18C975F1146324996FDE17007CF3E6E8F4E764022533EDBFE07D4733E48BB372D75B0EF48EC983EB78532161CC529E5ABB89837DFCCA6261DBB37C7C5E6A87478BF41EE85A518C0F4EFA9BDE828C5A71B8E46597B634AFD204D3C501334239C3414285ED72D3A9169EABBD4DC25D52BB7516D3BA712D75AD8C0AE5D493C19E38A77939E7A058D713E9CCCCA58045F436B434B1C80D365472406E392951987DB6905C80D431DA18451135BE7E82BCAB358CB3971E61405B2FF17980D6E7E67E861E28201C1EE30B441040FD06878D65042C95582A4318207BFC700BE0CE32889AEC2FFE5085E8967910D879FA0E8C0FF85FDC510B9FF2FBF87CFCB29577D68099E04FFA05F752A73D377C70D3A8BC2DA80E6E780EC057182C33AD1DE387252258A1E18E6FAD910327CE7F42FD1E1E0515F9586E2F2EFCB9F472B1D
|
||||
|
||||
Cipher = chacha20
|
||||
Key = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
|
||||
IV = 00000000000000000001020304050607
|
||||
Plaintext = 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
Ciphertext = f798a189f195e66982105ffb640bb7757f579da31602fc93ec01ac56f85ac3c134a4547b733b46413042c9440049176905d3be59ea1c53f15916155c2be8241a38008b9a26bc35941e2444177c8ade6689de95264986d95889fb60e84629c9bd9a5acb1cc118be563eb9b3a4a472f82e09a7e778492b562ef7130e88dfe031c79db9d4f7c7a899151b9a475032b63fc385245fe054e3dd5a97a5f576fe064025d3ce042c566ab2c507b138db853e3d6959660996546cc9c4a6eafdc777c040d70eaf46f76dad3979e5c5360c3317166a1c894c94a371876a94df7628fe4eaaf2ccb27d5aaae0ad7ad0f9d4b6ad3b54098746d4524d38407a6deb3ab78fab78c94213668bbbd394c5de93b853178addd6b97f9fa1ec3e56c00c9ddff0a44a204241175a4cab0f961ba53ede9bdf960b94f9829b1f3414726429b362c5b538e391520f489b7ed8d20ae3fd49e9e259e44397514d618c96c4846be3c680bdc11c71dcbbe29ccf80d62a0938fa549391e6ea57ecbe2606790ec15d2224ae307c144226b7c4e8c2f97d2a1d67852d29beba110edd445197012062a393a9c92803ad3b4f31d7bc6033ccf7932cfed3f019044d25905916777286f82f9a4cc1ffe430ffd1dcfc27deed327b9f9630d2fa969fb6f0603cd19dd9a9519e673bcfcd9014125291a44669ef7285e74ed3729b677f801c3cdf058c50963168b496043716c7307cd9e0cdd137fccb0f05b47cdbb95c5f54831622c3652a32b2531fe326bcd6e2bbf56a194fa196fbd1a54952110f51c73433865f7664b836685e3664b3d8444aF89A242805E18C975F1146324996FDE17007CF3E6E8F4E764022533EDBFE07D4733E48BB372D75B0EF48EC983EB78532161CC529E5ABB89837DFCCA6261DBB37C7C5E6A87478BF41EE85A518C0F4EFA9BDE828C5A71B8E46597B634AFD204D3C501334239C3414285ED72D3A9169EABBD4DC25D52BB7516D3BA712D75AD8C0AE5D493C19E38A77939E7A058D713E9CCCCA58045F436B434B1C80D365472406E392951987DB6905C80D431DA18451135BE7E82BCAB358CB3971E61405B2FF17980D6E7E67E861E28201C1EE30B441040FD06878D65042C95582A4318207BFC700BE0CE32889AEC2FFE5085E8967910D879FA0E8C0FF85FDC510B9FF2FBF87CFCB29577D68099E04FFA05F752A73D377C70D3A8BC2DA80E6E780EC057182C33AD1DE387252258A1E18E6FAD910327CE7F42FD1E1E0515F9586E2F2EFCB9F472B1DBDBAC354A4162151E9D92C79FB08BB4DDC56F19448C0175A46E2E6C491FEC71419AA43A349BEA768A92C75DE68FD9591E68067F3197094D3FB87ED81785EA075
|
||||
|
||||
Cipher = chacha20
|
||||
Key = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
|
||||
IV = 00000000000000000001020304050607
|
||||
Plaintext = 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
Ciphertext = f798a189f195e66982105ffb640bb7757f579da31602fc93ec01ac56f85ac3c134a4547b733b46413042c9440049176905d3be59ea1c53f15916155c2be8241a38008b9a26bc35941e2444177c8ade6689de95264986d95889fb60e84629c9bd9a5acb1cc118be563eb9b3a4a472f82e09a7e778492b562ef7130e88dfe031c79db9d4f7c7a899151b9a475032b63fc385245fe054e3dd5a97a5f576fe064025d3ce042c566ab2c507b138db853e3d6959660996546cc9c4a6eafdc777c040d70eaf46f76dad3979e5c5360c3317166a1c894c94a371876a94df7628fe4eaaf2ccb27d5aaae0ad7ad0f9d4b6ad3b54098746d4524d38407a6deb3ab78fab78c94213668bbbd394c5de93b853178addd6b97f9fa1ec3e56c00c9ddff0a44a204241175a4cab0f961ba53ede9bdf960b94f9829b1f3414726429b362c5b538e391520f489b7ed8d20ae3fd49e9e259e44397514d618c96c4846be3c680bdc11c71dcbbe29ccf80d62a0938fa549391e6ea57ecbe2606790ec15d2224ae307c144226b7c4e8c2f97d2a1d67852d29beba110edd445197012062a393a9c92803ad3b4f31d7bc6033ccf7932cfed3f019044d25905916777286f82f9a4cc1ffe430ffd1dcfc27deed327b9f9630d2fa969fb6f0603cd19dd9a9519e673bcfcd9014125291a44669ef7285e74ed3729b677f801c3cdf058c50963168b496043716c7307cd9e0cdd137fccb0f05b47cdbb95c5f54831622c3652a32b2531fe326bcd6e2bbf56a194fa196fbd1a54952110f51c73433865f7664b836685e3664b3d8444aF89A242805E18C975F1146324996FDE17007CF3E6E8F4E764022533EDBFE07D4733E48BB372D75B0EF48EC983EB78532161CC529E5ABB89837DFCCA6261DBB37C7C5E6A87478BF41EE85A518C0F4EFA9BDE828C5A71B8E46597B634AFD204D3C501334239C3414285ED72D3A9169EABBD4DC25D52BB7516D3BA712D75AD8C0AE5D493C19E38A77939E7A058D713E9CCCCA58045F436B434B1C80D365472406E392951987DB6905C80D431DA18451135BE7E82BCAB358CB3971E61405B2FF17980D6E7E67E861E28201C1EE30B441040FD06878D65042C95582A4318207BFC700BE0CE32889AEC2FFE5085E8967910D879FA0E8C0FF85FDC510B9FF2FBF87CFCB29577D68099E04FFA05F752A73D377C70D3A8BC2DA80E6E780EC057182C33AD1DE387252258A1E18E6FAD910327CE7F42FD1E1E0515F9586E2F2EFCB9F472B1DBDBAC354A4162151E9D92C79FB08BB4DDC56F19448C0175A46E2E6C491FEC71419AA43A349BEA768A92C75DE68FD9591E68067F3197094D3FB87ED81785EA075E4B65E3E4C78F81DA9B751C5EFE024152301C48E63245B556C4C67AFF857E5EA15A908D83A1D9704F8E55E7352B20B694BF9970298E6B5AAD33EA2155D105D4E
|
||||
|
||||
Cipher = chacha20
|
||||
Key = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
|
||||
IV = 00000000000000000001020304050607
|
||||
Plaintext = 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
Ciphertext = f798a189f195e66982105ffb640bb7757f579da31602fc93ec01ac56f85ac3c134a4547b733b46413042c9440049176905d3be59ea1c53f15916155c2be8241a38008b9a26bc35941e2444177c8ade6689de95264986d95889fb60e84629c9bd9a5acb1cc118be563eb9b3a4a472f82e09a7e778492b562ef7130e88dfe031c79db9d4f7c7a899151b9a475032b63fc385245fe054e3dd5a97a5f576fe064025d3ce042c566ab2c507b138db853e3d6959660996546cc9c4a6eafdc777c040d70eaf46f76dad3979e5c5360c3317166a1c894c94a371876a94df7628fe4eaaf2ccb27d5aaae0ad7ad0f9d4b6ad3b54098746d4524d38407a6deb3ab78fab78c94213668bbbd394c5de93b853178addd6b97f9fa1ec3e56c00c9ddff0a44a204241175a4cab0f961ba53ede9bdf960b94f9829b1f3414726429b362c5b538e391520f489b7ed8d20ae3fd49e9e259e44397514d618c96c4846be3c680bdc11c71dcbbe29ccf80d62a0938fa549391e6ea57ecbe2606790ec15d2224ae307c144226b7c4e8c2f97d2a1d67852d29beba110edd445197012062a393a9c92803ad3b4f31d7bc6033ccf7932cfed3f019044d25905916777286f82f9a4cc1ffe430ffd1dcfc27deed327b9f9630d2fa969fb6f0603cd19dd9a9519e673bcfcd9014125291a44669ef7285e74ed3729b677f801c3cdf058c50963168b496043716c7307cd9e0cdd137fccb0f05b47cdbb95c5f54831622c3652a32b2531fe326bcd6e2bbf56a194fa196fbd1a54952110f51c73433865f7664b836685e3664b3d8444aF89A242805E18C975F1146324996FDE17007CF3E6E8F4E764022533EDBFE07D4733E48BB372D75B0EF48EC983EB78532161CC529E5ABB89837DFCCA6261DBB37C7C5E6A87478BF41EE85A518C0F4EFA9BDE828C5A71B8E46597B634AFD204D3C501334239C3414285ED72D3A9169EABBD4DC25D52BB7516D3BA712D75AD8C0AE5D493C19E38A77939E7A058D713E9CCCCA58045F436B434B1C80D365472406E392951987DB6905C80D431DA18451135BE7E82BCAB358CB3971E61405B2FF17980D6E7E67E861E28201C1EE30B441040FD06878D65042C95582A4318207BFC700BE0CE32889AEC2FFE5085E8967910D879FA0E8C0FF85FDC510B9FF2FBF87CFCB29577D68099E04FFA05F752A73D377C70D3A8BC2DA80E6E780EC057182C33AD1DE387252258A1E18E6FAD910327CE7F42FD1E1E0515F9586E2F2EFCB9F472B1DBDBAC354A4162151E9D92C79FB08BB4DDC56F19448C0175A46E2E6C491FEC71419AA43A349BEA768A92C75DE68FD9591E68067F3197094D3FB87ED81785EA075E4B65E3E4C78F81DA9B751C5EFE024152301C48E63245B556C4C67AFF857E5EA15A908D83A1D9704F8E55E7352B20B694BF9970298E6B5AAD33EA2155D105D4E637D1E87C40A8E5F4E8C5A16A4B8F3DC27B31721D77A65FD1ED6F86BE25FB95DB29B1988493770A7C60E451FF97DD241A236851FC425691979FE30226559AD95
|
||||
|
||||
# RFC7539
|
||||
Cipher = chacha20-poly1305
|
||||
Key = 808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f
|
||||
IV = 070000004041424344454647
|
||||
AAD = 50515253c0c1c2c3c4c5c6c7
|
||||
Tag = 1ae10b594f09e26a7e902ecbd0600691
|
||||
Plaintext = 4c616469657320616e642047656e746c656d656e206f662074686520636c617373206f66202739393a204966204920636f756c64206f6666657220796f75206f6e6c79206f6e652074697020666f7220746865206675747572652c2073756e73637265656e20776f756c642062652069742e
|
||||
Ciphertext = d31a8d34648e60db7b86afbc53ef7ec2a4aded51296e08fea9e2b5a736ee62d63dbea45e8ca9671282fafb69da92728b1a71de0a9e060b2905d6a5b67ecd3b3692ddbd7f2d778b8c9803aee328091b58fab324e4fad675945585808b4831d7bc3ff4def08e4b7a9de576d26586cec64b6116
|
||||
|
||||
Cipher = chacha20-poly1305
|
||||
Key = 1c9240a5eb55d38af333888604f6b5f0473917c1402b80099dca5cbc207075c0
|
||||
IV = 000000000102030405060708
|
||||
AAD = f33388860000000000004e91
|
||||
Tag = eead9d67890cbb22392336fea1851f38
|
||||
Plaintext = 496e7465726e65742d4472616674732061726520647261667420646f63756d656e74732076616c696420666f722061206d6178696d756d206f6620736978206d6f6e74687320616e64206d617920626520757064617465642c207265706c616365642c206f72206f62736f6c65746564206279206f7468657220646f63756d656e747320617420616e792074696d652e20497420697320696e617070726f70726961746520746f2075736520496e7465726e65742d447261667473206173207265666572656e6365206d6174657269616c206f7220746f2063697465207468656d206f74686572207468616e206173202fe2809c776f726b20696e2070726f67726573732e2fe2809d
|
||||
Ciphertext = 64a0861575861af460f062c79be643bd5e805cfd345cf389f108670ac76c8cb24c6cfc18755d43eea09ee94e382d26b0bdb7b73c321b0100d4f03b7f355894cf332f830e710b97ce98c8a84abd0b948114ad176e008d33bd60f982b1ff37c8559797a06ef4f0ef61c186324e2b3506383606907b6a7c02b0f9f6157b53c867e4b9166c767b804d46a59b5216cde7a4e99040c5a40433225ee282a1b0a06c523eaf4534d7f83fa1155b0047718cbc546a0d072b04b3564eea1b422273f548271a0bb2316053fa76991955ebd63159434ecebb4e466dae5a1073a6727627097a1049e617d91d361094fa68f0ff77987130305beaba2eda04df997b714d6c6f2c29a6ad5cb4022b02709b
|
||||
|
||||
Cipher = chacha20-poly1305
|
||||
Key = 1c9240a5eb55d38af333888604f6b5f0473917c1402b80099dca5cbc207075c0
|
||||
IV = 000000000102030405060708
|
||||
AAD = f33388860000000000004e91
|
||||
Tag = eead9d67890cbb22392336fea1851f39
|
||||
Plaintext = 496e7465726e65742d4472616674732061726520647261667420646f63756d656e74732076616c696420666f722061206d6178696d756d206f6620736978206d6f6e74687320616e64206d617920626520757064617465642c207265706c616365642c206f72206f62736f6c65746564206279206f7468657220646f63756d656e747320617420616e792074696d652e20497420697320696e617070726f70726961746520746f2075736520496e7465726e65742d447261667473206173207265666572656e6365206d6174657269616c206f7220746f2063697465207468656d206f74686572207468616e206173202fe2809c776f726b20696e2070726f67726573732e2fe2809d
|
||||
Ciphertext = 64a0861575861af460f062c79be643bd5e805cfd345cf389f108670ac76c8cb24c6cfc18755d43eea09ee94e382d26b0bdb7b73c321b0100d4f03b7f355894cf332f830e710b97ce98c8a84abd0b948114ad176e008d33bd60f982b1ff37c8559797a06ef4f0ef61c186324e2b3506383606907b6a7c02b0f9f6157b53c867e4b9166c767b804d46a59b5216cde7a4e99040c5a40433225ee282a1b0a06c523eaf4534d7f83fa1155b0047718cbc546a0d072b04b3564eea1b422273f548271a0bb2316053fa76991955ebd63159434ecebb4e466dae5a1073a6727627097a1049e617d91d361094fa68f0ff77987130305beaba2eda04df997b714d6c6f2c29a6ad5cb4022b02709b
|
||||
Operation = DECRYPT
|
||||
Result = CIPHERFINAL_ERROR
|
||||
|
||||
# self-generated vectors
|
||||
Cipher = chacha20-poly1305
|
||||
Key = 1c9240a5eb55d38af333888604f6b5f0473917c1402b80099dca5cbc207075c0
|
||||
IV = 000000000102030405060708
|
||||
AAD = f33388860000000000004e91
|
||||
Tag = d96119a40cd17f2527306866a3ef0413
|
||||
Plaintext = 496e7465726e65742d4472616674732061726520647261667420646f63756d656e74732076616c696420666f722061206d6178696d756d206f6620736978206d6f6e74687320616e64206d617920626520757064617465642c207265706c616365642c206f72206f62736f6c65746564206279206f7468657220646f63756d656e747320617420616e792074696d652e20497420697320696e617070726f70726961746520746f2075736520496e7465726e65742d4472616674732061732072
|
||||
Ciphertext = 64a0861575861af460f062c79be643bd5e805cfd345cf389f108670ac76c8cb24c6cfc18755d43eea09ee94e382d26b0bdb7b73c321b0100d4f03b7f355894cf332f830e710b97ce98c8a84abd0b948114ad176e008d33bd60f982b1ff37c8559797a06ef4f0ef61c186324e2b3506383606907b6a7c02b0f9f6157b53c867e4b9166c767b804d46a59b5216cde7a4e99040c5a40433225ee282a1b0a06c523eaf4534d7f83fa1155b0047718cbc546a0d072b04b3564eea1b422273f548271a
|
||||
|
||||
Cipher = chacha20-poly1305
|
||||
Key = 1c9240a5eb55d38af333888604f6b5f0473917c1402b80099dca5cbc207075c0
|
||||
IV = 000000000102030405060708
|
||||
AAD = f33388860000000000004e91
|
||||
Tag = 53aee3189d2b747032378a6186feb43f
|
||||
Plaintext = 496e7465726e65742d4472616674732061726520647261667420646f63756d656e74732076616c696420666f722061206d6178696d756d206f6620736978206d6f6e74687320616e64206d617920626520757064617465642c207265706c616365642c206f72206f62736f6c65746564206279206f7468657220646f63756d656e747320617420616e792074696d652e20497420697320696e617070726f70726961746520746f2075736520496e7465726e65742d447261667473206173207265666572656e6365206d6174657269616c206f7220746f2063697465207468656d206f74686572207468616e206173202fe2809c776f726b20696e2070726f67496e7465726e65742d4472616674732061726520647261667420646f63756d656e74732076616c696420666f722061206d6178696d756d206f6620736978206d6f6e74687320616e64206d617920626520757064617465642c207265706c616365642c206f72206f62736f6c65746564206279206f7468657220646f63756d656e747320617420616e792074696d652e20497420697320696e617070726f70726961746520746f2075736520496e7465726e65742d447261667473206173207265666572656e6365206d6174657269616c206f7220746f2063697465207468656d206f74686572207468616e206173202fe2809c776f726b20696e2070726f67
|
||||
Ciphertext = 64a0861575861af460f062c79be643bd5e805cfd345cf389f108670ac76c8cb24c6cfc18755d43eea09ee94e382d26b0bdb7b73c321b0100d4f03b7f355894cf332f830e710b97ce98c8a84abd0b948114ad176e008d33bd60f982b1ff37c8559797a06ef4f0ef61c186324e2b3506383606907b6a7c02b0f9f6157b53c867e4b9166c767b804d46a59b5216cde7a4e99040c5a40433225ee282a1b0a06c523eaf4534d7f83fa1155b0047718cbc546a0d072b04b3564eea1b422273f548271a0bb2316053fa76991955ebd63159434ecebb4e466dae5a1073a6727627097a1049e617d91d361094fa68f0ff77987130305beaba2eda04df997b714d6c6f2c299da65ba25e6a85842bf0440fd98a9a2266b061c4b3a13327c090f9a0789f58aad805275e4378a525f19232bfbfb749ede38480f405cf43ec2f1f8619ebcbc80a89e92a859c7911e674977ab17d4a7126a6b8a477358ff14a344d276ef6e504e10268ac3619fcf90c2d6c03fc2e3d1f290d9bf26c1fa1495dd8f97eec6229a55c2354e4524143551a5cc370a1c622c9390530cff21c3e1ed50c5e3daf97518ccce34156bdbd7eafab8bd417aef25c6c927301731bd319d247a1d5c3186ed10bfd9a7a24bac30e3e4503ed9204154d338b79ea276e7058e7f20f4d4fd1ac93d63f611af7b6d006c2a72add0eedc497b19cb30a198816664f0da00155f2e2d6ac61
|
||||
|
||||
Cipher = chacha20-poly1305
|
||||
Key = 1c9240a5eb55d38af333888604f6b5f0473917c1402b80099dca5cbc207075c0
|
||||
IV = 000000000102030405060708
|
||||
AAD = f33388860000000000004e91
|
||||
Tag = e0723bce23528ce6ccb10ff9627038bf
|
||||
Plaintext = 496e7465726e65742d4472616674732061726520647261667420646f63756d656e74732076616c696420666f722061206d6178696d756d206f6620736978206d6f6e74687320616e64206d617920626520757064617465642c207265706c616365642c206f72206f62736f6c65746564206279206f7468657220646f63756d656e747320617420616e792074696d652e20497420697320696e617070726f70726961746520746f2075736520496e7465726e65742d447261667473206173207265666572656e6365206d6174657269616c206f7220746f2063697465207468656d206f74686572207468616e206173202fe2809c776f726b20696e2070726f67496e7465726e65742d4472616674732061726520647261667420646f63756d656e74732076616c696420666f722061206d6178696d756d206f6620736978206d6f6e74687320616e64206d617920626520757064617465642c207265706c616365642c206f72206f62736f6c65746564206279206f7468657220646f63756d656e747320617420616e792074696d652e20497420697320696e617070726f70726961746520746f2075736520496e7465726e65742d447261667473206173207265666572656e6365206d6174657269616c206f7220746f2063697465207468656d206f74686572207468616e206173202fe2809c776f726b20696e2070726f67496e7465726e65742d4472616674732061726520647261667420646f63756d656e74732076616c696420666f722061206d6178696d756d206f6620736978206d
|
||||
Ciphertext = 64a0861575861af460f062c79be643bd5e805cfd345cf389f108670ac76c8cb24c6cfc18755d43eea09ee94e382d26b0bdb7b73c321b0100d4f03b7f355894cf332f830e710b97ce98c8a84abd0b948114ad176e008d33bd60f982b1ff37c8559797a06ef4f0ef61c186324e2b3506383606907b6a7c02b0f9f6157b53c867e4b9166c767b804d46a59b5216cde7a4e99040c5a40433225ee282a1b0a06c523eaf4534d7f83fa1155b0047718cbc546a0d072b04b3564eea1b422273f548271a0bb2316053fa76991955ebd63159434ecebb4e466dae5a1073a6727627097a1049e617d91d361094fa68f0ff77987130305beaba2eda04df997b714d6c6f2c299da65ba25e6a85842bf0440fd98a9a2266b061c4b3a13327c090f9a0789f58aad805275e4378a525f19232bfbfb749ede38480f405cf43ec2f1f8619ebcbc80a89e92a859c7911e674977ab17d4a7126a6b8a477358ff14a344d276ef6e504e10268ac3619fcf90c2d6c03fc2e3d1f290d9bf26c1fa1495dd8f97eec6229a55c2354e4524143551a5cc370a1c622c9390530cff21c3e1ed50c5e3daf97518ccce34156bdbd7eafab8bd417aef25c6c927301731bd319d247a1d5c3186ed10bfd9a7a24bac30e3e4503ed9204154d338b79ea276e7058e7f20f4d4fd1ac93d63f611af7b6d006c2a72add0eedc497b19cb30a198816664f0da00155f2e2d6ac61045b296d614301e0ad4983308028850dd4feffe3a8163970306e4047f5a165cb4befbc129729cd2e286e837e9b606486d402acc3dec5bf8b92387f6e486f2140
|
||||
|
||||
Cipher = chacha20-poly1305
|
||||
Key = 1c9240a5eb55d38af333888604f6b5f0473917c1402b80099dca5cbc207075c0
|
||||
IV = ff000000000102030405060708
|
||||
AAD = f33388860000000000004e91
|
||||
Tag = e0723bce23528ce6ccb10ff9627038bf
|
||||
Plaintext = 496e7465726e65742d4472616674732061726520647261667420646f63756d656e74732076616c696420666f722061206d6178696d756d206f6620736978206d6f6e74687320616e64206d617920626520757064617465642c207265706c616365642c206f72206f62736f6c65746564206279206f7468657220646f63756d656e747320617420616e792074696d652e20497420697320696e617070726f70726961746520746f2075736520496e7465726e65742d447261667473206173207265666572656e6365206d6174657269616c206f7220746f2063697465207468656d206f74686572207468616e206173202fe2809c776f726b20696e2070726f67496e7465726e65742d4472616674732061726520647261667420646f63756d656e74732076616c696420666f722061206d6178696d756d206f6620736978206d6f6e74687320616e64206d617920626520757064617465642c207265706c616365642c206f72206f62736f6c65746564206279206f7468657220646f63756d656e747320617420616e792074696d652e20497420697320696e617070726f70726961746520746f2075736520496e7465726e65742d447261667473206173207265666572656e6365206d6174657269616c206f7220746f2063697465207468656d206f74686572207468616e206173202fe2809c776f726b20696e2070726f67496e7465726e65742d4472616674732061726520647261667420646f63756d656e74732076616c696420666f722061206d6178696d756d206f6620736978206d
|
||||
Ciphertext = 64a0861575861af460f062c79be643bd5e805cfd345cf389f108670ac76c8cb24c6cfc18755d43eea09ee94e382d26b0bdb7b73c321b0100d4f03b7f355894cf332f830e710b97ce98c8a84abd0b948114ad176e008d33bd60f982b1ff37c8559797a06ef4f0ef61c186324e2b3506383606907b6a7c02b0f9f6157b53c867e4b9166c767b804d46a59b5216cde7a4e99040c5a40433225ee282a1b0a06c523eaf4534d7f83fa1155b0047718cbc546a0d072b04b3564eea1b422273f548271a0bb2316053fa76991955ebd63159434ecebb4e466dae5a1073a6727627097a1049e617d91d361094fa68f0ff77987130305beaba2eda04df997b714d6c6f2c299da65ba25e6a85842bf0440fd98a9a2266b061c4b3a13327c090f9a0789f58aad805275e4378a525f19232bfbfb749ede38480f405cf43ec2f1f8619ebcbc80a89e92a859c7911e674977ab17d4a7126a6b8a477358ff14a344d276ef6e504e10268ac3619fcf90c2d6c03fc2e3d1f290d9bf26c1fa1495dd8f97eec6229a55c2354e4524143551a5cc370a1c622c9390530cff21c3e1ed50c5e3daf97518ccce34156bdbd7eafab8bd417aef25c6c927301731bd319d247a1d5c3186ed10bfd9a7a24bac30e3e4503ed9204154d338b79ea276e7058e7f20f4d4fd1ac93d63f611af7b6d006c2a72add0eedc497b19cb30a198816664f0da00155f2e2d6ac61045b296d614301e0ad4983308028850dd4feffe3a8163970306e4047f5a165cb4befbc129729cd2e286e837e9b606486d402acc3dec5bf8b92387f6e486f2140
|
||||
Result = INVALID_IV_LENGTH
|
||||
@@ -0,0 +1,107 @@
|
||||
#
|
||||
# Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
# this file except in compliance with the License. You can obtain a copy
|
||||
# in the file LICENSE in the source distribution or at
|
||||
# https://www.openssl.org/source/license.html
|
||||
|
||||
# A valid set of RC2 test vectors could not be found for all RC2 modes - the
|
||||
# following values were generated using the deprecated cipher code, in order to
|
||||
# confirm that the new provider code is equivalent.
|
||||
Title = RC2 Test vectors
|
||||
|
||||
Cipher = RC2-ECB
|
||||
Key = 0000000000000000
|
||||
Plaintext = 000102030405060708090A0B0C0D0E0F
|
||||
Ciphertext = a4085a9f3e710563ae3b1e8c4339122b
|
||||
|
||||
Cipher = RC2-ECB
|
||||
Key = 0000000000000000
|
||||
KeyBits = 63
|
||||
Plaintext = 000102030405060708090A0B0C0D0E0F
|
||||
Ciphertext = b406b9037baf2d86982af542e6d70b13
|
||||
|
||||
Cipher = RC2-CBC
|
||||
Key = 0000000000000000
|
||||
IV = 0000000000000000
|
||||
Plaintext = 000102030405060708090A0B0C0D0E0F
|
||||
Ciphertext = a4085a9f3e710563d1091a1552ba8962
|
||||
|
||||
Cipher = RC2-CBC
|
||||
Key = 0000000000000000
|
||||
KeyBits = 63
|
||||
IV = 0000000000000000
|
||||
Plaintext = 000102030405060708090A0B0C0D0E0F
|
||||
Ciphertext = b406b9037baf2d866614ef5e55e95b8d
|
||||
|
||||
Cipher = RC2-40-CBC
|
||||
Key = 0000000000
|
||||
IV = 0000000000000000
|
||||
Plaintext = 0102030405060708
|
||||
Ciphertext = 61ae28bcf59d1f6f
|
||||
|
||||
Cipher = RC2-40-CBC
|
||||
Key = 0000000000
|
||||
KeyBits = 63
|
||||
IV = 0000000000000000
|
||||
Plaintext = 0102030405060708
|
||||
Ciphertext = c1d8e65290b2f06d
|
||||
|
||||
Cipher = RC2-40-CBC
|
||||
Key = 000000000001
|
||||
IV = 0000000000000000
|
||||
Plaintext = 0102030405060708
|
||||
Ciphertext = b3ddf36b5c81b0db
|
||||
|
||||
Cipher = RC2-64-CBC
|
||||
Key = 0000000000000000
|
||||
IV = 0000000000000000
|
||||
Plaintext = 0102030405060708
|
||||
Ciphertext = 191d1abf767bfbe7
|
||||
|
||||
Cipher = RC2-64-CBC
|
||||
Key = 0000000000000000
|
||||
KeyBits = 63
|
||||
IV = 0000000000000000
|
||||
Plaintext = 0102030405060708
|
||||
Ciphertext = 191d1abf767bfbe7
|
||||
|
||||
Cipher = RC2-CFB
|
||||
Key = 0000000000000000
|
||||
IV = 0000000000000000
|
||||
Plaintext = 000102030405060708090A0B0C0D0E0F
|
||||
Ciphertext = 81b5cc4d43119e987a2b526ea152f3fe
|
||||
|
||||
Cipher = RC2-CFB
|
||||
Key = 0000000000000000
|
||||
KeyBits = 63
|
||||
IV = 0000000000000000
|
||||
Plaintext = 000102030405060708090A0B0C0D0E0F
|
||||
Ciphertext = ebb671fa972288f87cb1810b91f2ae39
|
||||
|
||||
Cipher = RC2-OFB
|
||||
Key = 0000000000000000
|
||||
IV = 0000000000000000
|
||||
Plaintext = 000102030405060708090A0B0C0D0E0F
|
||||
Ciphertext = 81b5cc4d43119e9849bdb7ef7fb35eb7
|
||||
|
||||
Cipher = RC2-OFB
|
||||
Key = 0000000000000000
|
||||
IV = 0000000000000000
|
||||
KeyBits = 63
|
||||
Plaintext = 000102030405060708090A0B0C0D0E0F
|
||||
Ciphertext = ebb671fa972288f8f8587d8069d61d58
|
||||
|
||||
Cipher = RC2-OFB
|
||||
Key = 0000000000000000
|
||||
IV = 000000000000000000
|
||||
Plaintext = 000102030405060708090A0B0C0D0E0F
|
||||
Result = INVALID_IV_LENGTH
|
||||
|
||||
#Variable key length is allowed for RC2
|
||||
Cipher = RC2-OFB
|
||||
Key = 0000000000000000000000000000000000
|
||||
IV = 0000000000000000
|
||||
Plaintext = 000102030405060708090A0B0C0D0E0F
|
||||
Ciphertext = 1df8d70bb9c66ffc37869d8ed80d796b
|
||||
@@ -0,0 +1,62 @@
|
||||
#
|
||||
# Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
# this file except in compliance with the License. You can obtain a copy
|
||||
# in the file LICENSE in the source distribution or at
|
||||
# https://www.openssl.org/source/license.html
|
||||
|
||||
Title = RC4 tests
|
||||
|
||||
Cipher = RC4
|
||||
Key = 0123456789abcdef0123456789abcdef
|
||||
Plaintext = 0123456789abcdef
|
||||
Ciphertext = 75b7878099e0c596
|
||||
|
||||
Cipher = RC4
|
||||
Key = 0123456789abcdef0123456789abcdef
|
||||
Plaintext = 0000000000000000
|
||||
Ciphertext = 7494c2e7104b0879
|
||||
|
||||
Cipher = RC4
|
||||
Key = 00000000000000000000000000000000
|
||||
Plaintext = 0000000000000000
|
||||
Ciphertext = de188941a3375d3a
|
||||
|
||||
Cipher = RC4
|
||||
Key = ef012345ef012345ef012345ef012345
|
||||
Plaintext = 0000000000000000000000000000000000000000
|
||||
Ciphertext = d6a141a7ec3c38dfbd615a1162e1c7ba36b67858
|
||||
|
||||
Cipher = RC4
|
||||
Key = 0123456789abcdef0123456789abcdef
|
||||
Plaintext = 123456789ABCDEF0123456789ABCDEF0123456789ABCDEF012345678
|
||||
Ciphertext = 66a0949f8af7d6891f7f832ba833c00c892ebe30143ce28740011ecf
|
||||
|
||||
Cipher = RC4
|
||||
Key = ef012345ef012345ef012345ef012345
|
||||
Plaintext = 00000000000000000000
|
||||
Ciphertext = d6a141a7ec3c38dfbd61
|
||||
|
||||
Title = RC4 tests (From RFC6229)
|
||||
|
||||
Cipher = RC4-40
|
||||
Key = 0102030405
|
||||
Plaintext = 00000000000000000000000000000000
|
||||
Ciphertext = b2396305f03dc027ccc3524a0a1118a8
|
||||
|
||||
Cipher = RC4-40
|
||||
Key = 833222772a
|
||||
Plaintext = 00000000000000000000000000000000
|
||||
Ciphertext = 80ad97bdc973df8a2e879e92a497efda
|
||||
|
||||
Cipher = RC4
|
||||
Key = 0102030405060708090a0b0c0d0e0f10
|
||||
Plaintext = 00000000000000000000000000000000
|
||||
Ciphertext = 9ac7cc9a609d1ef7b2932899cde41b97
|
||||
|
||||
Cipher = RC4
|
||||
Key = ebb46227c6cc8b37641910833222772a
|
||||
Plaintext = 00000000000000000000000000000000
|
||||
Ciphertext = 720c94b63edf44e131d950ca211a5a30
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
#
|
||||
# Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
# this file except in compliance with the License. You can obtain a copy
|
||||
# in the file LICENSE in the source distribution or at
|
||||
# https://www.openssl.org/source/license.html
|
||||
|
||||
#The following tests were generated using legacy code, to ensure that the
|
||||
#provider ciphers have identical results.
|
||||
Title = RC5 Tests
|
||||
|
||||
Cipher = RC5-ECB
|
||||
Key = 00000000000000000000000000000000
|
||||
Plaintext = 0000000000000000
|
||||
Ciphertext = 21a5dbee154b8f6d
|
||||
|
||||
Cipher = RC5-ECB
|
||||
Key = 00000000000000000000000000000000
|
||||
Plaintext = 000102030405060708090A0B0C0D0E0F
|
||||
Ciphertext = d9d37019aec1161b27d7ad56b21f0f42
|
||||
|
||||
Cipher = RC5-CBC
|
||||
Key = 00000000000000000000000000000000
|
||||
IV = 0000000000000000
|
||||
Plaintext = 0000000000000000
|
||||
Ciphertext = 21a5dbee154b8f6d
|
||||
|
||||
Cipher = RC5-CBC
|
||||
Key = 0102030405060708090A0B0C0D0E0F10
|
||||
IV = 0102030405060708
|
||||
Plaintext = 000102030405060708090A0B0C0D0E0F
|
||||
Ciphertext = eeebae12d768ac9e5b3d6072a9c76c65
|
||||
|
||||
Cipher = RC5-OFB
|
||||
Key = 00000000000000000000000000000000
|
||||
IV = 0000000000000000
|
||||
Plaintext = 0000000000000000
|
||||
Ciphertext = 21a5dbee154b8f6d
|
||||
|
||||
Cipher = RC5-OFB
|
||||
Key = 0102030405060708090A0B0C0D0E0F10
|
||||
IV = 0102030405060708
|
||||
Plaintext = 000102030405060708090A0B0C0D0E0F
|
||||
Ciphertext = c0ad101b40fc7ffdfc386ea5ecf458b7
|
||||
|
||||
Cipher = RC5-CFB
|
||||
Key = 00000000000000000000000000000000
|
||||
IV = 0000000000000000
|
||||
Plaintext = 0000000000000000
|
||||
Ciphertext = 21a5dbee154b8f6d
|
||||
|
||||
Cipher = RC5-CFB
|
||||
Key = 0102030405060708090A0B0C0D0E0F10
|
||||
IV = 0102030405060708
|
||||
Plaintext = 000102030405060708090A0B0C0D0E0F
|
||||
Ciphertext = c0ad101b40fc7ffdeb97c6173bf2987e
|
||||
|
||||
Cipher = RC5-CFB
|
||||
Key = 0102030405060708090A0B0C0D0E0F10
|
||||
IV = 0102030405060708
|
||||
Rounds = 8
|
||||
Plaintext = 000102030405060708090A0B0C0D0E0F
|
||||
Ciphertext = 439945301dfa830885ac2f3cf5e61d0e
|
||||
|
||||
Cipher = RC5-CFB
|
||||
Key = 0102030405060708090A0B0C0D0E0F10
|
||||
IV = 0102030405060708
|
||||
Rounds = 16
|
||||
Plaintext = 000102030405060708090A0B0C0D0E0F
|
||||
Ciphertext = 5ad80530f4a19e622d03cd4f2b165730
|
||||
|
||||
#Bad rounds
|
||||
Cipher = RC5-CFB
|
||||
Key = 0102030405060708090A0B0C0D0E0F10
|
||||
IV = 0102030405060708
|
||||
Rounds = 9
|
||||
Plaintext = 000102030405060708090A0B0C0D0E0F
|
||||
Result = INVALID_ROUNDS
|
||||
|
||||
#bigger key
|
||||
Cipher = RC5-CFB
|
||||
Key = 0102030405060708090A0B0C0D0E0F101213141516
|
||||
IV = 0102030405060708
|
||||
Plaintext = 000102030405060708090A0B0C0D0E0F
|
||||
Ciphertext = b3724d2d9d1b9285e1338fd266c2277d
|
||||
@@ -20,60 +20,105 @@ use lib srctop_dir('Configurations');
|
||||
use lib bldtop_dir('.');
|
||||
use platform;
|
||||
|
||||
my @types = ( "digest", "cipher" );
|
||||
my $no_fips = disabled('fips') || ($ENV{NO_FIPS} // 0);
|
||||
|
||||
plan tests => 2 + 16 * scalar(@types);
|
||||
my @types = ( "digest", "cipher" );
|
||||
|
||||
$ENV{OPENSSL_MODULES} = bldtop_dir("providers");
|
||||
$ENV{OPENSSL_CONF_INCLUDE} = bldtop_dir("providers");
|
||||
|
||||
my $infile = bldtop_file('providers', platform->dso('fips'));
|
||||
ok(run(app(['openssl', 'fipsinstall', '-out', bldtop_file('providers', 'fipsinstall.conf'),
|
||||
'-module', $infile,
|
||||
'-provider_name', 'fips', '-mac_name', 'HMAC',
|
||||
'-macopt', 'digest:SHA256', '-macopt', 'hexkey:00',
|
||||
'-section_name', 'fips_sect'])), "fipinstall");
|
||||
my @setups = ();
|
||||
my @testdata = (
|
||||
{ config => srctop_file("test", "default.cnf"),
|
||||
providers => [ 'default' ],
|
||||
tests => [ { providers => [] },
|
||||
{ },
|
||||
{ args => [ '-property', 'default=yes' ],
|
||||
message => 'using property "default=yes"' },
|
||||
{ args => [ '-property', 'fips=no' ],
|
||||
message => 'using property "fips=no"' },
|
||||
{ args => [ '-property', 'default=no', '-fetchfail' ],
|
||||
message =>
|
||||
'using property "default=no" is expected to fail' },
|
||||
{ args => [ '-property', 'fips=yes', '-fetchfail' ],
|
||||
message =>
|
||||
'using property "fips=yes" is expected to fail' } ] }
|
||||
);
|
||||
|
||||
unless ($no_fips) {
|
||||
push @setups, {
|
||||
cmd => app(['openssl', 'fipsinstall',
|
||||
'-out', bldtop_file('providers', 'fipsinstall.conf'),
|
||||
'-module', bldtop_file('providers', platform->dso('fips')),
|
||||
'-provider_name', 'fips', '-mac_name', 'HMAC',
|
||||
'-macopt', 'digest:SHA256', '-macopt', 'hexkey:00',
|
||||
'-section_name', 'fips_sect']),
|
||||
message => "fipinstall"
|
||||
};
|
||||
push @testdata, (
|
||||
{ config => srctop_file("test", "fips.cnf"),
|
||||
providers => [ 'fips' ],
|
||||
tests => [
|
||||
{ args => [ '-property', '' ] },
|
||||
{ args => [ '-property', 'fips=yes' ],
|
||||
message => 'using property "fips=yes"' },
|
||||
{ args => [ '-property', 'default=no' ],
|
||||
message => 'using property "default = no"' },
|
||||
{ args => [ '-property', 'default=yes', '-fetchfail' ],
|
||||
message =>
|
||||
'using property "default=yes" is expected to fail' },
|
||||
{ args => [ '-property', 'fips=no', '-fetchfail' ],
|
||||
message =>
|
||||
'using property "fips=no" is expected to fail' } ] },
|
||||
{ config => srctop_file("test", "default-and-fips.cnf"),
|
||||
providers => [ 'default', 'fips' ],
|
||||
tests => [
|
||||
{ args => [ '-property', '' ] },
|
||||
{ args => [ '-property', 'default=no' ],
|
||||
message => 'using property "default=no"' },
|
||||
{ args => [ '-property', 'default=yes' ],
|
||||
message => 'using property "default=yes"' },
|
||||
{ args => [ '-property', 'fips=no' ],
|
||||
message => 'using property "fips=no"' },
|
||||
{ args => [ '-property', 'fips=yes' ],
|
||||
message => 'using property "fips=yes"' } ] }
|
||||
);
|
||||
}
|
||||
|
||||
my $testcount = 0;
|
||||
foreach (@testdata) {
|
||||
$testcount += scalar @{$_->{tests}};
|
||||
}
|
||||
|
||||
plan tests => 1 + scalar @setups + $testcount * scalar(@types);
|
||||
|
||||
# Do implicit fetch using the default context
|
||||
ok(run(test(["evp_fetch_prov_test", "-defaultctx"])),
|
||||
"running evp_fetch_prov_test using implicit fetch using the default libctx");
|
||||
"running evp_fetch_prov_test using the default libctx");
|
||||
|
||||
foreach my $alg(@types) {
|
||||
$ENV{OPENSSL_CONF} = srctop_file("test", "default.cnf");
|
||||
ok(run(test(["evp_fetch_prov_test", "-type", "$alg"])),
|
||||
"running evp_fetch_prov_test using implicit fetch using a created libctx");
|
||||
ok(run(test(["evp_fetch_prov_test", "-type", "$alg", "default"])),
|
||||
"running evp_fetch_prov_test with implicit fetch using default provider loaded");
|
||||
ok(run(test(["evp_fetch_prov_test", "-type", "$alg", "-property", "default=yes", "default"])),
|
||||
"running evp_fetch_prov_test with $alg fetch 'default=yes' using default provider loaded");
|
||||
ok(run(test(["evp_fetch_prov_test", "-type", "$alg", "-property", "fips=no", "default"])),
|
||||
"running evp_fetch_prov_test with $alg fetch 'fips=no' using default provider loaded");
|
||||
ok(run(test(["evp_fetch_prov_test", "-type", "$alg", "-property", "default=no", "-fetchfail", "default"])),
|
||||
"running evp_fetch_prov_test with $alg fetch 'default=no' using default provider loaded should fail");
|
||||
ok(run(test(["evp_fetch_prov_test", "-type", "$alg", "-property", "fips=yes", "-fetchfail", "default"])),
|
||||
"running evp_fetch_prov_test with $alg fetch 'fips=yes' using default provider loaded should fail");
|
||||
foreach my $setup (@setups) {
|
||||
ok(run($setup->{cmd}), $setup->{message});
|
||||
}
|
||||
|
||||
$ENV{OPENSSL_CONF} = srctop_file("test", "fips.cnf");
|
||||
ok(run(test(["evp_fetch_prov_test", "-type", "$alg", "-property", "", "fips"])),
|
||||
"running evp_fetch_prov_test with $alg fetch '' using loaded fips provider");
|
||||
ok(run(test(["evp_fetch_prov_test", "-type", "$alg", "-property", "fips=yes", "fips"])),
|
||||
"running evp_fetch_prov_test with $alg fetch 'fips=yes' using loaded fips provider");
|
||||
ok(run(test(["evp_fetch_prov_test", "-type", "$alg", "-property", "default=no", "fips"])),
|
||||
"running evp_fetch_prov_test with $alg fetch 'default=no' using loaded fips provider");
|
||||
ok(run(test(["evp_fetch_prov_test", "-type", "$alg", "-property", "default=yes", "-fetchfail", "fips"])),
|
||||
"running evp_fetch_prov_test with $alg fetch 'default=yes' using loaded fips provider should fail");
|
||||
ok(run(test(["evp_fetch_prov_test", "-type", "$alg", "-property", "fips=no", "-fetchfail", "fips"])),
|
||||
"running evp_fetch_prov_test with $alg fetch 'fips=no' using loaded fips provider should fail");
|
||||
foreach my $alg (@types) {
|
||||
foreach my $testcase (@testdata) {
|
||||
$ENV{OPENSSL_CONF} = $testcase->{config};
|
||||
foreach my $test (@{$testcase->{tests}}) {
|
||||
my @testproviders =
|
||||
@{ $test->{providers} // $testcase->{providers} };
|
||||
my $testprovstr = @testproviders
|
||||
? ' and loaded providers ' . join(' & ',
|
||||
map { "'$_'" } @testproviders)
|
||||
: '';
|
||||
my @testargs = @{ $test->{args} // [] };
|
||||
my $testmsg =
|
||||
defined $test->{message} ? ' '.$test->{message} : '';
|
||||
|
||||
$ENV{OPENSSL_CONF} = srctop_file("test", "default-and-fips.cnf");
|
||||
ok(run(test(["evp_fetch_prov_test", "-type", "$alg", "-property", "", "default", "fips"])),
|
||||
"running evp_fetch_prov_test with $alg fetch '' using loaded default & fips provider");
|
||||
ok(run(test(["evp_fetch_prov_test", "-type", "$alg", "-property", "default=no", "default", "fips"])),
|
||||
"running evp_fetch_prov_test with $alg fetch 'default=no' using loaded default & fips provider");
|
||||
ok(run(test(["evp_fetch_prov_test", "-type", "$alg", "-property", "default=yes", "default", "fips"])),
|
||||
"running evp_fetch_prov_test with $alg fetch 'default=yes' using loaded default & fips provider");
|
||||
ok(run(test(["evp_fetch_prov_test", "-type", "$alg", "-property", "fips=no", "default", "fips"])),
|
||||
"running evp_fetch_prov_test with $alg fetch 'fips=no' using loaded default & fips provider");
|
||||
ok(run(test(["evp_fetch_prov_test", "-type", "$alg", "-property", "fips=yes", "default", "fips"])),
|
||||
"running evp_fetch_prov_test with $alg fetch 'fips=yes' using loaded default & fips provider");
|
||||
}
|
||||
my $message =
|
||||
"running evp_fetch_prov_test with $alg$testprovstr$testmsg";
|
||||
|
||||
ok(run(test(["evp_fetch_prov_test", "-type", "$alg",
|
||||
@testargs, @testproviders])),
|
||||
$message);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
#! /usr/bin/env perl
|
||||
# Copyright 2007-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
# Copyright Nokia 2007-2019
|
||||
# Copyright Siemens AG 2015-2019
|
||||
#
|
||||
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
# this file except in compliance with the License. You can obtain a copy
|
||||
# in the file LICENSE in the source distribution or at
|
||||
# https://www.openssl.org/source/license.html
|
||||
|
||||
use strict;
|
||||
use OpenSSL::Test qw/:DEFAULT data_file/;
|
||||
use OpenSSL::Test::Utils;
|
||||
|
||||
setup("test_cmp_asn");
|
||||
|
||||
plan skip_all => "This test is not supported in a no-cmp build"
|
||||
if disabled("cmp");
|
||||
|
||||
plan tests => 1;
|
||||
|
||||
ok(run(test(["cmp_asn_test"])));
|
||||
@@ -0,0 +1,22 @@
|
||||
#! /usr/bin/env perl
|
||||
# Copyright 2007-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
# Copyright Nokia 2007-2019
|
||||
# Copyright Siemens AG 2015-2019
|
||||
#
|
||||
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
# this file except in compliance with the License. You can obtain a copy
|
||||
# in the file LICENSE in the source distribution or at
|
||||
# https://www.openssl.org/source/license.html
|
||||
|
||||
|
||||
use strict;
|
||||
use OpenSSL::Test; # get 'plan'
|
||||
use OpenSSL::Test::Simple;
|
||||
use OpenSSL::Test::Utils;
|
||||
|
||||
setup("test_cmp_ctx");
|
||||
|
||||
plan skip_all => "This test is not supported in a no-cmp build"
|
||||
if disabled("cmp");
|
||||
|
||||
simple_test("test_cmp_ctx", "cmp_ctx_test", "cmp_ctx");
|
||||
@@ -26,7 +26,7 @@ int setup_tests(void)
|
||||
return 1;
|
||||
}
|
||||
#else
|
||||
# include "rsa_locl.h"
|
||||
# include "rsa_local.h"
|
||||
# include <openssl/rsa.h>
|
||||
|
||||
/* taken from RSA2 cavs data */
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <openssl/opensslv.h>
|
||||
#include <openssl/ssl.h>
|
||||
#include <openssl/ossl_typ.h>
|
||||
#include "internal/dso_conf.h"
|
||||
#include <openssl/types.h>
|
||||
#include "crypto/dso_conf.h"
|
||||
|
||||
typedef void DSO;
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
#include <openssl/bio.h>
|
||||
#include "testutil.h"
|
||||
#include "internal/siphash.h"
|
||||
#include "crypto/siphash.h"
|
||||
#include "../crypto/siphash/siphash_local.h"
|
||||
#include "internal/nelem.h"
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#ifndef OPENSSL_NO_SM2
|
||||
|
||||
# include "internal/sm2.h"
|
||||
# include "crypto/sm2.h"
|
||||
|
||||
static RAND_METHOD fake_rand;
|
||||
static const RAND_METHOD *saved_rand;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include "testutil.h"
|
||||
|
||||
#ifndef OPENSSL_NO_SM4
|
||||
# include "internal/sm4.h"
|
||||
# include "crypto/sm4.h"
|
||||
|
||||
static int test_sm4_ecb(void)
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <openssl/crypto.h>
|
||||
#include <internal/nelem.h>
|
||||
|
||||
#include "internal/sparse_array.h"
|
||||
#include "crypto/sparse_array.h"
|
||||
#include "testutil.h"
|
||||
|
||||
/* The macros below generate unused functions which error out one of the clang
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <openssl/ssl.h>
|
||||
#include "testutil.h"
|
||||
#include "internal/nelem.h"
|
||||
#include "../ssl/ssl_locl.h"
|
||||
#include "../ssl/ssl_local.h"
|
||||
#include "../ssl/ssl_cert_table.h"
|
||||
|
||||
#define test_cert_table(nid, amask, idx) \
|
||||
|
||||
+3
-3
@@ -7,8 +7,8 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_SSL_TEST_CTX_H
|
||||
#define HEADER_SSL_TEST_CTX_H
|
||||
#ifndef OSSL_TEST_SSL_TEST_CTX_H
|
||||
#define OSSL_TEST_SSL_TEST_CTX_H
|
||||
|
||||
#include <openssl/conf.h>
|
||||
#include <openssl/ssl.h>
|
||||
@@ -250,4 +250,4 @@ SSL_TEST_CTX *SSL_TEST_CTX_new(void);
|
||||
|
||||
void SSL_TEST_CTX_free(SSL_TEST_CTX *ctx);
|
||||
|
||||
#endif /* HEADER_SSL_TEST_CTX_H */
|
||||
#endif /* OSSL_TEST_SSL_TEST_CTX_H */
|
||||
+1
-1
@@ -25,7 +25,7 @@
|
||||
#include "testutil/output.h"
|
||||
#include "internal/nelem.h"
|
||||
#include "internal/ktls.h"
|
||||
#include "../ssl/ssl_locl.h"
|
||||
#include "../ssl/ssl_local.h"
|
||||
|
||||
#ifndef OPENSSL_NO_TLS1_3
|
||||
|
||||
|
||||
+3
-3
@@ -7,8 +7,8 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_SSLTESTLIB_H
|
||||
# define HEADER_SSLTESTLIB_H
|
||||
#ifndef OSSL_TEST_SSLTESTLIB_H
|
||||
# define OSSL_TEST_SSLTESTLIB_H
|
||||
|
||||
# include <openssl/ssl.h>
|
||||
|
||||
@@ -56,4 +56,4 @@ typedef struct mempacket_st MEMPACKET;
|
||||
|
||||
DEFINE_STACK_OF(MEMPACKET)
|
||||
|
||||
#endif /* HEADER_SSLTESTLIB_H */
|
||||
#endif /* OSSL_TEST_SSLTESTLIB_H */
|
||||
+3
-3
@@ -7,8 +7,8 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_TESTUTIL_H
|
||||
# define HEADER_TESTUTIL_H
|
||||
#ifndef OSSL_TESTUTIL_H
|
||||
# define OSSL_TESTUTIL_H
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
@@ -548,4 +548,4 @@ void test_random_seed(uint32_t sd);
|
||||
/* Create a file path from a directory and a filename */
|
||||
char *test_mk_file_path(const char *dir, const char *file);
|
||||
|
||||
#endif /* HEADER_TESTUTIL_H */
|
||||
#endif /* OSSL_TESTUTIL_H */
|
||||
@@ -7,8 +7,8 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_TU_OUTPUT_H
|
||||
# define HEADER_TU_OUTPUT_H
|
||||
#ifndef OSSL_TESTUTIL_OUTPUT_H
|
||||
# define OSSL_TESTUTIL_OUTPUT_H
|
||||
|
||||
# include <stdarg.h>
|
||||
|
||||
@@ -53,4 +53,4 @@ int test_printf_stderr(const char *fmt, ...)
|
||||
# undef ossl_test__printf__
|
||||
# undef ossl_test__attr__
|
||||
|
||||
#endif /* HEADER_TU_OUTPUT_H */
|
||||
#endif /* OSSL_TESTUTIL_OUTPUT_H */
|
||||
@@ -72,7 +72,7 @@ static char *strip_spaces(char *p)
|
||||
/* Skip over leading spaces */
|
||||
while (*p && isspace((unsigned char)*p))
|
||||
p++;
|
||||
if (!*p)
|
||||
if (*p == '\0')
|
||||
return NULL;
|
||||
|
||||
for (q = p + strlen(p) - 1; q != p && isspace((unsigned char)*q); )
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
#include <openssl/ssl.h>
|
||||
#include <openssl/evp.h>
|
||||
#include "../ssl/ssl_locl.h"
|
||||
#include "../ssl/record/record_locl.h"
|
||||
#include "../ssl/ssl_local.h"
|
||||
#include "../ssl/record/record_local.h"
|
||||
#include "internal/nelem.h"
|
||||
#include "testutil.h"
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <openssl/ssl.h>
|
||||
#include <openssl/evp.h>
|
||||
|
||||
#include "../ssl/ssl_locl.h"
|
||||
#include "../ssl/ssl_local.h"
|
||||
#include "testutil.h"
|
||||
|
||||
#define IVLEN 12
|
||||
|
||||
Reference in New Issue
Block a user