Update pre10

This commit is contained in:
2018-09-09 01:28:51 +09:00
parent 6ed909873d
commit a8ed1c4cb9
27557 changed files with 21959 additions and 8607 deletions
+1 -1
View File
@@ -364,7 +364,7 @@ INCLUDE_MAIN___test_libtestutil_OLB = /INCLUDE=MAIN
INCLUDE[ciphername_test]=../include
DEPEND[ciphername_test]=../libcrypto ../libssl libtestutil.a
SOURCE[servername_test]=servername_test.c
SOURCE[servername_test]=servername_test.c ssltestlib.c
INCLUDE[servername_test]=../include
DEPEND[servername_test]=../libcrypto ../libssl libtestutil.a
+138
View File
@@ -16,6 +16,7 @@
#include <openssl/evp.h>
#include <openssl/rsa.h>
#include <openssl/x509.h>
#include <openssl/pem.h>
#include "testutil.h"
#include "internal/nelem.h"
#include "internal/evp_int.h"
@@ -356,6 +357,50 @@ end:
return ret;
}
static int test_EVP_Enveloped(void)
{
int ret = 0;
EVP_CIPHER_CTX *ctx = NULL;
EVP_PKEY *keypair = NULL;
unsigned char *kek = NULL;
unsigned char iv[EVP_MAX_IV_LENGTH];
static const unsigned char msg[] = { 1, 2, 3, 4, 5, 6, 7, 8 };
int len, kek_len, ciphertext_len, plaintext_len;
unsigned char ciphertext[32], plaintext[16];
const EVP_CIPHER *type = EVP_aes_256_cbc();
if (!TEST_ptr(keypair = load_example_rsa_key())
|| !TEST_ptr(kek = OPENSSL_zalloc(EVP_PKEY_size(keypair)))
|| !TEST_ptr(ctx = EVP_CIPHER_CTX_new())
|| !TEST_true(EVP_SealInit(ctx, type, &kek, &kek_len, iv,
&keypair, 1))
|| !TEST_true(EVP_SealUpdate(ctx, ciphertext, &ciphertext_len,
msg, sizeof(msg)))
|| !TEST_true(EVP_SealFinal(ctx, ciphertext + ciphertext_len,
&len)))
goto err;
ciphertext_len += len;
if (!TEST_true(EVP_OpenInit(ctx, type, kek, kek_len, iv, keypair))
|| !TEST_true(EVP_OpenUpdate(ctx, plaintext, &plaintext_len,
ciphertext, ciphertext_len))
|| !TEST_true(EVP_OpenFinal(ctx, plaintext + plaintext_len, &len)))
goto err;
plaintext_len += len;
if (!TEST_mem_eq(msg, sizeof(msg), plaintext, plaintext_len))
goto err;
ret = 1;
err:
OPENSSL_free(kek);
EVP_PKEY_free(keypair);
EVP_CIPHER_CTX_free(ctx);
return ret;
}
static int test_EVP_DigestSignInit(void)
{
int ret = 0;
@@ -479,6 +524,84 @@ static int test_EVP_PKCS82PKEY(void)
#ifndef OPENSSL_NO_SM2
static int test_EVP_SM2_verify(void)
{
/* From https://tools.ietf.org/html/draft-shen-sm2-ecdsa-02#appendix-A */
const char *pubkey =
"-----BEGIN PUBLIC KEY-----\n"
"MIIBMzCB7AYHKoZIzj0CATCB4AIBATAsBgcqhkjOPQEBAiEAhULWnkwETxjouSQ1\n"
"v2/33kVyg5FcRVF9ci7biwjx38MwRAQgeHlotPoyw/0kF4Quc7v+/y88hItoMdfg\n"
"7GUiizk35JgEIGPkxtOyOwyEnPhCQUhL/kj2HVmlsWugbm4S0donxSSaBEEEQh3r\n"
"1hti6rZ0ZDTrw8wxXjIiCzut1QvcTE5sFH/t1D0GgFEry7QsB9RzSdIVO3DE5df9\n"
"/L+jbqGoWEG55G4JogIhAIVC1p5MBE8Y6LkkNb9v990pdyBjBIVijVrnTufDLnm3\n"
"AgEBA0IABArkx3mKoPEZRxvuEYJb5GICu3nipYRElel8BP9N8lSKfAJA+I8c1OFj\n"
"Uqc8F7fxbwc1PlOhdtaEqf4Ma7eY6Fc=\n"
"-----END PUBLIC KEY-----\n";
const char *msg = "message digest";
const char *id = "ALICE123@YAHOO.COM";
const uint8_t signature[] = {
0x30, 0x44, 0x02, 0x20,
0x40, 0xF1, 0xEC, 0x59, 0xF7, 0x93, 0xD9, 0xF4, 0x9E, 0x09, 0xDC,
0xEF, 0x49, 0x13, 0x0D, 0x41, 0x94, 0xF7, 0x9F, 0xB1, 0xEE, 0xD2,
0xCA, 0xA5, 0x5B, 0xAC, 0xDB, 0x49, 0xC4, 0xE7, 0x55, 0xD1,
0x02, 0x20,
0x6F, 0xC6, 0xDA, 0xC3, 0x2C, 0x5D, 0x5C, 0xF1, 0x0C, 0x77, 0xDF,
0xB2, 0x0F, 0x7C, 0x2E, 0xB6, 0x67, 0xA4, 0x57, 0x87, 0x2F, 0xB0,
0x9E, 0xC5, 0x63, 0x27, 0xA6, 0x7E, 0xC7, 0xDE, 0xEB, 0xE7
};
int rc = 0;
BIO *bio = NULL;
EVP_PKEY *pkey = NULL;
EVP_MD_CTX *mctx = NULL;
EVP_PKEY_CTX *pctx = NULL;
bio = BIO_new_mem_buf(pubkey, strlen(pubkey));
if (!TEST_true(bio != NULL))
goto done;
pkey = PEM_read_bio_PUBKEY(bio, NULL, NULL, NULL);
if (!TEST_true(pkey != NULL))
goto done;
if (!TEST_true(EVP_PKEY_set_alias_type(pkey, EVP_PKEY_SM2)))
goto done;
if (!TEST_ptr(mctx = EVP_MD_CTX_new()))
goto done;
if (!TEST_ptr(pctx = EVP_PKEY_CTX_new(pkey, NULL)))
goto done;
if (!TEST_int_gt(EVP_PKEY_CTX_set1_id(pctx, (const uint8_t *)id,
strlen(id)), 0))
goto done;
EVP_MD_CTX_set_pkey_ctx(mctx, pctx);
if (!TEST_true(EVP_DigestVerifyInit(mctx, NULL, EVP_sm3(), NULL, pkey)))
goto done;
if (!TEST_true(EVP_DigestVerifyUpdate(mctx, msg, strlen(msg))))
goto done;
if (!TEST_true(EVP_DigestVerifyFinal(mctx, signature, sizeof(signature))))
goto done;
rc = 1;
done:
BIO_free(bio);
EVP_PKEY_free(pkey);
EVP_PKEY_CTX_free(pctx);
EVP_MD_CTX_free(mctx);
return rc;
}
static int test_EVP_SM2(void)
{
int ret = 0;
@@ -486,6 +609,7 @@ static int test_EVP_SM2(void)
EVP_PKEY *params = NULL;
EVP_PKEY_CTX *pctx = NULL;
EVP_PKEY_CTX *kctx = NULL;
EVP_PKEY_CTX *sctx = NULL;
size_t sig_len = 0;
unsigned char *sig = NULL;
EVP_MD_CTX *md_ctx = NULL;
@@ -498,6 +622,8 @@ static int test_EVP_SM2(void)
uint8_t plaintext[8];
size_t ptext_len = sizeof(plaintext);
uint8_t sm2_id[] = {1, 2, 3, 4, 'l', 'e', 't', 't', 'e', 'r'};
pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_EC, NULL);
if (!TEST_ptr(pctx))
goto done;
@@ -530,6 +656,15 @@ static int test_EVP_SM2(void)
if (!TEST_ptr(md_ctx_verify = EVP_MD_CTX_new()))
goto done;
if (!TEST_ptr(sctx = EVP_PKEY_CTX_new(pkey, NULL)))
goto done;
EVP_MD_CTX_set_pkey_ctx(md_ctx, sctx);
EVP_MD_CTX_set_pkey_ctx(md_ctx_verify, sctx);
if (!TEST_int_gt(EVP_PKEY_CTX_set1_id(sctx, sm2_id, sizeof(sm2_id)), 0))
goto done;
if (!TEST_true(EVP_DigestSignInit(md_ctx, NULL, EVP_sm3(), NULL, pkey)))
goto done;
@@ -587,6 +722,7 @@ static int test_EVP_SM2(void)
done:
EVP_PKEY_CTX_free(pctx);
EVP_PKEY_CTX_free(kctx);
EVP_PKEY_CTX_free(sctx);
EVP_PKEY_CTX_free(cctx);
EVP_PKEY_free(pkey);
EVP_PKEY_free(params);
@@ -781,12 +917,14 @@ int setup_tests(void)
{
ADD_TEST(test_EVP_DigestSignInit);
ADD_TEST(test_EVP_DigestVerifyInit);
ADD_TEST(test_EVP_Enveloped);
ADD_ALL_TESTS(test_d2i_AutoPrivateKey, OSSL_NELEM(keydata));
#ifndef OPENSSL_NO_EC
ADD_TEST(test_EVP_PKCS82PKEY);
#endif
#ifndef OPENSSL_NO_SM2
ADD_TEST(test_EVP_SM2);
ADD_TEST(test_EVP_SM2_verify);
#endif
ADD_ALL_TESTS(test_set_get_raw_keys, OSSL_NELEM(keys));
custom_pmeth = EVP_PKEY_meth_new(0xdefaced, 0);
+22 -8
View File
@@ -12,18 +12,31 @@
#include <openssl/pem.h>
#include "testutil.h"
#include "internal/nelem.h"
static const char raw[] = "hello world";
static const char encoded[] = "aGVsbG8gd29ybGQ=";
static const char pemtype[] = "PEMTESTDATA";
typedef struct {
const char *raw;
const char *encoded;
} TESTDATA;
static int test_b64(void)
static TESTDATA b64_pem_data[] = {
{ "hello world",
"aGVsbG8gd29ybGQ=" },
{ "a very ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong input",
"YSB2ZXJ5IG9vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29vb29uZyBpbnB1dA==" }
};
static const char *pemtype = "PEMTESTDATA";
static int test_b64(int idx)
{
BIO *b = BIO_new(BIO_s_mem());
char *name = NULL, *header = NULL;
unsigned char *data = NULL;
long len;
int ret = 0;
const char *raw = b64_pem_data[idx].raw;
const char *encoded = b64_pem_data[idx].encoded;
if (!TEST_ptr(b)
|| !TEST_true(BIO_printf(b, "-----BEGIN %s-----\n", pemtype))
@@ -32,9 +45,9 @@ static int test_b64(void)
|| !TEST_true(PEM_read_bio_ex(b, &name, &header, &data, &len,
PEM_FLAG_ONLY_B64)))
goto err;
if (!TEST_int_eq(memcmp(pemtype, name, sizeof(pemtype) - 1), 0)
|| !TEST_int_eq(len,sizeof(raw) - 1)
|| !TEST_int_eq(memcmp(data, raw, sizeof(raw) - 1), 0))
if (!TEST_int_eq(memcmp(pemtype, name, strlen(pemtype)), 0)
|| !TEST_int_eq(len, strlen(raw))
|| !TEST_int_eq(memcmp(data, raw, strlen(raw)), 0))
goto err;
ret = 1;
err:
@@ -51,6 +64,7 @@ static int test_invalid(void)
char *name = NULL, *header = NULL;
unsigned char *data = NULL;
long len;
const char *encoded = b64_pem_data[0].encoded;
if (!TEST_ptr(b)
|| !TEST_true(BIO_printf(b, "-----BEGIN %s-----\n", pemtype))
@@ -71,7 +85,7 @@ static int test_invalid(void)
int setup_tests(void)
{
ADD_TEST(test_b64);
ADD_ALL_TESTS(test_b64, OSSL_NELEM(b64_pem_data));
ADD_TEST(test_invalid);
return 1;
}
+2 -1
View File
@@ -15,7 +15,8 @@ use OpenSSL::Test qw/:DEFAULT data_file/;
setup("test_evp");
my @files = ( "evpciph.txt", "evpdigest.txt", "evpencod.txt", "evpkdf.txt",
"evpmac.txt", "evppbe.txt", "evppkey.txt", "evppkey_ecc.txt" );
"evpmac.txt", "evppbe.txt", "evppkey.txt", "evppkey_ecc.txt",
"evpcase.txt" );
plan tests => scalar(@files);
+54
View File
@@ -0,0 +1,54 @@
#
# Copyright 2018 The OpenSSL Project Authors. All Rights Reserved.
#
# Licensed under the OpenSSL license (the "License"). You may not use
# this file except in compliance with the License. You can obtain a copy
# 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.
# These tests exercise the case insensitive handling of object names.
# They are contrived
Title = Case insensitive AES tests
Cipher = Aes-128-eCb
Key = 2B7E151628AED2A6ABF7158809CF4F3C
Plaintext = 6BC1BEE22E409F96E93D7E117393172A
Ciphertext = 3AD77BB40D7A3660A89ECAF32466EF97
Cipher = AeS-128-cbC
Key = 2B7E151628AED2A6ABF7158809CF4F3C
IV = 73BED6B8E3C1743B7116E69E22229516
Plaintext = F69F2445DF4F9B17AD2B417BE66C3710
Ciphertext = 3FF1CAA1681FAC09120ECA307586E1A7
Cipher = aES-128-CTR
Key = AE6852F8121067CC4BF7A5765577F39E
IV = 00000030000000000000000000000001
Operation = ENCRYPT
Plaintext = 53696E676C6520626C6F636B206D7367
Ciphertext = E4095D4FB7A7B3792D6175A3261311B8
Cipher = AES-128-GcM
Key = 00000000000000000000000000000000
IV = 000000000000000000000000
AAD =
Tag = ab6e47d42cec13bdf53a67b21257bddf
Plaintext = 00000000000000000000000000000000
Ciphertext = 0388dace60b6a392f328c2b971b2fe78
Title = Case insensitive digest tests
Digest = Sha3-256
Input = ""
Output = A7FFC6F8BF1ED76651C14756A061D662F580FF4DE43B49FA82D80A4B80F8434A
Digest = shA512
Input = "abc"
Output = ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f
+36
View File
@@ -248,6 +248,42 @@ Title = SHA3
# NIST's test vectors
MAC = HMAC
Algorithm = SHA3-224
Input = "Sample message for keylen<blocklen"
Key = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b
Output = 332cfd59347fdb8e576e77260be4aba2d6dc53117b3bfb52c6d18c04
MAC = HMAC
Algorithm = SHA3-224
Input = "Sample message for keylen=blocklen"
Key = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f
Output = d8b733bcf66c644a12323d564e24dcf3fc75f231f3b67968359100c7
MAC = HMAC
Algorithm = SHA3-224
Input = "Sample message for keylen>blocklen"
Key = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaab
Output = 078695eecc227c636ad31d063a15dd05a7e819a66ec6d8de1e193e59
MAC = HMAC
Algorithm = SHA3-256
Input = "Sample message for keylen<blocklen"
Key = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
Output = 4fe8e202c4f058e8dddc23d8c34e467343e23555e24fc2f025d598f558f67205
MAC = HMAC
Algorithm = SHA3-256
Input = "Sample message for keylen=blocklen"
Key = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f8081828384858687
Output = 68b94e2e538a9be4103bebb5aa016d47961d4d1aa906061313b557f8af2c3faa
MAC = HMAC
Algorithm = SHA3-256
Input = "Sample message for keylen>blocklen"
Key = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7
Output = 9bcf2c238e235c3ce88404e813bd2f3a97185ac6f238c63d6229a00b07974258
MAC = HMAC
Algorithm = SHA3-384
Input = "Sample message for keylen<blocklen"
@@ -17286,6 +17286,8 @@ Derive=ALICE_cf_sect283k1
PeerKey=BOB_cf_sect283k1_PUB
Ctrl=ecdh_cofactor_mode:1
Result = DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title = Test keypair mismatches
@@ -623,12 +623,16 @@ Derive=BOB_cf_c2pnb163v1
PeerKey=MALICE_cf_c2pnb163v1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_c2pnb163v1
PeerKey=MALICE_cf_c2pnb163v1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=c2pnb163v2 curve tests
@@ -691,12 +695,16 @@ Derive=BOB_cf_c2pnb163v2
PeerKey=MALICE_cf_c2pnb163v2_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_c2pnb163v2
PeerKey=MALICE_cf_c2pnb163v2_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=c2pnb163v3 curve tests
@@ -759,12 +767,16 @@ Derive=BOB_cf_c2pnb163v3
PeerKey=MALICE_cf_c2pnb163v3_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_c2pnb163v3
PeerKey=MALICE_cf_c2pnb163v3_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=c2pnb176v1 curve tests
@@ -827,12 +839,16 @@ Derive=BOB_cf_c2pnb176v1
PeerKey=MALICE_cf_c2pnb176v1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_c2pnb176v1
PeerKey=MALICE_cf_c2pnb176v1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=c2pnb208w1 curve tests
@@ -897,12 +913,16 @@ Derive=BOB_cf_c2pnb208w1
PeerKey=MALICE_cf_c2pnb208w1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_c2pnb208w1
PeerKey=MALICE_cf_c2pnb208w1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=c2pnb272w1 curve tests
@@ -967,12 +987,16 @@ Derive=BOB_cf_c2pnb272w1
PeerKey=MALICE_cf_c2pnb272w1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_c2pnb272w1
PeerKey=MALICE_cf_c2pnb272w1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=c2pnb304w1 curve tests
@@ -1037,12 +1061,16 @@ Derive=BOB_cf_c2pnb304w1
PeerKey=MALICE_cf_c2pnb304w1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_c2pnb304w1
PeerKey=MALICE_cf_c2pnb304w1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=c2pnb368w1 curve tests
@@ -1110,12 +1138,16 @@ Derive=BOB_cf_c2pnb368w1
PeerKey=MALICE_cf_c2pnb368w1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_c2pnb368w1
PeerKey=MALICE_cf_c2pnb368w1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=c2tnb191v1 curve tests
@@ -1180,12 +1212,16 @@ Derive=BOB_cf_c2tnb191v1
PeerKey=MALICE_cf_c2tnb191v1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_c2tnb191v1
PeerKey=MALICE_cf_c2tnb191v1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=c2tnb191v2 curve tests
@@ -1250,12 +1286,16 @@ Derive=BOB_cf_c2tnb191v2
PeerKey=MALICE_cf_c2tnb191v2_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_c2tnb191v2
PeerKey=MALICE_cf_c2tnb191v2_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=c2tnb191v3 curve tests
@@ -1320,12 +1360,16 @@ Derive=BOB_cf_c2tnb191v3
PeerKey=MALICE_cf_c2tnb191v3_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_c2tnb191v3
PeerKey=MALICE_cf_c2tnb191v3_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=c2tnb239v1 curve tests
@@ -1390,12 +1434,16 @@ Derive=BOB_cf_c2tnb239v1
PeerKey=MALICE_cf_c2tnb239v1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_c2tnb239v1
PeerKey=MALICE_cf_c2tnb239v1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=c2tnb239v2 curve tests
@@ -1460,12 +1508,16 @@ Derive=BOB_cf_c2tnb239v2
PeerKey=MALICE_cf_c2tnb239v2_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_c2tnb239v2
PeerKey=MALICE_cf_c2tnb239v2_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=c2tnb239v3 curve tests
@@ -1530,12 +1582,16 @@ Derive=BOB_cf_c2tnb239v3
PeerKey=MALICE_cf_c2tnb239v3_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_c2tnb239v3
PeerKey=MALICE_cf_c2tnb239v3_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=c2tnb359v1 curve tests
@@ -1603,12 +1659,16 @@ Derive=BOB_cf_c2tnb359v1
PeerKey=MALICE_cf_c2tnb359v1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_c2tnb359v1
PeerKey=MALICE_cf_c2tnb359v1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=c2tnb431r1 curve tests
@@ -1676,12 +1736,16 @@ Derive=BOB_cf_c2tnb431r1
PeerKey=MALICE_cf_c2tnb431r1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_c2tnb431r1
PeerKey=MALICE_cf_c2tnb431r1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=prime192v1 curve tests
@@ -2057,12 +2121,16 @@ Derive=BOB_cf_secp112r2
PeerKey=MALICE_cf_secp112r2_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_secp112r2
PeerKey=MALICE_cf_secp112r2_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=secp128r1 curve tests
@@ -2158,12 +2226,16 @@ Derive=BOB_cf_secp128r2
PeerKey=MALICE_cf_secp128r2_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_secp128r2
PeerKey=MALICE_cf_secp128r2_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=secp160k1 curve tests
@@ -2579,12 +2651,16 @@ Derive=BOB_cf_sect113r1
PeerKey=MALICE_cf_sect113r1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_sect113r1
PeerKey=MALICE_cf_sect113r1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=sect113r2 curve tests
@@ -2644,12 +2720,16 @@ Derive=BOB_cf_sect113r2
PeerKey=MALICE_cf_sect113r2_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_sect113r2
PeerKey=MALICE_cf_sect113r2_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=sect131r1 curve tests
@@ -2712,12 +2792,16 @@ Derive=BOB_cf_sect131r1
PeerKey=MALICE_cf_sect131r1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_sect131r1
PeerKey=MALICE_cf_sect131r1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=sect131r2 curve tests
@@ -2780,12 +2864,16 @@ Derive=BOB_cf_sect131r2
PeerKey=MALICE_cf_sect131r2_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_sect131r2
PeerKey=MALICE_cf_sect131r2_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=sect163k1 curve tests
@@ -2848,12 +2936,16 @@ Derive=BOB_cf_sect163k1
PeerKey=MALICE_cf_sect163k1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_sect163k1
PeerKey=MALICE_cf_sect163k1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=sect163r1 curve tests
@@ -2916,12 +3008,16 @@ Derive=BOB_cf_sect163r1
PeerKey=MALICE_cf_sect163r1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_sect163r1
PeerKey=MALICE_cf_sect163r1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=sect163r2 curve tests
@@ -2984,12 +3080,16 @@ Derive=BOB_cf_sect163r2
PeerKey=MALICE_cf_sect163r2_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_sect163r2
PeerKey=MALICE_cf_sect163r2_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=sect193r1 curve tests
@@ -3052,12 +3152,16 @@ Derive=BOB_cf_sect193r1
PeerKey=MALICE_cf_sect193r1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_sect193r1
PeerKey=MALICE_cf_sect193r1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=sect193r2 curve tests
@@ -3120,12 +3224,16 @@ Derive=BOB_cf_sect193r2
PeerKey=MALICE_cf_sect193r2_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_sect193r2
PeerKey=MALICE_cf_sect193r2_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=sect233k1 curve tests
@@ -3190,12 +3298,16 @@ Derive=BOB_cf_sect233k1
PeerKey=MALICE_cf_sect233k1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_sect233k1
PeerKey=MALICE_cf_sect233k1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=sect233r1 curve tests
@@ -3260,12 +3372,16 @@ Derive=BOB_cf_sect233r1
PeerKey=MALICE_cf_sect233r1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_sect233r1
PeerKey=MALICE_cf_sect233r1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=sect239k1 curve tests
@@ -3330,12 +3446,16 @@ Derive=BOB_cf_sect239k1
PeerKey=MALICE_cf_sect239k1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_sect239k1
PeerKey=MALICE_cf_sect239k1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=sect283k1 curve tests
@@ -3400,12 +3520,16 @@ Derive=BOB_cf_sect283k1
PeerKey=MALICE_cf_sect283k1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_sect283k1
PeerKey=MALICE_cf_sect283k1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=sect283r1 curve tests
@@ -3470,12 +3594,16 @@ Derive=BOB_cf_sect283r1
PeerKey=MALICE_cf_sect283r1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_sect283r1
PeerKey=MALICE_cf_sect283r1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=sect409k1 curve tests
@@ -3543,12 +3671,16 @@ Derive=BOB_cf_sect409k1
PeerKey=MALICE_cf_sect409k1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_sect409k1
PeerKey=MALICE_cf_sect409k1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=sect409r1 curve tests
@@ -3616,12 +3748,16 @@ Derive=BOB_cf_sect409r1
PeerKey=MALICE_cf_sect409r1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_sect409r1
PeerKey=MALICE_cf_sect409r1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=sect571k1 curve tests
@@ -3689,12 +3825,16 @@ Derive=BOB_cf_sect571k1
PeerKey=MALICE_cf_sect571k1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_sect571k1
PeerKey=MALICE_cf_sect571k1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=sect571r1 curve tests
@@ -3762,12 +3902,16 @@ Derive=BOB_cf_sect571r1
PeerKey=MALICE_cf_sect571r1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_sect571r1
PeerKey=MALICE_cf_sect571r1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=wap-wsg-idm-ecid-wtls10 curve tests
@@ -3832,12 +3976,16 @@ Derive=BOB_cf_wap-wsg-idm-ecid-wtls10
PeerKey=MALICE_cf_wap-wsg-idm-ecid-wtls10_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_wap-wsg-idm-ecid-wtls10
PeerKey=MALICE_cf_wap-wsg-idm-ecid-wtls10_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=wap-wsg-idm-ecid-wtls11 curve tests
@@ -3902,12 +4050,16 @@ Derive=BOB_cf_wap-wsg-idm-ecid-wtls11
PeerKey=MALICE_cf_wap-wsg-idm-ecid-wtls11_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_wap-wsg-idm-ecid-wtls11
PeerKey=MALICE_cf_wap-wsg-idm-ecid-wtls11_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=wap-wsg-idm-ecid-wtls12 curve tests
@@ -4007,12 +4159,16 @@ Derive=BOB_cf_wap-wsg-idm-ecid-wtls1
PeerKey=MALICE_cf_wap-wsg-idm-ecid-wtls1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_wap-wsg-idm-ecid-wtls1
PeerKey=MALICE_cf_wap-wsg-idm-ecid-wtls1_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=wap-wsg-idm-ecid-wtls3 curve tests
@@ -4075,12 +4231,16 @@ Derive=BOB_cf_wap-wsg-idm-ecid-wtls3
PeerKey=MALICE_cf_wap-wsg-idm-ecid-wtls3_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_wap-wsg-idm-ecid-wtls3
PeerKey=MALICE_cf_wap-wsg-idm-ecid-wtls3_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=wap-wsg-idm-ecid-wtls4 curve tests
@@ -4140,12 +4300,16 @@ Derive=BOB_cf_wap-wsg-idm-ecid-wtls4
PeerKey=MALICE_cf_wap-wsg-idm-ecid-wtls4_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_wap-wsg-idm-ecid-wtls4
PeerKey=MALICE_cf_wap-wsg-idm-ecid-wtls4_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=wap-wsg-idm-ecid-wtls5 curve tests
@@ -4208,12 +4372,16 @@ Derive=BOB_cf_wap-wsg-idm-ecid-wtls5
PeerKey=MALICE_cf_wap-wsg-idm-ecid-wtls5_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
# ECC CDH Alice with Malice peer
Derive=ALICE_cf_wap-wsg-idm-ecid-wtls5
PeerKey=MALICE_cf_wap-wsg-idm-ecid-wtls5_PUB
Ctrl=ecdh_cofactor_mode:1
Result=DERIVE_ERROR
Function=EC_POINT_get_affine_coordinates
Reason=point at infinity
Title=wap-wsg-idm-ecid-wtls6 curve tests
+6 -2
View File
@@ -11,7 +11,7 @@ use strict;
use warnings;
use OpenSSL::Test::Simple;
use OpenSSL::Test;
use OpenSSL::Test qw/:DEFAULT srctop_file/;
use OpenSSL::Test::Utils qw(alldisabled available_protocols);
setup("test_servername");
@@ -19,4 +19,8 @@ setup("test_servername");
plan skip_all => "No TLS/SSL protocols are supported by this OpenSSL build"
if alldisabled(grep { $_ ne "ssl3" } available_protocols("tls"));
simple_test("test_servername", "servername_test");
plan tests => 1;
ok(run(test(["servername_test", srctop_file("apps", "server.pem"),
srctop_file("apps", "server.pem")])),
"running servername_test");
+32 -31
View File
@@ -22,11 +22,15 @@
#include "testutil.h"
#include "internal/nelem.h"
#include "ssltestlib.h"
#define CLIENT_VERSION_LEN 2
static const char *host = "dummy-host";
static char *cert = NULL;
static char *privkey = NULL;
static int get_sni_from_client_hello(BIO *bio, char **sni)
{
long len;
@@ -176,45 +180,38 @@ end:
static int server_setup_sni(void)
{
SSL_CTX *ctx;
SSL *con = NULL;
BIO *rbio;
BIO *wbio;
int ret = 0;
SSL_CTX *cctx = NULL, *sctx = NULL;
SSL *clientssl = NULL, *serverssl = NULL;
int testresult = 0;
/* use TLS_server_method to choose 'server-side' */
ctx = SSL_CTX_new(TLS_server_method());
if (!TEST_ptr(ctx))
if (!TEST_true(create_ssl_ctx_pair(TLS_server_method(),
TLS_client_method(),
TLS1_VERSION, TLS_MAX_VERSION,
&sctx, &cctx, cert, privkey))
|| !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl,
NULL, NULL)))
goto end;
con = SSL_new(ctx);
if (!TEST_ptr(con))
goto end;
rbio = BIO_new(BIO_s_mem());
wbio = BIO_new(BIO_s_mem());
if (!TEST_ptr(rbio)|| !TEST_ptr(wbio)) {
BIO_free(rbio);
BIO_free(wbio);
goto end;
}
SSL_set_bio(con, rbio, wbio);
/* set SNI at server side */
SSL_set_tlsext_host_name(con, host);
SSL_set_tlsext_host_name(serverssl, host);
if (!TEST_int_le(SSL_accept(con), 0))
/* This shouldn't succeed because we have nothing to listen on */
if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE)))
goto end;
if (!TEST_ptr_null(SSL_get_servername(con, TLSEXT_NAMETYPE_host_name)))
/* SNI should be cleared by SSL_accpet */
if (!TEST_ptr_null(SSL_get_servername(serverssl,
TLSEXT_NAMETYPE_host_name))) {
/* SNI should have been cleared during handshake */
goto end;
ret = 1;
}
testresult = 1;
end:
SSL_free(con);
SSL_CTX_free(ctx);
return ret;
SSL_free(serverssl);
SSL_free(clientssl);
SSL_CTX_free(sctx);
SSL_CTX_free(cctx);
return testresult;
}
typedef int (*sni_test_fn)(void);
@@ -236,6 +233,10 @@ static int test_servername(int test)
int setup_tests(void)
{
if (!TEST_ptr(cert = test_get_argument(0))
|| !TEST_ptr(privkey = test_get_argument(1)))
return 0;
ADD_ALL_TESTS(test_servername, OSSL_NELEM(sni_test_fns));
return 1;
}
+6 -1
View File
@@ -48,7 +48,12 @@ typedef void *SHLIB_SYM;
static int shlib_load(const char *filename, SHLIB *lib)
{
*lib = dlopen(filename, RTLD_GLOBAL | RTLD_LAZY);
int dl_flags = (RTLD_GLOBAL|RTLD_LAZY);
#ifdef _AIX
if (filename[strlen(filename) - 1] == ')')
dl_flags |= RTLD_MEMBER;
#endif
*lib = dlopen(filename, dl_flags);
return *lib == NULL ? 0 : 1;
}
+4 -3
View File
@@ -294,7 +294,8 @@ static int test_sm2_sign(const EC_GROUP *group,
goto done;
start_fake_rand(k_hex);
sig = sm2_do_sign(key, EVP_sm3(), userid, (const uint8_t *)message, msg_len);
sig = sm2_do_sign(key, EVP_sm3(), (const uint8_t *)userid, strlen(userid),
(const uint8_t *)message, msg_len);
if (!TEST_ptr(sig)
|| !TEST_size_t_eq(fake_rand_bytes_offset, fake_rand_size)) {
restore_rand();
@@ -310,8 +311,8 @@ static int test_sm2_sign(const EC_GROUP *group,
|| !TEST_BN_eq(s, sig_s))
goto done;
ok = sm2_do_verify(key, EVP_sm3(), sig, userid, (const uint8_t *)message,
msg_len);
ok = sm2_do_verify(key, EVP_sm3(), sig, (const uint8_t *)userid,
strlen(userid), (const uint8_t *)message, msg_len);
/* We goto done whether this passes or fails */
TEST_true(ok);
+335 -282
View File
@@ -1,6 +1,6 @@
# Generated with generate_ssl_tests.pl
num_tests = 47
num_tests = 49
test-0 = 0-ECDSA CipherString Selection
test-1 = 1-ECDSA CipherString Selection
@@ -24,31 +24,33 @@ test-18 = 18-RSA-PSS Certificate Legacy Signature Algorithm Selection
test-19 = 19-RSA-PSS Certificate Unified Signature Algorithm Selection
test-20 = 20-Only RSA-PSS Certificate
test-21 = 21-RSA-PSS Certificate, no PSS signature algorithms
test-22 = 22-Suite B P-256 Hash Algorithm Selection
test-23 = 23-Suite B P-384 Hash Algorithm Selection
test-24 = 24-TLS 1.2 Ed25519 Client Auth
test-25 = 25-TLS 1.2 Ed448 Client Auth
test-26 = 26-Only RSA-PSS Certificate, TLS v1.1
test-27 = 27-TLS 1.3 ECDSA Signature Algorithm Selection
test-28 = 28-TLS 1.3 ECDSA Signature Algorithm Selection compressed point
test-29 = 29-TLS 1.3 ECDSA Signature Algorithm Selection SHA1
test-30 = 30-TLS 1.3 ECDSA Signature Algorithm Selection with PSS
test-31 = 31-TLS 1.3 RSA Signature Algorithm Selection SHA384 with PSS
test-32 = 32-TLS 1.3 ECDSA Signature Algorithm Selection, no ECDSA certificate
test-33 = 33-TLS 1.3 RSA Signature Algorithm Selection, no PSS
test-34 = 34-TLS 1.3 RSA-PSS Signature Algorithm Selection
test-35 = 35-TLS 1.3 Ed25519 Signature Algorithm Selection
test-36 = 36-TLS 1.3 Ed448 Signature Algorithm Selection
test-37 = 37-TLS 1.3 Ed25519 CipherString and Groups Selection
test-38 = 38-TLS 1.3 Ed448 CipherString and Groups Selection
test-39 = 39-TLS 1.3 RSA Client Auth Signature Algorithm Selection
test-40 = 40-TLS 1.3 RSA Client Auth Signature Algorithm Selection non-empty CA Names
test-41 = 41-TLS 1.3 ECDSA Client Auth Signature Algorithm Selection
test-42 = 42-TLS 1.3 Ed25519 Client Auth
test-43 = 43-TLS 1.3 Ed448 Client Auth
test-44 = 44-TLS 1.2 DSA Certificate Test
test-45 = 45-TLS 1.3 Client Auth No TLS 1.3 Signature Algorithms
test-46 = 46-TLS 1.3 DSA Certificate Test
test-22 = 22-RSA key exchange with all RSA certificate types
test-23 = 23-RSA key exchange with only RSA-PSS certificate
test-24 = 24-Suite B P-256 Hash Algorithm Selection
test-25 = 25-Suite B P-384 Hash Algorithm Selection
test-26 = 26-TLS 1.2 Ed25519 Client Auth
test-27 = 27-TLS 1.2 Ed448 Client Auth
test-28 = 28-Only RSA-PSS Certificate, TLS v1.1
test-29 = 29-TLS 1.3 ECDSA Signature Algorithm Selection
test-30 = 30-TLS 1.3 ECDSA Signature Algorithm Selection compressed point
test-31 = 31-TLS 1.3 ECDSA Signature Algorithm Selection SHA1
test-32 = 32-TLS 1.3 ECDSA Signature Algorithm Selection with PSS
test-33 = 33-TLS 1.3 RSA Signature Algorithm Selection SHA384 with PSS
test-34 = 34-TLS 1.3 ECDSA Signature Algorithm Selection, no ECDSA certificate
test-35 = 35-TLS 1.3 RSA Signature Algorithm Selection, no PSS
test-36 = 36-TLS 1.3 RSA-PSS Signature Algorithm Selection
test-37 = 37-TLS 1.3 Ed25519 Signature Algorithm Selection
test-38 = 38-TLS 1.3 Ed448 Signature Algorithm Selection
test-39 = 39-TLS 1.3 Ed25519 CipherString and Groups Selection
test-40 = 40-TLS 1.3 Ed448 CipherString and Groups Selection
test-41 = 41-TLS 1.3 RSA Client Auth Signature Algorithm Selection
test-42 = 42-TLS 1.3 RSA Client Auth Signature Algorithm Selection non-empty CA Names
test-43 = 43-TLS 1.3 ECDSA Client Auth Signature Algorithm Selection
test-44 = 44-TLS 1.3 Ed25519 Client Auth
test-45 = 45-TLS 1.3 Ed448 Client Auth
test-46 = 46-TLS 1.2 DSA Certificate Test
test-47 = 47-TLS 1.3 Client Auth No TLS 1.3 Signature Algorithms
test-48 = 48-TLS 1.3 DSA Certificate Test
# ===========================================================
[0-ECDSA CipherString Selection]
@@ -766,14 +768,65 @@ ExpectedResult = ServerFail
# ===========================================================
[22-Suite B P-256 Hash Algorithm Selection]
ssl_conf = 22-Suite B P-256 Hash Algorithm Selection-ssl
[22-RSA key exchange with all RSA certificate types]
ssl_conf = 22-RSA key exchange with all RSA certificate types-ssl
[22-Suite B P-256 Hash Algorithm Selection-ssl]
server = 22-Suite B P-256 Hash Algorithm Selection-server
client = 22-Suite B P-256 Hash Algorithm Selection-client
[22-RSA key exchange with all RSA certificate types-ssl]
server = 22-RSA key exchange with all RSA certificate types-server
client = 22-RSA key exchange with all RSA certificate types-client
[22-Suite B P-256 Hash Algorithm Selection-server]
[22-RSA key exchange with all RSA certificate types-server]
Certificate = ${ENV::TEST_CERTS_DIR}/servercert.pem
CipherString = DEFAULT
PSS.Certificate = ${ENV::TEST_CERTS_DIR}/server-pss-cert.pem
PSS.PrivateKey = ${ENV::TEST_CERTS_DIR}/server-pss-key.pem
PrivateKey = ${ENV::TEST_CERTS_DIR}/serverkey.pem
[22-RSA key exchange with all RSA certificate types-client]
CipherString = kRSA
MaxProtocol = TLSv1.2
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/rootcert.pem
VerifyMode = Peer
[test-22]
ExpectedResult = Success
ExpectedServerCertType = RSA
# ===========================================================
[23-RSA key exchange with only RSA-PSS certificate]
ssl_conf = 23-RSA key exchange with only RSA-PSS certificate-ssl
[23-RSA key exchange with only RSA-PSS certificate-ssl]
server = 23-RSA key exchange with only RSA-PSS certificate-server
client = 23-RSA key exchange with only RSA-PSS certificate-client
[23-RSA key exchange with only RSA-PSS certificate-server]
Certificate = ${ENV::TEST_CERTS_DIR}/server-pss-cert.pem
CipherString = DEFAULT
PrivateKey = ${ENV::TEST_CERTS_DIR}/server-pss-key.pem
[23-RSA key exchange with only RSA-PSS certificate-client]
CipherString = kRSA
MaxProtocol = TLSv1.2
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/rootcert.pem
VerifyMode = Peer
[test-23]
ExpectedResult = ServerFail
# ===========================================================
[24-Suite B P-256 Hash Algorithm Selection]
ssl_conf = 24-Suite B P-256 Hash Algorithm Selection-ssl
[24-Suite B P-256 Hash Algorithm Selection-ssl]
server = 24-Suite B P-256 Hash Algorithm Selection-server
client = 24-Suite B P-256 Hash Algorithm Selection-client
[24-Suite B P-256 Hash Algorithm Selection-server]
Certificate = ${ENV::TEST_CERTS_DIR}/servercert.pem
CipherString = SUITEB128
ECDSA.Certificate = ${ENV::TEST_CERTS_DIR}/p256-server-cert.pem
@@ -781,13 +834,13 @@ ECDSA.PrivateKey = ${ENV::TEST_CERTS_DIR}/p256-server-key.pem
MaxProtocol = TLSv1.2
PrivateKey = ${ENV::TEST_CERTS_DIR}/serverkey.pem
[22-Suite B P-256 Hash Algorithm Selection-client]
[24-Suite B P-256 Hash Algorithm Selection-client]
CipherString = DEFAULT
SignatureAlgorithms = ECDSA+SHA384:ECDSA+SHA256
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/p384-root.pem
VerifyMode = Peer
[test-22]
[test-24]
ExpectedResult = Success
ExpectedServerCertType = P-256
ExpectedServerSignHash = SHA256
@@ -796,14 +849,14 @@ ExpectedServerSignType = EC
# ===========================================================
[23-Suite B P-384 Hash Algorithm Selection]
ssl_conf = 23-Suite B P-384 Hash Algorithm Selection-ssl
[25-Suite B P-384 Hash Algorithm Selection]
ssl_conf = 25-Suite B P-384 Hash Algorithm Selection-ssl
[23-Suite B P-384 Hash Algorithm Selection-ssl]
server = 23-Suite B P-384 Hash Algorithm Selection-server
client = 23-Suite B P-384 Hash Algorithm Selection-client
[25-Suite B P-384 Hash Algorithm Selection-ssl]
server = 25-Suite B P-384 Hash Algorithm Selection-server
client = 25-Suite B P-384 Hash Algorithm Selection-client
[23-Suite B P-384 Hash Algorithm Selection-server]
[25-Suite B P-384 Hash Algorithm Selection-server]
Certificate = ${ENV::TEST_CERTS_DIR}/servercert.pem
CipherString = SUITEB128
ECDSA.Certificate = ${ENV::TEST_CERTS_DIR}/p384-server-cert.pem
@@ -811,13 +864,13 @@ ECDSA.PrivateKey = ${ENV::TEST_CERTS_DIR}/p384-server-key.pem
MaxProtocol = TLSv1.2
PrivateKey = ${ENV::TEST_CERTS_DIR}/serverkey.pem
[23-Suite B P-384 Hash Algorithm Selection-client]
[25-Suite B P-384 Hash Algorithm Selection-client]
CipherString = DEFAULT
SignatureAlgorithms = ECDSA+SHA256:ECDSA+SHA384
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/p384-root.pem
VerifyMode = Peer
[test-23]
[test-25]
ExpectedResult = Success
ExpectedServerCertType = P-384
ExpectedServerSignHash = SHA384
@@ -826,21 +879,21 @@ ExpectedServerSignType = EC
# ===========================================================
[24-TLS 1.2 Ed25519 Client Auth]
ssl_conf = 24-TLS 1.2 Ed25519 Client Auth-ssl
[26-TLS 1.2 Ed25519 Client Auth]
ssl_conf = 26-TLS 1.2 Ed25519 Client Auth-ssl
[24-TLS 1.2 Ed25519 Client Auth-ssl]
server = 24-TLS 1.2 Ed25519 Client Auth-server
client = 24-TLS 1.2 Ed25519 Client Auth-client
[26-TLS 1.2 Ed25519 Client Auth-ssl]
server = 26-TLS 1.2 Ed25519 Client Auth-server
client = 26-TLS 1.2 Ed25519 Client Auth-client
[24-TLS 1.2 Ed25519 Client Auth-server]
[26-TLS 1.2 Ed25519 Client Auth-server]
Certificate = ${ENV::TEST_CERTS_DIR}/servercert.pem
CipherString = DEFAULT
PrivateKey = ${ENV::TEST_CERTS_DIR}/serverkey.pem
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/root-cert.pem
VerifyMode = Require
[24-TLS 1.2 Ed25519 Client Auth-client]
[26-TLS 1.2 Ed25519 Client Auth-client]
CipherString = DEFAULT
Ed25519.Certificate = ${ENV::TEST_CERTS_DIR}/client-ed25519-cert.pem
Ed25519.PrivateKey = ${ENV::TEST_CERTS_DIR}/client-ed25519-key.pem
@@ -849,7 +902,7 @@ MinProtocol = TLSv1.2
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/rootcert.pem
VerifyMode = Peer
[test-24]
[test-26]
ExpectedClientCertType = Ed25519
ExpectedClientSignType = Ed25519
ExpectedResult = Success
@@ -857,21 +910,21 @@ ExpectedResult = Success
# ===========================================================
[25-TLS 1.2 Ed448 Client Auth]
ssl_conf = 25-TLS 1.2 Ed448 Client Auth-ssl
[27-TLS 1.2 Ed448 Client Auth]
ssl_conf = 27-TLS 1.2 Ed448 Client Auth-ssl
[25-TLS 1.2 Ed448 Client Auth-ssl]
server = 25-TLS 1.2 Ed448 Client Auth-server
client = 25-TLS 1.2 Ed448 Client Auth-client
[27-TLS 1.2 Ed448 Client Auth-ssl]
server = 27-TLS 1.2 Ed448 Client Auth-server
client = 27-TLS 1.2 Ed448 Client Auth-client
[25-TLS 1.2 Ed448 Client Auth-server]
[27-TLS 1.2 Ed448 Client Auth-server]
Certificate = ${ENV::TEST_CERTS_DIR}/servercert.pem
CipherString = DEFAULT
PrivateKey = ${ENV::TEST_CERTS_DIR}/serverkey.pem
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/root-cert.pem
VerifyMode = Require
[25-TLS 1.2 Ed448 Client Auth-client]
[27-TLS 1.2 Ed448 Client Auth-client]
CipherString = DEFAULT
Ed448.Certificate = ${ENV::TEST_CERTS_DIR}/client-ed448-cert.pem
Ed448.PrivateKey = ${ENV::TEST_CERTS_DIR}/client-ed448-key.pem
@@ -880,7 +933,7 @@ MinProtocol = TLSv1.2
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/rootcert.pem
VerifyMode = Peer
[test-25]
[test-27]
ExpectedClientCertType = Ed448
ExpectedClientSignType = Ed448
ExpectedResult = Success
@@ -888,38 +941,38 @@ ExpectedResult = Success
# ===========================================================
[26-Only RSA-PSS Certificate, TLS v1.1]
ssl_conf = 26-Only RSA-PSS Certificate, TLS v1.1-ssl
[28-Only RSA-PSS Certificate, TLS v1.1]
ssl_conf = 28-Only RSA-PSS Certificate, TLS v1.1-ssl
[26-Only RSA-PSS Certificate, TLS v1.1-ssl]
server = 26-Only RSA-PSS Certificate, TLS v1.1-server
client = 26-Only RSA-PSS Certificate, TLS v1.1-client
[28-Only RSA-PSS Certificate, TLS v1.1-ssl]
server = 28-Only RSA-PSS Certificate, TLS v1.1-server
client = 28-Only RSA-PSS Certificate, TLS v1.1-client
[26-Only RSA-PSS Certificate, TLS v1.1-server]
[28-Only RSA-PSS Certificate, TLS v1.1-server]
Certificate = ${ENV::TEST_CERTS_DIR}/server-pss-cert.pem
CipherString = DEFAULT
PrivateKey = ${ENV::TEST_CERTS_DIR}/server-pss-key.pem
[26-Only RSA-PSS Certificate, TLS v1.1-client]
[28-Only RSA-PSS Certificate, TLS v1.1-client]
CipherString = DEFAULT
MaxProtocol = TLSv1.1
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/rootcert.pem
VerifyMode = Peer
[test-26]
[test-28]
ExpectedResult = ServerFail
# ===========================================================
[27-TLS 1.3 ECDSA Signature Algorithm Selection]
ssl_conf = 27-TLS 1.3 ECDSA Signature Algorithm Selection-ssl
[29-TLS 1.3 ECDSA Signature Algorithm Selection]
ssl_conf = 29-TLS 1.3 ECDSA Signature Algorithm Selection-ssl
[27-TLS 1.3 ECDSA Signature Algorithm Selection-ssl]
server = 27-TLS 1.3 ECDSA Signature Algorithm Selection-server
client = 27-TLS 1.3 ECDSA Signature Algorithm Selection-client
[29-TLS 1.3 ECDSA Signature Algorithm Selection-ssl]
server = 29-TLS 1.3 ECDSA Signature Algorithm Selection-server
client = 29-TLS 1.3 ECDSA Signature Algorithm Selection-client
[27-TLS 1.3 ECDSA Signature Algorithm Selection-server]
[29-TLS 1.3 ECDSA Signature Algorithm Selection-server]
Certificate = ${ENV::TEST_CERTS_DIR}/servercert.pem
CipherString = DEFAULT
ECDSA.Certificate = ${ENV::TEST_CERTS_DIR}/server-ecdsa-cert.pem
@@ -932,13 +985,13 @@ MaxProtocol = TLSv1.3
MinProtocol = TLSv1.3
PrivateKey = ${ENV::TEST_CERTS_DIR}/serverkey.pem
[27-TLS 1.3 ECDSA Signature Algorithm Selection-client]
[29-TLS 1.3 ECDSA Signature Algorithm Selection-client]
CipherString = DEFAULT
SignatureAlgorithms = ECDSA+SHA256
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/rootcert.pem
VerifyMode = Peer
[test-27]
[test-29]
ExpectedResult = Success
ExpectedServerCANames = empty
ExpectedServerCertType = P-256
@@ -948,14 +1001,14 @@ ExpectedServerSignType = EC
# ===========================================================
[28-TLS 1.3 ECDSA Signature Algorithm Selection compressed point]
ssl_conf = 28-TLS 1.3 ECDSA Signature Algorithm Selection compressed point-ssl
[30-TLS 1.3 ECDSA Signature Algorithm Selection compressed point]
ssl_conf = 30-TLS 1.3 ECDSA Signature Algorithm Selection compressed point-ssl
[28-TLS 1.3 ECDSA Signature Algorithm Selection compressed point-ssl]
server = 28-TLS 1.3 ECDSA Signature Algorithm Selection compressed point-server
client = 28-TLS 1.3 ECDSA Signature Algorithm Selection compressed point-client
[30-TLS 1.3 ECDSA Signature Algorithm Selection compressed point-ssl]
server = 30-TLS 1.3 ECDSA Signature Algorithm Selection compressed point-server
client = 30-TLS 1.3 ECDSA Signature Algorithm Selection compressed point-client
[28-TLS 1.3 ECDSA Signature Algorithm Selection compressed point-server]
[30-TLS 1.3 ECDSA Signature Algorithm Selection compressed point-server]
Certificate = ${ENV::TEST_CERTS_DIR}/servercert.pem
CipherString = DEFAULT
ECDSA.Certificate = ${ENV::TEST_CERTS_DIR}/server-cecdsa-cert.pem
@@ -964,13 +1017,13 @@ MaxProtocol = TLSv1.3
MinProtocol = TLSv1.3
PrivateKey = ${ENV::TEST_CERTS_DIR}/serverkey.pem
[28-TLS 1.3 ECDSA Signature Algorithm Selection compressed point-client]
[30-TLS 1.3 ECDSA Signature Algorithm Selection compressed point-client]
CipherString = DEFAULT
SignatureAlgorithms = ECDSA+SHA256
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/rootcert.pem
VerifyMode = Peer
[test-28]
[test-30]
ExpectedResult = Success
ExpectedServerCANames = empty
ExpectedServerCertType = P-256
@@ -980,14 +1033,14 @@ ExpectedServerSignType = EC
# ===========================================================
[29-TLS 1.3 ECDSA Signature Algorithm Selection SHA1]
ssl_conf = 29-TLS 1.3 ECDSA Signature Algorithm Selection SHA1-ssl
[31-TLS 1.3 ECDSA Signature Algorithm Selection SHA1]
ssl_conf = 31-TLS 1.3 ECDSA Signature Algorithm Selection SHA1-ssl
[29-TLS 1.3 ECDSA Signature Algorithm Selection SHA1-ssl]
server = 29-TLS 1.3 ECDSA Signature Algorithm Selection SHA1-server
client = 29-TLS 1.3 ECDSA Signature Algorithm Selection SHA1-client
[31-TLS 1.3 ECDSA Signature Algorithm Selection SHA1-ssl]
server = 31-TLS 1.3 ECDSA Signature Algorithm Selection SHA1-server
client = 31-TLS 1.3 ECDSA Signature Algorithm Selection SHA1-client
[29-TLS 1.3 ECDSA Signature Algorithm Selection SHA1-server]
[31-TLS 1.3 ECDSA Signature Algorithm Selection SHA1-server]
Certificate = ${ENV::TEST_CERTS_DIR}/servercert.pem
CipherString = DEFAULT
ECDSA.Certificate = ${ENV::TEST_CERTS_DIR}/server-ecdsa-cert.pem
@@ -1000,26 +1053,26 @@ MaxProtocol = TLSv1.3
MinProtocol = TLSv1.3
PrivateKey = ${ENV::TEST_CERTS_DIR}/serverkey.pem
[29-TLS 1.3 ECDSA Signature Algorithm Selection SHA1-client]
[31-TLS 1.3 ECDSA Signature Algorithm Selection SHA1-client]
CipherString = DEFAULT
SignatureAlgorithms = ECDSA+SHA1
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/rootcert.pem
VerifyMode = Peer
[test-29]
[test-31]
ExpectedResult = ServerFail
# ===========================================================
[30-TLS 1.3 ECDSA Signature Algorithm Selection with PSS]
ssl_conf = 30-TLS 1.3 ECDSA Signature Algorithm Selection with PSS-ssl
[32-TLS 1.3 ECDSA Signature Algorithm Selection with PSS]
ssl_conf = 32-TLS 1.3 ECDSA Signature Algorithm Selection with PSS-ssl
[30-TLS 1.3 ECDSA Signature Algorithm Selection with PSS-ssl]
server = 30-TLS 1.3 ECDSA Signature Algorithm Selection with PSS-server
client = 30-TLS 1.3 ECDSA Signature Algorithm Selection with PSS-client
[32-TLS 1.3 ECDSA Signature Algorithm Selection with PSS-ssl]
server = 32-TLS 1.3 ECDSA Signature Algorithm Selection with PSS-server
client = 32-TLS 1.3 ECDSA Signature Algorithm Selection with PSS-client
[30-TLS 1.3 ECDSA Signature Algorithm Selection with PSS-server]
[32-TLS 1.3 ECDSA Signature Algorithm Selection with PSS-server]
Certificate = ${ENV::TEST_CERTS_DIR}/servercert.pem
CipherString = DEFAULT
ECDSA.Certificate = ${ENV::TEST_CERTS_DIR}/server-ecdsa-cert.pem
@@ -1032,14 +1085,14 @@ MaxProtocol = TLSv1.3
MinProtocol = TLSv1.3
PrivateKey = ${ENV::TEST_CERTS_DIR}/serverkey.pem
[30-TLS 1.3 ECDSA Signature Algorithm Selection with PSS-client]
[32-TLS 1.3 ECDSA Signature Algorithm Selection with PSS-client]
CipherString = DEFAULT
RequestCAFile = ${ENV::TEST_CERTS_DIR}/root-cert.pem
SignatureAlgorithms = ECDSA+SHA256:RSA-PSS+SHA256
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/rootcert.pem
VerifyMode = Peer
[test-30]
[test-32]
ExpectedResult = Success
ExpectedServerCANames = ${ENV::TEST_CERTS_DIR}/root-cert.pem
ExpectedServerCertType = P-256
@@ -1049,14 +1102,14 @@ ExpectedServerSignType = EC
# ===========================================================
[31-TLS 1.3 RSA Signature Algorithm Selection SHA384 with PSS]
ssl_conf = 31-TLS 1.3 RSA Signature Algorithm Selection SHA384 with PSS-ssl
[33-TLS 1.3 RSA Signature Algorithm Selection SHA384 with PSS]
ssl_conf = 33-TLS 1.3 RSA Signature Algorithm Selection SHA384 with PSS-ssl
[31-TLS 1.3 RSA Signature Algorithm Selection SHA384 with PSS-ssl]
server = 31-TLS 1.3 RSA Signature Algorithm Selection SHA384 with PSS-server
client = 31-TLS 1.3 RSA Signature Algorithm Selection SHA384 with PSS-client
[33-TLS 1.3 RSA Signature Algorithm Selection SHA384 with PSS-ssl]
server = 33-TLS 1.3 RSA Signature Algorithm Selection SHA384 with PSS-server
client = 33-TLS 1.3 RSA Signature Algorithm Selection SHA384 with PSS-client
[31-TLS 1.3 RSA Signature Algorithm Selection SHA384 with PSS-server]
[33-TLS 1.3 RSA Signature Algorithm Selection SHA384 with PSS-server]
Certificate = ${ENV::TEST_CERTS_DIR}/servercert.pem
CipherString = DEFAULT
ECDSA.Certificate = ${ENV::TEST_CERTS_DIR}/server-ecdsa-cert.pem
@@ -1069,13 +1122,13 @@ MaxProtocol = TLSv1.3
MinProtocol = TLSv1.3
PrivateKey = ${ENV::TEST_CERTS_DIR}/serverkey.pem
[31-TLS 1.3 RSA Signature Algorithm Selection SHA384 with PSS-client]
[33-TLS 1.3 RSA Signature Algorithm Selection SHA384 with PSS-client]
CipherString = DEFAULT
SignatureAlgorithms = ECDSA+SHA384:RSA-PSS+SHA384
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/rootcert.pem
VerifyMode = Peer
[test-31]
[test-33]
ExpectedResult = Success
ExpectedServerCertType = RSA
ExpectedServerSignHash = SHA384
@@ -1084,40 +1137,40 @@ ExpectedServerSignType = RSA-PSS
# ===========================================================
[32-TLS 1.3 ECDSA Signature Algorithm Selection, no ECDSA certificate]
ssl_conf = 32-TLS 1.3 ECDSA Signature Algorithm Selection, no ECDSA certificate-ssl
[34-TLS 1.3 ECDSA Signature Algorithm Selection, no ECDSA certificate]
ssl_conf = 34-TLS 1.3 ECDSA Signature Algorithm Selection, no ECDSA certificate-ssl
[32-TLS 1.3 ECDSA Signature Algorithm Selection, no ECDSA certificate-ssl]
server = 32-TLS 1.3 ECDSA Signature Algorithm Selection, no ECDSA certificate-server
client = 32-TLS 1.3 ECDSA Signature Algorithm Selection, no ECDSA certificate-client
[34-TLS 1.3 ECDSA Signature Algorithm Selection, no ECDSA certificate-ssl]
server = 34-TLS 1.3 ECDSA Signature Algorithm Selection, no ECDSA certificate-server
client = 34-TLS 1.3 ECDSA Signature Algorithm Selection, no ECDSA certificate-client
[32-TLS 1.3 ECDSA Signature Algorithm Selection, no ECDSA certificate-server]
[34-TLS 1.3 ECDSA Signature Algorithm Selection, no ECDSA certificate-server]
Certificate = ${ENV::TEST_CERTS_DIR}/servercert.pem
CipherString = DEFAULT
MaxProtocol = TLSv1.3
MinProtocol = TLSv1.3
PrivateKey = ${ENV::TEST_CERTS_DIR}/serverkey.pem
[32-TLS 1.3 ECDSA Signature Algorithm Selection, no ECDSA certificate-client]
[34-TLS 1.3 ECDSA Signature Algorithm Selection, no ECDSA certificate-client]
CipherString = DEFAULT
SignatureAlgorithms = ECDSA+SHA256
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/rootcert.pem
VerifyMode = Peer
[test-32]
[test-34]
ExpectedResult = ServerFail
# ===========================================================
[33-TLS 1.3 RSA Signature Algorithm Selection, no PSS]
ssl_conf = 33-TLS 1.3 RSA Signature Algorithm Selection, no PSS-ssl
[35-TLS 1.3 RSA Signature Algorithm Selection, no PSS]
ssl_conf = 35-TLS 1.3 RSA Signature Algorithm Selection, no PSS-ssl
[33-TLS 1.3 RSA Signature Algorithm Selection, no PSS-ssl]
server = 33-TLS 1.3 RSA Signature Algorithm Selection, no PSS-server
client = 33-TLS 1.3 RSA Signature Algorithm Selection, no PSS-client
[35-TLS 1.3 RSA Signature Algorithm Selection, no PSS-ssl]
server = 35-TLS 1.3 RSA Signature Algorithm Selection, no PSS-server
client = 35-TLS 1.3 RSA Signature Algorithm Selection, no PSS-client
[33-TLS 1.3 RSA Signature Algorithm Selection, no PSS-server]
[35-TLS 1.3 RSA Signature Algorithm Selection, no PSS-server]
Certificate = ${ENV::TEST_CERTS_DIR}/servercert.pem
CipherString = DEFAULT
ECDSA.Certificate = ${ENV::TEST_CERTS_DIR}/server-ecdsa-cert.pem
@@ -1130,26 +1183,26 @@ MaxProtocol = TLSv1.3
MinProtocol = TLSv1.3
PrivateKey = ${ENV::TEST_CERTS_DIR}/serverkey.pem
[33-TLS 1.3 RSA Signature Algorithm Selection, no PSS-client]
[35-TLS 1.3 RSA Signature Algorithm Selection, no PSS-client]
CipherString = DEFAULT
SignatureAlgorithms = RSA+SHA256
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/rootcert.pem
VerifyMode = Peer
[test-33]
[test-35]
ExpectedResult = ServerFail
# ===========================================================
[34-TLS 1.3 RSA-PSS Signature Algorithm Selection]
ssl_conf = 34-TLS 1.3 RSA-PSS Signature Algorithm Selection-ssl
[36-TLS 1.3 RSA-PSS Signature Algorithm Selection]
ssl_conf = 36-TLS 1.3 RSA-PSS Signature Algorithm Selection-ssl
[34-TLS 1.3 RSA-PSS Signature Algorithm Selection-ssl]
server = 34-TLS 1.3 RSA-PSS Signature Algorithm Selection-server
client = 34-TLS 1.3 RSA-PSS Signature Algorithm Selection-client
[36-TLS 1.3 RSA-PSS Signature Algorithm Selection-ssl]
server = 36-TLS 1.3 RSA-PSS Signature Algorithm Selection-server
client = 36-TLS 1.3 RSA-PSS Signature Algorithm Selection-client
[34-TLS 1.3 RSA-PSS Signature Algorithm Selection-server]
[36-TLS 1.3 RSA-PSS Signature Algorithm Selection-server]
Certificate = ${ENV::TEST_CERTS_DIR}/servercert.pem
CipherString = DEFAULT
ECDSA.Certificate = ${ENV::TEST_CERTS_DIR}/server-ecdsa-cert.pem
@@ -1162,13 +1215,13 @@ MaxProtocol = TLSv1.3
MinProtocol = TLSv1.3
PrivateKey = ${ENV::TEST_CERTS_DIR}/serverkey.pem
[34-TLS 1.3 RSA-PSS Signature Algorithm Selection-client]
[36-TLS 1.3 RSA-PSS Signature Algorithm Selection-client]
CipherString = DEFAULT
SignatureAlgorithms = RSA-PSS+SHA256
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/rootcert.pem
VerifyMode = Peer
[test-34]
[test-36]
ExpectedResult = Success
ExpectedServerCertType = RSA
ExpectedServerSignHash = SHA256
@@ -1177,14 +1230,14 @@ ExpectedServerSignType = RSA-PSS
# ===========================================================
[35-TLS 1.3 Ed25519 Signature Algorithm Selection]
ssl_conf = 35-TLS 1.3 Ed25519 Signature Algorithm Selection-ssl
[37-TLS 1.3 Ed25519 Signature Algorithm Selection]
ssl_conf = 37-TLS 1.3 Ed25519 Signature Algorithm Selection-ssl
[35-TLS 1.3 Ed25519 Signature Algorithm Selection-ssl]
server = 35-TLS 1.3 Ed25519 Signature Algorithm Selection-server
client = 35-TLS 1.3 Ed25519 Signature Algorithm Selection-client
[37-TLS 1.3 Ed25519 Signature Algorithm Selection-ssl]
server = 37-TLS 1.3 Ed25519 Signature Algorithm Selection-server
client = 37-TLS 1.3 Ed25519 Signature Algorithm Selection-client
[35-TLS 1.3 Ed25519 Signature Algorithm Selection-server]
[37-TLS 1.3 Ed25519 Signature Algorithm Selection-server]
Certificate = ${ENV::TEST_CERTS_DIR}/servercert.pem
CipherString = DEFAULT
ECDSA.Certificate = ${ENV::TEST_CERTS_DIR}/server-ecdsa-cert.pem
@@ -1197,13 +1250,13 @@ MaxProtocol = TLSv1.3
MinProtocol = TLSv1.3
PrivateKey = ${ENV::TEST_CERTS_DIR}/serverkey.pem
[35-TLS 1.3 Ed25519 Signature Algorithm Selection-client]
[37-TLS 1.3 Ed25519 Signature Algorithm Selection-client]
CipherString = DEFAULT
SignatureAlgorithms = ed25519
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/rootcert.pem
VerifyMode = Peer
[test-35]
[test-37]
ExpectedResult = Success
ExpectedServerCertType = Ed25519
ExpectedServerSignType = Ed25519
@@ -1211,14 +1264,14 @@ ExpectedServerSignType = Ed25519
# ===========================================================
[36-TLS 1.3 Ed448 Signature Algorithm Selection]
ssl_conf = 36-TLS 1.3 Ed448 Signature Algorithm Selection-ssl
[38-TLS 1.3 Ed448 Signature Algorithm Selection]
ssl_conf = 38-TLS 1.3 Ed448 Signature Algorithm Selection-ssl
[36-TLS 1.3 Ed448 Signature Algorithm Selection-ssl]
server = 36-TLS 1.3 Ed448 Signature Algorithm Selection-server
client = 36-TLS 1.3 Ed448 Signature Algorithm Selection-client
[38-TLS 1.3 Ed448 Signature Algorithm Selection-ssl]
server = 38-TLS 1.3 Ed448 Signature Algorithm Selection-server
client = 38-TLS 1.3 Ed448 Signature Algorithm Selection-client
[36-TLS 1.3 Ed448 Signature Algorithm Selection-server]
[38-TLS 1.3 Ed448 Signature Algorithm Selection-server]
Certificate = ${ENV::TEST_CERTS_DIR}/servercert.pem
CipherString = DEFAULT
ECDSA.Certificate = ${ENV::TEST_CERTS_DIR}/server-ecdsa-cert.pem
@@ -1231,13 +1284,13 @@ MaxProtocol = TLSv1.3
MinProtocol = TLSv1.3
PrivateKey = ${ENV::TEST_CERTS_DIR}/serverkey.pem
[36-TLS 1.3 Ed448 Signature Algorithm Selection-client]
[38-TLS 1.3 Ed448 Signature Algorithm Selection-client]
CipherString = DEFAULT
SignatureAlgorithms = ed448
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/rootcert.pem
VerifyMode = Peer
[test-36]
[test-38]
ExpectedResult = Success
ExpectedServerCertType = Ed448
ExpectedServerSignType = Ed448
@@ -1245,14 +1298,14 @@ ExpectedServerSignType = Ed448
# ===========================================================
[37-TLS 1.3 Ed25519 CipherString and Groups Selection]
ssl_conf = 37-TLS 1.3 Ed25519 CipherString and Groups Selection-ssl
[39-TLS 1.3 Ed25519 CipherString and Groups Selection]
ssl_conf = 39-TLS 1.3 Ed25519 CipherString and Groups Selection-ssl
[37-TLS 1.3 Ed25519 CipherString and Groups Selection-ssl]
server = 37-TLS 1.3 Ed25519 CipherString and Groups Selection-server
client = 37-TLS 1.3 Ed25519 CipherString and Groups Selection-client
[39-TLS 1.3 Ed25519 CipherString and Groups Selection-ssl]
server = 39-TLS 1.3 Ed25519 CipherString and Groups Selection-server
client = 39-TLS 1.3 Ed25519 CipherString and Groups Selection-client
[37-TLS 1.3 Ed25519 CipherString and Groups Selection-server]
[39-TLS 1.3 Ed25519 CipherString and Groups Selection-server]
Certificate = ${ENV::TEST_CERTS_DIR}/servercert.pem
CipherString = DEFAULT
ECDSA.Certificate = ${ENV::TEST_CERTS_DIR}/server-ecdsa-cert.pem
@@ -1265,14 +1318,14 @@ MaxProtocol = TLSv1.3
MinProtocol = TLSv1.3
PrivateKey = ${ENV::TEST_CERTS_DIR}/serverkey.pem
[37-TLS 1.3 Ed25519 CipherString and Groups Selection-client]
[39-TLS 1.3 Ed25519 CipherString and Groups Selection-client]
CipherString = DEFAULT
Groups = X25519
SignatureAlgorithms = ECDSA+SHA256:ed25519
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/rootcert.pem
VerifyMode = Peer
[test-37]
[test-39]
ExpectedResult = Success
ExpectedServerCertType = P-256
ExpectedServerSignType = EC
@@ -1280,14 +1333,14 @@ ExpectedServerSignType = EC
# ===========================================================
[38-TLS 1.3 Ed448 CipherString and Groups Selection]
ssl_conf = 38-TLS 1.3 Ed448 CipherString and Groups Selection-ssl
[40-TLS 1.3 Ed448 CipherString and Groups Selection]
ssl_conf = 40-TLS 1.3 Ed448 CipherString and Groups Selection-ssl
[38-TLS 1.3 Ed448 CipherString and Groups Selection-ssl]
server = 38-TLS 1.3 Ed448 CipherString and Groups Selection-server
client = 38-TLS 1.3 Ed448 CipherString and Groups Selection-client
[40-TLS 1.3 Ed448 CipherString and Groups Selection-ssl]
server = 40-TLS 1.3 Ed448 CipherString and Groups Selection-server
client = 40-TLS 1.3 Ed448 CipherString and Groups Selection-client
[38-TLS 1.3 Ed448 CipherString and Groups Selection-server]
[40-TLS 1.3 Ed448 CipherString and Groups Selection-server]
Certificate = ${ENV::TEST_CERTS_DIR}/servercert.pem
CipherString = DEFAULT
ECDSA.Certificate = ${ENV::TEST_CERTS_DIR}/server-ecdsa-cert.pem
@@ -1300,14 +1353,14 @@ MaxProtocol = TLSv1.3
MinProtocol = TLSv1.3
PrivateKey = ${ENV::TEST_CERTS_DIR}/serverkey.pem
[38-TLS 1.3 Ed448 CipherString and Groups Selection-client]
[40-TLS 1.3 Ed448 CipherString and Groups Selection-client]
CipherString = DEFAULT
Groups = X448
SignatureAlgorithms = ECDSA+SHA256:ed448
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/rootcert.pem
VerifyMode = Peer
[test-38]
[test-40]
ExpectedResult = Success
ExpectedServerCertType = P-256
ExpectedServerSignType = EC
@@ -1315,14 +1368,14 @@ ExpectedServerSignType = EC
# ===========================================================
[39-TLS 1.3 RSA Client Auth Signature Algorithm Selection]
ssl_conf = 39-TLS 1.3 RSA Client Auth Signature Algorithm Selection-ssl
[41-TLS 1.3 RSA Client Auth Signature Algorithm Selection]
ssl_conf = 41-TLS 1.3 RSA Client Auth Signature Algorithm Selection-ssl
[39-TLS 1.3 RSA Client Auth Signature Algorithm Selection-ssl]
server = 39-TLS 1.3 RSA Client Auth Signature Algorithm Selection-server
client = 39-TLS 1.3 RSA Client Auth Signature Algorithm Selection-client
[41-TLS 1.3 RSA Client Auth Signature Algorithm Selection-ssl]
server = 41-TLS 1.3 RSA Client Auth Signature Algorithm Selection-server
client = 41-TLS 1.3 RSA Client Auth Signature Algorithm Selection-client
[39-TLS 1.3 RSA Client Auth Signature Algorithm Selection-server]
[41-TLS 1.3 RSA Client Auth Signature Algorithm Selection-server]
Certificate = ${ENV::TEST_CERTS_DIR}/servercert.pem
CipherString = DEFAULT
ClientSignatureAlgorithms = PSS+SHA256
@@ -1330,80 +1383,7 @@ PrivateKey = ${ENV::TEST_CERTS_DIR}/serverkey.pem
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/root-cert.pem
VerifyMode = Require
[39-TLS 1.3 RSA Client Auth Signature Algorithm Selection-client]
CipherString = DEFAULT
ECDSA.Certificate = ${ENV::TEST_CERTS_DIR}/ee-ecdsa-client-chain.pem
ECDSA.PrivateKey = ${ENV::TEST_CERTS_DIR}/ee-ecdsa-key.pem
MaxProtocol = TLSv1.3
MinProtocol = TLSv1.3
RSA.Certificate = ${ENV::TEST_CERTS_DIR}/ee-client-chain.pem
RSA.PrivateKey = ${ENV::TEST_CERTS_DIR}/ee-key.pem
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/rootcert.pem
VerifyMode = Peer
[test-39]
ExpectedClientCANames = empty
ExpectedClientCertType = RSA
ExpectedClientSignHash = SHA256
ExpectedClientSignType = RSA-PSS
ExpectedResult = Success
# ===========================================================
[40-TLS 1.3 RSA Client Auth Signature Algorithm Selection non-empty CA Names]
ssl_conf = 40-TLS 1.3 RSA Client Auth Signature Algorithm Selection non-empty CA Names-ssl
[40-TLS 1.3 RSA Client Auth Signature Algorithm Selection non-empty CA Names-ssl]
server = 40-TLS 1.3 RSA Client Auth Signature Algorithm Selection non-empty CA Names-server
client = 40-TLS 1.3 RSA Client Auth Signature Algorithm Selection non-empty CA Names-client
[40-TLS 1.3 RSA Client Auth Signature Algorithm Selection non-empty CA Names-server]
Certificate = ${ENV::TEST_CERTS_DIR}/servercert.pem
CipherString = DEFAULT
ClientSignatureAlgorithms = PSS+SHA256
PrivateKey = ${ENV::TEST_CERTS_DIR}/serverkey.pem
RequestCAFile = ${ENV::TEST_CERTS_DIR}/root-cert.pem
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/root-cert.pem
VerifyMode = Require
[40-TLS 1.3 RSA Client Auth Signature Algorithm Selection non-empty CA Names-client]
CipherString = DEFAULT
ECDSA.Certificate = ${ENV::TEST_CERTS_DIR}/ee-ecdsa-client-chain.pem
ECDSA.PrivateKey = ${ENV::TEST_CERTS_DIR}/ee-ecdsa-key.pem
MaxProtocol = TLSv1.3
MinProtocol = TLSv1.3
RSA.Certificate = ${ENV::TEST_CERTS_DIR}/ee-client-chain.pem
RSA.PrivateKey = ${ENV::TEST_CERTS_DIR}/ee-key.pem
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/rootcert.pem
VerifyMode = Peer
[test-40]
ExpectedClientCANames = ${ENV::TEST_CERTS_DIR}/root-cert.pem
ExpectedClientCertType = RSA
ExpectedClientSignHash = SHA256
ExpectedClientSignType = RSA-PSS
ExpectedResult = Success
# ===========================================================
[41-TLS 1.3 ECDSA Client Auth Signature Algorithm Selection]
ssl_conf = 41-TLS 1.3 ECDSA Client Auth Signature Algorithm Selection-ssl
[41-TLS 1.3 ECDSA Client Auth Signature Algorithm Selection-ssl]
server = 41-TLS 1.3 ECDSA Client Auth Signature Algorithm Selection-server
client = 41-TLS 1.3 ECDSA Client Auth Signature Algorithm Selection-client
[41-TLS 1.3 ECDSA Client Auth Signature Algorithm Selection-server]
Certificate = ${ENV::TEST_CERTS_DIR}/servercert.pem
CipherString = DEFAULT
ClientSignatureAlgorithms = ECDSA+SHA256
PrivateKey = ${ENV::TEST_CERTS_DIR}/serverkey.pem
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/root-cert.pem
VerifyMode = Require
[41-TLS 1.3 ECDSA Client Auth Signature Algorithm Selection-client]
[41-TLS 1.3 RSA Client Auth Signature Algorithm Selection-client]
CipherString = DEFAULT
ECDSA.Certificate = ${ENV::TEST_CERTS_DIR}/ee-ecdsa-client-chain.pem
ECDSA.PrivateKey = ${ENV::TEST_CERTS_DIR}/ee-ecdsa-key.pem
@@ -1415,6 +1395,79 @@ VerifyCAFile = ${ENV::TEST_CERTS_DIR}/rootcert.pem
VerifyMode = Peer
[test-41]
ExpectedClientCANames = empty
ExpectedClientCertType = RSA
ExpectedClientSignHash = SHA256
ExpectedClientSignType = RSA-PSS
ExpectedResult = Success
# ===========================================================
[42-TLS 1.3 RSA Client Auth Signature Algorithm Selection non-empty CA Names]
ssl_conf = 42-TLS 1.3 RSA Client Auth Signature Algorithm Selection non-empty CA Names-ssl
[42-TLS 1.3 RSA Client Auth Signature Algorithm Selection non-empty CA Names-ssl]
server = 42-TLS 1.3 RSA Client Auth Signature Algorithm Selection non-empty CA Names-server
client = 42-TLS 1.3 RSA Client Auth Signature Algorithm Selection non-empty CA Names-client
[42-TLS 1.3 RSA Client Auth Signature Algorithm Selection non-empty CA Names-server]
Certificate = ${ENV::TEST_CERTS_DIR}/servercert.pem
CipherString = DEFAULT
ClientSignatureAlgorithms = PSS+SHA256
PrivateKey = ${ENV::TEST_CERTS_DIR}/serverkey.pem
RequestCAFile = ${ENV::TEST_CERTS_DIR}/root-cert.pem
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/root-cert.pem
VerifyMode = Require
[42-TLS 1.3 RSA Client Auth Signature Algorithm Selection non-empty CA Names-client]
CipherString = DEFAULT
ECDSA.Certificate = ${ENV::TEST_CERTS_DIR}/ee-ecdsa-client-chain.pem
ECDSA.PrivateKey = ${ENV::TEST_CERTS_DIR}/ee-ecdsa-key.pem
MaxProtocol = TLSv1.3
MinProtocol = TLSv1.3
RSA.Certificate = ${ENV::TEST_CERTS_DIR}/ee-client-chain.pem
RSA.PrivateKey = ${ENV::TEST_CERTS_DIR}/ee-key.pem
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/rootcert.pem
VerifyMode = Peer
[test-42]
ExpectedClientCANames = ${ENV::TEST_CERTS_DIR}/root-cert.pem
ExpectedClientCertType = RSA
ExpectedClientSignHash = SHA256
ExpectedClientSignType = RSA-PSS
ExpectedResult = Success
# ===========================================================
[43-TLS 1.3 ECDSA Client Auth Signature Algorithm Selection]
ssl_conf = 43-TLS 1.3 ECDSA Client Auth Signature Algorithm Selection-ssl
[43-TLS 1.3 ECDSA Client Auth Signature Algorithm Selection-ssl]
server = 43-TLS 1.3 ECDSA Client Auth Signature Algorithm Selection-server
client = 43-TLS 1.3 ECDSA Client Auth Signature Algorithm Selection-client
[43-TLS 1.3 ECDSA Client Auth Signature Algorithm Selection-server]
Certificate = ${ENV::TEST_CERTS_DIR}/servercert.pem
CipherString = DEFAULT
ClientSignatureAlgorithms = ECDSA+SHA256
PrivateKey = ${ENV::TEST_CERTS_DIR}/serverkey.pem
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/root-cert.pem
VerifyMode = Require
[43-TLS 1.3 ECDSA Client Auth Signature Algorithm Selection-client]
CipherString = DEFAULT
ECDSA.Certificate = ${ENV::TEST_CERTS_DIR}/ee-ecdsa-client-chain.pem
ECDSA.PrivateKey = ${ENV::TEST_CERTS_DIR}/ee-ecdsa-key.pem
MaxProtocol = TLSv1.3
MinProtocol = TLSv1.3
RSA.Certificate = ${ENV::TEST_CERTS_DIR}/ee-client-chain.pem
RSA.PrivateKey = ${ENV::TEST_CERTS_DIR}/ee-key.pem
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/rootcert.pem
VerifyMode = Peer
[test-43]
ExpectedClientCertType = P-256
ExpectedClientSignHash = SHA256
ExpectedClientSignType = EC
@@ -1423,21 +1476,21 @@ ExpectedResult = Success
# ===========================================================
[42-TLS 1.3 Ed25519 Client Auth]
ssl_conf = 42-TLS 1.3 Ed25519 Client Auth-ssl
[44-TLS 1.3 Ed25519 Client Auth]
ssl_conf = 44-TLS 1.3 Ed25519 Client Auth-ssl
[42-TLS 1.3 Ed25519 Client Auth-ssl]
server = 42-TLS 1.3 Ed25519 Client Auth-server
client = 42-TLS 1.3 Ed25519 Client Auth-client
[44-TLS 1.3 Ed25519 Client Auth-ssl]
server = 44-TLS 1.3 Ed25519 Client Auth-server
client = 44-TLS 1.3 Ed25519 Client Auth-client
[42-TLS 1.3 Ed25519 Client Auth-server]
[44-TLS 1.3 Ed25519 Client Auth-server]
Certificate = ${ENV::TEST_CERTS_DIR}/servercert.pem
CipherString = DEFAULT
PrivateKey = ${ENV::TEST_CERTS_DIR}/serverkey.pem
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/root-cert.pem
VerifyMode = Require
[42-TLS 1.3 Ed25519 Client Auth-client]
[44-TLS 1.3 Ed25519 Client Auth-client]
CipherString = DEFAULT
EdDSA.Certificate = ${ENV::TEST_CERTS_DIR}/client-ed25519-cert.pem
EdDSA.PrivateKey = ${ENV::TEST_CERTS_DIR}/client-ed25519-key.pem
@@ -1446,7 +1499,7 @@ MinProtocol = TLSv1.3
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/rootcert.pem
VerifyMode = Peer
[test-42]
[test-44]
ExpectedClientCertType = Ed25519
ExpectedClientSignType = Ed25519
ExpectedResult = Success
@@ -1454,21 +1507,21 @@ ExpectedResult = Success
# ===========================================================
[43-TLS 1.3 Ed448 Client Auth]
ssl_conf = 43-TLS 1.3 Ed448 Client Auth-ssl
[45-TLS 1.3 Ed448 Client Auth]
ssl_conf = 45-TLS 1.3 Ed448 Client Auth-ssl
[43-TLS 1.3 Ed448 Client Auth-ssl]
server = 43-TLS 1.3 Ed448 Client Auth-server
client = 43-TLS 1.3 Ed448 Client Auth-client
[45-TLS 1.3 Ed448 Client Auth-ssl]
server = 45-TLS 1.3 Ed448 Client Auth-server
client = 45-TLS 1.3 Ed448 Client Auth-client
[43-TLS 1.3 Ed448 Client Auth-server]
[45-TLS 1.3 Ed448 Client Auth-server]
Certificate = ${ENV::TEST_CERTS_DIR}/servercert.pem
CipherString = DEFAULT
PrivateKey = ${ENV::TEST_CERTS_DIR}/serverkey.pem
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/root-cert.pem
VerifyMode = Require
[43-TLS 1.3 Ed448 Client Auth-client]
[45-TLS 1.3 Ed448 Client Auth-client]
CipherString = DEFAULT
EdDSA.Certificate = ${ENV::TEST_CERTS_DIR}/client-ed448-cert.pem
EdDSA.PrivateKey = ${ENV::TEST_CERTS_DIR}/client-ed448-key.pem
@@ -1477,7 +1530,7 @@ MinProtocol = TLSv1.3
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/rootcert.pem
VerifyMode = Peer
[test-43]
[test-45]
ExpectedClientCertType = Ed448
ExpectedClientSignType = Ed448
ExpectedResult = Success
@@ -1485,14 +1538,14 @@ ExpectedResult = Success
# ===========================================================
[44-TLS 1.2 DSA Certificate Test]
ssl_conf = 44-TLS 1.2 DSA Certificate Test-ssl
[46-TLS 1.2 DSA Certificate Test]
ssl_conf = 46-TLS 1.2 DSA Certificate Test-ssl
[44-TLS 1.2 DSA Certificate Test-ssl]
server = 44-TLS 1.2 DSA Certificate Test-server
client = 44-TLS 1.2 DSA Certificate Test-client
[46-TLS 1.2 DSA Certificate Test-ssl]
server = 46-TLS 1.2 DSA Certificate Test-server
client = 46-TLS 1.2 DSA Certificate Test-client
[44-TLS 1.2 DSA Certificate Test-server]
[46-TLS 1.2 DSA Certificate Test-server]
Certificate = ${ENV::TEST_CERTS_DIR}/servercert.pem
CipherString = ALL
DHParameters = ${ENV::TEST_CERTS_DIR}/dhp2048.pem
@@ -1502,26 +1555,26 @@ MaxProtocol = TLSv1.2
MinProtocol = TLSv1.2
PrivateKey = ${ENV::TEST_CERTS_DIR}/serverkey.pem
[44-TLS 1.2 DSA Certificate Test-client]
[46-TLS 1.2 DSA Certificate Test-client]
CipherString = ALL
SignatureAlgorithms = DSA+SHA256:DSA+SHA1
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/rootcert.pem
VerifyMode = Peer
[test-44]
[test-46]
ExpectedResult = Success
# ===========================================================
[45-TLS 1.3 Client Auth No TLS 1.3 Signature Algorithms]
ssl_conf = 45-TLS 1.3 Client Auth No TLS 1.3 Signature Algorithms-ssl
[47-TLS 1.3 Client Auth No TLS 1.3 Signature Algorithms]
ssl_conf = 47-TLS 1.3 Client Auth No TLS 1.3 Signature Algorithms-ssl
[45-TLS 1.3 Client Auth No TLS 1.3 Signature Algorithms-ssl]
server = 45-TLS 1.3 Client Auth No TLS 1.3 Signature Algorithms-server
client = 45-TLS 1.3 Client Auth No TLS 1.3 Signature Algorithms-client
[47-TLS 1.3 Client Auth No TLS 1.3 Signature Algorithms-ssl]
server = 47-TLS 1.3 Client Auth No TLS 1.3 Signature Algorithms-server
client = 47-TLS 1.3 Client Auth No TLS 1.3 Signature Algorithms-client
[45-TLS 1.3 Client Auth No TLS 1.3 Signature Algorithms-server]
[47-TLS 1.3 Client Auth No TLS 1.3 Signature Algorithms-server]
Certificate = ${ENV::TEST_CERTS_DIR}/servercert.pem
CipherString = DEFAULT
ClientSignatureAlgorithms = ECDSA+SHA1:DSA+SHA256:RSA+SHA256
@@ -1529,25 +1582,25 @@ PrivateKey = ${ENV::TEST_CERTS_DIR}/serverkey.pem
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/root-cert.pem
VerifyMode = Request
[45-TLS 1.3 Client Auth No TLS 1.3 Signature Algorithms-client]
[47-TLS 1.3 Client Auth No TLS 1.3 Signature Algorithms-client]
CipherString = DEFAULT
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/rootcert.pem
VerifyMode = Peer
[test-45]
[test-47]
ExpectedResult = ServerFail
# ===========================================================
[46-TLS 1.3 DSA Certificate Test]
ssl_conf = 46-TLS 1.3 DSA Certificate Test-ssl
[48-TLS 1.3 DSA Certificate Test]
ssl_conf = 48-TLS 1.3 DSA Certificate Test-ssl
[46-TLS 1.3 DSA Certificate Test-ssl]
server = 46-TLS 1.3 DSA Certificate Test-server
client = 46-TLS 1.3 DSA Certificate Test-client
[48-TLS 1.3 DSA Certificate Test-ssl]
server = 48-TLS 1.3 DSA Certificate Test-server
client = 48-TLS 1.3 DSA Certificate Test-client
[46-TLS 1.3 DSA Certificate Test-server]
[48-TLS 1.3 DSA Certificate Test-server]
Certificate = ${ENV::TEST_CERTS_DIR}/servercert.pem
CipherString = ALL
DSA.Certificate = ${ENV::TEST_CERTS_DIR}/server-dsa-cert.pem
@@ -1556,13 +1609,13 @@ MaxProtocol = TLSv1.3
MinProtocol = TLSv1.3
PrivateKey = ${ENV::TEST_CERTS_DIR}/serverkey.pem
[46-TLS 1.3 DSA Certificate Test-client]
[48-TLS 1.3 DSA Certificate Test-client]
CipherString = ALL
SignatureAlgorithms = DSA+SHA1:DSA+SHA256:ECDSA+SHA256
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/rootcert.pem
VerifyMode = Peer
[test-46]
[test-48]
ExpectedResult = ServerFail
+30
View File
@@ -36,6 +36,13 @@ my $server_pss_only = {
"PrivateKey" => test_pem("server-pss-key.pem"),
};
my $server_rsa_all = {
"PSS.Certificate" => test_pem("server-pss-cert.pem"),
"PSS.PrivateKey" => test_pem("server-pss-key.pem"),
"Certificate" => test_pem("servercert.pem"),
"PrivateKey" => test_pem("serverkey.pem"),
};
our @tests = (
{
name => "ECDSA CipherString Selection",
@@ -360,6 +367,29 @@ our @tests = (
"ExpectedResult" => "ServerFail"
},
},
{
name => "RSA key exchange with all RSA certificate types",
server => $server_rsa_all,
client => {
"CipherString" => "kRSA",
"MaxProtocol" => "TLSv1.2",
},
test => {
"ExpectedServerCertType" =>, "RSA",
"ExpectedResult" => "Success"
},
},
{
name => "RSA key exchange with only RSA-PSS certificate",
server => $server_pss_only,
client => {
"CipherString" => "kRSA",
"MaxProtocol" => "TLSv1.2",
},
test => {
"ExpectedResult" => "ServerFail"
},
},
{
name => "Suite B P-256 Hash Algorithm Selection",
server => {
+153 -43
View File
@@ -24,6 +24,24 @@
#include "internal/nelem.h"
#include "../ssl/ssl_locl.h"
#ifndef OPENSSL_NO_TLS1_3
static SSL_SESSION *clientpsk = NULL;
static SSL_SESSION *serverpsk = NULL;
static const char *pskid = "Identity";
static const char *srvid;
static int use_session_cb(SSL *ssl, const EVP_MD *md, const unsigned char **id,
size_t *idlen, SSL_SESSION **sess);
static int find_session_cb(SSL *ssl, const unsigned char *identity,
size_t identity_len, SSL_SESSION **sess);
static int use_session_cb_cnt = 0;
static int find_session_cb_cnt = 0;
static SSL_SESSION *create_a_psk(SSL *ssl);
#endif
static char *cert = NULL;
static char *privkey = NULL;
static char *srpvfile = NULL;
@@ -1430,6 +1448,61 @@ static int test_stateful_tickets(int idx)
{
return test_tickets(1, idx);
}
static int test_psk_tickets(void)
{
SSL_CTX *sctx = NULL, *cctx = NULL;
SSL *serverssl = NULL, *clientssl = NULL;
int testresult = 0;
int sess_id_ctx = 1;
if (!TEST_true(create_ssl_ctx_pair(TLS_server_method(), TLS_client_method(),
TLS1_VERSION, TLS_MAX_VERSION, &sctx,
&cctx, NULL, NULL))
|| !TEST_true(SSL_CTX_set_session_id_context(sctx,
(void *)&sess_id_ctx,
sizeof(sess_id_ctx))))
goto end;
SSL_CTX_set_session_cache_mode(cctx, SSL_SESS_CACHE_CLIENT
| SSL_SESS_CACHE_NO_INTERNAL_STORE);
SSL_CTX_set_psk_use_session_callback(cctx, use_session_cb);
SSL_CTX_set_psk_find_session_callback(sctx, find_session_cb);
SSL_CTX_sess_set_new_cb(cctx, new_session_cb);
use_session_cb_cnt = 0;
find_session_cb_cnt = 0;
srvid = pskid;
new_called = 0;
if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl,
NULL, NULL)))
goto end;
clientpsk = serverpsk = create_a_psk(clientssl);
if (!TEST_ptr(clientpsk))
goto end;
SSL_SESSION_up_ref(clientpsk);
if (!TEST_true(create_ssl_connection(serverssl, clientssl,
SSL_ERROR_NONE))
|| !TEST_int_eq(1, find_session_cb_cnt)
|| !TEST_int_eq(1, use_session_cb_cnt)
/* We should always get 1 ticket when using external PSK */
|| !TEST_int_eq(1, new_called))
goto end;
testresult = 1;
end:
SSL_free(serverssl);
SSL_free(clientssl);
SSL_CTX_free(sctx);
SSL_CTX_free(cctx);
SSL_SESSION_free(clientpsk);
SSL_SESSION_free(serverpsk);
clientpsk = serverpsk = NULL;
return testresult;
}
#endif
#define USE_NULL 0
@@ -1806,14 +1879,6 @@ static int test_set_sigalgs(int idx)
#endif
#ifndef OPENSSL_NO_TLS1_3
static SSL_SESSION *clientpsk = NULL;
static SSL_SESSION *serverpsk = NULL;
static const char *pskid = "Identity";
static const char *srvid;
static int use_session_cb_cnt = 0;
static int find_session_cb_cnt = 0;
static int psk_client_cb_cnt = 0;
static int psk_server_cb_cnt = 0;
@@ -1944,6 +2009,35 @@ static unsigned int psk_server_cb(SSL *ssl, const char *identity,
#define TLS13_AES_256_GCM_SHA384_BYTES ((const unsigned char *)"\x13\x02")
#define TLS13_AES_128_GCM_SHA256_BYTES ((const unsigned char *)"\x13\x01")
static SSL_SESSION *create_a_psk(SSL *ssl)
{
const SSL_CIPHER *cipher = NULL;
const unsigned char key[] = {
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a,
0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,
0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b,
0x2c, 0x2d, 0x2e, 0x2f
};
SSL_SESSION *sess = NULL;
cipher = SSL_CIPHER_find(ssl, TLS13_AES_256_GCM_SHA384_BYTES);
sess = SSL_SESSION_new();
if (!TEST_ptr(sess)
|| !TEST_ptr(cipher)
|| !TEST_true(SSL_SESSION_set1_master_key(sess, key,
sizeof(key)))
|| !TEST_true(SSL_SESSION_set_cipher(sess, cipher))
|| !TEST_true(
SSL_SESSION_set_protocol_version(sess,
TLS1_3_VERSION))) {
SSL_SESSION_free(sess);
return NULL;
}
return sess;
}
/*
* Helper method to setup objects for early data test. Caller frees objects on
* error.
@@ -1989,26 +2083,8 @@ static int setupearly_data_test(SSL_CTX **cctx, SSL_CTX **sctx, SSL **clientssl,
return 0;
if (idx == 2) {
/* Create the PSK */
const SSL_CIPHER *cipher = NULL;
const unsigned char key[] = {
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a,
0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,
0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b,
0x2c, 0x2d, 0x2e, 0x2f
};
cipher = SSL_CIPHER_find(*clientssl, TLS13_AES_256_GCM_SHA384_BYTES);
clientpsk = SSL_SESSION_new();
clientpsk = create_a_psk(*clientssl);
if (!TEST_ptr(clientpsk)
|| !TEST_ptr(cipher)
|| !TEST_true(SSL_SESSION_set1_master_key(clientpsk, key,
sizeof(key)))
|| !TEST_true(SSL_SESSION_set_cipher(clientpsk, cipher))
|| !TEST_true(
SSL_SESSION_set_protocol_version(clientpsk,
TLS1_3_VERSION))
/*
* We just choose an arbitrary value for max_early_data which
* should be big enough for testing purposes.
@@ -5265,9 +5341,11 @@ static int test_ticket_callbacks(int tst)
* Test 1: TLSv1.2, server continues to read/write after client shutdown
* Test 2: TLSv1.3, no pending NewSessionTicket messages
* Test 3: TLSv1.3, pending NewSessionTicket messages
* Test 4: TLSv1.3, server continues to read/write after client shutdown, client
* reads it
* Test 5: TLSv1.3, server continues to read/write after client shutdown, client
* Test 4: TLSv1.3, server continues to read/write after client shutdown, server
* sends key update, client reads it
* Test 5: TLSv1.3, server continues to read/write after client shutdown, server
* sends CertificateRequest, client reads and ignores it
* Test 6: TLSv1.3, server continues to read/write after client shutdown, client
* doesn't read it
*/
static int test_shutdown(int tst)
@@ -5278,6 +5356,7 @@ static int test_shutdown(int tst)
char msg[] = "A test message";
char buf[80];
size_t written, readbytes;
SSL_SESSION *sess;
#ifdef OPENSSL_NO_TLS1_2
if (tst <= 1)
@@ -5293,17 +5372,26 @@ static int test_shutdown(int tst)
TLS1_VERSION,
(tst <= 1) ? TLS1_2_VERSION
: TLS1_3_VERSION,
&sctx, &cctx, cert, privkey))
|| !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl,
&sctx, &cctx, cert, privkey)))
goto end;
if (tst == 5)
SSL_CTX_set_post_handshake_auth(cctx, 1);
if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl,
NULL, NULL)))
goto end;
if (tst == 3) {
if (!TEST_true(create_bare_ssl_connection(serverssl, clientssl,
SSL_ERROR_NONE)))
SSL_ERROR_NONE))
|| !TEST_ptr_ne(sess = SSL_get_session(clientssl), NULL)
|| !TEST_false(SSL_SESSION_is_resumable(sess)))
goto end;
} else if (!TEST_true(create_ssl_connection(serverssl, clientssl,
SSL_ERROR_NONE))) {
SSL_ERROR_NONE))
|| !TEST_ptr_ne(sess = SSL_get_session(clientssl), NULL)
|| !TEST_true(SSL_SESSION_is_resumable(sess))) {
goto end;
}
@@ -5324,13 +5412,30 @@ static int test_shutdown(int tst)
* Even though we're shutdown on receive we should still be
* able to write.
*/
|| !TEST_true(SSL_write(serverssl, msg, sizeof(msg)))
|| !TEST_int_eq(SSL_shutdown(serverssl), 1))
|| !TEST_true(SSL_write(serverssl, msg, sizeof(msg))))
goto end;
if (tst == 4) {
/* Should still be able to read data from server */
if (tst == 4
&& !TEST_true(SSL_key_update(serverssl,
SSL_KEY_UPDATE_REQUESTED)))
goto end;
if (tst == 5) {
SSL_set_verify(serverssl, SSL_VERIFY_PEER, NULL);
if (!TEST_true(SSL_verify_client_post_handshake(serverssl)))
goto end;
}
if ((tst == 4 || tst == 5)
&& !TEST_true(SSL_write(serverssl, msg, sizeof(msg))))
goto end;
if (!TEST_int_eq(SSL_shutdown(serverssl), 1))
goto end;
if (tst == 4 || tst == 5) {
/* Should still be able to read data from server */
if (!TEST_true(SSL_read_ex(clientssl, buf, sizeof(buf),
&readbytes))
&readbytes))
|| !TEST_size_t_eq(readbytes, sizeof(msg))
|| !TEST_int_eq(memcmp(msg, buf, readbytes), 0)
|| !TEST_true(SSL_read_ex(clientssl, buf, sizeof(buf),
&readbytes))
|| !TEST_size_t_eq(readbytes, sizeof(msg))
|| !TEST_int_eq(memcmp(msg, buf, readbytes), 0))
goto end;
@@ -5354,19 +5459,23 @@ static int test_shutdown(int tst)
*/
|| !TEST_false(SSL_write_ex(serverssl, msg, sizeof(msg), &written))
|| !TEST_int_eq(SSL_shutdown(clientssl), 1)
|| !TEST_ptr_ne(sess = SSL_get_session(clientssl), NULL)
|| !TEST_true(SSL_SESSION_is_resumable(sess))
|| !TEST_int_eq(SSL_shutdown(serverssl), 1))
goto end;
} else if (tst == 4) {
} else if (tst == 4 || tst == 5) {
/*
* In this test the client has sent close_notify and it has been
* received by the server which has responded with a close_notify. The
* client needs to read the close_notify sent by the server.
*/
if (!TEST_int_eq(SSL_shutdown(clientssl), 1))
if (!TEST_int_eq(SSL_shutdown(clientssl), 1)
|| !TEST_ptr_ne(sess = SSL_get_session(clientssl), NULL)
|| !TEST_true(SSL_SESSION_is_resumable(sess)))
goto end;
} else {
/*
* tst == 5
* tst == 6
*
* The client has sent close_notify and is expecting a close_notify
* back, but instead there is application data first. The shutdown
@@ -5426,6 +5535,7 @@ int setup_tests(void)
#ifndef OPENSSL_NO_TLS1_3
ADD_ALL_TESTS(test_stateful_tickets, 3);
ADD_ALL_TESTS(test_stateless_tickets, 3);
ADD_TEST(test_psk_tickets);
#endif
ADD_ALL_TESTS(test_ssl_set_bio, TOTAL_SSL_SET_BIO_TESTS);
ADD_TEST(test_ssl_bio_pop_next_bio);
@@ -5488,7 +5598,7 @@ int setup_tests(void)
ADD_ALL_TESTS(test_ssl_pending, 2);
ADD_ALL_TESTS(test_ssl_get_shared_ciphers, OSSL_NELEM(shared_ciphers_data));
ADD_ALL_TESTS(test_ticket_callbacks, 12);
ADD_ALL_TESTS(test_shutdown, 6);
ADD_ALL_TESTS(test_shutdown, 7);
return 1;
}