diff options
Diffstat (limited to 'test')
31 files changed, 2328 insertions, 8986 deletions
diff --git a/test/bad_dtls_test.c b/test/bad_dtls_test.c index 3d734bba41c5..9178f2fb7940 100644 --- a/test/bad_dtls_test.c +++ b/test/bad_dtls_test.c @@ -1,5 +1,5 @@ /* - * Copyright 2016-2024 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2026 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 @@ -101,89 +101,17 @@ static SSL_SESSION *client_session(void) 0x04, 0x20, /* OCTET_STRING, session id */ #define SS_SESSID_OFS 15 /* Session ID goes here */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x04, - 0x30, /* OCTET_STRING, master secret */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, + 0x04, 0x30, /* OCTET_STRING, master secret */ #define SS_SECRET_OFS 49 /* Master secret goes here */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; const unsigned char *p = session_asn1; @@ -303,26 +231,8 @@ static int send_hello_verify(BIO *rbio) 0x00, /* DTLS1_BAD_VER */ 0x14, /* Cookie length */ #define HV_COOKIE_OFS 28 /* Cookie goes here */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; memcpy(hello_verify + HV_COOKIE_OFS, cookie, sizeof(cookie)); @@ -363,75 +273,18 @@ static int send_server_hello(BIO *rbio) 0x01, 0x00, /* DTLS1_BAD_VER */ #define SH_RANDOM_OFS 27 /* Server random goes here */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x20, /* Session ID length */ #define SH_SESSID_OFS 60 /* Session ID goes here */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x2f, /* Cipher suite AES128-SHA */ - 0x00, /* Compression null */ + 0x00 /* Compression null */ }; static unsigned char change_cipher_spec[] = { 0x14, /* Change Cipher Spec */ @@ -449,7 +302,7 @@ static int send_server_hello(BIO *rbio) 0x03, /* Length */ 0x01, 0x00, - 0x02, /* Message */ + 0x02 /* Message */ }; memcpy(server_hello + SH_RANDOM_OFS, server_random, sizeof(server_random)); diff --git a/test/build.info b/test/build.info index 6089b8c97cf8..83acdd1b4289 100644 --- a/test/build.info +++ b/test/build.info @@ -683,6 +683,13 @@ IF[{- !$disabled{tests} -}] INCLUDE[dsa_no_digest_size_test]=../include ../apps/include DEPEND[dsa_no_digest_size_test]=../libcrypto.a libtestutil.a + IF[{- !$disabled{ecx} && !$disabled{tls1_3} -}] + PROGRAMS{noinst}=tls13ticket_test + SOURCE[tls13ticket_test]=tls13tickettest.c helpers/ssltestlib.c + INCLUDE[tls13ticket_test]=../include ../apps/include + DEPEND[tls13ticket_test]=../libcrypto ../libssl libtestutil.a + ENDIF + SOURCE[tls13encryptiontest]=tls13encryptiontest.c INCLUDE[tls13encryptiontest]=.. ../include ../apps/include DEPEND[tls13encryptiontest]=../libcrypto.a ../libssl.a libtestutil.a diff --git a/test/cipherlist_test.c b/test/cipherlist_test.c index d14f566b165f..e00858b15fbd 100644 --- a/test/cipherlist_test.c +++ b/test/cipherlist_test.c @@ -1,5 +1,5 @@ /* - * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2026 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. @@ -243,10 +243,65 @@ end: return result; } +/* + * SSL_CTX_set_ciphersuites() must not crash on empty list elements. + * CONF_parse_list() signals them with elem=NULL; ciphersuite_cb() must skip + * such entries rather than passing NULL to memcpy(). + */ +#ifndef OPENSSL_NO_TLS1_3 +static int cipher_in_ctx(const SSL_CTX *ctx, uint32_t id) +{ + const STACK_OF(SSL_CIPHER) *sk = SSL_CTX_get_ciphers(ctx); + int i; + + for (i = 0; i < sk_SSL_CIPHER_num(sk); i++) + if (SSL_CIPHER_get_id(sk_SSL_CIPHER_value(sk, i)) == id) + return 1; + return 0; +} + +static int test_set_ciphersuites_empty_elem(void) +{ + SSL_CTX *ctx = NULL; + int result = 0; + + if (!TEST_ptr(ctx = SSL_CTX_new(TLS_method()))) + goto end; + + /* Double colon: both surrounding valid suites must be applied */ + if (!TEST_true(SSL_CTX_set_ciphersuites(ctx, + "TLS_AES_128_GCM_SHA256::TLS_AES_256_GCM_SHA384"))) + goto end; + if (!TEST_true(cipher_in_ctx(ctx, TLS1_3_CK_AES_128_GCM_SHA256)) + || !TEST_true(cipher_in_ctx(ctx, TLS1_3_CK_AES_256_GCM_SHA384))) + goto end; + + /* Leading separator: empty first element, one valid suite must apply */ + if (!TEST_true(SSL_CTX_set_ciphersuites(ctx, ":TLS_AES_128_GCM_SHA256"))) + goto end; + if (!TEST_true(cipher_in_ctx(ctx, TLS1_3_CK_AES_128_GCM_SHA256))) + goto end; + + /* Trailing separator: empty last element, one valid suite must apply */ + if (!TEST_true(SSL_CTX_set_ciphersuites(ctx, "TLS_AES_128_GCM_SHA256:"))) + goto end; + if (!TEST_true(cipher_in_ctx(ctx, TLS1_3_CK_AES_128_GCM_SHA256))) + goto end; + + result = 1; +end: + SSL_CTX_free(ctx); + return result; +} +#endif + int setup_tests(void) { ADD_TEST(test_default_cipherlist_implicit); ADD_TEST(test_default_cipherlist_explicit); ADD_TEST(test_default_cipherlist_clear); +#ifndef OPENSSL_NO_TLS1_3 + ADD_TEST(test_set_ciphersuites_empty_elem); +#endif return 1; } diff --git a/test/cms-msg/enveloped-content-type-for-aes-gcm.pem b/test/cms-msg/enveloped-content-type-for-aes-gcm.pem new file mode 100644 index 000000000000..b0610a7ec8a2 --- /dev/null +++ b/test/cms-msg/enveloped-content-type-for-aes-gcm.pem @@ -0,0 +1,7 @@ +-----BEGIN PKCS7----- +MIAGCSqGSIb3DQEHA6CAMIACAQIxNqI0AgEEMAgEBkMwRkVFMDALBglghkgBZQME +AQUEGPN0q9rM3neSiY7HIADpnqWym33mRZC4JDCABgkqhkiG9w0BBwEwHgYJYIZI +AWUDBAEGMBEEDIExQGiHZFSYa0ZBqQIBEKCABGNap+JL1B21Mq7ojKPzVuxtRkg3 +LWt8khnK1EzfmV7e64l5KnTdjq9+gfbwOfbuhTavfBI7VK/ZtpH3HII4fCOe37kV +mju8/YnYeRq2KcxESmJBySV/veMwxqmHGAw71JyHpg4AAAAAAAAAAAAA +-----END PKCS7----- diff --git a/test/cms-msg/make_missing_kdf_der.py b/test/cms-msg/make_missing_kdf_der.py new file mode 100755 index 000000000000..5b3fc0f6eeda --- /dev/null +++ b/test/cms-msg/make_missing_kdf_der.py @@ -0,0 +1,137 @@ +#!/usr/bin/env python3 + +# Copyright 2026 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 + +# This script generates missing-kdf.der - a password-encrypted CMS message +# without the keyDerivationAlgorithm field, which is used in the +# “PWRI missing keyDerivationAlgorithm regression” test. +# +# Usage: python3 make_missing_kdf_der.py valid.der missing-kdf.der + +from __future__ import annotations + +import argparse +import sys +from dataclasses import dataclass +from pathlib import Path + + +@dataclass +class Node: + off: int + tag: int + hdr_len: int + length: int + end: int + children: list["Node"] + + +def read_len(data: bytes, off: int) -> tuple[int, int]: + first = data[off] + if first < 0x80: + return first, 1 + n = first & 0x7F + if n == 0 or n > 4: + raise ValueError(f"unsupported DER length form at {off}") + val = 0 + for b in data[off + 1 : off + 1 + n]: + val = (val << 8) | b + return val, 1 + n + + +def parse_node(data: bytes, off: int) -> Node: + tag = data[off] + length, len_len = read_len(data, off + 1) + hdr_len = 1 + len_len + end = off + hdr_len + length + children: list[Node] = [] + if tag & 0x20: + cur = off + hdr_len + while cur < end: + child = parse_node(data, cur) + children.append(child) + cur = child.end + if cur != end: + raise ValueError(f"child parse ended at {cur}, expected {end}") + return Node(off=off, tag=tag, hdr_len=hdr_len, length=length, end=end, children=children) + + +def encode_len(length: int, existing_len_len: int) -> bytes: + if existing_len_len == 1: + if length >= 0x80: + raise ValueError("new length no longer fits in short-form DER") + return bytes([length]) + payload_len = existing_len_len - 1 + max_len = (1 << (payload_len * 8)) - 1 + if length > max_len: + raise ValueError("new length no longer fits in existing long-form DER") + out = bytearray([0x80 | payload_len]) + for shift in range((payload_len - 1) * 8, -8, -8): + out.append((length >> shift) & 0xFF) + return bytes(out) + + +def patch_length_field(buf: bytearray, node: Node, delta: int) -> None: + new_len = node.length + delta + if new_len < 0: + raise ValueError("negative patched length") + len_bytes = encode_len(new_len, node.hdr_len - 1) + start = node.off + 1 + end = start + len(node.hdr_len.to_bytes(1, "big")) - 1 # unused, kept for clarity + buf[start : start + len(len_bytes)] = len_bytes + + +def main() -> int: + ap = argparse.ArgumentParser(description="Remove PWRI keyDerivationAlgorithm from a CMS DER blob.") + ap.add_argument("input_der") + ap.add_argument("output_der") + args = ap.parse_args() + + data = Path(args.input_der).read_bytes() + root = parse_node(data, 0) + + # CMS structure we expect: + # SEQUENCE { OID envelopedData, [0] SEQUENCE { version, SET recipientInfos, ... } } + ed_wrapper = root.children[1] + env_seq = ed_wrapper.children[0] + recipient_set = env_seq.children[1] + pwri_choice = recipient_set.children[0] # [3] + + if pwri_choice.tag != 0xA3: + raise ValueError(f"expected PWRI choice tag 0xA3, found 0x{pwri_choice.tag:02x}") + if len(pwri_choice.children) < 3: + raise ValueError("unexpected PWRI child count") + + version = pwri_choice.children[0] + maybe_kdf = pwri_choice.children[1] + keyenc = pwri_choice.children[2] + if version.tag != 0x02: + raise ValueError("PWRI version is not INTEGER") + if maybe_kdf.tag != 0xA0: + raise ValueError(f"PWRI child after version is not [0] keyDerivationAlgorithm: 0x{maybe_kdf.tag:02x}") + if keyenc.tag != 0x30: + raise ValueError("PWRI keyEncryptionAlgorithm is not SEQUENCE") + + remove_start = maybe_kdf.off + remove_end = maybe_kdf.end + remove_len = remove_end - remove_start + + out = bytearray(data) + del out[remove_start:remove_end] + + # Adjust ancestors whose length spans the removed field. + for node in [root, ed_wrapper, env_seq, recipient_set, pwri_choice]: + patch_length_field(out, node, -remove_len) + + Path(args.output_der).write_bytes(out) + print(f"removed {remove_len} bytes at [{remove_start}, {remove_end})") + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/test/cms-msg/missing-kdf.der b/test/cms-msg/missing-kdf.der Binary files differnew file mode 100644 index 000000000000..3db602e47c23 --- /dev/null +++ b/test/cms-msg/missing-kdf.der diff --git a/test/cmsapitest.c b/test/cmsapitest.c index 7e74c5daf221..ba804ee1a60b 100644 --- a/test/cmsapitest.c +++ b/test/cmsapitest.c @@ -13,13 +13,199 @@ #include <openssl/cms.h> #include <openssl/bio.h> #include <openssl/x509.h> - +#include <internal/nelem.h> #include "testutil.h" static X509 *cert = NULL; static EVP_PKEY *privkey = NULL; static char *derin = NULL; static char *too_long_iv_cms_in = NULL; +static char *pwri_kek_oob_der_in = NULL; + +/* + * This is our bad cms data, it contains an AuthEnvelopedData field + * with a CIPHER OID set to AES-256-OFB + */ +static const unsigned char bad_cms_der[452] = { + 0x30, 0x82, 0x01, 0xc0, 0x06, 0x0b, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, + 0x01, 0x09, 0x10, 0x01, 0x17, 0xa0, 0x82, 0x01, 0xaf, 0x30, 0x82, 0x01, + 0xab, 0x02, 0x01, 0x00, 0x31, 0x82, 0x01, 0x44, 0x30, 0x82, 0x01, 0x40, + 0x02, 0x01, 0x00, 0x30, 0x28, 0x30, 0x10, 0x31, 0x0e, 0x30, 0x0c, 0x06, + 0x03, 0x55, 0x04, 0x03, 0x0c, 0x05, 0x52, 0x65, 0x63, 0x69, 0x70, 0x02, + 0x14, 0x1a, 0x5c, 0x04, 0x9b, 0x3a, 0x64, 0xff, 0xd4, 0x63, 0xde, 0x4f, + 0x90, 0xe5, 0x76, 0xe2, 0x18, 0xe8, 0x5c, 0x9e, 0xd7, 0x30, 0x0d, 0x06, + 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, + 0x04, 0x82, 0x01, 0x00, 0x18, 0xcf, 0x9f, 0x44, 0x95, 0x79, 0xe9, 0x96, + 0x7d, 0x0f, 0xd1, 0xb4, 0xc2, 0x38, 0xb0, 0xc9, 0x76, 0xd5, 0xba, 0x08, + 0x5c, 0xbf, 0xc3, 0x30, 0xea, 0x3a, 0x68, 0xa4, 0xba, 0x99, 0x4c, 0x70, + 0x97, 0xb8, 0xa9, 0xce, 0x71, 0x4c, 0x54, 0xa3, 0xfd, 0x81, 0x9e, 0x15, + 0x63, 0xb7, 0x23, 0x46, 0x17, 0x69, 0xaf, 0x8f, 0xbd, 0xa3, 0x54, 0x23, + 0xf3, 0xf5, 0x35, 0xa8, 0xd4, 0x9c, 0xec, 0xe1, 0x17, 0x2c, 0x6d, 0x0b, + 0xad, 0xc0, 0xe9, 0x1d, 0xd1, 0x8d, 0x59, 0xd5, 0x29, 0xc6, 0x40, 0xc4, + 0xcd, 0x4e, 0x87, 0x70, 0x19, 0x5d, 0x88, 0x50, 0xbd, 0x4a, 0x13, 0xb3, + 0xef, 0x0c, 0x6d, 0x6a, 0xc5, 0x51, 0xbb, 0x5c, 0x39, 0x17, 0xda, 0xb1, + 0x71, 0x17, 0x88, 0xfb, 0x6a, 0xef, 0x7f, 0x85, 0xa7, 0x04, 0x71, 0xc7, + 0x83, 0x91, 0xb3, 0x30, 0x1b, 0x3d, 0x18, 0x7f, 0x63, 0xbf, 0x42, 0x7c, + 0xae, 0x6f, 0xae, 0xa1, 0x17, 0x84, 0xfd, 0x67, 0x2a, 0x4f, 0x4c, 0xe9, + 0x05, 0x26, 0x2c, 0xd5, 0xab, 0x0c, 0xcf, 0xdc, 0x3f, 0x24, 0xcf, 0x71, + 0x26, 0x7a, 0x1f, 0xf7, 0xc9, 0x92, 0x5e, 0xb6, 0x3d, 0x7f, 0xc3, 0x08, + 0xd3, 0xad, 0xc0, 0xc8, 0x4f, 0x42, 0x0c, 0xf3, 0xac, 0x23, 0x11, 0xdf, + 0x75, 0x84, 0x69, 0x8c, 0xa6, 0x59, 0x43, 0xfb, 0xf7, 0x6b, 0x62, 0xf0, + 0xf7, 0x35, 0x07, 0xc4, 0xf8, 0xd5, 0x12, 0x4a, 0x16, 0x62, 0xbc, 0x04, + 0xaa, 0x9a, 0x2e, 0xb2, 0x1a, 0xfa, 0x4c, 0x82, 0xce, 0x9e, 0xa8, 0x6d, + 0xc1, 0x29, 0x59, 0xe0, 0x33, 0xb5, 0xa6, 0x47, 0x09, 0x2e, 0xbf, 0x60, + 0xa6, 0xb3, 0x21, 0xa0, 0x15, 0xac, 0x92, 0x29, 0xb5, 0xe6, 0xe0, 0xd4, + 0x8b, 0xd8, 0x21, 0xe2, 0x17, 0x98, 0xd1, 0x11, 0x5d, 0xc5, 0xae, 0x24, + 0xe8, 0x92, 0xdb, 0x96, 0xa3, 0x5b, 0x58, 0xa7, 0x30, 0x4c, 0x06, 0x09, + 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01, 0x30, 0x1d, 0x06, + 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x2b, 0x04, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x80, 0x20, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, + 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, + 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, + 0x41, 0x41, 0x04, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +/* + * This array represents a der encoded contentinfo structure addressed to + * servercert.pem, with the tag value of the aes-256-gcm cipher used to encrypt + * the contents of the mssages down to 1 byte. Decoding it should fail + */ +static const unsigned char one_byte_mac_cms_der[423] = { + 0x30, 0x82, 0x01, 0xa3, 0x06, 0x0b, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, + 0x01, 0x09, 0x10, 0x01, 0x17, 0xa0, 0x82, 0x01, 0x92, 0x30, 0x82, 0x01, + 0x8e, 0x02, 0x01, 0x00, 0x31, 0x82, 0x01, 0x33, 0x30, 0x82, 0x01, 0x2f, + 0x02, 0x01, 0x00, 0x30, 0x17, 0x30, 0x12, 0x31, 0x10, 0x30, 0x0e, 0x06, + 0x03, 0x55, 0x04, 0x03, 0x0c, 0x07, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, + 0x41, 0x02, 0x01, 0x02, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, + 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x04, 0x82, 0x01, 0x00, 0x10, + 0x3a, 0x8c, 0xee, 0x4e, 0xe2, 0x1f, 0xfe, 0xcc, 0x28, 0x39, 0x9e, 0x46, + 0xbe, 0xa7, 0xd5, 0x02, 0x2a, 0x53, 0x06, 0x5f, 0x94, 0x6b, 0x69, 0x6d, + 0x2d, 0xe8, 0x44, 0xa6, 0x43, 0x52, 0x82, 0x89, 0x2d, 0xf1, 0x9b, 0xb9, + 0x9e, 0xa4, 0x8d, 0x77, 0xf1, 0xd2, 0x8e, 0x86, 0x79, 0x06, 0x3e, 0x90, + 0xf0, 0xca, 0x9e, 0xb5, 0x35, 0xd5, 0x89, 0xf0, 0x7c, 0x06, 0xa0, 0x91, + 0xbf, 0xf4, 0x61, 0xaa, 0x5c, 0x99, 0xa3, 0x64, 0x15, 0xfd, 0xf9, 0x90, + 0xf0, 0xf3, 0x25, 0x5b, 0x48, 0xa1, 0xfb, 0x7a, 0xce, 0x63, 0xdc, 0xa9, + 0xfe, 0x7c, 0xbe, 0x9c, 0xaa, 0xd3, 0x42, 0x0e, 0x4a, 0xc3, 0x4b, 0x4e, + 0x76, 0x6d, 0x52, 0x54, 0x85, 0x4e, 0xab, 0x50, 0x2c, 0x5f, 0xc2, 0x8b, + 0x9f, 0x1f, 0x0f, 0x8a, 0x7c, 0xb3, 0x0a, 0xde, 0x50, 0x9b, 0xef, 0x89, + 0xf2, 0xea, 0x07, 0xca, 0x11, 0x76, 0x29, 0xaf, 0xe4, 0x59, 0x28, 0x19, + 0x48, 0x96, 0x67, 0xdd, 0xdd, 0x01, 0xf0, 0x14, 0xbe, 0x3d, 0xa5, 0xa3, + 0x83, 0x21, 0x39, 0x29, 0xb7, 0x8f, 0xb7, 0xf4, 0x85, 0x05, 0xee, 0xca, + 0xbb, 0xbd, 0xc0, 0xaf, 0x0d, 0xf1, 0xef, 0x5f, 0x06, 0x05, 0xeb, 0x0e, + 0x55, 0xf0, 0x7e, 0x13, 0x1a, 0x2a, 0x37, 0xd4, 0xba, 0x26, 0xc8, 0x2e, + 0x6b, 0xc3, 0xe1, 0xcf, 0x28, 0xab, 0x0d, 0xab, 0xdd, 0xa7, 0xf4, 0xd3, + 0x59, 0xcd, 0xc7, 0x2d, 0xa1, 0x56, 0x5f, 0x47, 0x77, 0x27, 0x17, 0x71, + 0xae, 0x75, 0xc8, 0x71, 0x58, 0xf9, 0xab, 0x67, 0xda, 0x23, 0x62, 0xa0, + 0x6d, 0xe5, 0x2d, 0x06, 0xb8, 0xc0, 0xac, 0xaa, 0x38, 0xa4, 0x0d, 0xb5, + 0xb2, 0xce, 0xa7, 0x26, 0x0d, 0x3a, 0x88, 0x2f, 0x8d, 0x6c, 0xa0, 0xf6, + 0x94, 0xf2, 0x2c, 0x37, 0x03, 0xaf, 0x67, 0x5c, 0xf3, 0x2c, 0xfb, 0xe8, + 0x16, 0x9e, 0x55, 0x30, 0x4f, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, + 0x0d, 0x01, 0x07, 0x01, 0x30, 0x1e, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, + 0x65, 0x03, 0x04, 0x01, 0x2e, 0x30, 0x11, 0x04, 0x0c, 0x6b, 0x1d, 0xe5, + 0xb2, 0x38, 0x0e, 0x17, 0x91, 0x9c, 0x9c, 0x40, 0x35, 0x02, 0x01, 0x10, + 0x80, 0x22, 0xa0, 0x90, 0x75, 0x74, 0xdf, 0x2d, 0xba, 0x4f, 0xce, 0x4e, + 0x7e, 0x52, 0xb0, 0x2e, 0x5f, 0xe0, 0x84, 0x01, 0xb1, 0x49, 0x0b, 0x69, + 0xc7, 0x61, 0x63, 0x84, 0x3a, 0xfc, 0xaa, 0x86, 0xfc, 0x96, 0x4e, 0x6c, + 0x04, 0x01, 0x92 +}; + +static int test_short_mac_on_auth_envelope_data(void) +{ + int ret = 0; + const unsigned char *derptr = one_byte_mac_cms_der; + BIO *outmsgbio = BIO_new(BIO_s_mem()); + CMS_ContentInfo *content = d2i_CMS_ContentInfo(NULL, &derptr, OSSL_NELEM(one_byte_mac_cms_der)); + + if (!TEST_ptr(content)) + goto end; + + /* + * We expect this to fail, as the tag value in the authEnvelopedData parameter is + * a single byte + */ + if (!TEST_false(CMS_decrypt(content, privkey, cert, NULL, outmsgbio, CMS_TEXT))) + goto end; + + ret = 1; +end: + BIO_free(outmsgbio); + CMS_ContentInfo_free(content); + return ret; +} + +static int test_non_aead_on_auth_envelope_dec(void) +{ + int ret = 0; + const unsigned char *derptr = bad_cms_der; + BIO *outmsgbio = BIO_new(BIO_s_mem()); + CMS_ContentInfo *content = d2i_CMS_ContentInfo(NULL, &derptr, OSSL_NELEM(bad_cms_der)); + + if (!TEST_ptr(content)) + goto end; + + /* + * We expect this to fail + */ + if (!TEST_false(CMS_decrypt(content, privkey, cert, NULL, outmsgbio, + CMS_TEXT))) + goto end; + + ret = 1; +end: + BIO_free(outmsgbio); + CMS_ContentInfo_free(content); + return ret; +} + +static int test_non_aead_on_auth_envelope_enc(void) +{ + CMS_ContentInfo *content = NULL; + STACK_OF(X509) *certstack = sk_X509_new_null(); + const EVP_CIPHER *cipher = EVP_aes_128_cbc(); + const char *msg = "Hello world"; + BIO *msgbio = BIO_new_mem_buf(msg, (int)strlen(msg)); + BIO *outmsgbio = BIO_new(BIO_s_mem()); + X509 *recip; + int i; + int ret = 0; + + if (!TEST_ptr(certstack) || !TEST_ptr(msgbio) || !TEST_ptr(outmsgbio)) + goto end; + + if (!TEST_int_gt(sk_X509_push(certstack, cert), 0)) + goto end; + + /* + * Emulate CMS_encrypt here, but use a non AEAD cipher + */ + content = CMS_AuthEnvelopedData_create_ex(cipher, NULL, NULL); + + if (!TEST_ptr(content)) + goto end; + + for (i = 0; i < sk_X509_num(certstack); i++) { + recip = sk_X509_value(certstack, i); + if (!TEST_ptr(CMS_add1_recipient_cert(content, recip, CMS_TEXT))) + goto end; + } + + /* + * We expect this to fail as we are using a non-AEAD cipher on + * AuthEnvelopedData + */ + if (!TEST_int_eq(CMS_final(content, msgbio, NULL, CMS_TEXT), 0)) + goto end; + + ret = 1; +end: + sk_X509_free(certstack); + BIO_free(msgbio); + BIO_free(outmsgbio); + CMS_ContentInfo_free(content); + return ret; +} static int test_encrypt_decrypt(const EVP_CIPHER *cipher) { @@ -484,7 +670,48 @@ end: return ret; } -OPT_TEST_DECLARE_USAGE("certfile privkeyfile derfile\n") +/* + * CMS EnvelopedData with a single PasswordRecipientInfo using + * id-alg-PWRI-KEK and an AES-128-CFB key encryption cipher + * (1-byte effective block size). The encryptedKey OCTET STRING is + * only two bytes long, so the wrapped key buffer is shorter than + * the seven octets read by the check-byte test in kek_unwrap_key(). + * Prior to CVE-2026-9076 this triggered an out-of-bounds heap read; + * CMS_decrypt() must now fail cleanly. + */ +static int test_pwri_kek_unwrap_short_encrypted_key(void) +{ + BIO *in = NULL; + CMS_ContentInfo *cms = NULL; + unsigned long err = 0; + int ret = 0; + + if (!TEST_ptr(in = BIO_new_file(pwri_kek_oob_der_in, "rb")) + || !TEST_ptr(cms = d2i_CMS_bio(in, NULL))) + goto end; + + /* + * The unwrap is attempted eagerly inside CMS_decrypt_set1_password(). + * It must fail cleanly (no OOB read) and report CMS_R_UNWRAP_FAILURE. + */ + if (!TEST_false(CMS_decrypt_set1_password(cms, + (unsigned char *)"password", -1))) + goto end; + + err = ERR_peek_last_error(); + if (!TEST_int_eq(ERR_GET_LIB(err), ERR_LIB_CMS) + || !TEST_int_eq(ERR_GET_REASON(err), CMS_R_UNWRAP_FAILURE)) + goto end; + + ERR_clear_error(); + ret = 1; +end: + CMS_ContentInfo_free(cms); + BIO_free(in); + return ret; +} + +OPT_TEST_DECLARE_USAGE("certfile privkeyfile derfile tooLongIVpem pwriKekOobDer\n") int setup_tests(void) { @@ -499,7 +726,8 @@ int setup_tests(void) if (!TEST_ptr(certin = test_get_argument(0)) || !TEST_ptr(privkeyin = test_get_argument(1)) || !TEST_ptr(derin = test_get_argument(2)) - || !TEST_ptr(too_long_iv_cms_in = test_get_argument(3))) + || !TEST_ptr(too_long_iv_cms_in = test_get_argument(3)) + || !TEST_ptr(pwri_kek_oob_der_in = test_get_argument(4))) return 0; certbio = BIO_new_file(certin, "r"); @@ -529,12 +757,16 @@ int setup_tests(void) ADD_TEST(test_encrypt_decrypt_aes_128_gcm); ADD_TEST(test_encrypt_decrypt_aes_192_gcm); ADD_TEST(test_encrypt_decrypt_aes_256_gcm); + ADD_TEST(test_non_aead_on_auth_envelope_enc); + ADD_TEST(test_non_aead_on_auth_envelope_dec); + ADD_TEST(test_short_mac_on_auth_envelope_data); ADD_TEST(test_d2i_CMS_bio_NULL); ADD_TEST(test_CMS_set1_key_mem_leak); ADD_TEST(test_encrypted_data); ADD_TEST(test_encrypted_data_aead); ADD_ALL_TESTS(test_d2i_CMS_decode, 2); ADD_TEST(test_cms_aesgcm_iv_too_long); + ADD_TEST(test_pwri_kek_unwrap_short_encrypted_key); return 1; } diff --git a/test/destest.c b/test/destest.c index e4e4d887d811..ddb0d7cbec93 100644 --- a/test/destest.c +++ b/test/destest.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2026 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 @@ -187,46 +187,10 @@ static unsigned char cbc_iv[8] = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x1 */ /* static char cbc_data[40]="7654321 Now is the time for \0001"; */ static unsigned char cbc_data[40] = { - 0x37, - 0x36, - 0x35, - 0x34, - 0x33, - 0x32, - 0x31, - 0x20, - 0x4E, - 0x6F, - 0x77, - 0x20, - 0x69, - 0x73, - 0x20, - 0x74, - 0x68, - 0x65, - 0x20, - 0x74, - 0x69, - 0x6D, - 0x65, - 0x20, - 0x66, - 0x6F, - 0x72, - 0x20, - 0x00, - 0x31, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0x37, 0x36, 0x35, 0x34, 0x33, 0x32, 0x31, 0x20, 0x4E, 0x6F, + 0x77, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, + 0x69, 0x6D, 0x65, 0x20, 0x66, 0x6F, 0x72, 0x20, 0x00, 0x31, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; static unsigned char cbc_ok[32] = { @@ -241,73 +205,17 @@ static unsigned char cbc_ok[32] = { #error "Original vectors are preserved for reference only." static unsigned char cbc2_key[8] = { 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87 }; static unsigned char xcbc_ok[32] = { - 0x86, - 0x74, - 0x81, - 0x0D, - 0x61, - 0xA4, - 0xA5, - 0x48, - 0xB9, - 0x93, - 0x03, - 0xE1, - 0xB8, - 0xBB, - 0xBD, - 0xBD, - 0x64, - 0x30, - 0x0B, - 0xB9, - 0x06, - 0x65, - 0x81, - 0x76, - 0x04, - 0x1D, - 0x77, - 0x62, - 0x17, - 0xCA, - 0x2B, - 0xD2, + 0x86, 0x74, 0x81, 0x0D, 0x61, 0xA4, 0xA5, 0x48, 0xB9, 0x93, + 0x03, 0xE1, 0xB8, 0xBB, 0xBD, 0xBD, 0x64, 0x30, 0x0B, 0xB9, + 0x06, 0x65, 0x81, 0x76, 0x04, 0x1D, 0x77, 0x62, 0x17, 0xCA, + 0x2B, 0xD2 }; #else static unsigned char xcbc_ok[32] = { - 0x84, - 0x6B, - 0x29, - 0x14, - 0x85, - 0x1E, - 0x9A, - 0x29, - 0x54, - 0x73, - 0x2F, - 0x8A, - 0xA0, - 0xA6, - 0x11, - 0xC1, - 0x15, - 0xCD, - 0xC2, - 0xD7, - 0x95, - 0x1B, - 0x10, - 0x53, - 0xA6, - 0x3C, - 0x5E, - 0x03, - 0xB2, - 0x1A, - 0xA3, - 0xC4, + 0x84, 0x6B, 0x29, 0x14, 0x85, 0x1E, 0x9A, 0x29, 0x54, 0x73, + 0x2F, 0x8A, 0xA0, 0xA6, 0x11, 0xC1, 0x15, 0xCD, 0xC2, 0xD7, + 0x95, 0x1B, 0x10, 0x53, 0xA6, 0x3C, 0x5E, 0x03, 0xB2, 0x1A, + 0xA3, 0xC4 }; #endif diff --git a/test/dsatest.c b/test/dsatest.c index 69c8baea07e4..cdd043de3101 100644 --- a/test/dsatest.c +++ b/test/dsatest.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2026 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 @@ -33,158 +33,26 @@ static int dsa_cb(int p, int n, BN_GENCB *arg); static unsigned char out_p[] = { - 0x8d, - 0xf2, - 0xa4, - 0x94, - 0x49, - 0x22, - 0x76, - 0xaa, - 0x3d, - 0x25, - 0x75, - 0x9b, - 0xb0, - 0x68, - 0x69, - 0xcb, - 0xea, - 0xc0, - 0xd8, - 0x3a, - 0xfb, - 0x8d, - 0x0c, - 0xf7, - 0xcb, - 0xb8, - 0x32, - 0x4f, - 0x0d, - 0x78, - 0x82, - 0xe5, - 0xd0, - 0x76, - 0x2f, - 0xc5, - 0xb7, - 0x21, - 0x0e, - 0xaf, - 0xc2, - 0xe9, - 0xad, - 0xac, - 0x32, - 0xab, - 0x7a, - 0xac, - 0x49, - 0x69, - 0x3d, - 0xfb, - 0xf8, - 0x37, - 0x24, - 0xc2, - 0xec, - 0x07, - 0x36, - 0xee, - 0x31, - 0xc8, - 0x02, - 0x91, + 0x8d, 0xf2, 0xa4, 0x94, 0x49, 0x22, 0x76, 0xaa, 0x3d, 0x25, + 0x75, 0x9b, 0xb0, 0x68, 0x69, 0xcb, 0xea, 0xc0, 0xd8, 0x3a, + 0xfb, 0x8d, 0x0c, 0xf7, 0xcb, 0xb8, 0x32, 0x4f, 0x0d, 0x78, + 0x82, 0xe5, 0xd0, 0x76, 0x2f, 0xc5, 0xb7, 0x21, 0x0e, 0xaf, + 0xc2, 0xe9, 0xad, 0xac, 0x32, 0xab, 0x7a, 0xac, 0x49, 0x69, + 0x3d, 0xfb, 0xf8, 0x37, 0x24, 0xc2, 0xec, 0x07, 0x36, 0xee, + 0x31, 0xc8, 0x02, 0x91 }; static unsigned char out_q[] = { - 0xc7, - 0x73, - 0x21, - 0x8c, - 0x73, - 0x7e, - 0xc8, - 0xee, - 0x99, - 0x3b, - 0x4f, - 0x2d, - 0xed, - 0x30, - 0xf4, - 0x8e, - 0xda, - 0xce, - 0x91, - 0x5f, + 0xc7, 0x73, 0x21, 0x8c, 0x73, 0x7e, 0xc8, 0xee, 0x99, 0x3b, + 0x4f, 0x2d, 0xed, 0x30, 0xf4, 0x8e, 0xda, 0xce, 0x91, 0x5f }; static unsigned char out_g[] = { - 0x62, - 0x6d, - 0x02, - 0x78, - 0x39, - 0xea, - 0x0a, - 0x13, - 0x41, - 0x31, - 0x63, - 0xa5, - 0x5b, - 0x4c, - 0xb5, - 0x00, - 0x29, - 0x9d, - 0x55, - 0x22, - 0x95, - 0x6c, - 0xef, - 0xcb, - 0x3b, - 0xff, - 0x10, - 0xf3, - 0x99, - 0xce, - 0x2c, - 0x2e, - 0x71, - 0xcb, - 0x9d, - 0xe5, - 0xfa, - 0x24, - 0xba, - 0xbf, - 0x58, - 0xe5, - 0xb7, - 0x95, - 0x21, - 0x92, - 0x5c, - 0x9c, - 0xc4, - 0x2e, - 0x9f, - 0x6f, - 0x46, - 0x4b, - 0x08, - 0x8c, - 0xc5, - 0x72, - 0xaf, - 0x53, - 0xe6, - 0xd7, - 0x88, - 0x02, + 0x62, 0x6d, 0x02, 0x78, 0x39, 0xea, 0x0a, 0x13, 0x41, 0x31, + 0x63, 0xa5, 0x5b, 0x4c, 0xb5, 0x00, 0x29, 0x9d, 0x55, 0x22, + 0x95, 0x6c, 0xef, 0xcb, 0x3b, 0xff, 0x10, 0xf3, 0x99, 0xce, + 0x2c, 0x2e, 0x71, 0xcb, 0x9d, 0xe5, 0xfa, 0x24, 0xba, 0xbf, + 0x58, 0xe5, 0xb7, 0x95, 0x21, 0x92, 0x5c, 0x9c, 0xc4, 0x2e, + 0x9f, 0x6f, 0x46, 0x4b, 0x08, 0x8c, 0xc5, 0x72, 0xaf, 0x53, + 0xe6, 0xd7, 0x88, 0x02 }; static int dsa_test(void) @@ -202,26 +70,8 @@ static int dsa_test(void) * PUB 186 and also appear in Appendix 5 to FIPS PIB 186-1 */ static unsigned char seed[20] = { - 0xd5, - 0x01, - 0x4e, - 0x4b, - 0x60, - 0xef, - 0x2b, - 0xa8, - 0xb6, - 0x21, - 0x1b, - 0x40, - 0x62, - 0xba, - 0x32, - 0x24, - 0xe0, - 0x42, - 0x7d, - 0xd3, + 0xd5, 0x01, 0x4e, 0x4b, 0x60, 0xef, 0x2b, 0xa8, 0xb6, 0x21, + 0x1b, 0x40, 0x62, 0xba, 0x32, 0x24, 0xe0, 0x42, 0x7d, 0xd3 }; static const unsigned char str1[] = "12345678901234567890"; diff --git a/test/ectest.c b/test/ectest.c index 78a661c98ba9..985738259d96 100644 --- a/test/ectest.c +++ b/test/ectest.c @@ -1,5 +1,5 @@ /* - * Copyright 2001-2025 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2001-2026 The OpenSSL Project Authors. All Rights Reserved. * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved * * Licensed under the Apache License 2.0 (the "License"). You may not use @@ -1421,471 +1421,56 @@ err: } static const unsigned char p521_named[] = { - 0x06, - 0x05, - 0x2b, - 0x81, - 0x04, - 0x00, - 0x23, + 0x06, 0x05, 0x2b, 0x81, 0x04, 0x00, 0x23 }; static const unsigned char p521_explicit[] = { - 0x30, - 0x82, - 0x01, - 0xc3, - 0x02, - 0x01, - 0x01, - 0x30, - 0x4d, - 0x06, - 0x07, - 0x2a, - 0x86, - 0x48, - 0xce, - 0x3d, - 0x01, - 0x01, - 0x02, - 0x42, - 0x01, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0x30, - 0x81, - 0x9f, - 0x04, - 0x42, - 0x01, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xfc, - 0x04, - 0x42, - 0x00, - 0x51, - 0x95, - 0x3e, - 0xb9, - 0x61, - 0x8e, - 0x1c, - 0x9a, - 0x1f, - 0x92, - 0x9a, - 0x21, - 0xa0, - 0xb6, - 0x85, - 0x40, - 0xee, - 0xa2, - 0xda, - 0x72, - 0x5b, - 0x99, - 0xb3, - 0x15, - 0xf3, - 0xb8, - 0xb4, - 0x89, - 0x91, - 0x8e, - 0xf1, - 0x09, - 0xe1, - 0x56, - 0x19, - 0x39, - 0x51, - 0xec, - 0x7e, - 0x93, - 0x7b, - 0x16, - 0x52, - 0xc0, - 0xbd, - 0x3b, - 0xb1, - 0xbf, - 0x07, - 0x35, - 0x73, - 0xdf, - 0x88, - 0x3d, - 0x2c, - 0x34, - 0xf1, - 0xef, - 0x45, - 0x1f, - 0xd4, - 0x6b, - 0x50, - 0x3f, - 0x00, - 0x03, - 0x15, - 0x00, - 0xd0, - 0x9e, - 0x88, - 0x00, - 0x29, - 0x1c, - 0xb8, - 0x53, - 0x96, - 0xcc, - 0x67, - 0x17, - 0x39, - 0x32, - 0x84, - 0xaa, - 0xa0, - 0xda, - 0x64, - 0xba, - 0x04, - 0x81, - 0x85, - 0x04, - 0x00, - 0xc6, - 0x85, - 0x8e, - 0x06, - 0xb7, - 0x04, - 0x04, - 0xe9, - 0xcd, - 0x9e, - 0x3e, - 0xcb, - 0x66, - 0x23, - 0x95, - 0xb4, - 0x42, - 0x9c, - 0x64, - 0x81, - 0x39, - 0x05, - 0x3f, - 0xb5, - 0x21, - 0xf8, - 0x28, - 0xaf, - 0x60, - 0x6b, - 0x4d, - 0x3d, - 0xba, - 0xa1, - 0x4b, - 0x5e, - 0x77, - 0xef, - 0xe7, - 0x59, - 0x28, - 0xfe, - 0x1d, - 0xc1, - 0x27, - 0xa2, - 0xff, - 0xa8, - 0xde, - 0x33, - 0x48, - 0xb3, - 0xc1, - 0x85, - 0x6a, - 0x42, - 0x9b, - 0xf9, - 0x7e, - 0x7e, - 0x31, - 0xc2, - 0xe5, - 0xbd, - 0x66, - 0x01, - 0x18, - 0x39, - 0x29, - 0x6a, - 0x78, - 0x9a, - 0x3b, - 0xc0, - 0x04, - 0x5c, - 0x8a, - 0x5f, - 0xb4, - 0x2c, - 0x7d, - 0x1b, - 0xd9, - 0x98, - 0xf5, - 0x44, - 0x49, - 0x57, - 0x9b, - 0x44, - 0x68, - 0x17, - 0xaf, - 0xbd, - 0x17, - 0x27, - 0x3e, - 0x66, - 0x2c, - 0x97, - 0xee, - 0x72, - 0x99, - 0x5e, - 0xf4, - 0x26, - 0x40, - 0xc5, - 0x50, - 0xb9, - 0x01, - 0x3f, - 0xad, - 0x07, - 0x61, - 0x35, - 0x3c, - 0x70, - 0x86, - 0xa2, - 0x72, - 0xc2, - 0x40, - 0x88, - 0xbe, - 0x94, - 0x76, - 0x9f, - 0xd1, - 0x66, - 0x50, - 0x02, - 0x42, - 0x01, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xfa, - 0x51, - 0x86, - 0x87, - 0x83, - 0xbf, - 0x2f, - 0x96, - 0x6b, - 0x7f, - 0xcc, - 0x01, - 0x48, - 0xf7, - 0x09, - 0xa5, - 0xd0, - 0x3b, - 0xb5, - 0xc9, - 0xb8, - 0x89, - 0x9c, - 0x47, - 0xae, - 0xbb, - 0x6f, - 0xb7, - 0x1e, - 0x91, - 0x38, - 0x64, - 0x09, - 0x02, - 0x01, - 0x01, + 0x30, 0x82, 0x01, 0xc3, 0x02, 0x01, 0x01, 0x30, 0x4d, 0x06, + 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x01, 0x01, 0x02, 0x42, + 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x30, 0x81, 0x9f, 0x04, + 0x42, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x04, 0x42, 0x00, + 0x51, 0x95, 0x3e, 0xb9, 0x61, 0x8e, 0x1c, 0x9a, 0x1f, 0x92, + 0x9a, 0x21, 0xa0, 0xb6, 0x85, 0x40, 0xee, 0xa2, 0xda, 0x72, + 0x5b, 0x99, 0xb3, 0x15, 0xf3, 0xb8, 0xb4, 0x89, 0x91, 0x8e, + 0xf1, 0x09, 0xe1, 0x56, 0x19, 0x39, 0x51, 0xec, 0x7e, 0x93, + 0x7b, 0x16, 0x52, 0xc0, 0xbd, 0x3b, 0xb1, 0xbf, 0x07, 0x35, + 0x73, 0xdf, 0x88, 0x3d, 0x2c, 0x34, 0xf1, 0xef, 0x45, 0x1f, + 0xd4, 0x6b, 0x50, 0x3f, 0x00, 0x03, 0x15, 0x00, 0xd0, 0x9e, + 0x88, 0x00, 0x29, 0x1c, 0xb8, 0x53, 0x96, 0xcc, 0x67, 0x17, + 0x39, 0x32, 0x84, 0xaa, 0xa0, 0xda, 0x64, 0xba, 0x04, 0x81, + 0x85, 0x04, 0x00, 0xc6, 0x85, 0x8e, 0x06, 0xb7, 0x04, 0x04, + 0xe9, 0xcd, 0x9e, 0x3e, 0xcb, 0x66, 0x23, 0x95, 0xb4, 0x42, + 0x9c, 0x64, 0x81, 0x39, 0x05, 0x3f, 0xb5, 0x21, 0xf8, 0x28, + 0xaf, 0x60, 0x6b, 0x4d, 0x3d, 0xba, 0xa1, 0x4b, 0x5e, 0x77, + 0xef, 0xe7, 0x59, 0x28, 0xfe, 0x1d, 0xc1, 0x27, 0xa2, 0xff, + 0xa8, 0xde, 0x33, 0x48, 0xb3, 0xc1, 0x85, 0x6a, 0x42, 0x9b, + 0xf9, 0x7e, 0x7e, 0x31, 0xc2, 0xe5, 0xbd, 0x66, 0x01, 0x18, + 0x39, 0x29, 0x6a, 0x78, 0x9a, 0x3b, 0xc0, 0x04, 0x5c, 0x8a, + 0x5f, 0xb4, 0x2c, 0x7d, 0x1b, 0xd9, 0x98, 0xf5, 0x44, 0x49, + 0x57, 0x9b, 0x44, 0x68, 0x17, 0xaf, 0xbd, 0x17, 0x27, 0x3e, + 0x66, 0x2c, 0x97, 0xee, 0x72, 0x99, 0x5e, 0xf4, 0x26, 0x40, + 0xc5, 0x50, 0xb9, 0x01, 0x3f, 0xad, 0x07, 0x61, 0x35, 0x3c, + 0x70, 0x86, 0xa2, 0x72, 0xc2, 0x40, 0x88, 0xbe, 0x94, 0x76, + 0x9f, 0xd1, 0x66, 0x50, 0x02, 0x42, 0x01, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, + 0x51, 0x86, 0x87, 0x83, 0xbf, 0x2f, 0x96, 0x6b, 0x7f, 0xcc, + 0x01, 0x48, 0xf7, 0x09, 0xa5, 0xd0, 0x3b, 0xb5, 0xc9, 0xb8, + 0x89, 0x9c, 0x47, 0xae, 0xbb, 0x6f, 0xb7, 0x1e, 0x91, 0x38, + 0x64, 0x09, 0x02, 0x01, 0x01 }; /* diff --git a/test/endecode_test.c b/test/endecode_test.c index 7f093f6a257f..d20277115aa2 100644 --- a/test/endecode_test.c +++ b/test/endecode_test.c @@ -1,5 +1,5 @@ /* - * Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2020-2026 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 @@ -1158,36 +1158,9 @@ static int do_create_ec_explicit_trinomial_params(OSSL_PARAM_BLD *bld, BIGNUM *a, *b, *poly, *order, *cofactor; /* sect233k1 characteristic-two-field tpBasis */ static const unsigned char poly_data[] = { - 0x02, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x04, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x01, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }; static const unsigned char a_data[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, diff --git a/test/enginetest.c b/test/enginetest.c index 50556131b393..6132142d1e52 100644 --- a/test/enginetest.c +++ b/test/enginetest.c @@ -1,5 +1,5 @@ /* - * Copyright 2000-2022 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2000-2026 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 @@ -61,6 +61,8 @@ static int test_engines(void) ENGINE *new_h4 = NULL; memset(block, 0, sizeof(block)); + memset(eid, 0, sizeof(eid)); + memset(ename, 0, sizeof(ename)); if (!TEST_ptr(new_h1 = ENGINE_new()) || !TEST_true(ENGINE_set_id(new_h1, "test_id0")) || !TEST_true(ENGINE_set_name(new_h1, "First test item")) @@ -171,10 +173,6 @@ cleanup_loop: goto end; ENGINE_free(ptr); } - for (loop = 0; loop < NUMTOADD; loop++) { - OPENSSL_free(eid[loop]); - OPENSSL_free(ename[loop]); - } to_return = 1; end: @@ -182,8 +180,11 @@ end: ENGINE_free(new_h2); ENGINE_free(new_h3); ENGINE_free(new_h4); - for (loop = 0; loop < NUMTOADD; loop++) + for (loop = 0; loop < NUMTOADD; loop++) { + OPENSSL_free(eid[loop]); + OPENSSL_free(ename[loop]); ENGINE_free(block[loop]); + } return to_return; } diff --git a/test/evp_extra_test.c b/test/evp_extra_test.c index 1b0f0711cb57..9b25ec6e2833 100644 --- a/test/evp_extra_test.c +++ b/test/evp_extra_test.c @@ -1726,6 +1726,29 @@ out: return ret; } +#ifndef OPENSSL_NO_POLY1305 +/* Test that EVP_MAC_final fails for Poly1305 when no key was set */ +static int test_evp_mac_poly1305_no_key(void) +{ + int ret = 0; + EVP_MAC *mac = NULL; + EVP_MAC_CTX *ctx = NULL; + unsigned char out[16]; + size_t outl = 0; + + if (!TEST_ptr(mac = EVP_MAC_fetch(testctx, "Poly1305", testpropq)) + || !TEST_ptr(ctx = EVP_MAC_CTX_new(mac)) + || !TEST_int_eq(EVP_MAC_init(ctx, NULL, 0, NULL), 1) + || !TEST_int_eq(EVP_MAC_final(ctx, out, &outl, sizeof(out)), 0)) + goto err; + ret = 1; +err: + EVP_MAC_CTX_free(ctx); + EVP_MAC_free(mac); + return ret; +} +#endif + static int test_d2i_AutoPrivateKey(int i) { int ret = 0; @@ -2067,9 +2090,10 @@ static int test_EVP_SM2(void) uint8_t ciphertext[128]; size_t ctext_len = sizeof(ciphertext); - + size_t ctext_len_param = 0; uint8_t plaintext[8]; size_t ptext_len = sizeof(plaintext); + size_t ptext_len_param = 0; uint8_t sm2_id[] = { 1, 2, 3, 4, 'l', 'e', 't', 't', 'e', 'r' }; @@ -2199,7 +2223,8 @@ static int test_EVP_SM2(void) if (!TEST_true(EVP_PKEY_CTX_set_params(cctx, sparams))) goto done; - if (!TEST_true(EVP_PKEY_encrypt(cctx, ciphertext, &ctext_len, kMsg, + ctext_len_param = ctext_len; + if (!TEST_true(EVP_PKEY_encrypt(cctx, ciphertext, &ctext_len_param, kMsg, sizeof(kMsg)))) goto done; @@ -2209,8 +2234,9 @@ static int test_EVP_SM2(void) if (!TEST_true(EVP_PKEY_CTX_set_params(cctx, sparams))) goto done; - if (!TEST_int_gt(EVP_PKEY_decrypt(cctx, plaintext, &ptext_len, ciphertext, - ctext_len), + ptext_len_param = ptext_len; + if (!TEST_int_gt(EVP_PKEY_decrypt(cctx, plaintext, &ptext_len_param, ciphertext, + ctext_len_param), 0)) goto done; @@ -2230,7 +2256,7 @@ static int test_EVP_SM2(void) goto done; } - if (!TEST_true(ptext_len == sizeof(kMsg))) + if (!TEST_true(ptext_len_param == sizeof(kMsg))) goto done; if (!TEST_true(memcmp(plaintext, kMsg, sizeof(kMsg)) == 0)) @@ -3050,6 +3076,85 @@ err: return ret; } +static int test_RSA_verify_recover_rejects_short_buffer(void) +{ + int ret = 0; + int recovered_cap = 0; + EVP_PKEY *pkey = NULL; + EVP_PKEY_CTX *sign_ctx = NULL, *verify_ctx = NULL; + unsigned char *sig = NULL, *recovered = NULL; + size_t sig_len = 0, recovered_len = 0; + unsigned long err = 0; + unsigned char shortbuf[] = { 0xa5, 0x5a }; + const unsigned char shortbuf_expected[] = { 0xa5, 0x5a }; + unsigned char digest[32]; + size_t i; + + for (i = 0; i < sizeof(digest); i++) + digest[i] = (unsigned char)i; + + if (OSSL_PROVIDER_available(testctx, "fips")) + return TEST_skip("Test skipped for FIPS provider"); + + if (!TEST_ptr(pkey = load_example_rsa_key()) + || !TEST_ptr(sign_ctx = EVP_PKEY_CTX_new_from_pkey(testctx, pkey, NULL)) + || !TEST_int_gt(EVP_PKEY_sign_init(sign_ctx), 0) + || !TEST_int_gt(EVP_PKEY_CTX_set_rsa_padding(sign_ctx, + RSA_PKCS1_PADDING), + 0) + || !TEST_int_gt(EVP_PKEY_CTX_set_signature_md(sign_ctx, EVP_sha256()), + 0) + || !TEST_int_gt(EVP_PKEY_sign(sign_ctx, NULL, &sig_len, digest, + sizeof(digest)), + 0) + || !TEST_ptr(sig = OPENSSL_malloc(sig_len)) + || !TEST_int_gt(EVP_PKEY_sign(sign_ctx, sig, &sig_len, digest, + sizeof(digest)), + 0) + || !TEST_int_gt(recovered_cap = EVP_PKEY_get_size(pkey), 0) + || !TEST_ptr(recovered = OPENSSL_malloc(recovered_cap)) + || !TEST_ptr(verify_ctx = EVP_PKEY_CTX_new_from_pkey(testctx, pkey, + NULL)) + || !TEST_int_gt(EVP_PKEY_verify_recover_init(verify_ctx), 0) + || !TEST_int_gt(EVP_PKEY_CTX_set_rsa_padding(verify_ctx, + RSA_PKCS1_PADDING), + 0) + || !TEST_int_gt(EVP_PKEY_CTX_set_signature_md(verify_ctx, EVP_sha256()), + 0)) + goto done; + + recovered_len = (size_t)recovered_cap; + if (!TEST_int_gt(EVP_PKEY_verify_recover(verify_ctx, recovered, + &recovered_len, sig, sig_len), + 0) + || !TEST_size_t_eq(recovered_len, sizeof(digest)) + || !TEST_mem_eq(recovered, recovered_len, digest, sizeof(digest))) + goto done; + + ERR_clear_error(); + recovered_len = 1; + if (!TEST_int_le(EVP_PKEY_verify_recover(verify_ctx, shortbuf, + &recovered_len, sig, sig_len), + 0)) + goto done; + + err = ERR_peek_error(); + if (!TEST_int_eq(ERR_GET_LIB(err), ERR_LIB_PROV) + || !TEST_int_eq(ERR_GET_REASON(err), PROV_R_OUTPUT_BUFFER_TOO_SMALL) + || !TEST_mem_eq(shortbuf, sizeof(shortbuf), shortbuf_expected, + sizeof(shortbuf_expected))) + goto done; + + ret = 1; +done: + EVP_PKEY_CTX_free(sign_ctx); + EVP_PKEY_CTX_free(verify_ctx); + EVP_PKEY_free(pkey); + OPENSSL_free(sig); + OPENSSL_free(recovered); + return ret; +} + static int test_RSA_encrypt(void) { int ret = 0; @@ -5414,6 +5519,64 @@ static int test_aes_rc4_keylen_change_cve_2023_5363(void) } #endif +/* + * AES-SIV reuse-without-rekey: + * msg1: legit non-empty CT, tag verifies, final_ret=0 + * msg2: no reinit (or reinit with key=NULL), set forged tag, + * AAD only, DecryptFinal -> does stale final_ret leak through? + */ +static int test_aes_siv_ctx_reuse(void) +{ + unsigned char key[32] = { 7 }; /* AES-128-SIV => 2*16 */ + unsigned char pt[9] = "payload!"; + unsigned char ct[9], tagbuf[16], out[16], zero16[16] = { 0 }; + unsigned char aad[14] = "forged header"; + int outl, ret = 0; + EVP_CIPHER_CTX *e = NULL, *d = NULL; + EVP_CIPHER *c = EVP_CIPHER_fetch(NULL, "AES-128-SIV", NULL); + + if (c == NULL) { + return TEST_skip("AES-128-SIV cipher is not available"); + } + + /* produce a valid (ct,tag) for msg1 */ + e = EVP_CIPHER_CTX_new(); + if (!TEST_ptr(e) + || !TEST_true(EVP_EncryptInit_ex2(e, c, key, NULL, NULL)) + || !TEST_true(EVP_EncryptUpdate(e, NULL, &outl, (unsigned char *)"hdr1", 4)) + || !TEST_true(EVP_EncryptUpdate(e, ct, &outl, pt, sizeof(pt))) + || !TEST_true(EVP_EncryptFinal_ex(e, out, &outl)) + || !TEST_true(EVP_CIPHER_CTX_ctrl(e, EVP_CTRL_AEAD_GET_TAG, 16, tagbuf))) { + EVP_CIPHER_CTX_free(e); + goto err; + } + EVP_CIPHER_CTX_free(e); + + /* msg1 decrypt */ + d = EVP_CIPHER_CTX_new(); + if (!TEST_ptr(d) + || !TEST_true(EVP_DecryptInit_ex2(d, c, key, NULL, NULL)) + || !TEST_true(EVP_CIPHER_CTX_ctrl(d, EVP_CTRL_AEAD_SET_TAG, 16, tagbuf)) + || !TEST_true(EVP_DecryptUpdate(d, NULL, &outl, (unsigned char *)"hdr1", 4)) + || !TEST_true(EVP_DecryptUpdate(d, out, &outl, ct, sizeof(ct))) + || !TEST_true(EVP_DecryptFinal_ex(d, out, &outl))) + goto err; + + /* msg2 on SAME ctx, reinit with key=NULL => initkey skipped, final_ret should be reset */ + if (!TEST_true(EVP_DecryptInit_ex2(d, NULL, NULL, NULL, NULL)) + || !TEST_true(EVP_CIPHER_CTX_ctrl(d, EVP_CTRL_AEAD_SET_TAG, 16, zero16)) + || !TEST_true(EVP_DecryptUpdate(d, NULL, &outl, aad, sizeof(aad))) /* forged AAD */ + || !TEST_false(EVP_DecryptFinal_ex(d, out, &outl))) + goto err; + + ret = 1; + +err: + EVP_CIPHER_CTX_free(d); + EVP_CIPHER_free(c); + return ret; +} + static int test_invalid_ctx_for_digest(void) { int ret; @@ -5472,6 +5635,333 @@ end: return ret; } +/* + * Cross-driver round-trip test for AEAD one-shot vs streaming paths. + * + * The streaming path (EVP_CipherUpdate/Final, dispatched to + * OSSL_FUNC_CIPHER_UPDATE/_FINAL) is treated as the oracle. For each + * AEAD configuration we encrypt and decrypt the same (key, iv, aad, pt), + * driving the body in two combinations: + * + * 1. body encrypt via EVP_Cipher() (one-shot, OSSL_FUNC_CIPHER_CIPHER), + * body decrypt via EVP_CipherUpdate (streaming). + * 2. body encrypt via EVP_CipherUpdate, body decrypt via EVP_Cipher(). + * + * Both combinations must recover the plaintext and verify the tag. AAD + * is always fed via EVP_CipherUpdate(NULL, ...): OCB's one-shot is body + * only and the asymmetric "AAD streaming, body one-shot" call shape is + * the natural pattern a caller reaching for EVP_Cipher() for throughput + * would write anyway. + * + * CVE-2026-45445 (AES-OCB EVP_Cipher() ignored IV) was a silent failure + * in this matrix: the one-shot encrypt path produced ciphertext under + * Offset_0 = 0 regardless of IV, which the streaming decrypt path then + * could not verify. Adding this cross-check catches the same class of + * bug for any future AEAD whose one-shot dispatch diverges from its + * streaming dispatch. + */ +typedef struct { + const char *name; /* EVP_CIPHER fetch name */ + size_t keylen; + size_t ivlen; + size_t taglen; + int is_ccm; /* needs length-up-front + tag-before-body dance */ +} AEAD_ONESHOT_CFG; + +static const AEAD_ONESHOT_CFG aead_oneshot_cfgs[] = { + { "AES-128-GCM", 16, 12, 16, 0 }, + { "AES-256-GCM", 32, 12, 16, 0 }, + { "AES-128-CCM", 16, 12, 16, 1 }, + { "AES-256-CCM", 32, 12, 16, 1 }, + { "AES-128-OCB", 16, 12, 16, 0 }, + { "AES-256-OCB", 32, 12, 16, 0 }, + { "ChaCha20-Poly1305", 32, 12, 16, 0 } +}; + +/* + * Drive an encrypt or decrypt operation. AAD always via EVP_CipherUpdate. + * Body via EVP_Cipher() when oneshot_body is non-zero, EVP_CipherUpdate + * otherwise. On encrypt, fills *out and the caller-provided tag buffer. + * On decrypt, reads from in and verifies tag; returns 0 if verification + * fails (the test asserts the expected outcome). + */ +static int aead_oneshot_op(const AEAD_ONESHOT_CFG *cfg, int enc, + int oneshot_body, const unsigned char *key, + const unsigned char *iv, const unsigned char *aad, + size_t aad_len, const unsigned char *in, size_t in_len, + unsigned char *out, unsigned char *tag, const char **why) +{ + EVP_CIPHER_CTX *ctx = NULL; + EVP_CIPHER *cipher = NULL; + int outl = 0, tmpl = 0; + int ok = 0; + int body_rv; + + *why = NULL; + + if (!TEST_ptr(cipher = EVP_CIPHER_fetch(testctx, cfg->name, testpropq))) { + *why = "CIPHER_FETCH"; + goto end; + } + if (!TEST_ptr(ctx = EVP_CIPHER_CTX_new())) { + *why = "CTX_NEW"; + goto end; + } + if (!TEST_true(EVP_CipherInit_ex(ctx, cipher, NULL, NULL, NULL, enc))) { + *why = "INIT_CIPHER"; + goto end; + } + if (!TEST_int_gt(EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_IVLEN, + (int)cfg->ivlen, NULL), + 0)) { + *why = "SET_IVLEN"; + goto end; + } + if (cfg->is_ccm) { + /* Placeholder taglen on encrypt, real tag on decrypt; both before key+iv. */ + if (!TEST_int_gt(EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG, + (int)cfg->taglen, enc ? NULL : tag), + 0)) { + *why = "CCM_SET_TAG"; + goto end; + } + } + if (!TEST_true(EVP_CipherInit_ex(ctx, NULL, NULL, key, iv, enc))) { + *why = "INIT_KEY_IV"; + goto end; + } + if (cfg->is_ccm) { + if (!TEST_true(EVP_CipherUpdate(ctx, NULL, &outl, NULL, (int)in_len))) { + *why = "CCM_LEN_DECL"; + goto end; + } + } + if (aad_len > 0 + && !TEST_true(EVP_CipherUpdate(ctx, NULL, &outl, aad, (int)aad_len))) { + *why = "AAD"; + goto end; + } + if (!enc && !cfg->is_ccm + && !TEST_int_gt(EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG, + (int)cfg->taglen, tag), + 0)) { + *why = "SET_TAG"; + goto end; + } + + if (oneshot_body) { + body_rv = EVP_Cipher(ctx, out, in, (unsigned int)in_len); + if (cfg->is_ccm && !enc) { + /* CCM decrypt: 0 means tag verify failed, < 0 means error. */ + if (!TEST_int_gt(body_rv, 0)) { + *why = "ONESHOT_DECRYPT"; + goto end; + } + } else { + if (!TEST_int_ge(body_rv, 0)) { + *why = "ONESHOT_BODY"; + goto end; + } + } + outl = (int)in_len; + } else { + if (!TEST_true(EVP_CipherUpdate(ctx, out, &outl, in, (int)in_len))) { + *why = enc ? "STREAM_BODY_ENC" : "STREAM_BODY_DEC"; + goto end; + } + } + + if (!cfg->is_ccm) { + if (!TEST_true(EVP_CipherFinal_ex(ctx, out + outl, &tmpl))) { + *why = enc ? "FINAL_ENC" : "FINAL_DEC"; + goto end; + } + } + + if (enc) { + if (!TEST_int_gt(EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_GET_TAG, + (int)cfg->taglen, tag), + 0)) { + *why = "GET_TAG"; + goto end; + } + } + ok = 1; +end: + EVP_CIPHER_CTX_free(ctx); + EVP_CIPHER_free(cipher); + return ok; +} + +/* + * For each AEAD row we run two AAD modes, and within each AAD mode two + * cross-driver round trips: + * + * aad_mode 0: no AAD. Critical for catching the OCB-style bug: any + * EVP_CipherUpdate(NULL, aad, ...) call before the body + * would itself pass through the (correct) streaming + * handler and apply the buffered IV, masking the one-shot + * handler's failure to do so. With aad_len == 0 we make + * EVP_Cipher() the very first cipher operation on the + * context, which is the shape the bug requires. + * + * aad_mode 1: with AAD via streaming. Catches divergence between the + * drivers when AAD is in play. + * + * leg 0: encrypt-oneshot + decrypt-streaming + * leg 1: encrypt-streaming + decrypt-oneshot + * + * The test index encodes (cipher, aad_mode) so a failure points at both. + */ +static int test_aead_oneshot_roundtrip(int idx) +{ + static const unsigned char fixed_key[32] = { + 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 + }; + static const unsigned char fixed_iv[12] = { + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab + }; + static const unsigned char fixed_aad[] = "extra:context"; + static const unsigned char fixed_pt[] = "THE QUICK BROWN FOX JUMPS OVER LAZY!!"; + const AEAD_ONESHOT_CFG *cfg = &aead_oneshot_cfgs[idx / 2]; + int with_aad = idx % 2; + size_t aad_len = with_aad ? sizeof(fixed_aad) - 1 : 0; + size_t pt_len = sizeof(fixed_pt) - 1; + EVP_CIPHER *probe = NULL; + unsigned char ct[64], pt[64]; + unsigned char tag_oneshot[16], tag_stream[16]; + const char *why = NULL; + int leg, ok = 0; + + /* + * Probe for the cipher: a build with no-ocb / no-chacha / etc. will + * not have it, and we treat that as a pass (nothing to test here). + */ + ERR_set_mark(); + probe = EVP_CIPHER_fetch(testctx, cfg->name, testpropq); + ERR_pop_to_mark(); + if (probe == NULL) { + TEST_info("skipping, '%s' is not available", cfg->name); + return 1; + } + EVP_CIPHER_free(probe); + + for (leg = 0; leg <= 1; leg++) { + int enc_oneshot = (leg == 0); + unsigned char *tag = enc_oneshot ? tag_oneshot : tag_stream; + + memset(ct, 0, sizeof(ct)); + memset(pt, 0, sizeof(pt)); + memset(tag, 0, cfg->taglen); + + if (!aead_oneshot_op(cfg, /*enc=*/1, /*oneshot_body=*/enc_oneshot, + fixed_key, fixed_iv, fixed_aad, aad_len, + fixed_pt, pt_len, ct, tag, &why)) { + TEST_error("%s (%s): encrypt leg %d (%s body) failed at %s", + cfg->name, with_aad ? "with AAD" : "no AAD", + leg, enc_oneshot ? "oneshot" : "stream", + why ? why : "?"); + goto end; + } + if (!aead_oneshot_op(cfg, /*enc=*/0, /*oneshot_body=*/!enc_oneshot, + fixed_key, fixed_iv, fixed_aad, aad_len, + ct, pt_len, pt, tag, &why)) { + TEST_error("%s (%s): decrypt leg %d (%s body) failed at %s", + cfg->name, with_aad ? "with AAD" : "no AAD", + leg, enc_oneshot ? "stream" : "oneshot", + why ? why : "?"); + goto end; + } + if (!TEST_mem_eq(pt, pt_len, fixed_pt, pt_len)) { + TEST_error("%s (%s): leg %d: recovered plaintext differs", + cfg->name, with_aad ? "with AAD" : "no AAD", leg); + goto end; + } + } + + /* + * Both legs share the same (key, iv, aad, pt) and must therefore + * agree on the tag bit-for-bit, regardless of which driver computed + * it. This catches the OCB-style failure where the one-shot path + * silently emits a different ciphertext/tag from the streaming path. + */ + if (!TEST_mem_eq(tag_oneshot, cfg->taglen, tag_stream, cfg->taglen)) { + TEST_error("%s (%s): oneshot-encrypt tag != streaming-encrypt tag", + cfg->name, with_aad ? "with AAD" : "no AAD"); + goto end; + } + ok = 1; +end: + return ok; +} + +#ifndef OPENSSL_NO_DES +static int test_EVP_CIPHER_get_type_des_ede3(void) +{ + const EVP_CIPHER *cipher = NULL; + int base_type, variant_type, nid; + int ret = 0; + + /* Get the base type from CFB64 (should be NID_des_ede3_cfb64) */ + cipher = EVP_des_ede3_cfb64(); + base_type = EVP_CIPHER_get_type(cipher); + + /* Test CFB64 - should map to the same base_type */ + variant_type = EVP_CIPHER_get_type(cipher); + nid = EVP_CIPHER_get_nid(cipher); + + /* Verify the returned type */ + if (!TEST_int_eq(variant_type, base_type)) + goto end; + + /* Verify that variant_type and nid are same for 64-bit variants */ + if (!TEST_int_eq(variant_type, nid)) + goto end; + + if (!TEST_int_eq(NID_des_ede3_cfb64, variant_type)) + goto end; + + /* Test CFB8 - should map to the same base_type */ + cipher = EVP_des_ede3_cfb8(); + variant_type = EVP_CIPHER_get_type(cipher); + nid = EVP_CIPHER_get_nid(cipher); + + /* Verify the returned type */ + if (!TEST_int_eq(variant_type, base_type)) + goto end; + + /* Verify that variant_type and nid are different for variants */ + if (!TEST_int_ne(variant_type, nid)) + goto end; + + if (!TEST_int_eq(NID_des_ede3_cfb64, variant_type)) + goto end; + + /* Test CFB1 - should map to the same base_type */ + cipher = EVP_des_ede3_cfb1(); + variant_type = EVP_CIPHER_get_type(cipher); + nid = EVP_CIPHER_get_nid(cipher); + + /* Verify the returned type */ + if (!TEST_int_eq(variant_type, base_type)) + goto end; + + /* Verify that variant_type and nid are different for variants */ + if (!TEST_int_ne(variant_type, nid)) + goto end; + + if (!TEST_int_eq(NID_des_ede3_cfb64, variant_type)) + goto end; + + ret = 1; +end: + return ret; +} +#endif /*OPENSSL_NO_DES */ + int setup_tests(void) { OPTION_CHOICE o; @@ -5512,6 +6002,9 @@ int setup_tests(void) #endif ADD_TEST(test_EVP_Digest); ADD_TEST(test_EVP_md_null); +#ifndef OPENSSL_NO_POLY1305 + ADD_TEST(test_evp_mac_poly1305_no_key); +#endif ADD_ALL_TESTS(test_EVP_PKEY_sign, 3); #ifndef OPENSSL_NO_DEPRECATED_3_0 ADD_ALL_TESTS(test_EVP_PKEY_sign_with_app_method, 2); @@ -5561,6 +6054,7 @@ int setup_tests(void) ADD_TEST(test_RSA_get_set_params); ADD_TEST(test_RSA_OAEP_set_get_params); ADD_TEST(test_RSA_OAEP_set_null_label); + ADD_TEST(test_RSA_verify_recover_rejects_short_buffer); ADD_TEST(test_RSA_encrypt); #if !defined(OPENSSL_NO_CHACHA) && !defined(OPENSSL_NO_POLY1305) ADD_TEST(test_decrypt_null_chunks); @@ -5584,7 +6078,8 @@ int setup_tests(void) ADD_ALL_TESTS(test_evp_iv_aes, 12); #ifndef OPENSSL_NO_DES ADD_ALL_TESTS(test_evp_iv_des, 6); -#endif + ADD_TEST(test_EVP_CIPHER_get_type_des_ede3); +#endif /* OPENSSL_NO_DES */ #ifndef OPENSSL_NO_BF ADD_ALL_TESTS(test_evp_bf_default_keylen, 4); #endif @@ -5637,6 +6132,11 @@ int setup_tests(void) ADD_TEST(test_aes_rc4_keylen_change_cve_2023_5363); #endif + ADD_ALL_TESTS(test_aead_oneshot_roundtrip, 2 * OSSL_NELEM(aead_oneshot_cfgs)); + + /* Test case for CVE-2026-45446 */ + ADD_TEST(test_aes_siv_ctx_reuse); + ADD_TEST(test_invalid_ctx_for_digest); ADD_TEST(test_evp_cipher_negative_length); diff --git a/test/evp_extra_test2.c b/test/evp_extra_test2.c index 924ecc2533f0..86d098b2d392 100644 --- a/test/evp_extra_test2.c +++ b/test/evp_extra_test2.c @@ -1,5 +1,5 @@ /* - * Copyright 2015-2024 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2015-2026 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 @@ -36,614 +36,67 @@ static OSSL_PROVIDER *nullprov = NULL; * should never use this key anywhere but in an example. */ static const unsigned char kExampleRSAKeyDER[] = { - 0x30, - 0x82, - 0x02, - 0x5c, - 0x02, - 0x01, - 0x00, - 0x02, - 0x81, - 0x81, - 0x00, - 0xf8, - 0xb8, - 0x6c, - 0x83, - 0xb4, - 0xbc, - 0xd9, - 0xa8, - 0x57, - 0xc0, - 0xa5, - 0xb4, - 0x59, - 0x76, - 0x8c, - 0x54, - 0x1d, - 0x79, - 0xeb, - 0x22, - 0x52, - 0x04, - 0x7e, - 0xd3, - 0x37, - 0xeb, - 0x41, - 0xfd, - 0x83, - 0xf9, - 0xf0, - 0xa6, - 0x85, - 0x15, - 0x34, - 0x75, - 0x71, - 0x5a, - 0x84, - 0xa8, - 0x3c, - 0xd2, - 0xef, - 0x5a, - 0x4e, - 0xd3, - 0xde, - 0x97, - 0x8a, - 0xdd, - 0xff, - 0xbb, - 0xcf, - 0x0a, - 0xaa, - 0x86, - 0x92, - 0xbe, - 0xb8, - 0x50, - 0xe4, - 0xcd, - 0x6f, - 0x80, - 0x33, - 0x30, - 0x76, - 0x13, - 0x8f, - 0xca, - 0x7b, - 0xdc, - 0xec, - 0x5a, - 0xca, - 0x63, - 0xc7, - 0x03, - 0x25, - 0xef, - 0xa8, - 0x8a, - 0x83, - 0x58, - 0x76, - 0x20, - 0xfa, - 0x16, - 0x77, - 0xd7, - 0x79, - 0x92, - 0x63, - 0x01, - 0x48, - 0x1a, - 0xd8, - 0x7b, - 0x67, - 0xf1, - 0x52, - 0x55, - 0x49, - 0x4e, - 0xd6, - 0x6e, - 0x4a, - 0x5c, - 0xd7, - 0x7a, - 0x37, - 0x36, - 0x0c, - 0xde, - 0xdd, - 0x8f, - 0x44, - 0xe8, - 0xc2, - 0xa7, - 0x2c, - 0x2b, - 0xb5, - 0xaf, - 0x64, - 0x4b, - 0x61, - 0x07, - 0x02, - 0x03, - 0x01, - 0x00, - 0x01, - 0x02, - 0x81, - 0x80, - 0x74, - 0x88, - 0x64, - 0x3f, - 0x69, - 0x45, - 0x3a, - 0x6d, - 0xc7, - 0x7f, - 0xb9, - 0xa3, - 0xc0, - 0x6e, - 0xec, - 0xdc, - 0xd4, - 0x5a, - 0xb5, - 0x32, - 0x85, - 0x5f, - 0x19, - 0xd4, - 0xf8, - 0xd4, - 0x3f, - 0x3c, - 0xfa, - 0xc2, - 0xf6, - 0x5f, - 0xee, - 0xe6, - 0xba, - 0x87, - 0x74, - 0x2e, - 0xc7, - 0x0c, - 0xd4, - 0x42, - 0xb8, - 0x66, - 0x85, - 0x9c, - 0x7b, - 0x24, - 0x61, - 0xaa, - 0x16, - 0x11, - 0xf6, - 0xb5, - 0xb6, - 0xa4, - 0x0a, - 0xc9, - 0x55, - 0x2e, - 0x81, - 0xa5, - 0x47, - 0x61, - 0xcb, - 0x25, - 0x8f, - 0xc2, - 0x15, - 0x7b, - 0x0e, - 0x7c, - 0x36, - 0x9f, - 0x3a, - 0xda, - 0x58, - 0x86, - 0x1c, - 0x5b, - 0x83, - 0x79, - 0xe6, - 0x2b, - 0xcc, - 0xe6, - 0xfa, - 0x2c, - 0x61, - 0xf2, - 0x78, - 0x80, - 0x1b, - 0xe2, - 0xf3, - 0x9d, - 0x39, - 0x2b, - 0x65, - 0x57, - 0x91, - 0x3d, - 0x71, - 0x99, - 0x73, - 0xa5, - 0xc2, - 0x79, - 0x20, - 0x8c, - 0x07, - 0x4f, - 0xe5, - 0xb4, - 0x60, - 0x1f, - 0x99, - 0xa2, - 0xb1, - 0x4f, - 0x0c, - 0xef, - 0xbc, - 0x59, - 0x53, - 0x00, - 0x7d, - 0xb1, - 0x02, - 0x41, - 0x00, - 0xfc, - 0x7e, - 0x23, - 0x65, - 0x70, - 0xf8, - 0xce, - 0xd3, - 0x40, - 0x41, - 0x80, - 0x6a, - 0x1d, - 0x01, - 0xd6, - 0x01, - 0xff, - 0xb6, - 0x1b, - 0x3d, - 0x3d, - 0x59, - 0x09, - 0x33, - 0x79, - 0xc0, - 0x4f, - 0xde, - 0x96, - 0x27, - 0x4b, - 0x18, - 0xc6, - 0xd9, - 0x78, - 0xf1, - 0xf4, - 0x35, - 0x46, - 0xe9, - 0x7c, - 0x42, - 0x7a, - 0x5d, - 0x9f, - 0xef, - 0x54, - 0xb8, - 0xf7, - 0x9f, - 0xc4, - 0x33, - 0x6c, - 0xf3, - 0x8c, - 0x32, - 0x46, - 0x87, - 0x67, - 0x30, - 0x7b, - 0xa7, - 0xac, - 0xe3, - 0x02, - 0x41, - 0x00, - 0xfc, - 0x2c, - 0xdf, - 0x0c, - 0x0d, - 0x88, - 0xf5, - 0xb1, - 0x92, - 0xa8, - 0x93, - 0x47, - 0x63, - 0x55, - 0xf5, - 0xca, - 0x58, - 0x43, - 0xba, - 0x1c, - 0xe5, - 0x9e, - 0xb6, - 0x95, - 0x05, - 0xcd, - 0xb5, - 0x82, - 0xdf, - 0xeb, - 0x04, - 0x53, - 0x9d, - 0xbd, - 0xc2, - 0x38, - 0x16, - 0xb3, - 0x62, - 0xdd, - 0xa1, - 0x46, - 0xdb, - 0x6d, - 0x97, - 0x93, - 0x9f, - 0x8a, - 0xc3, - 0x9b, - 0x64, - 0x7e, - 0x42, - 0xe3, - 0x32, - 0x57, - 0x19, - 0x1b, - 0xd5, - 0x6e, - 0x85, - 0xfa, - 0xb8, - 0x8d, - 0x02, - 0x41, - 0x00, - 0xbc, - 0x3d, - 0xde, - 0x6d, - 0xd6, - 0x97, - 0xe8, - 0xba, - 0x9e, - 0x81, - 0x37, - 0x17, - 0xe5, - 0xa0, - 0x64, - 0xc9, - 0x00, - 0xb7, - 0xe7, - 0xfe, - 0xf4, - 0x29, - 0xd9, - 0x2e, - 0x43, - 0x6b, - 0x19, - 0x20, - 0xbd, - 0x99, - 0x75, - 0xe7, - 0x76, - 0xf8, - 0xd3, - 0xae, - 0xaf, - 0x7e, - 0xb8, - 0xeb, - 0x81, - 0xf4, - 0x9d, - 0xfe, - 0x07, - 0x2b, - 0x0b, - 0x63, - 0x0b, - 0x5a, - 0x55, - 0x90, - 0x71, - 0x7d, - 0xf1, - 0xdb, - 0xd9, - 0xb1, - 0x41, - 0x41, - 0x68, - 0x2f, - 0x4e, - 0x39, - 0x02, - 0x40, - 0x5a, - 0x34, - 0x66, - 0xd8, - 0xf5, - 0xe2, - 0x7f, - 0x18, - 0xb5, - 0x00, - 0x6e, - 0x26, - 0x84, - 0x27, - 0x14, - 0x93, - 0xfb, - 0xfc, - 0xc6, - 0x0f, - 0x5e, - 0x27, - 0xe6, - 0xe1, - 0xe9, - 0xc0, - 0x8a, - 0xe4, - 0x34, - 0xda, - 0xe9, - 0xa2, - 0x4b, - 0x73, - 0xbc, - 0x8c, - 0xb9, - 0xba, - 0x13, - 0x6c, - 0x7a, - 0x2b, - 0x51, - 0x84, - 0xa3, - 0x4a, - 0xe0, - 0x30, - 0x10, - 0x06, - 0x7e, - 0xed, - 0x17, - 0x5a, - 0x14, - 0x00, - 0xc9, - 0xef, - 0x85, - 0xea, - 0x52, - 0x2c, - 0xbc, - 0x65, - 0x02, - 0x40, - 0x51, - 0xe3, - 0xf2, - 0x83, - 0x19, - 0x9b, - 0xc4, - 0x1e, - 0x2f, - 0x50, - 0x3d, - 0xdf, - 0x5a, - 0xa2, - 0x18, - 0xca, - 0x5f, - 0x2e, - 0x49, - 0xaf, - 0x6f, - 0xcc, - 0xfa, - 0x65, - 0x77, - 0x94, - 0xb5, - 0xa1, - 0x0a, - 0xa9, - 0xd1, - 0x8a, - 0x39, - 0x37, - 0xf4, - 0x0b, - 0xa0, - 0xd7, - 0x82, - 0x27, - 0x5e, - 0xae, - 0x17, - 0x17, - 0xa1, - 0x1e, - 0x54, - 0x34, - 0xbf, - 0x6e, - 0xc4, - 0x8e, - 0x99, - 0x5d, - 0x08, - 0xf1, - 0x2d, - 0x86, - 0x9d, - 0xa5, - 0x20, - 0x1b, - 0xe5, - 0xdf, + 0x30, 0x82, 0x02, 0x5c, 0x02, 0x01, 0x00, 0x02, 0x81, 0x81, + 0x00, 0xf8, 0xb8, 0x6c, 0x83, 0xb4, 0xbc, 0xd9, 0xa8, 0x57, + 0xc0, 0xa5, 0xb4, 0x59, 0x76, 0x8c, 0x54, 0x1d, 0x79, 0xeb, + 0x22, 0x52, 0x04, 0x7e, 0xd3, 0x37, 0xeb, 0x41, 0xfd, 0x83, + 0xf9, 0xf0, 0xa6, 0x85, 0x15, 0x34, 0x75, 0x71, 0x5a, 0x84, + 0xa8, 0x3c, 0xd2, 0xef, 0x5a, 0x4e, 0xd3, 0xde, 0x97, 0x8a, + 0xdd, 0xff, 0xbb, 0xcf, 0x0a, 0xaa, 0x86, 0x92, 0xbe, 0xb8, + 0x50, 0xe4, 0xcd, 0x6f, 0x80, 0x33, 0x30, 0x76, 0x13, 0x8f, + 0xca, 0x7b, 0xdc, 0xec, 0x5a, 0xca, 0x63, 0xc7, 0x03, 0x25, + 0xef, 0xa8, 0x8a, 0x83, 0x58, 0x76, 0x20, 0xfa, 0x16, 0x77, + 0xd7, 0x79, 0x92, 0x63, 0x01, 0x48, 0x1a, 0xd8, 0x7b, 0x67, + 0xf1, 0x52, 0x55, 0x49, 0x4e, 0xd6, 0x6e, 0x4a, 0x5c, 0xd7, + 0x7a, 0x37, 0x36, 0x0c, 0xde, 0xdd, 0x8f, 0x44, 0xe8, 0xc2, + 0xa7, 0x2c, 0x2b, 0xb5, 0xaf, 0x64, 0x4b, 0x61, 0x07, 0x02, + 0x03, 0x01, 0x00, 0x01, 0x02, 0x81, 0x80, 0x74, 0x88, 0x64, + 0x3f, 0x69, 0x45, 0x3a, 0x6d, 0xc7, 0x7f, 0xb9, 0xa3, 0xc0, + 0x6e, 0xec, 0xdc, 0xd4, 0x5a, 0xb5, 0x32, 0x85, 0x5f, 0x19, + 0xd4, 0xf8, 0xd4, 0x3f, 0x3c, 0xfa, 0xc2, 0xf6, 0x5f, 0xee, + 0xe6, 0xba, 0x87, 0x74, 0x2e, 0xc7, 0x0c, 0xd4, 0x42, 0xb8, + 0x66, 0x85, 0x9c, 0x7b, 0x24, 0x61, 0xaa, 0x16, 0x11, 0xf6, + 0xb5, 0xb6, 0xa4, 0x0a, 0xc9, 0x55, 0x2e, 0x81, 0xa5, 0x47, + 0x61, 0xcb, 0x25, 0x8f, 0xc2, 0x15, 0x7b, 0x0e, 0x7c, 0x36, + 0x9f, 0x3a, 0xda, 0x58, 0x86, 0x1c, 0x5b, 0x83, 0x79, 0xe6, + 0x2b, 0xcc, 0xe6, 0xfa, 0x2c, 0x61, 0xf2, 0x78, 0x80, 0x1b, + 0xe2, 0xf3, 0x9d, 0x39, 0x2b, 0x65, 0x57, 0x91, 0x3d, 0x71, + 0x99, 0x73, 0xa5, 0xc2, 0x79, 0x20, 0x8c, 0x07, 0x4f, 0xe5, + 0xb4, 0x60, 0x1f, 0x99, 0xa2, 0xb1, 0x4f, 0x0c, 0xef, 0xbc, + 0x59, 0x53, 0x00, 0x7d, 0xb1, 0x02, 0x41, 0x00, 0xfc, 0x7e, + 0x23, 0x65, 0x70, 0xf8, 0xce, 0xd3, 0x40, 0x41, 0x80, 0x6a, + 0x1d, 0x01, 0xd6, 0x01, 0xff, 0xb6, 0x1b, 0x3d, 0x3d, 0x59, + 0x09, 0x33, 0x79, 0xc0, 0x4f, 0xde, 0x96, 0x27, 0x4b, 0x18, + 0xc6, 0xd9, 0x78, 0xf1, 0xf4, 0x35, 0x46, 0xe9, 0x7c, 0x42, + 0x7a, 0x5d, 0x9f, 0xef, 0x54, 0xb8, 0xf7, 0x9f, 0xc4, 0x33, + 0x6c, 0xf3, 0x8c, 0x32, 0x46, 0x87, 0x67, 0x30, 0x7b, 0xa7, + 0xac, 0xe3, 0x02, 0x41, 0x00, 0xfc, 0x2c, 0xdf, 0x0c, 0x0d, + 0x88, 0xf5, 0xb1, 0x92, 0xa8, 0x93, 0x47, 0x63, 0x55, 0xf5, + 0xca, 0x58, 0x43, 0xba, 0x1c, 0xe5, 0x9e, 0xb6, 0x95, 0x05, + 0xcd, 0xb5, 0x82, 0xdf, 0xeb, 0x04, 0x53, 0x9d, 0xbd, 0xc2, + 0x38, 0x16, 0xb3, 0x62, 0xdd, 0xa1, 0x46, 0xdb, 0x6d, 0x97, + 0x93, 0x9f, 0x8a, 0xc3, 0x9b, 0x64, 0x7e, 0x42, 0xe3, 0x32, + 0x57, 0x19, 0x1b, 0xd5, 0x6e, 0x85, 0xfa, 0xb8, 0x8d, 0x02, + 0x41, 0x00, 0xbc, 0x3d, 0xde, 0x6d, 0xd6, 0x97, 0xe8, 0xba, + 0x9e, 0x81, 0x37, 0x17, 0xe5, 0xa0, 0x64, 0xc9, 0x00, 0xb7, + 0xe7, 0xfe, 0xf4, 0x29, 0xd9, 0x2e, 0x43, 0x6b, 0x19, 0x20, + 0xbd, 0x99, 0x75, 0xe7, 0x76, 0xf8, 0xd3, 0xae, 0xaf, 0x7e, + 0xb8, 0xeb, 0x81, 0xf4, 0x9d, 0xfe, 0x07, 0x2b, 0x0b, 0x63, + 0x0b, 0x5a, 0x55, 0x90, 0x71, 0x7d, 0xf1, 0xdb, 0xd9, 0xb1, + 0x41, 0x41, 0x68, 0x2f, 0x4e, 0x39, 0x02, 0x40, 0x5a, 0x34, + 0x66, 0xd8, 0xf5, 0xe2, 0x7f, 0x18, 0xb5, 0x00, 0x6e, 0x26, + 0x84, 0x27, 0x14, 0x93, 0xfb, 0xfc, 0xc6, 0x0f, 0x5e, 0x27, + 0xe6, 0xe1, 0xe9, 0xc0, 0x8a, 0xe4, 0x34, 0xda, 0xe9, 0xa2, + 0x4b, 0x73, 0xbc, 0x8c, 0xb9, 0xba, 0x13, 0x6c, 0x7a, 0x2b, + 0x51, 0x84, 0xa3, 0x4a, 0xe0, 0x30, 0x10, 0x06, 0x7e, 0xed, + 0x17, 0x5a, 0x14, 0x00, 0xc9, 0xef, 0x85, 0xea, 0x52, 0x2c, + 0xbc, 0x65, 0x02, 0x40, 0x51, 0xe3, 0xf2, 0x83, 0x19, 0x9b, + 0xc4, 0x1e, 0x2f, 0x50, 0x3d, 0xdf, 0x5a, 0xa2, 0x18, 0xca, + 0x5f, 0x2e, 0x49, 0xaf, 0x6f, 0xcc, 0xfa, 0x65, 0x77, 0x94, + 0xb5, 0xa1, 0x0a, 0xa9, 0xd1, 0x8a, 0x39, 0x37, 0xf4, 0x0b, + 0xa0, 0xd7, 0x82, 0x27, 0x5e, 0xae, 0x17, 0x17, 0xa1, 0x1e, + 0x54, 0x34, 0xbf, 0x6e, 0xc4, 0x8e, 0x99, 0x5d, 0x08, 0xf1, + 0x2d, 0x86, 0x9d, 0xa5, 0x20, 0x1b, 0xe5, 0xdf }; /* @@ -651,640 +104,70 @@ static const unsigned char kExampleRSAKeyDER[] = { * PrivateKeyInfo. */ static const unsigned char kExampleRSAKeyPKCS8[] = { - 0x30, - 0x82, - 0x02, - 0x76, - 0x02, - 0x01, - 0x00, - 0x30, - 0x0d, - 0x06, - 0x09, - 0x2a, - 0x86, - 0x48, - 0x86, - 0xf7, - 0x0d, - 0x01, - 0x01, - 0x01, - 0x05, - 0x00, - 0x04, - 0x82, - 0x02, - 0x60, - 0x30, - 0x82, - 0x02, - 0x5c, - 0x02, - 0x01, - 0x00, - 0x02, - 0x81, - 0x81, - 0x00, - 0xf8, - 0xb8, - 0x6c, - 0x83, - 0xb4, - 0xbc, - 0xd9, - 0xa8, - 0x57, - 0xc0, - 0xa5, - 0xb4, - 0x59, - 0x76, - 0x8c, - 0x54, - 0x1d, - 0x79, - 0xeb, - 0x22, - 0x52, - 0x04, - 0x7e, - 0xd3, - 0x37, - 0xeb, - 0x41, - 0xfd, - 0x83, - 0xf9, - 0xf0, - 0xa6, - 0x85, - 0x15, - 0x34, - 0x75, - 0x71, - 0x5a, - 0x84, - 0xa8, - 0x3c, - 0xd2, - 0xef, - 0x5a, - 0x4e, - 0xd3, - 0xde, - 0x97, - 0x8a, - 0xdd, - 0xff, - 0xbb, - 0xcf, - 0x0a, - 0xaa, - 0x86, - 0x92, - 0xbe, - 0xb8, - 0x50, - 0xe4, - 0xcd, - 0x6f, - 0x80, - 0x33, - 0x30, - 0x76, - 0x13, - 0x8f, - 0xca, - 0x7b, - 0xdc, - 0xec, - 0x5a, - 0xca, - 0x63, - 0xc7, - 0x03, - 0x25, - 0xef, - 0xa8, - 0x8a, - 0x83, - 0x58, - 0x76, - 0x20, - 0xfa, - 0x16, - 0x77, - 0xd7, - 0x79, - 0x92, - 0x63, - 0x01, - 0x48, - 0x1a, - 0xd8, - 0x7b, - 0x67, - 0xf1, - 0x52, - 0x55, - 0x49, - 0x4e, - 0xd6, - 0x6e, - 0x4a, - 0x5c, - 0xd7, - 0x7a, - 0x37, - 0x36, - 0x0c, - 0xde, - 0xdd, - 0x8f, - 0x44, - 0xe8, - 0xc2, - 0xa7, - 0x2c, - 0x2b, - 0xb5, - 0xaf, - 0x64, - 0x4b, - 0x61, - 0x07, - 0x02, - 0x03, - 0x01, - 0x00, - 0x01, - 0x02, - 0x81, - 0x80, - 0x74, - 0x88, - 0x64, - 0x3f, - 0x69, - 0x45, - 0x3a, - 0x6d, - 0xc7, - 0x7f, - 0xb9, - 0xa3, - 0xc0, - 0x6e, - 0xec, - 0xdc, - 0xd4, - 0x5a, - 0xb5, - 0x32, - 0x85, - 0x5f, - 0x19, - 0xd4, - 0xf8, - 0xd4, - 0x3f, - 0x3c, - 0xfa, - 0xc2, - 0xf6, - 0x5f, - 0xee, - 0xe6, - 0xba, - 0x87, - 0x74, - 0x2e, - 0xc7, - 0x0c, - 0xd4, - 0x42, - 0xb8, - 0x66, - 0x85, - 0x9c, - 0x7b, - 0x24, - 0x61, - 0xaa, - 0x16, - 0x11, - 0xf6, - 0xb5, - 0xb6, - 0xa4, - 0x0a, - 0xc9, - 0x55, - 0x2e, - 0x81, - 0xa5, - 0x47, - 0x61, - 0xcb, - 0x25, - 0x8f, - 0xc2, - 0x15, - 0x7b, - 0x0e, - 0x7c, - 0x36, - 0x9f, - 0x3a, - 0xda, - 0x58, - 0x86, - 0x1c, - 0x5b, - 0x83, - 0x79, - 0xe6, - 0x2b, - 0xcc, - 0xe6, - 0xfa, - 0x2c, - 0x61, - 0xf2, - 0x78, - 0x80, - 0x1b, - 0xe2, - 0xf3, - 0x9d, - 0x39, - 0x2b, - 0x65, - 0x57, - 0x91, - 0x3d, - 0x71, - 0x99, - 0x73, - 0xa5, - 0xc2, - 0x79, - 0x20, - 0x8c, - 0x07, - 0x4f, - 0xe5, - 0xb4, - 0x60, - 0x1f, - 0x99, - 0xa2, - 0xb1, - 0x4f, - 0x0c, - 0xef, - 0xbc, - 0x59, - 0x53, - 0x00, - 0x7d, - 0xb1, - 0x02, - 0x41, - 0x00, - 0xfc, - 0x7e, - 0x23, - 0x65, - 0x70, - 0xf8, - 0xce, - 0xd3, - 0x40, - 0x41, - 0x80, - 0x6a, - 0x1d, - 0x01, - 0xd6, - 0x01, - 0xff, - 0xb6, - 0x1b, - 0x3d, - 0x3d, - 0x59, - 0x09, - 0x33, - 0x79, - 0xc0, - 0x4f, - 0xde, - 0x96, - 0x27, - 0x4b, - 0x18, - 0xc6, - 0xd9, - 0x78, - 0xf1, - 0xf4, - 0x35, - 0x46, - 0xe9, - 0x7c, - 0x42, - 0x7a, - 0x5d, - 0x9f, - 0xef, - 0x54, - 0xb8, - 0xf7, - 0x9f, - 0xc4, - 0x33, - 0x6c, - 0xf3, - 0x8c, - 0x32, - 0x46, - 0x87, - 0x67, - 0x30, - 0x7b, - 0xa7, - 0xac, - 0xe3, - 0x02, - 0x41, - 0x00, - 0xfc, - 0x2c, - 0xdf, - 0x0c, - 0x0d, - 0x88, - 0xf5, - 0xb1, - 0x92, - 0xa8, - 0x93, - 0x47, - 0x63, - 0x55, - 0xf5, - 0xca, - 0x58, - 0x43, - 0xba, - 0x1c, - 0xe5, - 0x9e, - 0xb6, - 0x95, - 0x05, - 0xcd, - 0xb5, - 0x82, - 0xdf, - 0xeb, - 0x04, - 0x53, - 0x9d, - 0xbd, - 0xc2, - 0x38, - 0x16, - 0xb3, - 0x62, - 0xdd, - 0xa1, - 0x46, - 0xdb, - 0x6d, - 0x97, - 0x93, - 0x9f, - 0x8a, - 0xc3, - 0x9b, - 0x64, - 0x7e, - 0x42, - 0xe3, - 0x32, - 0x57, - 0x19, - 0x1b, - 0xd5, - 0x6e, - 0x85, - 0xfa, - 0xb8, - 0x8d, - 0x02, - 0x41, - 0x00, - 0xbc, - 0x3d, - 0xde, - 0x6d, - 0xd6, - 0x97, - 0xe8, - 0xba, - 0x9e, - 0x81, - 0x37, - 0x17, - 0xe5, - 0xa0, - 0x64, - 0xc9, - 0x00, - 0xb7, - 0xe7, - 0xfe, - 0xf4, - 0x29, - 0xd9, - 0x2e, - 0x43, - 0x6b, - 0x19, - 0x20, - 0xbd, - 0x99, - 0x75, - 0xe7, - 0x76, - 0xf8, - 0xd3, - 0xae, - 0xaf, - 0x7e, - 0xb8, - 0xeb, - 0x81, - 0xf4, - 0x9d, - 0xfe, - 0x07, - 0x2b, - 0x0b, - 0x63, - 0x0b, - 0x5a, - 0x55, - 0x90, - 0x71, - 0x7d, - 0xf1, - 0xdb, - 0xd9, - 0xb1, - 0x41, - 0x41, - 0x68, - 0x2f, - 0x4e, - 0x39, - 0x02, - 0x40, - 0x5a, - 0x34, - 0x66, - 0xd8, - 0xf5, - 0xe2, - 0x7f, - 0x18, - 0xb5, - 0x00, - 0x6e, - 0x26, - 0x84, - 0x27, - 0x14, - 0x93, - 0xfb, - 0xfc, - 0xc6, - 0x0f, - 0x5e, - 0x27, - 0xe6, - 0xe1, - 0xe9, - 0xc0, - 0x8a, - 0xe4, - 0x34, - 0xda, - 0xe9, - 0xa2, - 0x4b, - 0x73, - 0xbc, - 0x8c, - 0xb9, - 0xba, - 0x13, - 0x6c, - 0x7a, - 0x2b, - 0x51, - 0x84, - 0xa3, - 0x4a, - 0xe0, - 0x30, - 0x10, - 0x06, - 0x7e, - 0xed, - 0x17, - 0x5a, - 0x14, - 0x00, - 0xc9, - 0xef, - 0x85, - 0xea, - 0x52, - 0x2c, - 0xbc, - 0x65, - 0x02, - 0x40, - 0x51, - 0xe3, - 0xf2, - 0x83, - 0x19, - 0x9b, - 0xc4, - 0x1e, - 0x2f, - 0x50, - 0x3d, - 0xdf, - 0x5a, - 0xa2, - 0x18, - 0xca, - 0x5f, - 0x2e, - 0x49, - 0xaf, - 0x6f, - 0xcc, - 0xfa, - 0x65, - 0x77, - 0x94, - 0xb5, - 0xa1, - 0x0a, - 0xa9, - 0xd1, - 0x8a, - 0x39, - 0x37, - 0xf4, - 0x0b, - 0xa0, - 0xd7, - 0x82, - 0x27, - 0x5e, - 0xae, - 0x17, - 0x17, - 0xa1, - 0x1e, - 0x54, - 0x34, - 0xbf, - 0x6e, - 0xc4, - 0x8e, - 0x99, - 0x5d, - 0x08, - 0xf1, - 0x2d, - 0x86, - 0x9d, - 0xa5, - 0x20, - 0x1b, - 0xe5, - 0xdf, + 0x30, 0x82, 0x02, 0x76, 0x02, 0x01, 0x00, 0x30, 0x0d, 0x06, + 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, + 0x05, 0x00, 0x04, 0x82, 0x02, 0x60, 0x30, 0x82, 0x02, 0x5c, + 0x02, 0x01, 0x00, 0x02, 0x81, 0x81, 0x00, 0xf8, 0xb8, 0x6c, + 0x83, 0xb4, 0xbc, 0xd9, 0xa8, 0x57, 0xc0, 0xa5, 0xb4, 0x59, + 0x76, 0x8c, 0x54, 0x1d, 0x79, 0xeb, 0x22, 0x52, 0x04, 0x7e, + 0xd3, 0x37, 0xeb, 0x41, 0xfd, 0x83, 0xf9, 0xf0, 0xa6, 0x85, + 0x15, 0x34, 0x75, 0x71, 0x5a, 0x84, 0xa8, 0x3c, 0xd2, 0xef, + 0x5a, 0x4e, 0xd3, 0xde, 0x97, 0x8a, 0xdd, 0xff, 0xbb, 0xcf, + 0x0a, 0xaa, 0x86, 0x92, 0xbe, 0xb8, 0x50, 0xe4, 0xcd, 0x6f, + 0x80, 0x33, 0x30, 0x76, 0x13, 0x8f, 0xca, 0x7b, 0xdc, 0xec, + 0x5a, 0xca, 0x63, 0xc7, 0x03, 0x25, 0xef, 0xa8, 0x8a, 0x83, + 0x58, 0x76, 0x20, 0xfa, 0x16, 0x77, 0xd7, 0x79, 0x92, 0x63, + 0x01, 0x48, 0x1a, 0xd8, 0x7b, 0x67, 0xf1, 0x52, 0x55, 0x49, + 0x4e, 0xd6, 0x6e, 0x4a, 0x5c, 0xd7, 0x7a, 0x37, 0x36, 0x0c, + 0xde, 0xdd, 0x8f, 0x44, 0xe8, 0xc2, 0xa7, 0x2c, 0x2b, 0xb5, + 0xaf, 0x64, 0x4b, 0x61, 0x07, 0x02, 0x03, 0x01, 0x00, 0x01, + 0x02, 0x81, 0x80, 0x74, 0x88, 0x64, 0x3f, 0x69, 0x45, 0x3a, + 0x6d, 0xc7, 0x7f, 0xb9, 0xa3, 0xc0, 0x6e, 0xec, 0xdc, 0xd4, + 0x5a, 0xb5, 0x32, 0x85, 0x5f, 0x19, 0xd4, 0xf8, 0xd4, 0x3f, + 0x3c, 0xfa, 0xc2, 0xf6, 0x5f, 0xee, 0xe6, 0xba, 0x87, 0x74, + 0x2e, 0xc7, 0x0c, 0xd4, 0x42, 0xb8, 0x66, 0x85, 0x9c, 0x7b, + 0x24, 0x61, 0xaa, 0x16, 0x11, 0xf6, 0xb5, 0xb6, 0xa4, 0x0a, + 0xc9, 0x55, 0x2e, 0x81, 0xa5, 0x47, 0x61, 0xcb, 0x25, 0x8f, + 0xc2, 0x15, 0x7b, 0x0e, 0x7c, 0x36, 0x9f, 0x3a, 0xda, 0x58, + 0x86, 0x1c, 0x5b, 0x83, 0x79, 0xe6, 0x2b, 0xcc, 0xe6, 0xfa, + 0x2c, 0x61, 0xf2, 0x78, 0x80, 0x1b, 0xe2, 0xf3, 0x9d, 0x39, + 0x2b, 0x65, 0x57, 0x91, 0x3d, 0x71, 0x99, 0x73, 0xa5, 0xc2, + 0x79, 0x20, 0x8c, 0x07, 0x4f, 0xe5, 0xb4, 0x60, 0x1f, 0x99, + 0xa2, 0xb1, 0x4f, 0x0c, 0xef, 0xbc, 0x59, 0x53, 0x00, 0x7d, + 0xb1, 0x02, 0x41, 0x00, 0xfc, 0x7e, 0x23, 0x65, 0x70, 0xf8, + 0xce, 0xd3, 0x40, 0x41, 0x80, 0x6a, 0x1d, 0x01, 0xd6, 0x01, + 0xff, 0xb6, 0x1b, 0x3d, 0x3d, 0x59, 0x09, 0x33, 0x79, 0xc0, + 0x4f, 0xde, 0x96, 0x27, 0x4b, 0x18, 0xc6, 0xd9, 0x78, 0xf1, + 0xf4, 0x35, 0x46, 0xe9, 0x7c, 0x42, 0x7a, 0x5d, 0x9f, 0xef, + 0x54, 0xb8, 0xf7, 0x9f, 0xc4, 0x33, 0x6c, 0xf3, 0x8c, 0x32, + 0x46, 0x87, 0x67, 0x30, 0x7b, 0xa7, 0xac, 0xe3, 0x02, 0x41, + 0x00, 0xfc, 0x2c, 0xdf, 0x0c, 0x0d, 0x88, 0xf5, 0xb1, 0x92, + 0xa8, 0x93, 0x47, 0x63, 0x55, 0xf5, 0xca, 0x58, 0x43, 0xba, + 0x1c, 0xe5, 0x9e, 0xb6, 0x95, 0x05, 0xcd, 0xb5, 0x82, 0xdf, + 0xeb, 0x04, 0x53, 0x9d, 0xbd, 0xc2, 0x38, 0x16, 0xb3, 0x62, + 0xdd, 0xa1, 0x46, 0xdb, 0x6d, 0x97, 0x93, 0x9f, 0x8a, 0xc3, + 0x9b, 0x64, 0x7e, 0x42, 0xe3, 0x32, 0x57, 0x19, 0x1b, 0xd5, + 0x6e, 0x85, 0xfa, 0xb8, 0x8d, 0x02, 0x41, 0x00, 0xbc, 0x3d, + 0xde, 0x6d, 0xd6, 0x97, 0xe8, 0xba, 0x9e, 0x81, 0x37, 0x17, + 0xe5, 0xa0, 0x64, 0xc9, 0x00, 0xb7, 0xe7, 0xfe, 0xf4, 0x29, + 0xd9, 0x2e, 0x43, 0x6b, 0x19, 0x20, 0xbd, 0x99, 0x75, 0xe7, + 0x76, 0xf8, 0xd3, 0xae, 0xaf, 0x7e, 0xb8, 0xeb, 0x81, 0xf4, + 0x9d, 0xfe, 0x07, 0x2b, 0x0b, 0x63, 0x0b, 0x5a, 0x55, 0x90, + 0x71, 0x7d, 0xf1, 0xdb, 0xd9, 0xb1, 0x41, 0x41, 0x68, 0x2f, + 0x4e, 0x39, 0x02, 0x40, 0x5a, 0x34, 0x66, 0xd8, 0xf5, 0xe2, + 0x7f, 0x18, 0xb5, 0x00, 0x6e, 0x26, 0x84, 0x27, 0x14, 0x93, + 0xfb, 0xfc, 0xc6, 0x0f, 0x5e, 0x27, 0xe6, 0xe1, 0xe9, 0xc0, + 0x8a, 0xe4, 0x34, 0xda, 0xe9, 0xa2, 0x4b, 0x73, 0xbc, 0x8c, + 0xb9, 0xba, 0x13, 0x6c, 0x7a, 0x2b, 0x51, 0x84, 0xa3, 0x4a, + 0xe0, 0x30, 0x10, 0x06, 0x7e, 0xed, 0x17, 0x5a, 0x14, 0x00, + 0xc9, 0xef, 0x85, 0xea, 0x52, 0x2c, 0xbc, 0x65, 0x02, 0x40, + 0x51, 0xe3, 0xf2, 0x83, 0x19, 0x9b, 0xc4, 0x1e, 0x2f, 0x50, + 0x3d, 0xdf, 0x5a, 0xa2, 0x18, 0xca, 0x5f, 0x2e, 0x49, 0xaf, + 0x6f, 0xcc, 0xfa, 0x65, 0x77, 0x94, 0xb5, 0xa1, 0x0a, 0xa9, + 0xd1, 0x8a, 0x39, 0x37, 0xf4, 0x0b, 0xa0, 0xd7, 0x82, 0x27, + 0x5e, 0xae, 0x17, 0x17, 0xa1, 0x1e, 0x54, 0x34, 0xbf, 0x6e, + 0xc4, 0x8e, 0x99, 0x5d, 0x08, 0xf1, 0x2d, 0x86, 0x9d, 0xa5, + 0x20, 0x1b, 0xe5, 0xdf }; #ifndef OPENSSL_NO_DH @@ -1345,127 +228,19 @@ static const unsigned char kExampleDHPrivateKeyDER[] = { * structure. */ static const unsigned char kExampleECKeyDER[] = { - 0x30, - 0x77, - 0x02, - 0x01, - 0x01, - 0x04, - 0x20, - 0x07, - 0x0f, - 0x08, - 0x72, - 0x7a, - 0xd4, - 0xa0, - 0x4a, - 0x9c, - 0xdd, - 0x59, - 0xc9, - 0x4d, - 0x89, - 0x68, - 0x77, - 0x08, - 0xb5, - 0x6f, - 0xc9, - 0x5d, - 0x30, - 0x77, - 0x0e, - 0xe8, - 0xd1, - 0xc9, - 0xce, - 0x0a, - 0x8b, - 0xb4, - 0x6a, - 0xa0, - 0x0a, - 0x06, - 0x08, - 0x2a, - 0x86, - 0x48, - 0xce, - 0x3d, - 0x03, - 0x01, - 0x07, - 0xa1, - 0x44, - 0x03, - 0x42, - 0x00, - 0x04, - 0xe6, - 0x2b, - 0x69, - 0xe2, - 0xbf, - 0x65, - 0x9f, - 0x97, - 0xbe, - 0x2f, - 0x1e, - 0x0d, - 0x94, - 0x8a, - 0x4c, - 0xd5, - 0x97, - 0x6b, - 0xb7, - 0xa9, - 0x1e, - 0x0d, - 0x46, - 0xfb, - 0xdd, - 0xa9, - 0xa9, - 0x1e, - 0x9d, - 0xdc, - 0xba, - 0x5a, - 0x01, - 0xe7, - 0xd6, - 0x97, - 0xa8, - 0x0a, - 0x18, - 0xf9, - 0xc3, - 0xc4, - 0xa3, - 0x1e, - 0x56, - 0xe2, - 0x7c, - 0x83, - 0x48, - 0xdb, - 0x16, - 0x1a, - 0x1c, - 0xf5, - 0x1d, - 0x7e, - 0xf1, - 0x94, - 0x2d, - 0x4b, - 0xcf, - 0x72, - 0x22, - 0xc1, + 0x30, 0x77, 0x02, 0x01, 0x01, 0x04, 0x20, 0x07, 0x0f, 0x08, + 0x72, 0x7a, 0xd4, 0xa0, 0x4a, 0x9c, 0xdd, 0x59, 0xc9, 0x4d, + 0x89, 0x68, 0x77, 0x08, 0xb5, 0x6f, 0xc9, 0x5d, 0x30, 0x77, + 0x0e, 0xe8, 0xd1, 0xc9, 0xce, 0x0a, 0x8b, 0xb4, 0x6a, 0xa0, + 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, + 0x07, 0xa1, 0x44, 0x03, 0x42, 0x00, 0x04, 0xe6, 0x2b, 0x69, + 0xe2, 0xbf, 0x65, 0x9f, 0x97, 0xbe, 0x2f, 0x1e, 0x0d, 0x94, + 0x8a, 0x4c, 0xd5, 0x97, 0x6b, 0xb7, 0xa9, 0x1e, 0x0d, 0x46, + 0xfb, 0xdd, 0xa9, 0xa9, 0x1e, 0x9d, 0xdc, 0xba, 0x5a, 0x01, + 0xe7, 0xd6, 0x97, 0xa8, 0x0a, 0x18, 0xf9, 0xc3, 0xc4, 0xa3, + 0x1e, 0x56, 0xe2, 0x7c, 0x83, 0x48, 0xdb, 0x16, 0x1a, 0x1c, + 0xf5, 0x1d, 0x7e, 0xf1, 0x94, 0x2d, 0x4b, 0xcf, 0x72, 0x22, + 0xc1 }; /* P-384 sample EC private key in PKCS8 format (no public key) */ @@ -1996,856 +771,91 @@ static int do_fromdata_key_is_equal(const OSSL_PARAM params[], * -paramfile dsa_param.pem -pkeyopt type:fips186_4 -out dsa_priv.pem */ static const unsigned char dsa_key[] = { - 0x30, - 0x82, - 0x03, - 0x4e, - 0x02, - 0x01, - 0x00, - 0x02, - 0x82, - 0x01, - 0x01, - 0x00, - 0xda, - 0xb3, - 0x46, - 0x4d, - 0x54, - 0x57, - 0xc7, - 0xb4, - 0x61, - 0xa0, - 0x6f, - 0x66, - 0x17, - 0xda, - 0xeb, - 0x90, - 0xf0, - 0xa3, - 0xd1, - 0x29, - 0xc9, - 0x5f, - 0xf2, - 0x21, - 0x3d, - 0x85, - 0xa3, - 0x4a, - 0xf0, - 0xf8, - 0x36, - 0x39, - 0x1b, - 0xe3, - 0xee, - 0x37, - 0x70, - 0x06, - 0x9b, - 0xe8, - 0xe3, - 0x0a, - 0xd2, - 0xf1, - 0xf6, - 0xc4, - 0x42, - 0x23, - 0x1f, - 0x74, - 0x78, - 0xc2, - 0x16, - 0xf5, - 0xce, - 0xd6, - 0xab, - 0xa0, - 0xc6, - 0xe8, - 0x99, - 0x3d, - 0xf8, - 0x8b, - 0xfb, - 0x47, - 0xf8, - 0x5e, - 0x05, - 0x68, - 0x6d, - 0x8b, - 0xa8, - 0xad, - 0xa1, - 0xc2, - 0x3a, - 0x4e, - 0xe0, - 0xad, - 0xec, - 0x38, - 0x75, - 0x21, - 0x55, - 0x22, - 0xce, - 0xa2, - 0xe9, - 0xe5, - 0x3b, - 0xd7, - 0x44, - 0xeb, - 0x5a, - 0x03, - 0x59, - 0xa0, - 0xc5, - 0x7a, - 0x92, - 0x59, - 0x7d, - 0x7a, - 0x07, - 0x80, - 0xfc, - 0x4e, - 0xf8, - 0x56, - 0x7e, - 0xf1, - 0x06, - 0xe0, - 0xba, - 0xb2, - 0xe7, - 0x5b, - 0x22, - 0x55, - 0xee, - 0x4b, - 0x42, - 0x61, - 0x67, - 0x2c, - 0x43, - 0x9a, - 0x38, - 0x2b, - 0x17, - 0xc2, - 0x62, - 0x12, - 0x8b, - 0x0b, - 0x22, - 0x8c, - 0x0c, - 0x1c, - 0x1c, - 0x92, - 0xb1, - 0xec, - 0x70, - 0xce, - 0x0f, - 0x8c, - 0xff, - 0x8d, - 0x21, - 0xf9, - 0x19, - 0x68, - 0x4d, - 0x32, - 0x59, - 0x78, - 0x42, - 0x1d, - 0x0c, - 0xc5, - 0x1a, - 0xcb, - 0x28, - 0xe2, - 0xc1, - 0x1a, - 0x35, - 0xf1, - 0x42, - 0x0a, - 0x19, - 0x39, - 0xfa, - 0x83, - 0xd1, - 0xb4, - 0xaa, - 0x69, - 0x0f, - 0xc2, - 0x8e, - 0xf9, - 0x59, - 0x2c, - 0xee, - 0x11, - 0xfc, - 0x3e, - 0x4b, - 0x44, - 0xfb, - 0x9a, - 0x32, - 0xc8, - 0x78, - 0x23, - 0x56, - 0x85, - 0x49, - 0x21, - 0x43, - 0x12, - 0x79, - 0xbd, - 0xa0, - 0x70, - 0x47, - 0x2f, - 0xae, - 0xb6, - 0xd7, - 0x6c, - 0xc6, - 0x07, - 0x76, - 0xa9, - 0x8a, - 0xa2, - 0x16, - 0x02, - 0x89, - 0x1f, - 0x1a, - 0xd1, - 0xa2, - 0x96, - 0x56, - 0xd1, - 0x1f, - 0x10, - 0xe1, - 0xe5, - 0x9f, - 0x3f, - 0xdd, - 0x09, - 0x0c, - 0x40, - 0x90, - 0x71, - 0xef, - 0x14, - 0x41, - 0x02, - 0x82, - 0x3a, - 0x6b, - 0xe1, - 0xf8, - 0x2c, - 0x5d, - 0xbe, - 0xfd, - 0x1b, - 0x02, - 0x1d, - 0x00, - 0xe0, - 0x20, - 0xe0, - 0x7c, - 0x02, - 0x16, - 0xa7, - 0x6c, - 0x6a, - 0x19, - 0xba, - 0xd5, - 0x83, - 0x73, - 0xf3, - 0x7d, - 0x31, - 0xef, - 0xa7, - 0xe1, - 0x5d, - 0x5b, - 0x7f, - 0xf3, - 0xfc, - 0xda, - 0x84, - 0x31, - 0x02, - 0x82, - 0x01, - 0x01, - 0x00, - 0x83, - 0xdb, - 0xa1, - 0xbc, - 0x3e, - 0xc7, - 0x29, - 0xa5, - 0x6a, - 0x5c, - 0x2c, - 0xe8, - 0x7a, - 0x8c, - 0x7e, - 0xe8, - 0xb8, - 0x3e, - 0x13, - 0x47, - 0xcd, - 0x36, - 0x7e, - 0x79, - 0x30, - 0x7a, - 0x28, - 0x03, - 0xd3, - 0xd4, - 0xd2, - 0xe3, - 0xee, - 0x3b, - 0x46, - 0xda, - 0xe0, - 0x71, - 0xe6, - 0xcf, - 0x46, - 0x86, - 0x0a, - 0x37, - 0x57, - 0xb6, - 0xe9, - 0xcf, - 0xa1, - 0x78, - 0x19, - 0xb8, - 0x72, - 0x9f, - 0x30, - 0x8c, - 0x2a, - 0x04, - 0x7c, - 0x2f, - 0x0c, - 0x27, - 0xa7, - 0xb3, - 0x23, - 0xe0, - 0x46, - 0xf2, - 0x75, - 0x0c, - 0x03, - 0x4c, - 0xad, - 0xfb, - 0xc1, - 0xcb, - 0x28, - 0xcd, - 0xa0, - 0x63, - 0xdb, - 0x44, - 0x88, - 0xe0, - 0xda, - 0x6c, - 0x5b, - 0x89, - 0xb2, - 0x5b, - 0x40, - 0x6d, - 0xeb, - 0x78, - 0x7a, - 0xd5, - 0xaf, - 0x40, - 0x52, - 0x46, - 0x63, - 0x92, - 0x13, - 0x0d, - 0xee, - 0xee, - 0xf9, - 0x53, - 0xca, - 0x2d, - 0x4e, - 0x3b, - 0x13, - 0xd8, - 0x0f, - 0x50, - 0xd0, - 0x44, - 0x57, - 0x67, - 0x0f, - 0x45, - 0x8f, - 0x21, - 0x30, - 0x97, - 0x9e, - 0x80, - 0xd9, - 0xd0, - 0x91, - 0xb7, - 0xc9, - 0x5a, - 0x69, - 0xda, - 0xeb, - 0xd5, - 0xea, - 0x37, - 0xf6, - 0xb3, - 0xbe, - 0x1f, - 0x24, - 0xf1, - 0x55, - 0x14, - 0x28, - 0x05, - 0xb5, - 0xd8, - 0x84, - 0x0f, - 0x62, - 0x85, - 0xaa, - 0xec, - 0x77, - 0x64, - 0xfd, - 0x80, - 0x7c, - 0x41, - 0x00, - 0x88, - 0xa3, - 0x79, - 0x7d, - 0x4f, - 0x6f, - 0xe3, - 0x76, - 0xf4, - 0xb5, - 0x97, - 0xb7, - 0xeb, - 0x67, - 0x28, - 0xba, - 0x07, - 0x1a, - 0x59, - 0x32, - 0xc1, - 0x53, - 0xd9, - 0x05, - 0x6b, - 0x63, - 0x93, - 0xce, - 0xa1, - 0xd9, - 0x7a, - 0xb2, - 0xff, - 0x1c, - 0x12, - 0x0a, - 0x9a, - 0xe5, - 0x51, - 0x1e, - 0xba, - 0xfc, - 0x95, - 0x2e, - 0x28, - 0xa9, - 0xfc, - 0x4c, - 0xed, - 0x7b, - 0x05, - 0xca, - 0x67, - 0xe0, - 0x2d, - 0xd7, - 0x54, - 0xb3, - 0x05, - 0x1c, - 0x23, - 0x2b, - 0x35, - 0x2e, - 0x19, - 0x48, - 0x59, - 0x0e, - 0x58, - 0xa8, - 0x01, - 0x56, - 0xfb, - 0x78, - 0x90, - 0xba, - 0x08, - 0x77, - 0x94, - 0x45, - 0x05, - 0x13, - 0xc7, - 0x6b, - 0x96, - 0xd2, - 0xa3, - 0xa6, - 0x01, - 0x9f, - 0x34, - 0x02, - 0x82, - 0x01, - 0x00, - 0x16, - 0x1a, - 0xb4, - 0x6d, - 0x9f, - 0x16, - 0x6c, - 0xcc, - 0x91, - 0x66, - 0xfe, - 0x30, - 0xeb, - 0x8e, - 0x44, - 0xba, - 0x2b, - 0x7a, - 0xc9, - 0xa8, - 0x95, - 0xf2, - 0xa6, - 0x38, - 0xd8, - 0xaf, - 0x3e, - 0x91, - 0x68, - 0xe8, - 0x52, - 0xf3, - 0x97, - 0x37, - 0x70, - 0xf2, - 0x47, - 0xa3, - 0xf4, - 0x62, - 0x26, - 0xf5, - 0x3b, - 0x71, - 0x52, - 0x50, - 0x15, - 0x9c, - 0x6d, - 0xa6, - 0x6d, - 0x92, - 0x4c, - 0x48, - 0x76, - 0x31, - 0x54, - 0x48, - 0xa5, - 0x99, - 0x7a, - 0xd4, - 0x61, - 0xf7, - 0x21, - 0x44, - 0xe7, - 0xd8, - 0x82, - 0xc3, - 0x50, - 0xd3, - 0xd9, - 0xd4, - 0x66, - 0x20, - 0xab, - 0x70, - 0x4c, - 0x97, - 0x9b, - 0x8d, - 0xac, - 0x1f, - 0x78, - 0x27, - 0x1e, - 0x47, - 0xf8, - 0x3b, - 0xd1, - 0x55, - 0x73, - 0xf3, - 0xb4, - 0x8e, - 0x6d, - 0x45, - 0x40, - 0x54, - 0xc6, - 0xd8, - 0x95, - 0x15, - 0x27, - 0xb7, - 0x5f, - 0x65, - 0xaa, - 0xcb, - 0x24, - 0xc9, - 0x49, - 0x87, - 0x32, - 0xad, - 0xcb, - 0xf8, - 0x35, - 0x63, - 0x56, - 0x72, - 0x7c, - 0x4e, - 0x6c, - 0xad, - 0x5f, - 0x26, - 0x8c, - 0xd2, - 0x80, - 0x41, - 0xaf, - 0x88, - 0x23, - 0x20, - 0x03, - 0xa4, - 0xd5, - 0x3c, - 0x53, - 0x54, - 0xb0, - 0x3d, - 0xed, - 0x0e, - 0x9e, - 0x53, - 0x0a, - 0x63, - 0x5f, - 0xfd, - 0x28, - 0x57, - 0x09, - 0x07, - 0x73, - 0xf4, - 0x0c, - 0xd4, - 0x71, - 0x5d, - 0x6b, - 0xa0, - 0xd7, - 0x86, - 0x99, - 0x29, - 0x9b, - 0xca, - 0xfb, - 0xcc, - 0xd6, - 0x2f, - 0xfe, - 0xbe, - 0x94, - 0xef, - 0x1a, - 0x0e, - 0x55, - 0x84, - 0xa7, - 0xaf, - 0x7b, - 0xfa, - 0xed, - 0x77, - 0x61, - 0x28, - 0x22, - 0xee, - 0x6b, - 0x11, - 0xdd, - 0xb0, - 0x17, - 0x1e, - 0x06, - 0xe4, - 0x29, - 0x4c, - 0xc2, - 0x3f, - 0xd6, - 0x75, - 0xb6, - 0x08, - 0x04, - 0x55, - 0x13, - 0x48, - 0x4f, - 0x44, - 0xea, - 0x8d, - 0xaf, - 0xcb, - 0xac, - 0x22, - 0xc4, - 0x6a, - 0xb3, - 0x86, - 0xe5, - 0x47, - 0xa9, - 0xb5, - 0x72, - 0x17, - 0x23, - 0x11, - 0x81, - 0x7f, - 0x00, - 0x00, - 0x67, - 0x5c, - 0xf4, - 0x58, - 0xcc, - 0xe2, - 0x46, - 0xce, - 0xf5, - 0x6d, - 0xd8, - 0x18, - 0x91, - 0xc4, - 0x20, - 0xbf, - 0x07, - 0x48, - 0x45, - 0xfd, - 0x02, - 0x1c, - 0x2f, - 0x68, - 0x44, - 0xcb, - 0xfb, - 0x6b, - 0xcb, - 0x8d, - 0x02, - 0x49, - 0x7c, - 0xee, - 0xd2, - 0xa6, - 0xd3, - 0x43, - 0xb8, - 0xa4, - 0x09, - 0xb7, - 0xc1, - 0xd4, - 0x4b, - 0xc3, - 0x66, - 0xa7, - 0xe0, - 0x21, + 0x30, 0x82, 0x03, 0x4e, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01, + 0x01, 0x00, 0xda, 0xb3, 0x46, 0x4d, 0x54, 0x57, 0xc7, 0xb4, + 0x61, 0xa0, 0x6f, 0x66, 0x17, 0xda, 0xeb, 0x90, 0xf0, 0xa3, + 0xd1, 0x29, 0xc9, 0x5f, 0xf2, 0x21, 0x3d, 0x85, 0xa3, 0x4a, + 0xf0, 0xf8, 0x36, 0x39, 0x1b, 0xe3, 0xee, 0x37, 0x70, 0x06, + 0x9b, 0xe8, 0xe3, 0x0a, 0xd2, 0xf1, 0xf6, 0xc4, 0x42, 0x23, + 0x1f, 0x74, 0x78, 0xc2, 0x16, 0xf5, 0xce, 0xd6, 0xab, 0xa0, + 0xc6, 0xe8, 0x99, 0x3d, 0xf8, 0x8b, 0xfb, 0x47, 0xf8, 0x5e, + 0x05, 0x68, 0x6d, 0x8b, 0xa8, 0xad, 0xa1, 0xc2, 0x3a, 0x4e, + 0xe0, 0xad, 0xec, 0x38, 0x75, 0x21, 0x55, 0x22, 0xce, 0xa2, + 0xe9, 0xe5, 0x3b, 0xd7, 0x44, 0xeb, 0x5a, 0x03, 0x59, 0xa0, + 0xc5, 0x7a, 0x92, 0x59, 0x7d, 0x7a, 0x07, 0x80, 0xfc, 0x4e, + 0xf8, 0x56, 0x7e, 0xf1, 0x06, 0xe0, 0xba, 0xb2, 0xe7, 0x5b, + 0x22, 0x55, 0xee, 0x4b, 0x42, 0x61, 0x67, 0x2c, 0x43, 0x9a, + 0x38, 0x2b, 0x17, 0xc2, 0x62, 0x12, 0x8b, 0x0b, 0x22, 0x8c, + 0x0c, 0x1c, 0x1c, 0x92, 0xb1, 0xec, 0x70, 0xce, 0x0f, 0x8c, + 0xff, 0x8d, 0x21, 0xf9, 0x19, 0x68, 0x4d, 0x32, 0x59, 0x78, + 0x42, 0x1d, 0x0c, 0xc5, 0x1a, 0xcb, 0x28, 0xe2, 0xc1, 0x1a, + 0x35, 0xf1, 0x42, 0x0a, 0x19, 0x39, 0xfa, 0x83, 0xd1, 0xb4, + 0xaa, 0x69, 0x0f, 0xc2, 0x8e, 0xf9, 0x59, 0x2c, 0xee, 0x11, + 0xfc, 0x3e, 0x4b, 0x44, 0xfb, 0x9a, 0x32, 0xc8, 0x78, 0x23, + 0x56, 0x85, 0x49, 0x21, 0x43, 0x12, 0x79, 0xbd, 0xa0, 0x70, + 0x47, 0x2f, 0xae, 0xb6, 0xd7, 0x6c, 0xc6, 0x07, 0x76, 0xa9, + 0x8a, 0xa2, 0x16, 0x02, 0x89, 0x1f, 0x1a, 0xd1, 0xa2, 0x96, + 0x56, 0xd1, 0x1f, 0x10, 0xe1, 0xe5, 0x9f, 0x3f, 0xdd, 0x09, + 0x0c, 0x40, 0x90, 0x71, 0xef, 0x14, 0x41, 0x02, 0x82, 0x3a, + 0x6b, 0xe1, 0xf8, 0x2c, 0x5d, 0xbe, 0xfd, 0x1b, 0x02, 0x1d, + 0x00, 0xe0, 0x20, 0xe0, 0x7c, 0x02, 0x16, 0xa7, 0x6c, 0x6a, + 0x19, 0xba, 0xd5, 0x83, 0x73, 0xf3, 0x7d, 0x31, 0xef, 0xa7, + 0xe1, 0x5d, 0x5b, 0x7f, 0xf3, 0xfc, 0xda, 0x84, 0x31, 0x02, + 0x82, 0x01, 0x01, 0x00, 0x83, 0xdb, 0xa1, 0xbc, 0x3e, 0xc7, + 0x29, 0xa5, 0x6a, 0x5c, 0x2c, 0xe8, 0x7a, 0x8c, 0x7e, 0xe8, + 0xb8, 0x3e, 0x13, 0x47, 0xcd, 0x36, 0x7e, 0x79, 0x30, 0x7a, + 0x28, 0x03, 0xd3, 0xd4, 0xd2, 0xe3, 0xee, 0x3b, 0x46, 0xda, + 0xe0, 0x71, 0xe6, 0xcf, 0x46, 0x86, 0x0a, 0x37, 0x57, 0xb6, + 0xe9, 0xcf, 0xa1, 0x78, 0x19, 0xb8, 0x72, 0x9f, 0x30, 0x8c, + 0x2a, 0x04, 0x7c, 0x2f, 0x0c, 0x27, 0xa7, 0xb3, 0x23, 0xe0, + 0x46, 0xf2, 0x75, 0x0c, 0x03, 0x4c, 0xad, 0xfb, 0xc1, 0xcb, + 0x28, 0xcd, 0xa0, 0x63, 0xdb, 0x44, 0x88, 0xe0, 0xda, 0x6c, + 0x5b, 0x89, 0xb2, 0x5b, 0x40, 0x6d, 0xeb, 0x78, 0x7a, 0xd5, + 0xaf, 0x40, 0x52, 0x46, 0x63, 0x92, 0x13, 0x0d, 0xee, 0xee, + 0xf9, 0x53, 0xca, 0x2d, 0x4e, 0x3b, 0x13, 0xd8, 0x0f, 0x50, + 0xd0, 0x44, 0x57, 0x67, 0x0f, 0x45, 0x8f, 0x21, 0x30, 0x97, + 0x9e, 0x80, 0xd9, 0xd0, 0x91, 0xb7, 0xc9, 0x5a, 0x69, 0xda, + 0xeb, 0xd5, 0xea, 0x37, 0xf6, 0xb3, 0xbe, 0x1f, 0x24, 0xf1, + 0x55, 0x14, 0x28, 0x05, 0xb5, 0xd8, 0x84, 0x0f, 0x62, 0x85, + 0xaa, 0xec, 0x77, 0x64, 0xfd, 0x80, 0x7c, 0x41, 0x00, 0x88, + 0xa3, 0x79, 0x7d, 0x4f, 0x6f, 0xe3, 0x76, 0xf4, 0xb5, 0x97, + 0xb7, 0xeb, 0x67, 0x28, 0xba, 0x07, 0x1a, 0x59, 0x32, 0xc1, + 0x53, 0xd9, 0x05, 0x6b, 0x63, 0x93, 0xce, 0xa1, 0xd9, 0x7a, + 0xb2, 0xff, 0x1c, 0x12, 0x0a, 0x9a, 0xe5, 0x51, 0x1e, 0xba, + 0xfc, 0x95, 0x2e, 0x28, 0xa9, 0xfc, 0x4c, 0xed, 0x7b, 0x05, + 0xca, 0x67, 0xe0, 0x2d, 0xd7, 0x54, 0xb3, 0x05, 0x1c, 0x23, + 0x2b, 0x35, 0x2e, 0x19, 0x48, 0x59, 0x0e, 0x58, 0xa8, 0x01, + 0x56, 0xfb, 0x78, 0x90, 0xba, 0x08, 0x77, 0x94, 0x45, 0x05, + 0x13, 0xc7, 0x6b, 0x96, 0xd2, 0xa3, 0xa6, 0x01, 0x9f, 0x34, + 0x02, 0x82, 0x01, 0x00, 0x16, 0x1a, 0xb4, 0x6d, 0x9f, 0x16, + 0x6c, 0xcc, 0x91, 0x66, 0xfe, 0x30, 0xeb, 0x8e, 0x44, 0xba, + 0x2b, 0x7a, 0xc9, 0xa8, 0x95, 0xf2, 0xa6, 0x38, 0xd8, 0xaf, + 0x3e, 0x91, 0x68, 0xe8, 0x52, 0xf3, 0x97, 0x37, 0x70, 0xf2, + 0x47, 0xa3, 0xf4, 0x62, 0x26, 0xf5, 0x3b, 0x71, 0x52, 0x50, + 0x15, 0x9c, 0x6d, 0xa6, 0x6d, 0x92, 0x4c, 0x48, 0x76, 0x31, + 0x54, 0x48, 0xa5, 0x99, 0x7a, 0xd4, 0x61, 0xf7, 0x21, 0x44, + 0xe7, 0xd8, 0x82, 0xc3, 0x50, 0xd3, 0xd9, 0xd4, 0x66, 0x20, + 0xab, 0x70, 0x4c, 0x97, 0x9b, 0x8d, 0xac, 0x1f, 0x78, 0x27, + 0x1e, 0x47, 0xf8, 0x3b, 0xd1, 0x55, 0x73, 0xf3, 0xb4, 0x8e, + 0x6d, 0x45, 0x40, 0x54, 0xc6, 0xd8, 0x95, 0x15, 0x27, 0xb7, + 0x5f, 0x65, 0xaa, 0xcb, 0x24, 0xc9, 0x49, 0x87, 0x32, 0xad, + 0xcb, 0xf8, 0x35, 0x63, 0x56, 0x72, 0x7c, 0x4e, 0x6c, 0xad, + 0x5f, 0x26, 0x8c, 0xd2, 0x80, 0x41, 0xaf, 0x88, 0x23, 0x20, + 0x03, 0xa4, 0xd5, 0x3c, 0x53, 0x54, 0xb0, 0x3d, 0xed, 0x0e, + 0x9e, 0x53, 0x0a, 0x63, 0x5f, 0xfd, 0x28, 0x57, 0x09, 0x07, + 0x73, 0xf4, 0x0c, 0xd4, 0x71, 0x5d, 0x6b, 0xa0, 0xd7, 0x86, + 0x99, 0x29, 0x9b, 0xca, 0xfb, 0xcc, 0xd6, 0x2f, 0xfe, 0xbe, + 0x94, 0xef, 0x1a, 0x0e, 0x55, 0x84, 0xa7, 0xaf, 0x7b, 0xfa, + 0xed, 0x77, 0x61, 0x28, 0x22, 0xee, 0x6b, 0x11, 0xdd, 0xb0, + 0x17, 0x1e, 0x06, 0xe4, 0x29, 0x4c, 0xc2, 0x3f, 0xd6, 0x75, + 0xb6, 0x08, 0x04, 0x55, 0x13, 0x48, 0x4f, 0x44, 0xea, 0x8d, + 0xaf, 0xcb, 0xac, 0x22, 0xc4, 0x6a, 0xb3, 0x86, 0xe5, 0x47, + 0xa9, 0xb5, 0x72, 0x17, 0x23, 0x11, 0x81, 0x7f, 0x00, 0x00, + 0x67, 0x5c, 0xf4, 0x58, 0xcc, 0xe2, 0x46, 0xce, 0xf5, 0x6d, + 0xd8, 0x18, 0x91, 0xc4, 0x20, 0xbf, 0x07, 0x48, 0x45, 0xfd, + 0x02, 0x1c, 0x2f, 0x68, 0x44, 0xcb, 0xfb, 0x6b, 0xcb, 0x8d, + 0x02, 0x49, 0x7c, 0xee, 0xd2, 0xa6, 0xd3, 0x43, 0xb8, 0xa4, + 0x09, 0xb7, 0xc1, 0xd4, 0x4b, 0xc3, 0x66, 0xa7, 0xe0, 0x21 }; static const unsigned char dsa_p[] = { 0x00, 0xda, 0xb3, 0x46, 0x4d, 0x54, 0x57, 0xc7, 0xb4, 0x61, 0xa0, 0x6f, 0x66, 0x17, 0xda, diff --git a/test/evp_kdf_test.c b/test/evp_kdf_test.c index 78fec30c7bd3..d6189c3fe4ef 100644 --- a/test/evp_kdf_test.c +++ b/test/evp_kdf_test.c @@ -1,5 +1,5 @@ /* - * Copyright 2018-2025 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2018-2026 The OpenSSL Project Authors. All Rights Reserved. * Copyright (c) 2018-2020, Oracle and/or its affiliates. All rights reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use @@ -683,7 +683,7 @@ static int test_kdf_pbkdf2_large_output(void) int mode = 0; OSSL_PARAM *params; - if (sizeof(len) > 32) + if (SIZE_MAX > 0xFFFFFFFFU) len = SIZE_MAX; params = construct_pbkdf2_params("passwordPASSWORDpassword", "sha256", @@ -1003,22 +1003,8 @@ static int test_kdf_kbkdf_6803_128(void) 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, + 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 }, @@ -1073,38 +1059,10 @@ static int test_kdf_kbkdf_6803_256(void) 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, + 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 }, @@ -1112,108 +1070,18 @@ static int test_kdf_kbkdf_6803_256(void) { 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, - }, + { 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 }; @@ -1400,56 +1268,14 @@ static int test_kdf_kbkdf_8009_prf1(void) 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, + 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, + 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 }; @@ -1482,88 +1308,17 @@ static int test_kdf_kbkdf_8009_prf2(void) 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, + 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, + 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 }; @@ -1607,103 +1362,22 @@ static int test_kdf_kbkdf_fixedinfo(void) int use_separator = 0; static unsigned char input_key[] = { - 0xc1, - 0x0b, - 0x15, - 0x2e, - 0x8c, - 0x97, - 0xb7, - 0x7e, - 0x18, - 0x70, - 0x4e, - 0x0f, - 0x0b, - 0xd3, - 0x83, - 0x05, + 0xc1, 0x0b, 0x15, 0x2e, 0x8c, 0x97, 0xb7, 0x7e, 0x18, 0x70, + 0x4e, 0x0f, 0x0b, 0xd3, 0x83, 0x05 }; static unsigned char fixed_input[] = { - 0x98, - 0xcd, - 0x4c, - 0xbb, - 0xbe, - 0xbe, - 0x15, - 0xd1, - 0x7d, - 0xc8, - 0x6e, - 0x6d, - 0xba, - 0xd8, - 0x00, - 0xa2, - 0xdc, - 0xbd, - 0x64, - 0xf7, - 0xc7, - 0xad, - 0x0e, - 0x78, - 0xe9, - 0xcf, - 0x94, - 0xff, - 0xdb, - 0xa8, - 0x9d, - 0x03, - 0xe9, - 0x7e, - 0xad, - 0xf6, - 0xc4, - 0xf7, - 0xb8, - 0x06, - 0xca, - 0xf5, - 0x2a, - 0xa3, - 0x8f, - 0x09, - 0xd0, - 0xeb, - 0x71, - 0xd7, - 0x1f, - 0x49, - 0x7b, - 0xcc, - 0x69, - 0x06, - 0xb4, - 0x8d, - 0x36, - 0xc4, - + 0x98, 0xcd, 0x4c, 0xbb, 0xbe, 0xbe, 0x15, 0xd1, + 0x7d, 0xc8, 0x6e, 0x6d, 0xba, 0xd8, 0x00, 0xa2, + 0xdc, 0xbd, 0x64, 0xf7, 0xc7, 0xad, 0x0e, 0x78, + 0xe9, 0xcf, 0x94, 0xff, 0xdb, 0xa8, 0x9d, 0x03, + 0xe9, 0x7e, 0xad, 0xf6, 0xc4, 0xf7, 0xb8, 0x06, + 0xca, 0xf5, 0x2a, 0xa3, 0x8f, 0x09, 0xd0, 0xeb, + 0x71, 0xd7, 0x1f, 0x49, 0x7b, 0xcc, 0x69, 0x06, + 0xb4, 0x8d, 0x36, 0xc4 }; static unsigned char output[] = { - 0x26, - 0xfa, - 0xf6, - 0x19, - 0x08, - 0xad, - 0x9e, - 0xe8, - 0x81, - 0xb8, - 0x30, - 0x5c, - 0x22, - 0x1d, - 0xb5, - 0x3f, + 0x26, 0xfa, 0xf6, 0x19, 0x08, 0xad, 0x9e, 0xe8, 0x81, 0xb8, + 0x30, 0x5c, 0x22, 0x1d, 0xb5, 0x3f }; unsigned char result[sizeof(output)] = { 0 }; diff --git a/test/evp_libctx_test.c b/test/evp_libctx_test.c index 304c987f50bb..ddc4fd4cc099 100644 --- a/test/evp_libctx_test.c +++ b/test/evp_libctx_test.c @@ -1,5 +1,5 @@ /* - * Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2020-2026 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 @@ -327,70 +327,13 @@ static int test_cipher_reinit(int test_id) 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10 }; unsigned char key[64] = { - 0x00, - 0x01, - 0x02, - 0x03, - 0x04, - 0x05, - 0x06, - 0x07, - 0x08, - 0x09, - 0x0a, - 0x0b, - 0x0c, - 0x0d, - 0x0e, - 0x0f, - 0x01, - 0x01, - 0x02, - 0x03, - 0x04, - 0x05, - 0x06, - 0x07, - 0x08, - 0x09, - 0x0a, - 0x0b, - 0x0c, - 0x0d, - 0x0e, - 0x0f, - 0x02, - 0x01, - 0x02, - 0x03, - 0x04, - 0x05, - 0x06, - 0x07, - 0x08, - 0x09, - 0x0a, - 0x0b, - 0x0c, - 0x0d, - 0x0e, - 0x0f, - 0x03, - 0x01, - 0x02, - 0x03, - 0x04, - 0x05, - 0x06, - 0x07, - 0x08, - 0x09, - 0x0a, - 0x0b, - 0x0c, - 0x0d, - 0x0e, - 0x0f, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, + 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x01, 0x01, 0x02, 0x03, + 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, + 0x0e, 0x0f, 0x02, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x03, 0x01, + 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, + 0x0c, 0x0d, 0x0e, 0x0f }; unsigned char iv[16] = { 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, @@ -468,104 +411,19 @@ static int test_cipher_reinit_partialupdate(int test_id) unsigned char out2[256]; unsigned char out3[256]; static const unsigned char in[32] = { - 0x08, - 0x09, - 0x0a, - 0x0b, - 0x0c, - 0x0d, - 0x0e, - 0x0f, - 0xba, - 0xbe, - 0xba, - 0xbe, - 0x00, - 0x00, - 0xba, - 0xbe, - 0x01, - 0x01, - 0x02, - 0x03, - 0x04, - 0x05, - 0x06, - 0x07, - 0x08, - 0x09, - 0x0a, - 0x0b, - 0x0c, - 0x0d, - 0x0e, - 0x0f, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0xba, 0xbe, + 0xba, 0xbe, 0x00, 0x00, 0xba, 0xbe, 0x01, 0x01, 0x02, 0x03, + 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, + 0x0e, 0x0f }; static const unsigned char key[64] = { - 0x00, - 0x01, - 0x02, - 0x03, - 0x04, - 0x05, - 0x06, - 0x07, - 0x08, - 0x09, - 0x0a, - 0x0b, - 0x0c, - 0x0d, - 0x0e, - 0x0f, - 0x01, - 0x01, - 0x02, - 0x03, - 0x04, - 0x05, - 0x06, - 0x07, - 0x08, - 0x09, - 0x0a, - 0x0b, - 0x0c, - 0x0d, - 0x0e, - 0x0f, - 0x02, - 0x01, - 0x02, - 0x03, - 0x04, - 0x05, - 0x06, - 0x07, - 0x08, - 0x09, - 0x0a, - 0x0b, - 0x0c, - 0x0d, - 0x0e, - 0x0f, - 0x03, - 0x01, - 0x02, - 0x03, - 0x04, - 0x05, - 0x06, - 0x07, - 0x08, - 0x09, - 0x0a, - 0x0b, - 0x0c, - 0x0d, - 0x0e, - 0x0f, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, + 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x01, 0x01, 0x02, 0x03, + 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, + 0x0e, 0x0f, 0x02, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x03, 0x01, + 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, + 0x0c, 0x0d, 0x0e, 0x0f }; static const unsigned char iv[16] = { 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, diff --git a/test/evp_pkey_provided_test.c b/test/evp_pkey_provided_test.c index dcc9524c9fa5..b7385be62f9a 100644 --- a/test/evp_pkey_provided_test.c +++ b/test/evp_pkey_provided_test.c @@ -1,5 +1,5 @@ /* - * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2019-2026 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 @@ -523,34 +523,9 @@ static int test_fromdata_dh_named_group(void) * -pkeyopt priv_len:224 -text */ static const unsigned char priv_data[] = { - 0x88, - 0x85, - 0xe7, - 0x9f, - 0xee, - 0x6d, - 0xc5, - 0x7c, - 0x78, - 0xaf, - 0x63, - 0x5d, - 0x38, - 0x2a, - 0xd0, - 0xed, - 0x56, - 0x4b, - 0x47, - 0x21, - 0x2b, - 0xfa, - 0x55, - 0xfa, - 0x87, - 0xe8, - 0xa9, - 0x7b, + 0x88, 0x85, 0xe7, 0x9f, 0xee, 0x6d, 0xc5, 0x7c, 0x78, 0xaf, + 0x63, 0x5d, 0x38, 0x2a, 0xd0, 0xed, 0x56, 0x4b, 0x47, 0x21, + 0x2b, 0xfa, 0x55, 0xfa, 0x87, 0xe8, 0xa9, 0x7b }; static const unsigned char pub_data[] = { 0x00, 0xd6, 0x2d, 0x77, 0xe0, 0xd3, 0x7d, 0xf8, 0xeb, 0x98, 0x50, 0xa1, @@ -763,34 +738,9 @@ static int test_fromdata_dh_fips186_4(void) * -pkeyopt group:ffdhe2048 -pkeyopt priv_len:224 -text */ static const unsigned char priv_data[] = { - 0x88, - 0x85, - 0xe7, - 0x9f, - 0xee, - 0x6d, - 0xc5, - 0x7c, - 0x78, - 0xaf, - 0x63, - 0x5d, - 0x38, - 0x2a, - 0xd0, - 0xed, - 0x56, - 0x4b, - 0x47, - 0x21, - 0x2b, - 0xfa, - 0x55, - 0xfa, - 0x87, - 0xe8, - 0xa9, - 0x7b, + 0x88, 0x85, 0xe7, 0x9f, 0xee, 0x6d, 0xc5, 0x7c, 0x78, 0xaf, + 0x63, 0x5d, 0x38, 0x2a, 0xd0, 0xed, 0x56, 0x4b, 0x47, 0x21, + 0x2b, 0xfa, 0x55, 0xfa, 0x87, 0xe8, 0xa9, 0x7b }; static const unsigned char pub_data[] = { 0xd6, 0x2d, 0x77, 0xe0, 0xd3, 0x7d, 0xf8, 0xeb, 0x98, 0x50, 0xa1, 0x82, @@ -1267,6 +1217,11 @@ static int test_fromdata_ec(void) BIGNUM *a = NULL; BIGNUM *b = NULL; BIGNUM *p = NULL; + OSSL_PARAM probe[2] = { + OSSL_PARAM_DEFN(OSSL_PKEY_PARAM_PRIV_KEY, OSSL_PARAM_UNSIGNED_INTEGER, + NULL, 0), + OSSL_PARAM_END + }; if (!TEST_ptr(bld = OSSL_PARAM_BLD_new())) goto err; @@ -1354,6 +1309,18 @@ static int test_fromdata_ec(void) || !TEST_BN_eq(group_b, b)) goto err; + /* + * Probe the EC private-key BN length via the explicit-params + * path; with NULL data, return_size receives the required + * (padded) buffer size, which equals the byte length of the + * group order. + */ + probe[0].return_size = OSSL_PARAM_UNMODIFIED; + if (!TEST_true(EVP_PKEY_get_params(pk, probe)) + || !TEST_size_t_eq(probe[0].return_size, + BN_num_bytes(EC_GROUP_get0_order(group)))) + goto err; + EC_GROUP_free(group); group = NULL; BN_free(group_p); diff --git a/test/helpers/predefined_dhparams.c b/test/helpers/predefined_dhparams.c index 28070efdb64b..ef71b4498d0f 100644 --- a/test/helpers/predefined_dhparams.c +++ b/test/helpers/predefined_dhparams.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2026 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 @@ -72,73 +72,16 @@ err: EVP_PKEY *get_dh512(OSSL_LIB_CTX *libctx) { static unsigned char dh512_p[] = { - 0xCB, - 0xC8, - 0xE1, - 0x86, - 0xD0, - 0x1F, - 0x94, - 0x17, - 0xA6, - 0x99, - 0xF0, - 0xC6, - 0x1F, - 0x0D, - 0xAC, - 0xB6, - 0x25, - 0x3E, - 0x06, - 0x39, - 0xCA, - 0x72, - 0x04, - 0xB0, - 0x6E, - 0xDA, - 0xC0, - 0x61, - 0xE6, - 0x7A, - 0x77, - 0x25, - 0xE8, - 0x3B, - 0xB9, - 0x5F, - 0x9A, - 0xB6, - 0xB5, - 0xFE, - 0x99, - 0x0B, - 0xA1, - 0x93, - 0x4E, - 0x35, - 0x33, - 0xB8, - 0xE1, - 0xF1, - 0x13, - 0x4F, - 0x59, - 0x1A, - 0xD2, - 0x57, - 0xC0, - 0x26, - 0x21, - 0x33, - 0x02, - 0xC5, - 0xAE, - 0x23, + 0xCB, 0xC8, 0xE1, 0x86, 0xD0, 0x1F, 0x94, 0x17, 0xA6, 0x99, + 0xF0, 0xC6, 0x1F, 0x0D, 0xAC, 0xB6, 0x25, 0x3E, 0x06, 0x39, + 0xCA, 0x72, 0x04, 0xB0, 0x6E, 0xDA, 0xC0, 0x61, 0xE6, 0x7A, + 0x77, 0x25, 0xE8, 0x3B, 0xB9, 0x5F, 0x9A, 0xB6, 0xB5, 0xFE, + 0x99, 0x0B, 0xA1, 0x93, 0x4E, 0x35, 0x33, 0xB8, 0xE1, 0xF1, + 0x13, 0x4F, 0x59, 0x1A, 0xD2, 0x57, 0xC0, 0x26, 0x21, 0x33, + 0x02, 0xC5, 0xAE, 0x23 }; static unsigned char dh512_g[] = { - 0x02, + 0x02 }; return get_dh_from_pg(libctx, "DH", dh512_p, sizeof(dh512_p), @@ -148,161 +91,27 @@ EVP_PKEY *get_dh512(OSSL_LIB_CTX *libctx) EVP_PKEY *get_dhx512(OSSL_LIB_CTX *libctx) { static unsigned char dhx512_p[] = { - 0x00, - 0xe8, - 0x1a, - 0xb7, - 0x9a, - 0x02, - 0x65, - 0x64, - 0x94, - 0x7b, - 0xba, - 0x09, - 0x1c, - 0x12, - 0x27, - 0x1e, - 0xea, - 0x89, - 0x32, - 0x64, - 0x78, - 0xf8, - 0x1c, - 0x78, - 0x8e, - 0x96, - 0xc3, - 0xc6, - 0x9f, - 0x41, - 0x05, - 0x41, - 0x65, - 0xae, - 0xe3, - 0x05, - 0xea, - 0x66, - 0x21, - 0xf7, - 0x38, - 0xb7, - 0x2b, - 0x32, - 0x40, - 0x5a, - 0x14, - 0x86, - 0x51, - 0x94, - 0xb1, - 0xcf, - 0x01, - 0xe3, - 0x27, - 0x28, - 0xf6, - 0x75, - 0xa3, - 0x15, - 0xbb, - 0x12, - 0x4d, - 0x99, - 0xe7, + 0x00, 0xe8, 0x1a, 0xb7, 0x9a, 0x02, 0x65, 0x64, 0x94, 0x7b, + 0xba, 0x09, 0x1c, 0x12, 0x27, 0x1e, 0xea, 0x89, 0x32, 0x64, + 0x78, 0xf8, 0x1c, 0x78, 0x8e, 0x96, 0xc3, 0xc6, 0x9f, 0x41, + 0x05, 0x41, 0x65, 0xae, 0xe3, 0x05, 0xea, 0x66, 0x21, 0xf7, + 0x38, 0xb7, 0x2b, 0x32, 0x40, 0x5a, 0x14, 0x86, 0x51, 0x94, + 0xb1, 0xcf, 0x01, 0xe3, 0x27, 0x28, 0xf6, 0x75, 0xa3, 0x15, + 0xbb, 0x12, 0x4d, 0x99, 0xe7 }; static unsigned char dhx512_g[] = { - 0x00, - 0x91, - 0xc1, - 0x43, - 0x6d, - 0x0d, - 0xb0, - 0xa4, - 0xde, - 0x41, - 0xb7, - 0x93, - 0xad, - 0x51, - 0x94, - 0x1b, - 0x43, - 0xd8, - 0x42, - 0xf1, - 0x5e, - 0x46, - 0x83, - 0x5d, - 0xf1, - 0xd1, - 0xf0, - 0x41, - 0x10, - 0xd1, - 0x1c, - 0x5e, - 0xad, - 0x9b, - 0x68, - 0xb1, - 0x6f, - 0xf5, - 0x8e, - 0xaa, - 0x6d, - 0x71, - 0x88, - 0x37, - 0xdf, - 0x05, - 0xf7, - 0x6e, - 0x7a, - 0xb4, - 0x25, - 0x10, - 0x6c, - 0x7f, - 0x38, - 0xb4, - 0xc8, - 0xfc, - 0xcc, - 0x0c, - 0x6a, - 0x02, - 0x08, - 0x61, - 0xf6, + 0x00, 0x91, 0xc1, 0x43, 0x6d, 0x0d, 0xb0, 0xa4, 0xde, 0x41, + 0xb7, 0x93, 0xad, 0x51, 0x94, 0x1b, 0x43, 0xd8, 0x42, 0xf1, + 0x5e, 0x46, 0x83, 0x5d, 0xf1, 0xd1, 0xf0, 0x41, 0x10, 0xd1, + 0x1c, 0x5e, 0xad, 0x9b, 0x68, 0xb1, 0x6f, 0xf5, 0x8e, 0xaa, + 0x6d, 0x71, 0x88, 0x37, 0xdf, 0x05, 0xf7, 0x6e, 0x7a, 0xb4, + 0x25, 0x10, 0x6c, 0x7f, 0x38, 0xb4, 0xc8, 0xfc, 0xcc, 0x0c, + 0x6a, 0x02, 0x08, 0x61, 0xf6 }; static unsigned char dhx512_q[] = { - 0x00, - 0xdd, - 0xf6, - 0x35, - 0xad, - 0xfa, - 0x70, - 0xc7, - 0xe7, - 0xa8, - 0xf0, - 0xe3, - 0xda, - 0x79, - 0x34, - 0x3f, - 0x5b, - 0xcf, - 0x73, - 0x82, - 0x91, + 0x00, 0xdd, 0xf6, 0x35, 0xad, 0xfa, 0x70, 0xc7, 0xe7, 0xa8, + 0xf0, 0xe3, 0xda, 0x79, 0x34, 0x3f, 0x5b, 0xcf, 0x73, 0x82, + 0x91 }; return get_dh_from_pg(libctx, "X9.42 DH", @@ -314,264 +123,34 @@ EVP_PKEY *get_dhx512(OSSL_LIB_CTX *libctx) EVP_PKEY *get_dh1024dsa(OSSL_LIB_CTX *libctx) { static unsigned char dh1024_p[] = { - 0xC8, - 0x00, - 0xF7, - 0x08, - 0x07, - 0x89, - 0x4D, - 0x90, - 0x53, - 0xF3, - 0xD5, - 0x00, - 0x21, - 0x1B, - 0xF7, - 0x31, - 0xA6, - 0xA2, - 0xDA, - 0x23, - 0x9A, - 0xC7, - 0x87, - 0x19, - 0x3B, - 0x47, - 0xB6, - 0x8C, - 0x04, - 0x6F, - 0xFF, - 0xC6, - 0x9B, - 0xB8, - 0x65, - 0xD2, - 0xC2, - 0x5F, - 0x31, - 0x83, - 0x4A, - 0xA7, - 0x5F, - 0x2F, - 0x88, - 0x38, - 0xB6, - 0x55, - 0xCF, - 0xD9, - 0x87, - 0x6D, - 0x6F, - 0x9F, - 0xDA, - 0xAC, - 0xA6, - 0x48, - 0xAF, - 0xFC, - 0x33, - 0x84, - 0x37, - 0x5B, - 0x82, - 0x4A, - 0x31, - 0x5D, - 0xE7, - 0xBD, - 0x52, - 0x97, - 0xA1, - 0x77, - 0xBF, - 0x10, - 0x9E, - 0x37, - 0xEA, - 0x64, - 0xFA, - 0xCA, - 0x28, - 0x8D, - 0x9D, - 0x3B, - 0xD2, - 0x6E, - 0x09, - 0x5C, - 0x68, - 0xC7, - 0x45, - 0x90, - 0xFD, - 0xBB, - 0x70, - 0xC9, - 0x3A, - 0xBB, - 0xDF, - 0xD4, - 0x21, - 0x0F, - 0xC4, - 0x6A, - 0x3C, - 0xF6, - 0x61, - 0xCF, - 0x3F, - 0xD6, - 0x13, - 0xF1, - 0x5F, - 0xBC, - 0xCF, - 0xBC, - 0x26, - 0x9E, - 0xBC, - 0x0B, - 0xBD, - 0xAB, - 0x5D, - 0xC9, - 0x54, - 0x39, + 0xC8, 0x00, 0xF7, 0x08, 0x07, 0x89, 0x4D, 0x90, 0x53, 0xF3, + 0xD5, 0x00, 0x21, 0x1B, 0xF7, 0x31, 0xA6, 0xA2, 0xDA, 0x23, + 0x9A, 0xC7, 0x87, 0x19, 0x3B, 0x47, 0xB6, 0x8C, 0x04, 0x6F, + 0xFF, 0xC6, 0x9B, 0xB8, 0x65, 0xD2, 0xC2, 0x5F, 0x31, 0x83, + 0x4A, 0xA7, 0x5F, 0x2F, 0x88, 0x38, 0xB6, 0x55, 0xCF, 0xD9, + 0x87, 0x6D, 0x6F, 0x9F, 0xDA, 0xAC, 0xA6, 0x48, 0xAF, 0xFC, + 0x33, 0x84, 0x37, 0x5B, 0x82, 0x4A, 0x31, 0x5D, 0xE7, 0xBD, + 0x52, 0x97, 0xA1, 0x77, 0xBF, 0x10, 0x9E, 0x37, 0xEA, 0x64, + 0xFA, 0xCA, 0x28, 0x8D, 0x9D, 0x3B, 0xD2, 0x6E, 0x09, 0x5C, + 0x68, 0xC7, 0x45, 0x90, 0xFD, 0xBB, 0x70, 0xC9, 0x3A, 0xBB, + 0xDF, 0xD4, 0x21, 0x0F, 0xC4, 0x6A, 0x3C, 0xF6, 0x61, 0xCF, + 0x3F, 0xD6, 0x13, 0xF1, 0x5F, 0xBC, 0xCF, 0xBC, 0x26, 0x9E, + 0xBC, 0x0B, 0xBD, 0xAB, 0x5D, 0xC9, 0x54, 0x39 }; static unsigned char dh1024_g[] = { - 0x3B, - 0x40, - 0x86, - 0xE7, - 0xF3, - 0x6C, - 0xDE, - 0x67, - 0x1C, - 0xCC, - 0x80, - 0x05, - 0x5A, - 0xDF, - 0xFE, - 0xBD, - 0x20, - 0x27, - 0x74, - 0x6C, - 0x24, - 0xC9, - 0x03, - 0xF3, - 0xE1, - 0x8D, - 0xC3, - 0x7D, - 0x98, - 0x27, - 0x40, - 0x08, - 0xB8, - 0x8C, - 0x6A, - 0xE9, - 0xBB, - 0x1A, - 0x3A, - 0xD6, - 0x86, - 0x83, - 0x5E, - 0x72, - 0x41, - 0xCE, - 0x85, - 0x3C, - 0xD2, - 0xB3, - 0xFC, - 0x13, - 0xCE, - 0x37, - 0x81, - 0x9E, - 0x4C, - 0x1C, - 0x7B, - 0x65, - 0xD3, - 0xE6, - 0xA6, - 0x00, - 0xF5, - 0x5A, - 0x95, - 0x43, - 0x5E, - 0x81, - 0xCF, - 0x60, - 0xA2, - 0x23, - 0xFC, - 0x36, - 0xA7, - 0x5D, - 0x7A, - 0x4C, - 0x06, - 0x91, - 0x6E, - 0xF6, - 0x57, - 0xEE, - 0x36, - 0xCB, - 0x06, - 0xEA, - 0xF5, - 0x3D, - 0x95, - 0x49, - 0xCB, - 0xA7, - 0xDD, - 0x81, - 0xDF, - 0x80, - 0x09, - 0x4A, - 0x97, - 0x4D, - 0xA8, - 0x22, - 0x72, - 0xA1, - 0x7F, - 0xC4, - 0x70, - 0x56, - 0x70, - 0xE8, - 0x20, - 0x10, - 0x18, - 0x8F, - 0x2E, - 0x60, - 0x07, - 0xE7, - 0x68, - 0x1A, - 0x82, - 0x5D, - 0x32, - 0xA2, + 0x3B, 0x40, 0x86, 0xE7, 0xF3, 0x6C, 0xDE, 0x67, 0x1C, 0xCC, + 0x80, 0x05, 0x5A, 0xDF, 0xFE, 0xBD, 0x20, 0x27, 0x74, 0x6C, + 0x24, 0xC9, 0x03, 0xF3, 0xE1, 0x8D, 0xC3, 0x7D, 0x98, 0x27, + 0x40, 0x08, 0xB8, 0x8C, 0x6A, 0xE9, 0xBB, 0x1A, 0x3A, 0xD6, + 0x86, 0x83, 0x5E, 0x72, 0x41, 0xCE, 0x85, 0x3C, 0xD2, 0xB3, + 0xFC, 0x13, 0xCE, 0x37, 0x81, 0x9E, 0x4C, 0x1C, 0x7B, 0x65, + 0xD3, 0xE6, 0xA6, 0x00, 0xF5, 0x5A, 0x95, 0x43, 0x5E, 0x81, + 0xCF, 0x60, 0xA2, 0x23, 0xFC, 0x36, 0xA7, 0x5D, 0x7A, 0x4C, + 0x06, 0x91, 0x6E, 0xF6, 0x57, 0xEE, 0x36, 0xCB, 0x06, 0xEA, + 0xF5, 0x3D, 0x95, 0x49, 0xCB, 0xA7, 0xDD, 0x81, 0xDF, 0x80, + 0x09, 0x4A, 0x97, 0x4D, 0xA8, 0x22, 0x72, 0xA1, 0x7F, 0xC4, + 0x70, 0x56, 0x70, 0xE8, 0x20, 0x10, 0x18, 0x8F, 0x2E, 0x60, + 0x07, 0xE7, 0x68, 0x1A, 0x82, 0x5D, 0x32, 0xA2 }; return get_dh_from_pg(libctx, "DH", dh1024_p, sizeof(dh1024_p), diff --git a/test/http_test.c b/test/http_test.c index f2f60a82bf98..69217d58853d 100644 --- a/test/http_test.c +++ b/test/http_test.c @@ -11,6 +11,7 @@ #include <openssl/http.h> #include <openssl/pem.h> #include <openssl/x509v3.h> +#include <openssl/err.h> #include <string.h> #include "testutil.h" @@ -329,6 +330,57 @@ static int test_http_url_invalid_path(void) return test_http_url_invalid("https://[FF01::101]pkix"); } +static int test_http_crlf_rejected(void) +{ + BIO *wbio = BIO_new(BIO_s_mem()); + BIO *rbio = BIO_new(BIO_s_mem()); + BIO *req = BIO_new(BIO_s_mem()); + BIO *proxy_bio = BIO_new(BIO_s_mem()); + OSSL_HTTP_REQ_CTX *rctx = NULL; + int res = 0; + + if (!TEST_ptr(wbio) + || !TEST_ptr(rbio) + || !TEST_ptr(req) + || !TEST_ptr(proxy_bio) + || !TEST_int_eq(BIO_puts(req, "x"), 1) + || !TEST_ptr(rctx = OSSL_HTTP_REQ_CTX_new(wbio, rbio, 0))) + goto err; + + ERR_clear_error(); + res = TEST_false(OSSL_HTTP_REQ_CTX_set_request_line(rctx, 0 /* GET */, + NULL, NULL, "/path\r\nInjected: value")) + && TEST_false(OSSL_HTTP_REQ_CTX_set_request_line(rctx, 0 /* GET */, + "server\r\nInjected: value", "80", RPATH)) + && TEST_false(OSSL_HTTP_REQ_CTX_set_request_line(rctx, 0 /* GET */, + "server", "80\r\nInjected: value", RPATH)) + && TEST_true(OSSL_HTTP_REQ_CTX_set_request_line(rctx, 0 /* GET */, + NULL, NULL, RPATH)) + && TEST_false(OSSL_HTTP_REQ_CTX_add1_header(rctx, + "X-Test\r\nInjected", "value")) + && TEST_false(OSSL_HTTP_REQ_CTX_add1_header(rctx, + "X-Test", "value\r\nInjected: value")) + && TEST_false(OSSL_HTTP_set1_request(rctx, RPATH, NULL, + "text/plain\r\nInjected: value", req, + NULL, 0 /* expect_asn1 */, 0 /* max_resp_len */, + 0 /* timeout */, 0 /* keep_alive */)) + && TEST_false(OSSL_HTTP_proxy_connect(proxy_bio, + "server\r\nInjected: value", "443", NULL, NULL, + 0 /* timeout */, NULL, NULL)) + && TEST_false(OSSL_HTTP_proxy_connect(proxy_bio, + "server", "443\r\nInjected: value", NULL, NULL, + 0 /* timeout */, NULL, NULL)); + +err: + ERR_clear_error(); + OSSL_HTTP_REQ_CTX_free(rctx); + BIO_free(wbio); + BIO_free(rbio); + BIO_free(req); + BIO_free(proxy_bio); + return res; +} + static int test_http_get_x509(void) { return test_http_x509(1); @@ -379,6 +431,14 @@ static int test_http_keep_alive_1_require_no(void) return test_http_keep_alive('1', 2, 0); } +static int test_http_adapt_proxy_empty_server(void) +{ + const char *proxy = "http://proxy.local:8080"; + + return TEST_str_eq(OSSL_HTTP_adapt_proxy(proxy, "abc", "", 0), proxy) + && TEST_str_eq(OSSL_HTTP_adapt_proxy(proxy, "abc", "[]", 0), proxy); +} + void cleanup_tests(void) { X509_free(x509); @@ -404,6 +464,8 @@ int setup_tests(void) ADD_TEST(test_http_url_invalid_prefix); ADD_TEST(test_http_url_invalid_port); ADD_TEST(test_http_url_invalid_path); + ADD_TEST(test_http_crlf_rejected); + ADD_TEST(test_http_get_x509); ADD_TEST(test_http_post_x509); ADD_TEST(test_http_keep_alive_0_no_no); @@ -414,5 +476,6 @@ int setup_tests(void) ADD_TEST(test_http_keep_alive_1_require_yes); ADD_TEST(test_http_keep_alive_0_require_no); ADD_TEST(test_http_keep_alive_1_require_no); + ADD_TEST(test_http_adapt_proxy_empty_server); return 1; } diff --git a/test/ideatest.c b/test/ideatest.c index b0e96088af95..d8f13e843540 100644 --- a/test/ideatest.c +++ b/test/ideatest.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2026 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 @@ -35,22 +35,8 @@ static unsigned char out[80]; static const unsigned char text[] = "Hello to all people out there"; static const unsigned char cfb_key[16] = { - 0xe1, - 0xf0, - 0xc3, - 0xd2, - 0xa5, - 0xb4, - 0x87, - 0x96, - 0x69, - 0x78, - 0x4b, - 0x5a, - 0x2d, - 0x3c, - 0x0f, - 0x1e, + 0xe1, 0xf0, 0xc3, 0xd2, 0xa5, 0xb4, 0x87, 0x96, 0x69, 0x78, + 0x4b, 0x5a, 0x2d, 0x3c, 0x0f, 0x1e }; static const unsigned char cfb_iv[80] = { 0x34, 0x12, 0x78, 0x56, 0xab, 0x90, 0xef, 0xcd }; static unsigned char cfb_buf1[40], cfb_buf2[40], cfb_tmp[8]; diff --git a/test/pbetest.c b/test/pbetest.c index 399e3a58f60c..6135b1fdd9a9 100644 --- a/test/pbetest.c +++ b/test/pbetest.c @@ -1,5 +1,5 @@ /* - * Copyright 2021-2023 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2021-2026 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 @@ -23,43 +23,15 @@ static const char pbe_password[] = "MyVoiceIsMyPassport"; static unsigned char pbe_salt[] = { - 0x01, - 0x02, - 0x03, - 0x04, - 0x05, - 0x06, - 0x07, - 0x08, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; static const int pbe_iter = 1000; static unsigned char pbe_plaintext[] = { - 0x57, - 0x65, - 0x20, - 0x61, - 0x72, - 0x65, - 0x20, - 0x61, - 0x6c, - 0x6c, - 0x20, - 0x6d, - 0x61, - 0x64, - 0x65, - 0x20, - 0x6f, - 0x66, - 0x20, - 0x73, - 0x74, - 0x61, - 0x72, - 0x73, + 0x57, 0x65, 0x20, 0x61, 0x72, 0x65, 0x20, 0x61, 0x6c, 0x6c, + 0x20, 0x6d, 0x61, 0x64, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x73, + 0x74, 0x61, 0x72, 0x73 }; #endif @@ -67,67 +39,18 @@ static unsigned char pbe_plaintext[] = { #if !defined OPENSSL_NO_RC4 && !defined OPENSSL_NO_MD5 static const unsigned char pbe_ciphertext_rc4_md5[] = { - 0x21, - 0x90, - 0xfa, - 0xee, - 0x95, - 0x66, - 0x59, - 0x45, - 0xfa, - 0x1e, - 0x9f, - 0xe2, - 0x25, - 0xd2, - 0xf9, - 0x71, - 0x94, - 0xe4, - 0x3d, - 0xc9, - 0x7c, - 0xb0, - 0x07, - 0x23, + 0x21, 0x90, 0xfa, 0xee, 0x95, 0x66, 0x59, 0x45, 0xfa, 0x1e, + 0x9f, 0xe2, 0x25, 0xd2, 0xf9, 0x71, 0x94, 0xe4, 0x3d, 0xc9, + 0x7c, 0xb0, 0x07, 0x23 }; #endif #if !defined OPENSSL_NO_DES && !defined OPENSSL_NO_SHA1 static const unsigned char pbe_ciphertext_des_sha1[] = { - 0xce, - 0x4b, - 0xb0, - 0x0a, - 0x7b, - 0x48, - 0xd7, - 0xe3, - 0x9a, - 0x9f, - 0x46, - 0xd6, - 0x41, - 0x42, - 0x4b, - 0x44, - 0x36, - 0x45, - 0x5f, - 0x60, - 0x8f, - 0x3c, - 0xd0, - 0x55, - 0xd0, - 0x8d, - 0xa9, - 0xab, - 0x78, - 0x5b, - 0x63, - 0xaf, + 0xce, 0x4b, 0xb0, 0x0a, 0x7b, 0x48, 0xd7, 0xe3, 0x9a, 0x9f, + 0x46, 0xd6, 0x41, 0x42, 0x4b, 0x44, 0x36, 0x45, 0x5f, 0x60, + 0x8f, 0x3c, 0xd0, 0x55, 0xd0, 0x8d, 0xa9, 0xab, 0x78, 0x5b, + 0x63, 0xaf }; #endif diff --git a/test/pkcs12_format_test.c b/test/pkcs12_format_test.c index a9d0e27e56a3..443f59bdedfc 100644 --- a/test/pkcs12_format_test.c +++ b/test/pkcs12_format_test.c @@ -1,5 +1,5 @@ /* - * Copyright 2020-2023 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2020-2026 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 @@ -33,2226 +33,237 @@ static OSSL_PROVIDER *lgcyprov = NULL; */ static const unsigned char CERT1[] = { - 0x30, - 0x82, - 0x01, - 0xed, - 0x30, - 0x82, - 0x01, - 0x56, - 0xa0, - 0x03, - 0x02, - 0x01, - 0x02, - 0x02, - 0x09, - 0x00, - 0x8b, - 0x4b, - 0x5e, - 0x6c, - 0x03, - 0x28, - 0x4e, - 0xe6, - 0x30, - 0x0d, - 0x06, - 0x09, - 0x2a, - 0x86, - 0x48, - 0x86, - 0xf7, - 0x0d, - 0x01, - 0x01, - 0x0b, - 0x05, - 0x00, - 0x30, - 0x19, - 0x31, - 0x17, - 0x30, - 0x15, - 0x06, - 0x03, - 0x55, - 0x04, - 0x03, - 0x0c, - 0x0e, - 0x50, - 0x31, - 0x32, - 0x54, - 0x65, - 0x73, - 0x74, - 0x2d, - 0x52, - 0x6f, - 0x6f, - 0x74, - 0x2d, - 0x41, - 0x30, - 0x1e, - 0x17, - 0x0d, - 0x31, - 0x39, - 0x30, - 0x39, - 0x33, - 0x30, - 0x30, - 0x30, - 0x34, - 0x36, - 0x35, - 0x36, - 0x5a, - 0x17, - 0x0d, - 0x32, - 0x39, - 0x30, - 0x39, - 0x32, - 0x37, - 0x30, - 0x30, - 0x34, - 0x36, - 0x35, - 0x36, - 0x5a, - 0x30, - 0x1b, - 0x31, - 0x19, - 0x30, - 0x17, - 0x06, - 0x03, - 0x55, - 0x04, - 0x03, - 0x0c, - 0x10, - 0x50, - 0x31, - 0x32, - 0x54, - 0x65, - 0x73, - 0x74, - 0x2d, - 0x53, - 0x65, - 0x72, - 0x76, - 0x65, - 0x72, - 0x2d, - 0x31, - 0x30, - 0x81, - 0x9f, - 0x30, - 0x0d, - 0x06, - 0x09, - 0x2a, - 0x86, - 0x48, - 0x86, - 0xf7, - 0x0d, - 0x01, - 0x01, - 0x01, - 0x05, - 0x00, - 0x03, - 0x81, - 0x8d, - 0x00, - 0x30, - 0x81, - 0x89, - 0x02, - 0x81, - 0x81, - 0x00, - 0xbc, - 0xdc, - 0x6f, - 0x8c, - 0x7a, - 0x2a, - 0x4b, - 0xea, - 0x66, - 0x66, - 0x04, - 0xa9, - 0x05, - 0x92, - 0x53, - 0xd7, - 0x13, - 0x3c, - 0x49, - 0xe1, - 0xc8, - 0xbb, - 0xdf, - 0x3d, - 0xcb, - 0x88, - 0x31, - 0x07, - 0x20, - 0x59, - 0x93, - 0x24, - 0x7f, - 0x7d, - 0xc6, - 0x84, - 0x81, - 0x16, - 0x64, - 0x4a, - 0x52, - 0xa6, - 0x30, - 0x44, - 0xdc, - 0x1a, - 0x30, - 0xde, - 0xae, - 0x29, - 0x18, - 0xcf, - 0xc7, - 0xf3, - 0xcf, - 0x0c, - 0xb7, - 0x8e, - 0x2b, - 0x1e, - 0x21, - 0x01, - 0x0b, - 0xfb, - 0xe5, - 0xe6, - 0xcf, - 0x2b, - 0x84, - 0xe1, - 0x33, - 0xf8, - 0xba, - 0x02, - 0xfc, - 0x30, - 0xfa, - 0xc4, - 0x33, - 0xc7, - 0x37, - 0xc6, - 0x7f, - 0x72, - 0x31, - 0x92, - 0x1d, - 0x8f, - 0xa0, - 0xfb, - 0xe5, - 0x4a, - 0x08, - 0x31, - 0x78, - 0x80, - 0x9c, - 0x23, - 0xb4, - 0xe9, - 0x19, - 0x56, - 0x04, - 0xfa, - 0x0d, - 0x07, - 0x04, - 0xb7, - 0x43, - 0xac, - 0x4c, - 0x49, - 0x7c, - 0xc2, - 0xa1, - 0x44, - 0xc1, - 0x48, - 0x7d, - 0x28, - 0xe5, - 0x23, - 0x66, - 0x07, - 0x22, - 0xd5, - 0xf0, - 0xf1, - 0x02, - 0x03, - 0x01, - 0x00, - 0x01, - 0xa3, - 0x3b, - 0x30, - 0x39, - 0x30, - 0x1f, - 0x06, - 0x03, - 0x55, - 0x1d, - 0x23, - 0x04, - 0x18, - 0x30, - 0x16, - 0x80, - 0x14, - 0xdb, - 0xbb, - 0xb8, - 0x92, - 0x4e, - 0x24, - 0x0b, - 0x1b, - 0xbb, - 0x78, - 0x33, - 0xf9, - 0x01, - 0x02, - 0x23, - 0x0d, - 0x96, - 0x18, - 0x30, - 0x47, - 0x30, - 0x09, - 0x06, - 0x03, - 0x55, - 0x1d, - 0x13, - 0x04, - 0x02, - 0x30, - 0x00, - 0x30, - 0x0b, - 0x06, - 0x03, - 0x55, - 0x1d, - 0x0f, - 0x04, - 0x04, - 0x03, - 0x02, - 0x04, - 0xf0, - 0x30, - 0x0d, - 0x06, - 0x09, - 0x2a, - 0x86, - 0x48, - 0x86, - 0xf7, - 0x0d, - 0x01, - 0x01, - 0x0b, - 0x05, - 0x00, - 0x03, - 0x81, - 0x81, - 0x00, - 0x1c, - 0x13, - 0xdc, - 0x02, - 0xf1, - 0x44, - 0x36, - 0x65, - 0xa9, - 0xbe, - 0x30, - 0x1c, - 0x66, - 0x14, - 0x20, - 0x86, - 0x5a, - 0xa8, - 0x69, - 0x25, - 0xf8, - 0x1a, - 0xb6, - 0x9e, - 0x5e, - 0xe9, - 0x89, - 0xb8, - 0x67, - 0x70, - 0x19, - 0x87, - 0x60, - 0xeb, - 0x4b, - 0x11, - 0x71, - 0x85, - 0xf8, - 0xe9, - 0xa7, - 0x3e, - 0x20, - 0x42, - 0xec, - 0x43, - 0x25, - 0x01, - 0x03, - 0xe5, - 0x4d, - 0x83, - 0x22, - 0xf5, - 0x8e, - 0x3a, - 0x1a, - 0x1b, - 0xd4, - 0x1c, - 0xda, - 0x6b, - 0x9d, - 0x10, - 0x1b, - 0xee, - 0x67, - 0x4e, - 0x1f, - 0x69, - 0xab, - 0xbc, - 0xaa, - 0x62, - 0x8e, - 0x9e, - 0xc6, - 0xee, - 0xd6, - 0x09, - 0xc0, - 0xca, - 0xe0, - 0xaa, - 0x9f, - 0x07, - 0xb2, - 0xc2, - 0xbb, - 0x31, - 0x96, - 0xa2, - 0x04, - 0x62, - 0xd3, - 0x13, - 0x32, - 0x29, - 0x67, - 0x6e, - 0xad, - 0x2e, - 0x0b, - 0xea, - 0x04, - 0x7c, - 0x8c, - 0x5a, - 0x5d, - 0xac, - 0x14, - 0xaa, - 0x61, - 0x7f, - 0x28, - 0x6c, - 0x2d, - 0x64, - 0x2d, - 0xc3, - 0xaf, - 0x77, - 0x52, - 0x90, - 0xb4, - 0x37, - 0xc0, - 0x30, + 0x30, 0x82, 0x01, 0xed, 0x30, 0x82, 0x01, 0x56, 0xa0, 0x03, + 0x02, 0x01, 0x02, 0x02, 0x09, 0x00, 0x8b, 0x4b, 0x5e, 0x6c, + 0x03, 0x28, 0x4e, 0xe6, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, + 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30, + 0x19, 0x31, 0x17, 0x30, 0x15, 0x06, 0x03, 0x55, 0x04, 0x03, + 0x0c, 0x0e, 0x50, 0x31, 0x32, 0x54, 0x65, 0x73, 0x74, 0x2d, + 0x52, 0x6f, 0x6f, 0x74, 0x2d, 0x41, 0x30, 0x1e, 0x17, 0x0d, + 0x31, 0x39, 0x30, 0x39, 0x33, 0x30, 0x30, 0x30, 0x34, 0x36, + 0x35, 0x36, 0x5a, 0x17, 0x0d, 0x32, 0x39, 0x30, 0x39, 0x32, + 0x37, 0x30, 0x30, 0x34, 0x36, 0x35, 0x36, 0x5a, 0x30, 0x1b, + 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, + 0x10, 0x50, 0x31, 0x32, 0x54, 0x65, 0x73, 0x74, 0x2d, 0x53, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x2d, 0x31, 0x30, 0x81, 0x9f, + 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, + 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81, 0x8d, 0x00, 0x30, + 0x81, 0x89, 0x02, 0x81, 0x81, 0x00, 0xbc, 0xdc, 0x6f, 0x8c, + 0x7a, 0x2a, 0x4b, 0xea, 0x66, 0x66, 0x04, 0xa9, 0x05, 0x92, + 0x53, 0xd7, 0x13, 0x3c, 0x49, 0xe1, 0xc8, 0xbb, 0xdf, 0x3d, + 0xcb, 0x88, 0x31, 0x07, 0x20, 0x59, 0x93, 0x24, 0x7f, 0x7d, + 0xc6, 0x84, 0x81, 0x16, 0x64, 0x4a, 0x52, 0xa6, 0x30, 0x44, + 0xdc, 0x1a, 0x30, 0xde, 0xae, 0x29, 0x18, 0xcf, 0xc7, 0xf3, + 0xcf, 0x0c, 0xb7, 0x8e, 0x2b, 0x1e, 0x21, 0x01, 0x0b, 0xfb, + 0xe5, 0xe6, 0xcf, 0x2b, 0x84, 0xe1, 0x33, 0xf8, 0xba, 0x02, + 0xfc, 0x30, 0xfa, 0xc4, 0x33, 0xc7, 0x37, 0xc6, 0x7f, 0x72, + 0x31, 0x92, 0x1d, 0x8f, 0xa0, 0xfb, 0xe5, 0x4a, 0x08, 0x31, + 0x78, 0x80, 0x9c, 0x23, 0xb4, 0xe9, 0x19, 0x56, 0x04, 0xfa, + 0x0d, 0x07, 0x04, 0xb7, 0x43, 0xac, 0x4c, 0x49, 0x7c, 0xc2, + 0xa1, 0x44, 0xc1, 0x48, 0x7d, 0x28, 0xe5, 0x23, 0x66, 0x07, + 0x22, 0xd5, 0xf0, 0xf1, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, + 0x3b, 0x30, 0x39, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, + 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0xdb, 0xbb, 0xb8, 0x92, + 0x4e, 0x24, 0x0b, 0x1b, 0xbb, 0x78, 0x33, 0xf9, 0x01, 0x02, + 0x23, 0x0d, 0x96, 0x18, 0x30, 0x47, 0x30, 0x09, 0x06, 0x03, + 0x55, 0x1d, 0x13, 0x04, 0x02, 0x30, 0x00, 0x30, 0x0b, 0x06, + 0x03, 0x55, 0x1d, 0x0f, 0x04, 0x04, 0x03, 0x02, 0x04, 0xf0, + 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, + 0x01, 0x01, 0x0b, 0x05, 0x00, 0x03, 0x81, 0x81, 0x00, 0x1c, + 0x13, 0xdc, 0x02, 0xf1, 0x44, 0x36, 0x65, 0xa9, 0xbe, 0x30, + 0x1c, 0x66, 0x14, 0x20, 0x86, 0x5a, 0xa8, 0x69, 0x25, 0xf8, + 0x1a, 0xb6, 0x9e, 0x5e, 0xe9, 0x89, 0xb8, 0x67, 0x70, 0x19, + 0x87, 0x60, 0xeb, 0x4b, 0x11, 0x71, 0x85, 0xf8, 0xe9, 0xa7, + 0x3e, 0x20, 0x42, 0xec, 0x43, 0x25, 0x01, 0x03, 0xe5, 0x4d, + 0x83, 0x22, 0xf5, 0x8e, 0x3a, 0x1a, 0x1b, 0xd4, 0x1c, 0xda, + 0x6b, 0x9d, 0x10, 0x1b, 0xee, 0x67, 0x4e, 0x1f, 0x69, 0xab, + 0xbc, 0xaa, 0x62, 0x8e, 0x9e, 0xc6, 0xee, 0xd6, 0x09, 0xc0, + 0xca, 0xe0, 0xaa, 0x9f, 0x07, 0xb2, 0xc2, 0xbb, 0x31, 0x96, + 0xa2, 0x04, 0x62, 0xd3, 0x13, 0x32, 0x29, 0x67, 0x6e, 0xad, + 0x2e, 0x0b, 0xea, 0x04, 0x7c, 0x8c, 0x5a, 0x5d, 0xac, 0x14, + 0xaa, 0x61, 0x7f, 0x28, 0x6c, 0x2d, 0x64, 0x2d, 0xc3, 0xaf, + 0x77, 0x52, 0x90, 0xb4, 0x37, 0xc0, 0x30 }; static const unsigned char CERT2[] = { - 0x30, - 0x82, - 0x01, - 0xed, - 0x30, - 0x82, - 0x01, - 0x56, - 0xa0, - 0x03, - 0x02, - 0x01, - 0x02, - 0x02, - 0x09, - 0x00, - 0x8b, - 0x4b, - 0x5e, - 0x6c, - 0x03, - 0x28, - 0x4e, - 0xe7, - 0x30, - 0x0d, - 0x06, - 0x09, - 0x2a, - 0x86, - 0x48, - 0x86, - 0xf7, - 0x0d, - 0x01, - 0x01, - 0x0b, - 0x05, - 0x00, - 0x30, - 0x19, - 0x31, - 0x17, - 0x30, - 0x15, - 0x06, - 0x03, - 0x55, - 0x04, - 0x03, - 0x0c, - 0x0e, - 0x50, - 0x31, - 0x32, - 0x54, - 0x65, - 0x73, - 0x74, - 0x2d, - 0x52, - 0x6f, - 0x6f, - 0x74, - 0x2d, - 0x41, - 0x30, - 0x1e, - 0x17, - 0x0d, - 0x31, - 0x39, - 0x30, - 0x39, - 0x33, - 0x30, - 0x30, - 0x30, - 0x34, - 0x36, - 0x35, - 0x36, - 0x5a, - 0x17, - 0x0d, - 0x32, - 0x39, - 0x30, - 0x39, - 0x32, - 0x37, - 0x30, - 0x30, - 0x34, - 0x36, - 0x35, - 0x36, - 0x5a, - 0x30, - 0x1b, - 0x31, - 0x19, - 0x30, - 0x17, - 0x06, - 0x03, - 0x55, - 0x04, - 0x03, - 0x0c, - 0x10, - 0x50, - 0x31, - 0x32, - 0x54, - 0x65, - 0x73, - 0x74, - 0x2d, - 0x43, - 0x6c, - 0x69, - 0x65, - 0x6e, - 0x74, - 0x2d, - 0x31, - 0x30, - 0x81, - 0x9f, - 0x30, - 0x0d, - 0x06, - 0x09, - 0x2a, - 0x86, - 0x48, - 0x86, - 0xf7, - 0x0d, - 0x01, - 0x01, - 0x01, - 0x05, - 0x00, - 0x03, - 0x81, - 0x8d, - 0x00, - 0x30, - 0x81, - 0x89, - 0x02, - 0x81, - 0x81, - 0x00, - 0xa8, - 0x6e, - 0x40, - 0x86, - 0x9f, - 0x98, - 0x59, - 0xfb, - 0x57, - 0xbf, - 0xc1, - 0x55, - 0x12, - 0x38, - 0xeb, - 0xb3, - 0x46, - 0x34, - 0xc9, - 0x35, - 0x4d, - 0xfd, - 0x03, - 0xe9, - 0x3a, - 0x88, - 0x9e, - 0x97, - 0x8f, - 0xf4, - 0xec, - 0x36, - 0x7b, - 0x3f, - 0xba, - 0xb8, - 0xa5, - 0x96, - 0x30, - 0x03, - 0xc5, - 0xc6, - 0xd9, - 0xa8, - 0x4e, - 0xbc, - 0x23, - 0x51, - 0xa1, - 0x96, - 0xd2, - 0x03, - 0x98, - 0x73, - 0xb6, - 0x17, - 0x9c, - 0x77, - 0xd4, - 0x95, - 0x1e, - 0x1b, - 0xb3, - 0x1b, - 0xc8, - 0x71, - 0xd1, - 0x2e, - 0x31, - 0xc7, - 0x6a, - 0x75, - 0x57, - 0x08, - 0x7f, - 0xba, - 0x70, - 0x76, - 0xf7, - 0x67, - 0xf4, - 0x4e, - 0xbe, - 0xfc, - 0x70, - 0x61, - 0x41, - 0x07, - 0x2b, - 0x7c, - 0x3c, - 0x3b, - 0xb3, - 0xbc, - 0xd5, - 0xa8, - 0xbd, - 0x28, - 0xd8, - 0x49, - 0xd3, - 0xe1, - 0x78, - 0xc8, - 0xc1, - 0x42, - 0x5e, - 0x18, - 0x36, - 0xa8, - 0x41, - 0xf7, - 0xc8, - 0xaa, - 0x35, - 0xfe, - 0x2d, - 0xd1, - 0xb4, - 0xcc, - 0x00, - 0x67, - 0xae, - 0x79, - 0xd3, - 0x28, - 0xd5, - 0x5b, - 0x02, - 0x03, - 0x01, - 0x00, - 0x01, - 0xa3, - 0x3b, - 0x30, - 0x39, - 0x30, - 0x1f, - 0x06, - 0x03, - 0x55, - 0x1d, - 0x23, - 0x04, - 0x18, - 0x30, - 0x16, - 0x80, - 0x14, - 0xdb, - 0xbb, - 0xb8, - 0x92, - 0x4e, - 0x24, - 0x0b, - 0x1b, - 0xbb, - 0x78, - 0x33, - 0xf9, - 0x01, - 0x02, - 0x23, - 0x0d, - 0x96, - 0x18, - 0x30, - 0x47, - 0x30, - 0x09, - 0x06, - 0x03, - 0x55, - 0x1d, - 0x13, - 0x04, - 0x02, - 0x30, - 0x00, - 0x30, - 0x0b, - 0x06, - 0x03, - 0x55, - 0x1d, - 0x0f, - 0x04, - 0x04, - 0x03, - 0x02, - 0x04, - 0xf0, - 0x30, - 0x0d, - 0x06, - 0x09, - 0x2a, - 0x86, - 0x48, - 0x86, - 0xf7, - 0x0d, - 0x01, - 0x01, - 0x0b, - 0x05, - 0x00, - 0x03, - 0x81, - 0x81, - 0x00, - 0x3b, - 0xa6, - 0x73, - 0xbe, - 0xe0, - 0x28, - 0xed, - 0x1f, - 0x29, - 0x78, - 0x4c, - 0xc0, - 0x1f, - 0xe9, - 0x85, - 0xc6, - 0x8f, - 0xe3, - 0x87, - 0x7c, - 0xd9, - 0xe7, - 0x0a, - 0x37, - 0xe8, - 0xaa, - 0xb5, - 0xd2, - 0x7f, - 0xf8, - 0x90, - 0x20, - 0x80, - 0x35, - 0xa7, - 0x79, - 0x2b, - 0x04, - 0xa7, - 0xbf, - 0xe6, - 0x7b, - 0x58, - 0xcb, - 0xec, - 0x0e, - 0x58, - 0xef, - 0x2a, - 0x70, - 0x8a, - 0x56, - 0x8a, - 0xcf, - 0x6b, - 0x7a, - 0x74, - 0x0c, - 0xf4, - 0x15, - 0x37, - 0x93, - 0xcd, - 0xe6, - 0xb2, - 0xa1, - 0x83, - 0x09, - 0xdb, - 0x9e, - 0x4f, - 0xff, - 0x6a, - 0x17, - 0x4f, - 0x33, - 0xc9, - 0xcc, - 0x90, - 0x2a, - 0x67, - 0xff, - 0x16, - 0x78, - 0xa8, - 0x2c, - 0x10, - 0xe0, - 0x52, - 0x8c, - 0xe6, - 0xe9, - 0x90, - 0x8d, - 0xe0, - 0x62, - 0x04, - 0x9a, - 0x0f, - 0x44, - 0x01, - 0x82, - 0x14, - 0x92, - 0x44, - 0x25, - 0x69, - 0x22, - 0xb7, - 0xb8, - 0xc5, - 0x94, - 0x4c, - 0x4b, - 0x1c, - 0x9b, - 0x92, - 0x60, - 0x66, - 0x90, - 0x4e, - 0xb9, - 0xa8, - 0x4c, - 0x89, - 0xbb, - 0x0f, - 0x0b, + 0x30, 0x82, 0x01, 0xed, 0x30, 0x82, 0x01, 0x56, 0xa0, 0x03, + 0x02, 0x01, 0x02, 0x02, 0x09, 0x00, 0x8b, 0x4b, 0x5e, 0x6c, + 0x03, 0x28, 0x4e, 0xe7, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, + 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30, + 0x19, 0x31, 0x17, 0x30, 0x15, 0x06, 0x03, 0x55, 0x04, 0x03, + 0x0c, 0x0e, 0x50, 0x31, 0x32, 0x54, 0x65, 0x73, 0x74, 0x2d, + 0x52, 0x6f, 0x6f, 0x74, 0x2d, 0x41, 0x30, 0x1e, 0x17, 0x0d, + 0x31, 0x39, 0x30, 0x39, 0x33, 0x30, 0x30, 0x30, 0x34, 0x36, + 0x35, 0x36, 0x5a, 0x17, 0x0d, 0x32, 0x39, 0x30, 0x39, 0x32, + 0x37, 0x30, 0x30, 0x34, 0x36, 0x35, 0x36, 0x5a, 0x30, 0x1b, + 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, + 0x10, 0x50, 0x31, 0x32, 0x54, 0x65, 0x73, 0x74, 0x2d, 0x43, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2d, 0x31, 0x30, 0x81, 0x9f, + 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, + 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81, 0x8d, 0x00, 0x30, + 0x81, 0x89, 0x02, 0x81, 0x81, 0x00, 0xa8, 0x6e, 0x40, 0x86, + 0x9f, 0x98, 0x59, 0xfb, 0x57, 0xbf, 0xc1, 0x55, 0x12, 0x38, + 0xeb, 0xb3, 0x46, 0x34, 0xc9, 0x35, 0x4d, 0xfd, 0x03, 0xe9, + 0x3a, 0x88, 0x9e, 0x97, 0x8f, 0xf4, 0xec, 0x36, 0x7b, 0x3f, + 0xba, 0xb8, 0xa5, 0x96, 0x30, 0x03, 0xc5, 0xc6, 0xd9, 0xa8, + 0x4e, 0xbc, 0x23, 0x51, 0xa1, 0x96, 0xd2, 0x03, 0x98, 0x73, + 0xb6, 0x17, 0x9c, 0x77, 0xd4, 0x95, 0x1e, 0x1b, 0xb3, 0x1b, + 0xc8, 0x71, 0xd1, 0x2e, 0x31, 0xc7, 0x6a, 0x75, 0x57, 0x08, + 0x7f, 0xba, 0x70, 0x76, 0xf7, 0x67, 0xf4, 0x4e, 0xbe, 0xfc, + 0x70, 0x61, 0x41, 0x07, 0x2b, 0x7c, 0x3c, 0x3b, 0xb3, 0xbc, + 0xd5, 0xa8, 0xbd, 0x28, 0xd8, 0x49, 0xd3, 0xe1, 0x78, 0xc8, + 0xc1, 0x42, 0x5e, 0x18, 0x36, 0xa8, 0x41, 0xf7, 0xc8, 0xaa, + 0x35, 0xfe, 0x2d, 0xd1, 0xb4, 0xcc, 0x00, 0x67, 0xae, 0x79, + 0xd3, 0x28, 0xd5, 0x5b, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, + 0x3b, 0x30, 0x39, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, + 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0xdb, 0xbb, 0xb8, 0x92, + 0x4e, 0x24, 0x0b, 0x1b, 0xbb, 0x78, 0x33, 0xf9, 0x01, 0x02, + 0x23, 0x0d, 0x96, 0x18, 0x30, 0x47, 0x30, 0x09, 0x06, 0x03, + 0x55, 0x1d, 0x13, 0x04, 0x02, 0x30, 0x00, 0x30, 0x0b, 0x06, + 0x03, 0x55, 0x1d, 0x0f, 0x04, 0x04, 0x03, 0x02, 0x04, 0xf0, + 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, + 0x01, 0x01, 0x0b, 0x05, 0x00, 0x03, 0x81, 0x81, 0x00, 0x3b, + 0xa6, 0x73, 0xbe, 0xe0, 0x28, 0xed, 0x1f, 0x29, 0x78, 0x4c, + 0xc0, 0x1f, 0xe9, 0x85, 0xc6, 0x8f, 0xe3, 0x87, 0x7c, 0xd9, + 0xe7, 0x0a, 0x37, 0xe8, 0xaa, 0xb5, 0xd2, 0x7f, 0xf8, 0x90, + 0x20, 0x80, 0x35, 0xa7, 0x79, 0x2b, 0x04, 0xa7, 0xbf, 0xe6, + 0x7b, 0x58, 0xcb, 0xec, 0x0e, 0x58, 0xef, 0x2a, 0x70, 0x8a, + 0x56, 0x8a, 0xcf, 0x6b, 0x7a, 0x74, 0x0c, 0xf4, 0x15, 0x37, + 0x93, 0xcd, 0xe6, 0xb2, 0xa1, 0x83, 0x09, 0xdb, 0x9e, 0x4f, + 0xff, 0x6a, 0x17, 0x4f, 0x33, 0xc9, 0xcc, 0x90, 0x2a, 0x67, + 0xff, 0x16, 0x78, 0xa8, 0x2c, 0x10, 0xe0, 0x52, 0x8c, 0xe6, + 0xe9, 0x90, 0x8d, 0xe0, 0x62, 0x04, 0x9a, 0x0f, 0x44, 0x01, + 0x82, 0x14, 0x92, 0x44, 0x25, 0x69, 0x22, 0xb7, 0xb8, 0xc5, + 0x94, 0x4c, 0x4b, 0x1c, 0x9b, 0x92, 0x60, 0x66, 0x90, 0x4e, + 0xb9, 0xa8, 0x4c, 0x89, 0xbb, 0x0f, 0x0b }; static const unsigned char KEY1[] = { - 0x30, - 0x82, - 0x02, - 0x5d, - 0x02, - 0x01, - 0x00, - 0x02, - 0x81, - 0x81, - 0x00, - 0xbc, - 0xdc, - 0x6f, - 0x8c, - 0x7a, - 0x2a, - 0x4b, - 0xea, - 0x66, - 0x66, - 0x04, - 0xa9, - 0x05, - 0x92, - 0x53, - 0xd7, - 0x13, - 0x3c, - 0x49, - 0xe1, - 0xc8, - 0xbb, - 0xdf, - 0x3d, - 0xcb, - 0x88, - 0x31, - 0x07, - 0x20, - 0x59, - 0x93, - 0x24, - 0x7f, - 0x7d, - 0xc6, - 0x84, - 0x81, - 0x16, - 0x64, - 0x4a, - 0x52, - 0xa6, - 0x30, - 0x44, - 0xdc, - 0x1a, - 0x30, - 0xde, - 0xae, - 0x29, - 0x18, - 0xcf, - 0xc7, - 0xf3, - 0xcf, - 0x0c, - 0xb7, - 0x8e, - 0x2b, - 0x1e, - 0x21, - 0x01, - 0x0b, - 0xfb, - 0xe5, - 0xe6, - 0xcf, - 0x2b, - 0x84, - 0xe1, - 0x33, - 0xf8, - 0xba, - 0x02, - 0xfc, - 0x30, - 0xfa, - 0xc4, - 0x33, - 0xc7, - 0x37, - 0xc6, - 0x7f, - 0x72, - 0x31, - 0x92, - 0x1d, - 0x8f, - 0xa0, - 0xfb, - 0xe5, - 0x4a, - 0x08, - 0x31, - 0x78, - 0x80, - 0x9c, - 0x23, - 0xb4, - 0xe9, - 0x19, - 0x56, - 0x04, - 0xfa, - 0x0d, - 0x07, - 0x04, - 0xb7, - 0x43, - 0xac, - 0x4c, - 0x49, - 0x7c, - 0xc2, - 0xa1, - 0x44, - 0xc1, - 0x48, - 0x7d, - 0x28, - 0xe5, - 0x23, - 0x66, - 0x07, - 0x22, - 0xd5, - 0xf0, - 0xf1, - 0x02, - 0x03, - 0x01, - 0x00, - 0x01, - 0x02, - 0x81, - 0x81, - 0x00, - 0xa5, - 0x6d, - 0xf9, - 0x8f, - 0xf5, - 0x5a, - 0xa3, - 0x50, - 0xd9, - 0x0d, - 0x37, - 0xbb, - 0xce, - 0x13, - 0x94, - 0xb8, - 0xea, - 0x32, - 0x7f, - 0x0c, - 0xf5, - 0x46, - 0x0b, - 0x90, - 0x17, - 0x7e, - 0x5e, - 0x63, - 0xbd, - 0xa4, - 0x78, - 0xcd, - 0x19, - 0x97, - 0xd4, - 0x92, - 0x30, - 0x78, - 0xaa, - 0xb4, - 0xa7, - 0x9c, - 0xc6, - 0xdf, - 0x2a, - 0x65, - 0x0e, - 0xb5, - 0x9f, - 0x9c, - 0x84, - 0x0d, - 0x4d, - 0x3a, - 0x74, - 0xfc, - 0xd0, - 0xb4, - 0x09, - 0x74, - 0xc4, - 0xb8, - 0x24, - 0x03, - 0xa8, - 0xf0, - 0xf8, - 0x0d, - 0x5c, - 0x8e, - 0xdf, - 0x4b, - 0xe1, - 0x0a, - 0x8f, - 0x4f, - 0xd5, - 0xc7, - 0x9b, - 0x54, - 0x55, - 0x8f, - 0x00, - 0x5c, - 0xea, - 0x4c, - 0x73, - 0xf9, - 0x1b, - 0xbf, - 0xb8, - 0x93, - 0x33, - 0x20, - 0xce, - 0x45, - 0xd9, - 0x03, - 0x02, - 0xb2, - 0x36, - 0xc5, - 0x0a, - 0x30, - 0x50, - 0x78, - 0x80, - 0x66, - 0x00, - 0x22, - 0x38, - 0x86, - 0xcf, - 0x63, - 0x4a, - 0x5c, - 0xbf, - 0x2b, - 0xd9, - 0x6e, - 0xe6, - 0xf0, - 0x39, - 0xad, - 0x12, - 0x25, - 0x41, - 0xb9, - 0x02, - 0x41, - 0x00, - 0xf3, - 0x7c, - 0x07, - 0x99, - 0x64, - 0x3a, - 0x28, - 0x8c, - 0x8d, - 0x05, - 0xfe, - 0x32, - 0xb5, - 0x4c, - 0x8c, - 0x6d, - 0xde, - 0x3d, - 0x16, - 0x08, - 0xa0, - 0x01, - 0x61, - 0x4f, - 0x8e, - 0xa0, - 0xf7, - 0x26, - 0x26, - 0xb5, - 0x8e, - 0xc0, - 0x7a, - 0xce, - 0x86, - 0x34, - 0xde, - 0xb8, - 0xef, - 0x86, - 0x01, - 0xbe, - 0x24, - 0xaa, - 0x9b, - 0x36, - 0x93, - 0x72, - 0x9b, - 0xf9, - 0xc6, - 0xcb, - 0x76, - 0x84, - 0x67, - 0x06, - 0x06, - 0x30, - 0x50, - 0xdf, - 0x42, - 0x17, - 0xe0, - 0xa7, - 0x02, - 0x41, - 0x00, - 0xc6, - 0x91, - 0xa0, - 0x41, - 0x34, - 0x11, - 0x67, - 0x4b, - 0x08, - 0x0f, - 0xda, - 0xa7, - 0x99, - 0xec, - 0x58, - 0x11, - 0xa5, - 0x82, - 0xdb, - 0x50, - 0xfe, - 0x77, - 0xe2, - 0xd1, - 0x53, - 0x9c, - 0x7d, - 0xe8, - 0xbf, - 0xe7, - 0x7c, - 0xa9, - 0x01, - 0xb1, - 0x87, - 0xc3, - 0x52, - 0x79, - 0x9e, - 0x2c, - 0xa7, - 0x6f, - 0x02, - 0x37, - 0x32, - 0xef, - 0x24, - 0x31, - 0x21, - 0x0b, - 0x86, - 0x05, - 0x32, - 0x4a, - 0x2e, - 0x0b, - 0x65, - 0x05, - 0xd3, - 0xd6, - 0x30, - 0xb2, - 0xfc, - 0xa7, - 0x02, - 0x41, - 0x00, - 0xc2, - 0xed, - 0x31, - 0xdc, - 0x40, - 0x9c, - 0x3a, - 0xe8, - 0x42, - 0xe2, - 0x60, - 0x5e, - 0x52, - 0x3c, - 0xc5, - 0x54, - 0x14, - 0x0e, - 0x8d, - 0x7c, - 0x3c, - 0x34, - 0xbe, - 0xa6, - 0x05, - 0x86, - 0xa2, - 0x36, - 0x5d, - 0xd9, - 0x0e, - 0x3e, - 0xd4, - 0x52, - 0x50, - 0xa9, - 0x35, - 0x01, - 0x93, - 0x68, - 0x92, - 0x2e, - 0x9a, - 0x86, - 0x27, - 0x1a, - 0xab, - 0x32, - 0x9e, - 0xe2, - 0x79, - 0x9f, - 0x5b, - 0xf3, - 0xa5, - 0xd2, - 0xf1, - 0xd3, - 0x6e, - 0x7b, - 0x3e, - 0x1b, - 0x85, - 0x93, - 0x02, - 0x40, - 0x68, - 0xb8, - 0xb6, - 0x7e, - 0x8c, - 0xba, - 0x3c, - 0xf2, - 0x8a, - 0x2e, - 0xea, - 0x4f, - 0x07, - 0xd3, - 0x68, - 0x62, - 0xee, - 0x1a, - 0x04, - 0x16, - 0x44, - 0x0d, - 0xef, - 0xf6, - 0x1b, - 0x95, - 0x65, - 0xa5, - 0xd1, - 0x47, - 0x81, - 0x2c, - 0x14, - 0xb3, - 0x8e, - 0xf9, - 0x08, - 0xcf, - 0x11, - 0x07, - 0x55, - 0xca, - 0x2a, - 0xad, - 0xf7, - 0xd3, - 0xbd, - 0x0f, - 0x97, - 0xf0, - 0xde, - 0xde, - 0x70, - 0xb6, - 0x44, - 0x70, - 0x47, - 0xf7, - 0xf9, - 0xcf, - 0x75, - 0x61, - 0x7f, - 0xf3, - 0x02, - 0x40, - 0x38, - 0x4a, - 0x67, - 0xaf, - 0xae, - 0xb6, - 0xb2, - 0x6a, - 0x00, - 0x25, - 0x5a, - 0xa4, - 0x65, - 0x20, - 0xb1, - 0x13, - 0xbd, - 0x83, - 0xff, - 0xb4, - 0xbc, - 0xf4, - 0xdd, - 0xa1, - 0xbb, - 0x1c, - 0x96, - 0x37, - 0x35, - 0xf4, - 0xbf, - 0xed, - 0x4c, - 0xed, - 0x92, - 0xe8, - 0xac, - 0xc9, - 0xc1, - 0xa5, - 0xa3, - 0x23, - 0x66, - 0x40, - 0x8a, - 0xa1, - 0xe6, - 0xe3, - 0x95, - 0xfe, - 0xc4, - 0x53, - 0xf5, - 0x7d, - 0x6e, - 0xca, - 0x45, - 0x42, - 0xe4, - 0xc2, - 0x9f, - 0xe5, - 0x1e, - 0xb5, + 0x30, 0x82, 0x02, 0x5d, 0x02, 0x01, 0x00, 0x02, 0x81, 0x81, + 0x00, 0xbc, 0xdc, 0x6f, 0x8c, 0x7a, 0x2a, 0x4b, 0xea, 0x66, + 0x66, 0x04, 0xa9, 0x05, 0x92, 0x53, 0xd7, 0x13, 0x3c, 0x49, + 0xe1, 0xc8, 0xbb, 0xdf, 0x3d, 0xcb, 0x88, 0x31, 0x07, 0x20, + 0x59, 0x93, 0x24, 0x7f, 0x7d, 0xc6, 0x84, 0x81, 0x16, 0x64, + 0x4a, 0x52, 0xa6, 0x30, 0x44, 0xdc, 0x1a, 0x30, 0xde, 0xae, + 0x29, 0x18, 0xcf, 0xc7, 0xf3, 0xcf, 0x0c, 0xb7, 0x8e, 0x2b, + 0x1e, 0x21, 0x01, 0x0b, 0xfb, 0xe5, 0xe6, 0xcf, 0x2b, 0x84, + 0xe1, 0x33, 0xf8, 0xba, 0x02, 0xfc, 0x30, 0xfa, 0xc4, 0x33, + 0xc7, 0x37, 0xc6, 0x7f, 0x72, 0x31, 0x92, 0x1d, 0x8f, 0xa0, + 0xfb, 0xe5, 0x4a, 0x08, 0x31, 0x78, 0x80, 0x9c, 0x23, 0xb4, + 0xe9, 0x19, 0x56, 0x04, 0xfa, 0x0d, 0x07, 0x04, 0xb7, 0x43, + 0xac, 0x4c, 0x49, 0x7c, 0xc2, 0xa1, 0x44, 0xc1, 0x48, 0x7d, + 0x28, 0xe5, 0x23, 0x66, 0x07, 0x22, 0xd5, 0xf0, 0xf1, 0x02, + 0x03, 0x01, 0x00, 0x01, 0x02, 0x81, 0x81, 0x00, 0xa5, 0x6d, + 0xf9, 0x8f, 0xf5, 0x5a, 0xa3, 0x50, 0xd9, 0x0d, 0x37, 0xbb, + 0xce, 0x13, 0x94, 0xb8, 0xea, 0x32, 0x7f, 0x0c, 0xf5, 0x46, + 0x0b, 0x90, 0x17, 0x7e, 0x5e, 0x63, 0xbd, 0xa4, 0x78, 0xcd, + 0x19, 0x97, 0xd4, 0x92, 0x30, 0x78, 0xaa, 0xb4, 0xa7, 0x9c, + 0xc6, 0xdf, 0x2a, 0x65, 0x0e, 0xb5, 0x9f, 0x9c, 0x84, 0x0d, + 0x4d, 0x3a, 0x74, 0xfc, 0xd0, 0xb4, 0x09, 0x74, 0xc4, 0xb8, + 0x24, 0x03, 0xa8, 0xf0, 0xf8, 0x0d, 0x5c, 0x8e, 0xdf, 0x4b, + 0xe1, 0x0a, 0x8f, 0x4f, 0xd5, 0xc7, 0x9b, 0x54, 0x55, 0x8f, + 0x00, 0x5c, 0xea, 0x4c, 0x73, 0xf9, 0x1b, 0xbf, 0xb8, 0x93, + 0x33, 0x20, 0xce, 0x45, 0xd9, 0x03, 0x02, 0xb2, 0x36, 0xc5, + 0x0a, 0x30, 0x50, 0x78, 0x80, 0x66, 0x00, 0x22, 0x38, 0x86, + 0xcf, 0x63, 0x4a, 0x5c, 0xbf, 0x2b, 0xd9, 0x6e, 0xe6, 0xf0, + 0x39, 0xad, 0x12, 0x25, 0x41, 0xb9, 0x02, 0x41, 0x00, 0xf3, + 0x7c, 0x07, 0x99, 0x64, 0x3a, 0x28, 0x8c, 0x8d, 0x05, 0xfe, + 0x32, 0xb5, 0x4c, 0x8c, 0x6d, 0xde, 0x3d, 0x16, 0x08, 0xa0, + 0x01, 0x61, 0x4f, 0x8e, 0xa0, 0xf7, 0x26, 0x26, 0xb5, 0x8e, + 0xc0, 0x7a, 0xce, 0x86, 0x34, 0xde, 0xb8, 0xef, 0x86, 0x01, + 0xbe, 0x24, 0xaa, 0x9b, 0x36, 0x93, 0x72, 0x9b, 0xf9, 0xc6, + 0xcb, 0x76, 0x84, 0x67, 0x06, 0x06, 0x30, 0x50, 0xdf, 0x42, + 0x17, 0xe0, 0xa7, 0x02, 0x41, 0x00, 0xc6, 0x91, 0xa0, 0x41, + 0x34, 0x11, 0x67, 0x4b, 0x08, 0x0f, 0xda, 0xa7, 0x99, 0xec, + 0x58, 0x11, 0xa5, 0x82, 0xdb, 0x50, 0xfe, 0x77, 0xe2, 0xd1, + 0x53, 0x9c, 0x7d, 0xe8, 0xbf, 0xe7, 0x7c, 0xa9, 0x01, 0xb1, + 0x87, 0xc3, 0x52, 0x79, 0x9e, 0x2c, 0xa7, 0x6f, 0x02, 0x37, + 0x32, 0xef, 0x24, 0x31, 0x21, 0x0b, 0x86, 0x05, 0x32, 0x4a, + 0x2e, 0x0b, 0x65, 0x05, 0xd3, 0xd6, 0x30, 0xb2, 0xfc, 0xa7, + 0x02, 0x41, 0x00, 0xc2, 0xed, 0x31, 0xdc, 0x40, 0x9c, 0x3a, + 0xe8, 0x42, 0xe2, 0x60, 0x5e, 0x52, 0x3c, 0xc5, 0x54, 0x14, + 0x0e, 0x8d, 0x7c, 0x3c, 0x34, 0xbe, 0xa6, 0x05, 0x86, 0xa2, + 0x36, 0x5d, 0xd9, 0x0e, 0x3e, 0xd4, 0x52, 0x50, 0xa9, 0x35, + 0x01, 0x93, 0x68, 0x92, 0x2e, 0x9a, 0x86, 0x27, 0x1a, 0xab, + 0x32, 0x9e, 0xe2, 0x79, 0x9f, 0x5b, 0xf3, 0xa5, 0xd2, 0xf1, + 0xd3, 0x6e, 0x7b, 0x3e, 0x1b, 0x85, 0x93, 0x02, 0x40, 0x68, + 0xb8, 0xb6, 0x7e, 0x8c, 0xba, 0x3c, 0xf2, 0x8a, 0x2e, 0xea, + 0x4f, 0x07, 0xd3, 0x68, 0x62, 0xee, 0x1a, 0x04, 0x16, 0x44, + 0x0d, 0xef, 0xf6, 0x1b, 0x95, 0x65, 0xa5, 0xd1, 0x47, 0x81, + 0x2c, 0x14, 0xb3, 0x8e, 0xf9, 0x08, 0xcf, 0x11, 0x07, 0x55, + 0xca, 0x2a, 0xad, 0xf7, 0xd3, 0xbd, 0x0f, 0x97, 0xf0, 0xde, + 0xde, 0x70, 0xb6, 0x44, 0x70, 0x47, 0xf7, 0xf9, 0xcf, 0x75, + 0x61, 0x7f, 0xf3, 0x02, 0x40, 0x38, 0x4a, 0x67, 0xaf, 0xae, + 0xb6, 0xb2, 0x6a, 0x00, 0x25, 0x5a, 0xa4, 0x65, 0x20, 0xb1, + 0x13, 0xbd, 0x83, 0xff, 0xb4, 0xbc, 0xf4, 0xdd, 0xa1, 0xbb, + 0x1c, 0x96, 0x37, 0x35, 0xf4, 0xbf, 0xed, 0x4c, 0xed, 0x92, + 0xe8, 0xac, 0xc9, 0xc1, 0xa5, 0xa3, 0x23, 0x66, 0x40, 0x8a, + 0xa1, 0xe6, 0xe3, 0x95, 0xfe, 0xc4, 0x53, 0xf5, 0x7d, 0x6e, + 0xca, 0x45, 0x42, 0xe4, 0xc2, 0x9f, 0xe5, 0x1e, 0xb5 }; static const unsigned char KEY2[] = { - 0x30, - 0x82, - 0x02, - 0x5c, - 0x02, - 0x01, - 0x00, - 0x02, - 0x81, - 0x81, - 0x00, - 0xa8, - 0x6e, - 0x40, - 0x86, - 0x9f, - 0x98, - 0x59, - 0xfb, - 0x57, - 0xbf, - 0xc1, - 0x55, - 0x12, - 0x38, - 0xeb, - 0xb3, - 0x46, - 0x34, - 0xc9, - 0x35, - 0x4d, - 0xfd, - 0x03, - 0xe9, - 0x3a, - 0x88, - 0x9e, - 0x97, - 0x8f, - 0xf4, - 0xec, - 0x36, - 0x7b, - 0x3f, - 0xba, - 0xb8, - 0xa5, - 0x96, - 0x30, - 0x03, - 0xc5, - 0xc6, - 0xd9, - 0xa8, - 0x4e, - 0xbc, - 0x23, - 0x51, - 0xa1, - 0x96, - 0xd2, - 0x03, - 0x98, - 0x73, - 0xb6, - 0x17, - 0x9c, - 0x77, - 0xd4, - 0x95, - 0x1e, - 0x1b, - 0xb3, - 0x1b, - 0xc8, - 0x71, - 0xd1, - 0x2e, - 0x31, - 0xc7, - 0x6a, - 0x75, - 0x57, - 0x08, - 0x7f, - 0xba, - 0x70, - 0x76, - 0xf7, - 0x67, - 0xf4, - 0x4e, - 0xbe, - 0xfc, - 0x70, - 0x61, - 0x41, - 0x07, - 0x2b, - 0x7c, - 0x3c, - 0x3b, - 0xb3, - 0xbc, - 0xd5, - 0xa8, - 0xbd, - 0x28, - 0xd8, - 0x49, - 0xd3, - 0xe1, - 0x78, - 0xc8, - 0xc1, - 0x42, - 0x5e, - 0x18, - 0x36, - 0xa8, - 0x41, - 0xf7, - 0xc8, - 0xaa, - 0x35, - 0xfe, - 0x2d, - 0xd1, - 0xb4, - 0xcc, - 0x00, - 0x67, - 0xae, - 0x79, - 0xd3, - 0x28, - 0xd5, - 0x5b, - 0x02, - 0x03, - 0x01, - 0x00, - 0x01, - 0x02, - 0x81, - 0x81, - 0x00, - 0xa6, - 0x00, - 0x83, - 0xf8, - 0x2b, - 0x33, - 0xac, - 0xfb, - 0xdb, - 0xf0, - 0x52, - 0x4b, - 0xd6, - 0x39, - 0xe3, - 0x94, - 0x3d, - 0x8d, - 0xa9, - 0x01, - 0xb0, - 0x6b, - 0xbe, - 0x7f, - 0x10, - 0x01, - 0xb6, - 0xcd, - 0x0a, - 0x45, - 0x0a, - 0xca, - 0x67, - 0x8e, - 0xd8, - 0x29, - 0x44, - 0x8a, - 0x51, - 0xa8, - 0x66, - 0x35, - 0x26, - 0x30, - 0x8b, - 0xe9, - 0x41, - 0xa6, - 0x22, - 0xec, - 0xd2, - 0xf0, - 0x58, - 0x41, - 0x33, - 0x26, - 0xf2, - 0x3f, - 0xe8, - 0x75, - 0x4f, - 0xc7, - 0x5d, - 0x2e, - 0x5a, - 0xa8, - 0x7a, - 0xd2, - 0xbf, - 0x59, - 0xa0, - 0x86, - 0x79, - 0x0b, - 0x92, - 0x6c, - 0x95, - 0x5d, - 0x87, - 0x63, - 0x5c, - 0xd6, - 0x1a, - 0xc0, - 0xf6, - 0x7a, - 0x15, - 0x8d, - 0xc7, - 0x3c, - 0xb6, - 0x9e, - 0xa6, - 0x58, - 0x46, - 0x9b, - 0xbf, - 0x3e, - 0x28, - 0x8c, - 0xdf, - 0x1a, - 0x87, - 0xaa, - 0x7e, - 0xf5, - 0xf2, - 0xcb, - 0x5e, - 0x84, - 0x2d, - 0xf6, - 0x82, - 0x7e, - 0x89, - 0x4e, - 0xf5, - 0xe6, - 0x3c, - 0x92, - 0x80, - 0x1e, - 0x98, - 0x1c, - 0x6a, - 0x7b, - 0x57, - 0x01, - 0x02, - 0x41, - 0x00, - 0xdd, - 0x60, - 0x95, - 0xd7, - 0xa1, - 0x9d, - 0x0c, - 0xa1, - 0x84, - 0xc5, - 0x39, - 0xca, - 0x67, - 0x4c, - 0x1c, - 0x06, - 0x71, - 0x5b, - 0x5c, - 0x2d, - 0x8d, - 0xce, - 0xcd, - 0xe2, - 0x79, - 0xc8, - 0x33, - 0xbe, - 0x50, - 0x37, - 0x60, - 0x9f, - 0x3b, - 0xb9, - 0x59, - 0x55, - 0x22, - 0x1f, - 0xa5, - 0x4b, - 0x1d, - 0xca, - 0x38, - 0xa0, - 0xab, - 0x87, - 0x9c, - 0x86, - 0x0e, - 0xdb, - 0x1c, - 0x4f, - 0x4f, - 0x07, - 0xed, - 0x18, - 0x3f, - 0x05, - 0x3c, - 0xec, - 0x78, - 0x11, - 0xf6, - 0x99, - 0x02, - 0x41, - 0x00, - 0xc2, - 0xc5, - 0xcf, - 0xbe, - 0x95, - 0x91, - 0xeb, - 0xcf, - 0x47, - 0xf3, - 0x33, - 0x32, - 0xc7, - 0x7e, - 0x93, - 0x56, - 0xf7, - 0xd8, - 0xf9, - 0xd4, - 0xb6, - 0xd6, - 0x20, - 0xac, - 0xba, - 0x8a, - 0x20, - 0x19, - 0x14, - 0xab, - 0xc5, - 0x5d, - 0xb2, - 0x08, - 0xcc, - 0x77, - 0x7c, - 0x65, - 0xa8, - 0xdb, - 0x66, - 0x97, - 0x36, - 0x44, - 0x2c, - 0x63, - 0xc0, - 0x6a, - 0x7e, - 0xb0, - 0x0b, - 0x5c, - 0x90, - 0x12, - 0x50, - 0xb4, - 0x36, - 0x60, - 0xc3, - 0x1f, - 0x22, - 0x0c, - 0xc8, - 0x13, - 0x02, - 0x40, - 0x33, - 0xc8, - 0x7e, - 0x04, - 0x7c, - 0x97, - 0x61, - 0xf6, - 0xfe, - 0x39, - 0xac, - 0x34, - 0xfe, - 0x48, - 0xbd, - 0x5d, - 0x7c, - 0x72, - 0xa4, - 0x73, - 0x3b, - 0x72, - 0x9e, - 0x92, - 0x55, - 0x6e, - 0x51, - 0x3c, - 0x39, - 0x43, - 0x5a, - 0xe4, - 0xa4, - 0x71, - 0xcc, - 0xc5, - 0xaf, - 0x3f, - 0xbb, - 0xc8, - 0x80, - 0x65, - 0x67, - 0x2d, - 0x9e, - 0x32, - 0x10, - 0x99, - 0x03, - 0x2c, - 0x99, - 0xc8, - 0xab, - 0x71, - 0xed, - 0x31, - 0xf8, - 0xbb, - 0xde, - 0xee, - 0x69, - 0x7f, - 0xba, - 0x31, - 0x02, - 0x40, - 0x7e, - 0xbc, - 0x60, - 0x55, - 0x4e, - 0xd5, - 0xc8, - 0x6e, - 0xf4, - 0x0e, - 0x57, - 0xbe, - 0x2e, - 0xf9, - 0x39, - 0xbe, - 0x59, - 0x3f, - 0xa2, - 0x30, - 0xbb, - 0x57, - 0xd1, - 0xa3, - 0x13, - 0x2e, - 0x55, - 0x7c, - 0x7c, - 0x6a, - 0xd8, - 0xde, - 0x02, - 0xbe, - 0x9e, - 0xed, - 0x10, - 0xd0, - 0xc5, - 0x73, - 0x1d, - 0xea, - 0x3e, - 0xb1, - 0x55, - 0x81, - 0x02, - 0xef, - 0x48, - 0xc8, - 0x1c, - 0x5c, - 0x7a, - 0x92, - 0xb0, - 0x58, - 0xd3, - 0x19, - 0x5b, - 0x5d, - 0xa2, - 0xb6, - 0x56, - 0x69, - 0x02, - 0x40, - 0x1e, - 0x00, - 0x6a, - 0x9f, - 0xba, - 0xee, - 0x46, - 0x5a, - 0xc5, - 0xb5, - 0x9f, - 0x91, - 0x33, - 0xdd, - 0xc9, - 0x96, - 0x75, - 0xb7, - 0x87, - 0xcf, - 0x18, - 0x1c, - 0xb7, - 0xb9, - 0x3f, - 0x04, - 0x10, - 0xb8, - 0x75, - 0xa9, - 0xb8, - 0xa0, - 0x31, - 0x35, - 0x03, - 0x30, - 0x89, - 0xc8, - 0x37, - 0x68, - 0x20, - 0x30, - 0x99, - 0x39, - 0x96, - 0xd6, - 0x2b, - 0x3d, - 0x5e, - 0x45, - 0x84, - 0xf7, - 0xd2, - 0x61, - 0x50, - 0xc9, - 0x50, - 0xba, - 0x8d, - 0x08, - 0xaa, - 0xd0, - 0x08, - 0x1e, + 0x30, 0x82, 0x02, 0x5c, 0x02, 0x01, 0x00, 0x02, 0x81, 0x81, + 0x00, 0xa8, 0x6e, 0x40, 0x86, 0x9f, 0x98, 0x59, 0xfb, 0x57, + 0xbf, 0xc1, 0x55, 0x12, 0x38, 0xeb, 0xb3, 0x46, 0x34, 0xc9, + 0x35, 0x4d, 0xfd, 0x03, 0xe9, 0x3a, 0x88, 0x9e, 0x97, 0x8f, + 0xf4, 0xec, 0x36, 0x7b, 0x3f, 0xba, 0xb8, 0xa5, 0x96, 0x30, + 0x03, 0xc5, 0xc6, 0xd9, 0xa8, 0x4e, 0xbc, 0x23, 0x51, 0xa1, + 0x96, 0xd2, 0x03, 0x98, 0x73, 0xb6, 0x17, 0x9c, 0x77, 0xd4, + 0x95, 0x1e, 0x1b, 0xb3, 0x1b, 0xc8, 0x71, 0xd1, 0x2e, 0x31, + 0xc7, 0x6a, 0x75, 0x57, 0x08, 0x7f, 0xba, 0x70, 0x76, 0xf7, + 0x67, 0xf4, 0x4e, 0xbe, 0xfc, 0x70, 0x61, 0x41, 0x07, 0x2b, + 0x7c, 0x3c, 0x3b, 0xb3, 0xbc, 0xd5, 0xa8, 0xbd, 0x28, 0xd8, + 0x49, 0xd3, 0xe1, 0x78, 0xc8, 0xc1, 0x42, 0x5e, 0x18, 0x36, + 0xa8, 0x41, 0xf7, 0xc8, 0xaa, 0x35, 0xfe, 0x2d, 0xd1, 0xb4, + 0xcc, 0x00, 0x67, 0xae, 0x79, 0xd3, 0x28, 0xd5, 0x5b, 0x02, + 0x03, 0x01, 0x00, 0x01, 0x02, 0x81, 0x81, 0x00, 0xa6, 0x00, + 0x83, 0xf8, 0x2b, 0x33, 0xac, 0xfb, 0xdb, 0xf0, 0x52, 0x4b, + 0xd6, 0x39, 0xe3, 0x94, 0x3d, 0x8d, 0xa9, 0x01, 0xb0, 0x6b, + 0xbe, 0x7f, 0x10, 0x01, 0xb6, 0xcd, 0x0a, 0x45, 0x0a, 0xca, + 0x67, 0x8e, 0xd8, 0x29, 0x44, 0x8a, 0x51, 0xa8, 0x66, 0x35, + 0x26, 0x30, 0x8b, 0xe9, 0x41, 0xa6, 0x22, 0xec, 0xd2, 0xf0, + 0x58, 0x41, 0x33, 0x26, 0xf2, 0x3f, 0xe8, 0x75, 0x4f, 0xc7, + 0x5d, 0x2e, 0x5a, 0xa8, 0x7a, 0xd2, 0xbf, 0x59, 0xa0, 0x86, + 0x79, 0x0b, 0x92, 0x6c, 0x95, 0x5d, 0x87, 0x63, 0x5c, 0xd6, + 0x1a, 0xc0, 0xf6, 0x7a, 0x15, 0x8d, 0xc7, 0x3c, 0xb6, 0x9e, + 0xa6, 0x58, 0x46, 0x9b, 0xbf, 0x3e, 0x28, 0x8c, 0xdf, 0x1a, + 0x87, 0xaa, 0x7e, 0xf5, 0xf2, 0xcb, 0x5e, 0x84, 0x2d, 0xf6, + 0x82, 0x7e, 0x89, 0x4e, 0xf5, 0xe6, 0x3c, 0x92, 0x80, 0x1e, + 0x98, 0x1c, 0x6a, 0x7b, 0x57, 0x01, 0x02, 0x41, 0x00, 0xdd, + 0x60, 0x95, 0xd7, 0xa1, 0x9d, 0x0c, 0xa1, 0x84, 0xc5, 0x39, + 0xca, 0x67, 0x4c, 0x1c, 0x06, 0x71, 0x5b, 0x5c, 0x2d, 0x8d, + 0xce, 0xcd, 0xe2, 0x79, 0xc8, 0x33, 0xbe, 0x50, 0x37, 0x60, + 0x9f, 0x3b, 0xb9, 0x59, 0x55, 0x22, 0x1f, 0xa5, 0x4b, 0x1d, + 0xca, 0x38, 0xa0, 0xab, 0x87, 0x9c, 0x86, 0x0e, 0xdb, 0x1c, + 0x4f, 0x4f, 0x07, 0xed, 0x18, 0x3f, 0x05, 0x3c, 0xec, 0x78, + 0x11, 0xf6, 0x99, 0x02, 0x41, 0x00, 0xc2, 0xc5, 0xcf, 0xbe, + 0x95, 0x91, 0xeb, 0xcf, 0x47, 0xf3, 0x33, 0x32, 0xc7, 0x7e, + 0x93, 0x56, 0xf7, 0xd8, 0xf9, 0xd4, 0xb6, 0xd6, 0x20, 0xac, + 0xba, 0x8a, 0x20, 0x19, 0x14, 0xab, 0xc5, 0x5d, 0xb2, 0x08, + 0xcc, 0x77, 0x7c, 0x65, 0xa8, 0xdb, 0x66, 0x97, 0x36, 0x44, + 0x2c, 0x63, 0xc0, 0x6a, 0x7e, 0xb0, 0x0b, 0x5c, 0x90, 0x12, + 0x50, 0xb4, 0x36, 0x60, 0xc3, 0x1f, 0x22, 0x0c, 0xc8, 0x13, + 0x02, 0x40, 0x33, 0xc8, 0x7e, 0x04, 0x7c, 0x97, 0x61, 0xf6, + 0xfe, 0x39, 0xac, 0x34, 0xfe, 0x48, 0xbd, 0x5d, 0x7c, 0x72, + 0xa4, 0x73, 0x3b, 0x72, 0x9e, 0x92, 0x55, 0x6e, 0x51, 0x3c, + 0x39, 0x43, 0x5a, 0xe4, 0xa4, 0x71, 0xcc, 0xc5, 0xaf, 0x3f, + 0xbb, 0xc8, 0x80, 0x65, 0x67, 0x2d, 0x9e, 0x32, 0x10, 0x99, + 0x03, 0x2c, 0x99, 0xc8, 0xab, 0x71, 0xed, 0x31, 0xf8, 0xbb, + 0xde, 0xee, 0x69, 0x7f, 0xba, 0x31, 0x02, 0x40, 0x7e, 0xbc, + 0x60, 0x55, 0x4e, 0xd5, 0xc8, 0x6e, 0xf4, 0x0e, 0x57, 0xbe, + 0x2e, 0xf9, 0x39, 0xbe, 0x59, 0x3f, 0xa2, 0x30, 0xbb, 0x57, + 0xd1, 0xa3, 0x13, 0x2e, 0x55, 0x7c, 0x7c, 0x6a, 0xd8, 0xde, + 0x02, 0xbe, 0x9e, 0xed, 0x10, 0xd0, 0xc5, 0x73, 0x1d, 0xea, + 0x3e, 0xb1, 0x55, 0x81, 0x02, 0xef, 0x48, 0xc8, 0x1c, 0x5c, + 0x7a, 0x92, 0xb0, 0x58, 0xd3, 0x19, 0x5b, 0x5d, 0xa2, 0xb6, + 0x56, 0x69, 0x02, 0x40, 0x1e, 0x00, 0x6a, 0x9f, 0xba, 0xee, + 0x46, 0x5a, 0xc5, 0xb5, 0x9f, 0x91, 0x33, 0xdd, 0xc9, 0x96, + 0x75, 0xb7, 0x87, 0xcf, 0x18, 0x1c, 0xb7, 0xb9, 0x3f, 0x04, + 0x10, 0xb8, 0x75, 0xa9, 0xb8, 0xa0, 0x31, 0x35, 0x03, 0x30, + 0x89, 0xc8, 0x37, 0x68, 0x20, 0x30, 0x99, 0x39, 0x96, 0xd6, + 0x2b, 0x3d, 0x5e, 0x45, 0x84, 0xf7, 0xd2, 0x61, 0x50, 0xc9, + 0x50, 0xba, 0x8d, 0x08, 0xaa, 0xd0, 0x08, 0x1e }; static const PKCS12_ATTR ATTRS1[] = { @@ -2783,615 +794,67 @@ static int pkcs12_create_test(void) const unsigned char *p; static const unsigned char rsa_key[] = { - 0x30, - 0x82, - 0x02, - 0x5d, - 0x02, - 0x01, - 0x00, - 0x02, - 0x81, - 0x81, - 0x00, - 0xbb, - 0x24, - 0x7a, - 0x09, - 0x7e, - 0x0e, - 0xb2, - 0x37, - 0x32, - 0xcc, - 0x39, - 0x67, - 0xad, - 0xf1, - 0x9e, - 0x3d, - 0x6b, - 0x82, - 0x83, - 0xd1, - 0xd0, - 0xac, - 0xa4, - 0xc0, - 0x18, - 0xbe, - 0x8d, - 0x98, - 0x00, - 0xc0, - 0x7b, - 0xff, - 0x07, - 0x44, - 0xc9, - 0xca, - 0x1c, - 0xba, - 0x36, - 0xe1, - 0x27, - 0x69, - 0xff, - 0xb1, - 0xe3, - 0x8d, - 0x8b, - 0xee, - 0x57, - 0xa9, - 0x3a, - 0xaa, - 0x16, - 0x43, - 0x39, - 0x54, - 0x19, - 0x7c, - 0xae, - 0x69, - 0x24, - 0x14, - 0xf6, - 0x64, - 0xff, - 0xbc, - 0x74, - 0xc6, - 0x67, - 0x6c, - 0x4c, - 0xf1, - 0x02, - 0x49, - 0x69, - 0xc7, - 0x2b, - 0xe1, - 0xe1, - 0xa1, - 0xa3, - 0x43, - 0x14, - 0xf4, - 0x77, - 0x8f, - 0xc8, - 0xd0, - 0x85, - 0x5a, - 0x35, - 0x95, - 0xac, - 0x62, - 0xa9, - 0xc1, - 0x21, - 0x00, - 0x77, - 0xa0, - 0x8b, - 0x97, - 0x30, - 0xb4, - 0x5a, - 0x2c, - 0xb8, - 0x90, - 0x2f, - 0x48, - 0xa0, - 0x05, - 0x28, - 0x4b, - 0xf2, - 0x0f, - 0x8d, - 0xec, - 0x8b, - 0x4d, - 0x03, - 0x42, - 0x75, - 0xd6, - 0xad, - 0x81, - 0xc0, - 0x11, - 0x02, - 0x03, - 0x01, - 0x00, - 0x01, - 0x02, - 0x81, - 0x80, - 0x00, - 0xfc, - 0xb9, - 0x4a, - 0x26, - 0x07, - 0x89, - 0x51, - 0x2b, - 0x53, - 0x72, - 0x91, - 0xe0, - 0x18, - 0x3e, - 0xa6, - 0x5e, - 0x31, - 0xef, - 0x9c, - 0x0c, - 0x16, - 0x24, - 0x42, - 0xd0, - 0x28, - 0x33, - 0xf9, - 0xfa, - 0xd0, - 0x3c, - 0x54, - 0x04, - 0x06, - 0xc0, - 0x15, - 0xf5, - 0x1b, - 0x9a, - 0xb3, - 0x24, - 0x31, - 0xab, - 0x3c, - 0x6b, - 0x47, - 0x43, - 0xb0, - 0xd2, - 0xa9, - 0xdc, - 0x05, - 0xe1, - 0x81, - 0x59, - 0xb6, - 0x04, - 0xe9, - 0x66, - 0x61, - 0xaa, - 0xd7, - 0x0b, - 0x00, - 0x8f, - 0x3d, - 0xe5, - 0xbf, - 0xa2, - 0xf8, - 0x5e, - 0x25, - 0x6c, - 0x1e, - 0x22, - 0x0f, - 0xb4, - 0xfd, - 0x41, - 0xe2, - 0x03, - 0x31, - 0x5f, - 0xda, - 0x20, - 0xc5, - 0xc0, - 0xf3, - 0x55, - 0x0e, - 0xe1, - 0xc9, - 0xec, - 0xd7, - 0x3e, - 0x2a, - 0x0c, - 0x01, - 0xca, - 0x7b, - 0x22, - 0xcb, - 0xac, - 0xf4, - 0x2b, - 0x27, - 0xf0, - 0x78, - 0x5f, - 0xb5, - 0xc2, - 0xf9, - 0xe8, - 0x14, - 0x5a, - 0x6e, - 0x7e, - 0x86, - 0xbd, - 0x6a, - 0x9b, - 0x20, - 0x0c, - 0xba, - 0xcc, - 0x97, - 0x20, - 0x11, - 0x02, - 0x41, - 0x00, - 0xc9, - 0x59, - 0x9f, - 0x29, - 0x8a, - 0x5b, - 0x9f, - 0xe3, - 0x2a, - 0xd8, - 0x7e, - 0xc2, - 0x40, - 0x9f, - 0xa8, - 0x45, - 0xe5, - 0x3e, - 0x11, - 0x8d, - 0x3c, - 0xed, - 0x6e, - 0xab, - 0xce, - 0xd0, - 0x65, - 0x46, - 0xd8, - 0xc7, - 0x07, - 0x63, - 0xb5, - 0x23, - 0x34, - 0xf4, - 0x9f, - 0x7e, - 0x1c, - 0xc7, - 0xc7, - 0xf9, - 0x65, - 0xd1, - 0xf4, - 0x04, - 0x42, - 0x38, - 0xbe, - 0x3a, - 0x0c, - 0x9d, - 0x08, - 0x25, - 0xfc, - 0xa3, - 0x71, - 0xd9, - 0xae, - 0x0c, - 0x39, - 0x61, - 0xf4, - 0x89, - 0x02, - 0x41, - 0x00, - 0xed, - 0xef, - 0xab, - 0xa9, - 0xd5, - 0x39, - 0x9c, - 0xee, - 0x59, - 0x1b, - 0xff, - 0xcf, - 0x48, - 0x44, - 0x1b, - 0xb6, - 0x32, - 0xe7, - 0x46, - 0x24, - 0xf3, - 0x04, - 0x7f, - 0xde, - 0x95, - 0x08, - 0x6d, - 0x75, - 0x9e, - 0x67, - 0x17, - 0xba, - 0x5c, - 0xa4, - 0xd4, - 0xe2, - 0xe2, - 0x4d, - 0x77, - 0xce, - 0xeb, - 0x66, - 0x29, - 0xc5, - 0x96, - 0xe0, - 0x62, - 0xbb, - 0xe5, - 0xac, - 0xdc, - 0x44, - 0x62, - 0x54, - 0x86, - 0xed, - 0x64, - 0x0c, - 0xce, - 0xd0, - 0x60, - 0x03, - 0x9d, - 0x49, - 0x02, - 0x40, - 0x54, - 0xd9, - 0x18, - 0x72, - 0x27, - 0xe4, - 0xbe, - 0x76, - 0xbb, - 0x1a, - 0x6a, - 0x28, - 0x2f, - 0x95, - 0x58, - 0x12, - 0xc4, - 0x2c, - 0xa8, - 0xb6, - 0xcc, - 0xe2, - 0xfd, - 0x0d, - 0x17, - 0x64, - 0xc8, - 0x18, - 0xd7, - 0xc6, - 0xdf, - 0x3d, - 0x4c, - 0x1a, - 0x9e, - 0xf9, - 0x2a, - 0xb0, - 0xb9, - 0x2e, - 0x12, - 0xfd, - 0xec, - 0xc3, - 0x51, - 0xc1, - 0xed, - 0xa9, - 0xfd, - 0xb7, - 0x76, - 0x93, - 0x41, - 0xd8, - 0xc8, - 0x22, - 0x94, - 0x1a, - 0x77, - 0xf6, - 0x9c, - 0xc3, - 0xc3, - 0x89, - 0x02, - 0x41, - 0x00, - 0x8e, - 0xf9, - 0xa7, - 0x08, - 0xad, - 0xb5, - 0x2a, - 0x04, - 0xdb, - 0x8d, - 0x04, - 0xa1, - 0xb5, - 0x06, - 0x20, - 0x34, - 0xd2, - 0xcf, - 0xc0, - 0x89, - 0xb1, - 0x72, - 0x31, - 0xb8, - 0x39, - 0x8b, - 0xcf, - 0xe2, - 0x8e, - 0xa5, - 0xda, - 0x4f, - 0x45, - 0x1e, - 0x53, - 0x42, - 0x66, - 0xc4, - 0x30, - 0x4b, - 0x29, - 0x8e, - 0xc1, - 0x69, - 0x17, - 0x29, - 0x8c, - 0x8a, - 0xe6, - 0x0f, - 0x82, - 0x68, - 0xa1, - 0x41, - 0xb3, - 0xb6, - 0x70, - 0x99, - 0x75, - 0xa9, - 0x27, - 0x18, - 0xe4, - 0xe9, - 0x02, - 0x41, - 0x00, - 0x89, - 0xea, - 0x6e, - 0x6d, - 0x70, - 0xdf, - 0x25, - 0x5f, - 0x18, - 0x3f, - 0x48, - 0xda, - 0x63, - 0x10, - 0x8b, - 0xfe, - 0xa8, - 0x0c, - 0x94, - 0x0f, - 0xde, - 0x97, - 0x56, - 0x53, - 0x89, - 0x94, - 0xe2, - 0x1e, - 0x2c, - 0x74, - 0x3c, - 0x91, - 0x81, - 0x34, - 0x0b, - 0xa6, - 0x40, - 0xf8, - 0xcb, - 0x2a, - 0x60, - 0x8c, - 0xe0, - 0x02, - 0xb7, - 0x89, - 0x93, - 0xcf, - 0x18, - 0x9f, - 0x49, - 0x54, - 0xfd, - 0x7d, - 0x3f, - 0x9a, - 0xef, - 0xd4, - 0xa4, - 0x4f, - 0xc1, - 0x45, - 0x99, - 0x91, + 0x30, 0x82, 0x02, 0x5d, 0x02, 0x01, 0x00, 0x02, 0x81, 0x81, + 0x00, 0xbb, 0x24, 0x7a, 0x09, 0x7e, 0x0e, 0xb2, 0x37, 0x32, + 0xcc, 0x39, 0x67, 0xad, 0xf1, 0x9e, 0x3d, 0x6b, 0x82, 0x83, + 0xd1, 0xd0, 0xac, 0xa4, 0xc0, 0x18, 0xbe, 0x8d, 0x98, 0x00, + 0xc0, 0x7b, 0xff, 0x07, 0x44, 0xc9, 0xca, 0x1c, 0xba, 0x36, + 0xe1, 0x27, 0x69, 0xff, 0xb1, 0xe3, 0x8d, 0x8b, 0xee, 0x57, + 0xa9, 0x3a, 0xaa, 0x16, 0x43, 0x39, 0x54, 0x19, 0x7c, 0xae, + 0x69, 0x24, 0x14, 0xf6, 0x64, 0xff, 0xbc, 0x74, 0xc6, 0x67, + 0x6c, 0x4c, 0xf1, 0x02, 0x49, 0x69, 0xc7, 0x2b, 0xe1, 0xe1, + 0xa1, 0xa3, 0x43, 0x14, 0xf4, 0x77, 0x8f, 0xc8, 0xd0, 0x85, + 0x5a, 0x35, 0x95, 0xac, 0x62, 0xa9, 0xc1, 0x21, 0x00, 0x77, + 0xa0, 0x8b, 0x97, 0x30, 0xb4, 0x5a, 0x2c, 0xb8, 0x90, 0x2f, + 0x48, 0xa0, 0x05, 0x28, 0x4b, 0xf2, 0x0f, 0x8d, 0xec, 0x8b, + 0x4d, 0x03, 0x42, 0x75, 0xd6, 0xad, 0x81, 0xc0, 0x11, 0x02, + 0x03, 0x01, 0x00, 0x01, 0x02, 0x81, 0x80, 0x00, 0xfc, 0xb9, + 0x4a, 0x26, 0x07, 0x89, 0x51, 0x2b, 0x53, 0x72, 0x91, 0xe0, + 0x18, 0x3e, 0xa6, 0x5e, 0x31, 0xef, 0x9c, 0x0c, 0x16, 0x24, + 0x42, 0xd0, 0x28, 0x33, 0xf9, 0xfa, 0xd0, 0x3c, 0x54, 0x04, + 0x06, 0xc0, 0x15, 0xf5, 0x1b, 0x9a, 0xb3, 0x24, 0x31, 0xab, + 0x3c, 0x6b, 0x47, 0x43, 0xb0, 0xd2, 0xa9, 0xdc, 0x05, 0xe1, + 0x81, 0x59, 0xb6, 0x04, 0xe9, 0x66, 0x61, 0xaa, 0xd7, 0x0b, + 0x00, 0x8f, 0x3d, 0xe5, 0xbf, 0xa2, 0xf8, 0x5e, 0x25, 0x6c, + 0x1e, 0x22, 0x0f, 0xb4, 0xfd, 0x41, 0xe2, 0x03, 0x31, 0x5f, + 0xda, 0x20, 0xc5, 0xc0, 0xf3, 0x55, 0x0e, 0xe1, 0xc9, 0xec, + 0xd7, 0x3e, 0x2a, 0x0c, 0x01, 0xca, 0x7b, 0x22, 0xcb, 0xac, + 0xf4, 0x2b, 0x27, 0xf0, 0x78, 0x5f, 0xb5, 0xc2, 0xf9, 0xe8, + 0x14, 0x5a, 0x6e, 0x7e, 0x86, 0xbd, 0x6a, 0x9b, 0x20, 0x0c, + 0xba, 0xcc, 0x97, 0x20, 0x11, 0x02, 0x41, 0x00, 0xc9, 0x59, + 0x9f, 0x29, 0x8a, 0x5b, 0x9f, 0xe3, 0x2a, 0xd8, 0x7e, 0xc2, + 0x40, 0x9f, 0xa8, 0x45, 0xe5, 0x3e, 0x11, 0x8d, 0x3c, 0xed, + 0x6e, 0xab, 0xce, 0xd0, 0x65, 0x46, 0xd8, 0xc7, 0x07, 0x63, + 0xb5, 0x23, 0x34, 0xf4, 0x9f, 0x7e, 0x1c, 0xc7, 0xc7, 0xf9, + 0x65, 0xd1, 0xf4, 0x04, 0x42, 0x38, 0xbe, 0x3a, 0x0c, 0x9d, + 0x08, 0x25, 0xfc, 0xa3, 0x71, 0xd9, 0xae, 0x0c, 0x39, 0x61, + 0xf4, 0x89, 0x02, 0x41, 0x00, 0xed, 0xef, 0xab, 0xa9, 0xd5, + 0x39, 0x9c, 0xee, 0x59, 0x1b, 0xff, 0xcf, 0x48, 0x44, 0x1b, + 0xb6, 0x32, 0xe7, 0x46, 0x24, 0xf3, 0x04, 0x7f, 0xde, 0x95, + 0x08, 0x6d, 0x75, 0x9e, 0x67, 0x17, 0xba, 0x5c, 0xa4, 0xd4, + 0xe2, 0xe2, 0x4d, 0x77, 0xce, 0xeb, 0x66, 0x29, 0xc5, 0x96, + 0xe0, 0x62, 0xbb, 0xe5, 0xac, 0xdc, 0x44, 0x62, 0x54, 0x86, + 0xed, 0x64, 0x0c, 0xce, 0xd0, 0x60, 0x03, 0x9d, 0x49, 0x02, + 0x40, 0x54, 0xd9, 0x18, 0x72, 0x27, 0xe4, 0xbe, 0x76, 0xbb, + 0x1a, 0x6a, 0x28, 0x2f, 0x95, 0x58, 0x12, 0xc4, 0x2c, 0xa8, + 0xb6, 0xcc, 0xe2, 0xfd, 0x0d, 0x17, 0x64, 0xc8, 0x18, 0xd7, + 0xc6, 0xdf, 0x3d, 0x4c, 0x1a, 0x9e, 0xf9, 0x2a, 0xb0, 0xb9, + 0x2e, 0x12, 0xfd, 0xec, 0xc3, 0x51, 0xc1, 0xed, 0xa9, 0xfd, + 0xb7, 0x76, 0x93, 0x41, 0xd8, 0xc8, 0x22, 0x94, 0x1a, 0x77, + 0xf6, 0x9c, 0xc3, 0xc3, 0x89, 0x02, 0x41, 0x00, 0x8e, 0xf9, + 0xa7, 0x08, 0xad, 0xb5, 0x2a, 0x04, 0xdb, 0x8d, 0x04, 0xa1, + 0xb5, 0x06, 0x20, 0x34, 0xd2, 0xcf, 0xc0, 0x89, 0xb1, 0x72, + 0x31, 0xb8, 0x39, 0x8b, 0xcf, 0xe2, 0x8e, 0xa5, 0xda, 0x4f, + 0x45, 0x1e, 0x53, 0x42, 0x66, 0xc4, 0x30, 0x4b, 0x29, 0x8e, + 0xc1, 0x69, 0x17, 0x29, 0x8c, 0x8a, 0xe6, 0x0f, 0x82, 0x68, + 0xa1, 0x41, 0xb3, 0xb6, 0x70, 0x99, 0x75, 0xa9, 0x27, 0x18, + 0xe4, 0xe9, 0x02, 0x41, 0x00, 0x89, 0xea, 0x6e, 0x6d, 0x70, + 0xdf, 0x25, 0x5f, 0x18, 0x3f, 0x48, 0xda, 0x63, 0x10, 0x8b, + 0xfe, 0xa8, 0x0c, 0x94, 0x0f, 0xde, 0x97, 0x56, 0x53, 0x89, + 0x94, 0xe2, 0x1e, 0x2c, 0x74, 0x3c, 0x91, 0x81, 0x34, 0x0b, + 0xa6, 0x40, 0xf8, 0xcb, 0x2a, 0x60, 0x8c, 0xe0, 0x02, 0xb7, + 0x89, 0x93, 0xcf, 0x18, 0x9f, 0x49, 0x54, 0xfd, 0x7d, 0x3f, + 0x9a, 0xef, 0xd4, 0xa4, 0x4f, 0xc1, 0x45, 0x99, 0x91 }; p = rsa_key; diff --git a/test/recipes/70-test_tls13ticket.t b/test/recipes/70-test_tls13ticket.t new file mode 100644 index 000000000000..d05bb357d2a7 --- /dev/null +++ b/test/recipes/70-test_tls13ticket.t @@ -0,0 +1,26 @@ +#! /usr/bin/env perl +# Copyright 2026 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 + +use OpenSSL::Test::Simple; +use OpenSSL::Test qw/:DEFAULT srctop_file/; +use OpenSSL::Test::Utils qw(disabled); + +setup("test_tls13ticket"); + +plan skip_all => "needs TLSv1.3 enabled" + if disabled("tls1_3"); + +plan skip_all => "needs EC enabled" + if disabled("ec"); + + +plan tests => 1; + +ok(run(test(["tls13ticket_test", srctop_file("apps", "server.pem"), + srctop_file("apps", "server.pem")])), + "running tls13ticket_test"); diff --git a/test/recipes/80-test_cms.t b/test/recipes/80-test_cms.t index b6ee61464409..2f850c6e0ee8 100644 --- a/test/recipes/80-test_cms.t +++ b/test/recipes/80-test_cms.t @@ -51,7 +51,7 @@ my ($no_des, $no_dh, $no_dsa, $no_ec, $no_ec2m, $no_rc2, $no_zlib) $no_rc2 = 1 if disabled("legacy"); -plan tests => 23; +plan tests => 26; ok(run(test(["pkcs7_test"])), "test pkcs7"); @@ -1011,6 +1011,23 @@ subtest "CMS binary input tests\n" => sub { "verify binary input with -binary missing -crlfeol"); }; +# Regression test for PKCS7_verify() ownership handling when +# digestAlgorithms is an empty SET. +# The malformed structure must fail cleanly without crashing or +# triggering use-after-free behaviour. +with({ exit_checker => sub { return shift == 4; } }, + sub { + ok(run(app([ + 'openssl', 'smime', + '-verify', + '-noverify', + '-in', + srctop_file('test', 'smime-eml', + 'pkcs7-empty-digest-set.eml'), + ])), + "Check empty digestAlgorithms SET is handled safely"); + }); + # Test case for missing MD algorithm (must not segfault) with({ exit_checker => sub { return shift == 4; } }, @@ -1054,6 +1071,16 @@ ok(!run(app(['openssl', 'cms', '-verify', ])), "issue#19643"); +# Check that users get error when using incorrect envelope type for AEAD algorithms +ok(!run(app(['openssl', 'cms', '-decrypt', + '-inform', 'PEM', '-stream', + '-secretkey', '000102030405060708090A0B0C0D0E0F', + '-secretkeyid', 'C0FEE0', + '-in', srctop_file("test/cms-msg", + "enveloped-content-type-for-aes-gcm.pem") + ])), + "Error AES-GCM in enveloped content type"); + # Check that kari encryption with originator does not segfault with({ exit_checker => sub { return shift == 3; } }, sub { @@ -1196,3 +1223,21 @@ subtest "encrypt to three recipients with RSA-OAEP, key only decrypt" => sub { "decrypt with key only"); is(compare($pt, $ptpt), 0, "compare original message with decrypted ciphertext"); }; + +# Regression test for NULL dereference in PWRI decrypt path +# when optional keyDerivationAlgorithm is omitted. +subtest "PWRI missing keyDerivationAlgorithm regression" => sub { + plan tests => 1; + + with({ exit_checker => sub { return shift == 4; } }, sub { + ok(run(app([ + "openssl", "cms", @prov, + "-decrypt", + "-inform", "DER", + "-in", + srctop_file('test', 'cms-msg', 'missing-kdf.der'), + "-out", "pwri-out.txt", + "-pwri_password", "secret"])), + "missing keyDerivationAlgorithm is rejected"); + }); +}; diff --git a/test/recipes/80-test_cmsapi.t b/test/recipes/80-test_cmsapi.t index 8d9371e005c0..3d1dae846464 100644 --- a/test/recipes/80-test_cmsapi.t +++ b/test/recipes/80-test_cmsapi.t @@ -19,5 +19,6 @@ plan tests => 1; ok(run(test(["cmsapitest", srctop_file("test", "certs", "servercert.pem"), srctop_file("test", "certs", "serverkey.pem"), srctop_file("test", "recipes", "80-test_cmsapi_data", "encryptedData.der"), - srctop_file("test", "recipes", "80-test_cmsapi_data", "encDataWithTooLongIV.pem")])), + srctop_file("test", "recipes", "80-test_cmsapi_data", "encDataWithTooLongIV.pem"), + srctop_file("test", "recipes", "80-test_cmsapi_data", "cms_pwri_kek_oob.der")])), "running cmsapitest"); diff --git a/test/recipes/80-test_cmsapi_data/cms_pwri_kek_oob.der b/test/recipes/80-test_cmsapi_data/cms_pwri_kek_oob.der Binary files differnew file mode 100644 index 000000000000..c3ef3abd10e6 --- /dev/null +++ b/test/recipes/80-test_cmsapi_data/cms_pwri_kek_oob.der diff --git a/test/siphash_internal_test.c b/test/siphash_internal_test.c index 8a97bd700e88..954a014f0dbb 100644 --- a/test/siphash_internal_test.c +++ b/test/siphash_internal_test.c @@ -1,5 +1,5 @@ /* - * Copyright 2016-2024 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2026 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 @@ -36,1798 +36,134 @@ typedef struct { /* From C reference: https://131002.net/siphash/ */ static TESTDATA tests[] = { - { 0, { 8, { - 0x31, - 0x0e, - 0x0e, - 0xdd, - 0x47, - 0xdb, - 0x6f, - 0x72, - } } }, - { 1, { 8, { - 0xfd, - 0x67, - 0xdc, - 0x93, - 0xc5, - 0x39, - 0xf8, - 0x74, - } } }, - { 2, { 8, { - 0x5a, - 0x4f, - 0xa9, - 0xd9, - 0x09, - 0x80, - 0x6c, - 0x0d, - } } }, - { 3, { 8, { - 0x2d, - 0x7e, - 0xfb, - 0xd7, - 0x96, - 0x66, - 0x67, - 0x85, - } } }, - { 4, { 8, { - 0xb7, - 0x87, - 0x71, - 0x27, - 0xe0, - 0x94, - 0x27, - 0xcf, - } } }, - { 5, { 8, { - 0x8d, - 0xa6, - 0x99, - 0xcd, - 0x64, - 0x55, - 0x76, - 0x18, - } } }, - { 6, { 8, { - 0xce, - 0xe3, - 0xfe, - 0x58, - 0x6e, - 0x46, - 0xc9, - 0xcb, - } } }, - { 7, { 8, { - 0x37, - 0xd1, - 0x01, - 0x8b, - 0xf5, - 0x00, - 0x02, - 0xab, - } } }, - { 8, { 8, { - 0x62, - 0x24, - 0x93, - 0x9a, - 0x79, - 0xf5, - 0xf5, - 0x93, - } } }, - { 9, { 8, { - 0xb0, - 0xe4, - 0xa9, - 0x0b, - 0xdf, - 0x82, - 0x00, - 0x9e, - } } }, - { 10, { 8, { - 0xf3, - 0xb9, - 0xdd, - 0x94, - 0xc5, - 0xbb, - 0x5d, - 0x7a, - } } }, - { 11, { 8, { - 0xa7, - 0xad, - 0x6b, - 0x22, - 0x46, - 0x2f, - 0xb3, - 0xf4, - } } }, - { 12, { 8, { - 0xfb, - 0xe5, - 0x0e, - 0x86, - 0xbc, - 0x8f, - 0x1e, - 0x75, - } } }, - { 13, { 8, { - 0x90, - 0x3d, - 0x84, - 0xc0, - 0x27, - 0x56, - 0xea, - 0x14, - } } }, - { 14, { 8, { - 0xee, - 0xf2, - 0x7a, - 0x8e, - 0x90, - 0xca, - 0x23, - 0xf7, - } } }, - { 15, { 8, { - 0xe5, - 0x45, - 0xbe, - 0x49, - 0x61, - 0xca, - 0x29, - 0xa1, - } } }, - { 16, { 8, { - 0xdb, - 0x9b, - 0xc2, - 0x57, - 0x7f, - 0xcc, - 0x2a, - 0x3f, - } } }, - { 17, { 8, { - 0x94, - 0x47, - 0xbe, - 0x2c, - 0xf5, - 0xe9, - 0x9a, - 0x69, - } } }, - { 18, { 8, { - 0x9c, - 0xd3, - 0x8d, - 0x96, - 0xf0, - 0xb3, - 0xc1, - 0x4b, - } } }, - { 19, { 8, { - 0xbd, - 0x61, - 0x79, - 0xa7, - 0x1d, - 0xc9, - 0x6d, - 0xbb, - } } }, - { 20, { 8, { - 0x98, - 0xee, - 0xa2, - 0x1a, - 0xf2, - 0x5c, - 0xd6, - 0xbe, - } } }, - { 21, { 8, { - 0xc7, - 0x67, - 0x3b, - 0x2e, - 0xb0, - 0xcb, - 0xf2, - 0xd0, - } } }, - { 22, { 8, { - 0x88, - 0x3e, - 0xa3, - 0xe3, - 0x95, - 0x67, - 0x53, - 0x93, - } } }, - { 23, { 8, { - 0xc8, - 0xce, - 0x5c, - 0xcd, - 0x8c, - 0x03, - 0x0c, - 0xa8, - } } }, - { 24, { 8, { - 0x94, - 0xaf, - 0x49, - 0xf6, - 0xc6, - 0x50, - 0xad, - 0xb8, - } } }, - { 25, { 8, { - 0xea, - 0xb8, - 0x85, - 0x8a, - 0xde, - 0x92, - 0xe1, - 0xbc, - } } }, - { 26, { 8, { - 0xf3, - 0x15, - 0xbb, - 0x5b, - 0xb8, - 0x35, - 0xd8, - 0x17, - } } }, - { 27, { 8, { - 0xad, - 0xcf, - 0x6b, - 0x07, - 0x63, - 0x61, - 0x2e, - 0x2f, - } } }, - { 28, { 8, { - 0xa5, - 0xc9, - 0x1d, - 0xa7, - 0xac, - 0xaa, - 0x4d, - 0xde, - } } }, - { 29, { 8, { - 0x71, - 0x65, - 0x95, - 0x87, - 0x66, - 0x50, - 0xa2, - 0xa6, - } } }, - { 30, { 8, { - 0x28, - 0xef, - 0x49, - 0x5c, - 0x53, - 0xa3, - 0x87, - 0xad, - } } }, - { 31, { 8, { - 0x42, - 0xc3, - 0x41, - 0xd8, - 0xfa, - 0x92, - 0xd8, - 0x32, - } } }, - { 32, { 8, { - 0xce, - 0x7c, - 0xf2, - 0x72, - 0x2f, - 0x51, - 0x27, - 0x71, - } } }, - { 33, { 8, { - 0xe3, - 0x78, - 0x59, - 0xf9, - 0x46, - 0x23, - 0xf3, - 0xa7, - } } }, - { 34, { 8, { - 0x38, - 0x12, - 0x05, - 0xbb, - 0x1a, - 0xb0, - 0xe0, - 0x12, - } } }, - { 35, { 8, { - 0xae, - 0x97, - 0xa1, - 0x0f, - 0xd4, - 0x34, - 0xe0, - 0x15, - } } }, - { 36, { 8, { - 0xb4, - 0xa3, - 0x15, - 0x08, - 0xbe, - 0xff, - 0x4d, - 0x31, - } } }, - { 37, { 8, { - 0x81, - 0x39, - 0x62, - 0x29, - 0xf0, - 0x90, - 0x79, - 0x02, - } } }, - { 38, { 8, { - 0x4d, - 0x0c, - 0xf4, - 0x9e, - 0xe5, - 0xd4, - 0xdc, - 0xca, - } } }, - { 39, { 8, { - 0x5c, - 0x73, - 0x33, - 0x6a, - 0x76, - 0xd8, - 0xbf, - 0x9a, - } } }, - { 40, { 8, { - 0xd0, - 0xa7, - 0x04, - 0x53, - 0x6b, - 0xa9, - 0x3e, - 0x0e, - } } }, - { 41, { 8, { - 0x92, - 0x59, - 0x58, - 0xfc, - 0xd6, - 0x42, - 0x0c, - 0xad, - } } }, - { 42, { 8, { - 0xa9, - 0x15, - 0xc2, - 0x9b, - 0xc8, - 0x06, - 0x73, - 0x18, - } } }, - { 43, { 8, { - 0x95, - 0x2b, - 0x79, - 0xf3, - 0xbc, - 0x0a, - 0xa6, - 0xd4, - } } }, - { 44, { 8, { - 0xf2, - 0x1d, - 0xf2, - 0xe4, - 0x1d, - 0x45, - 0x35, - 0xf9, - } } }, - { 45, { 8, { - 0x87, - 0x57, - 0x75, - 0x19, - 0x04, - 0x8f, - 0x53, - 0xa9, - } } }, - { 46, { 8, { - 0x10, - 0xa5, - 0x6c, - 0xf5, - 0xdf, - 0xcd, - 0x9a, - 0xdb, - } } }, - { 47, { 8, { - 0xeb, - 0x75, - 0x09, - 0x5c, - 0xcd, - 0x98, - 0x6c, - 0xd0, - } } }, - { 48, { 8, { - 0x51, - 0xa9, - 0xcb, - 0x9e, - 0xcb, - 0xa3, - 0x12, - 0xe6, - } } }, - { 49, { 8, { - 0x96, - 0xaf, - 0xad, - 0xfc, - 0x2c, - 0xe6, - 0x66, - 0xc7, - } } }, - { 50, { 8, { - 0x72, - 0xfe, - 0x52, - 0x97, - 0x5a, - 0x43, - 0x64, - 0xee, - } } }, - { 51, { 8, { - 0x5a, - 0x16, - 0x45, - 0xb2, - 0x76, - 0xd5, - 0x92, - 0xa1, - } } }, - { 52, { 8, { - 0xb2, - 0x74, - 0xcb, - 0x8e, - 0xbf, - 0x87, - 0x87, - 0x0a, - } } }, - { 53, { 8, { - 0x6f, - 0x9b, - 0xb4, - 0x20, - 0x3d, - 0xe7, - 0xb3, - 0x81, - } } }, - { 54, { 8, { - 0xea, - 0xec, - 0xb2, - 0xa3, - 0x0b, - 0x22, - 0xa8, - 0x7f, - } } }, - { 55, { 8, { - 0x99, - 0x24, - 0xa4, - 0x3c, - 0xc1, - 0x31, - 0x57, - 0x24, - } } }, - { 56, { 8, { - 0xbd, - 0x83, - 0x8d, - 0x3a, - 0xaf, - 0xbf, - 0x8d, - 0xb7, - } } }, - { 57, { 8, { - 0x0b, - 0x1a, - 0x2a, - 0x32, - 0x65, - 0xd5, - 0x1a, - 0xea, - } } }, - { 58, { 8, { - 0x13, - 0x50, - 0x79, - 0xa3, - 0x23, - 0x1c, - 0xe6, - 0x60, - } } }, - { 59, { 8, { - 0x93, - 0x2b, - 0x28, - 0x46, - 0xe4, - 0xd7, - 0x06, - 0x66, - } } }, - { 60, { 8, { - 0xe1, - 0x91, - 0x5f, - 0x5c, - 0xb1, - 0xec, - 0xa4, - 0x6c, - } } }, - { 61, { 8, { - 0xf3, - 0x25, - 0x96, - 0x5c, - 0xa1, - 0x6d, - 0x62, - 0x9f, - } } }, - { 62, { 8, { - 0x57, - 0x5f, - 0xf2, - 0x8e, - 0x60, - 0x38, - 0x1b, - 0xe5, - } } }, - { 63, { 8, { - 0x72, - 0x45, - 0x06, - 0xeb, - 0x4c, - 0x32, - 0x8a, - 0x95, - } } }, - { 0, { 16, { - 0xa3, - 0x81, - 0x7f, - 0x04, - 0xba, - 0x25, - 0xa8, - 0xe6, - 0x6d, - 0xf6, - 0x72, - 0x14, - 0xc7, - 0x55, - 0x02, - 0x93, - } } }, - { 1, { 16, { - 0xda, - 0x87, - 0xc1, - 0xd8, - 0x6b, - 0x99, - 0xaf, - 0x44, - 0x34, - 0x76, - 0x59, - 0x11, - 0x9b, - 0x22, - 0xfc, - 0x45, - } } }, - { 2, { 16, { - 0x81, - 0x77, - 0x22, - 0x8d, - 0xa4, - 0xa4, - 0x5d, - 0xc7, - 0xfc, - 0xa3, - 0x8b, - 0xde, - 0xf6, - 0x0a, - 0xff, - 0xe4, - } } }, - { 3, { 16, { - 0x9c, - 0x70, - 0xb6, - 0x0c, - 0x52, - 0x67, - 0xa9, - 0x4e, - 0x5f, - 0x33, - 0xb6, - 0xb0, - 0x29, - 0x85, - 0xed, - 0x51, - } } }, - { 4, { 16, { - 0xf8, - 0x81, - 0x64, - 0xc1, - 0x2d, - 0x9c, - 0x8f, - 0xaf, - 0x7d, - 0x0f, - 0x6e, - 0x7c, - 0x7b, - 0xcd, - 0x55, - 0x79, - } } }, - { 5, { 16, { - 0x13, - 0x68, - 0x87, - 0x59, - 0x80, - 0x77, - 0x6f, - 0x88, - 0x54, - 0x52, - 0x7a, - 0x07, - 0x69, - 0x0e, - 0x96, - 0x27, - } } }, - { 6, { 16, { - 0x14, - 0xee, - 0xca, - 0x33, - 0x8b, - 0x20, - 0x86, - 0x13, - 0x48, - 0x5e, - 0xa0, - 0x30, - 0x8f, - 0xd7, - 0xa1, - 0x5e, - } } }, - { 7, { 16, { - 0xa1, - 0xf1, - 0xeb, - 0xbe, - 0xd8, - 0xdb, - 0xc1, - 0x53, - 0xc0, - 0xb8, - 0x4a, - 0xa6, - 0x1f, - 0xf0, - 0x82, - 0x39, - } } }, - { 8, { 16, { - 0x3b, - 0x62, - 0xa9, - 0xba, - 0x62, - 0x58, - 0xf5, - 0x61, - 0x0f, - 0x83, - 0xe2, - 0x64, - 0xf3, - 0x14, - 0x97, - 0xb4, - } } }, - { 9, { 16, { - 0x26, - 0x44, - 0x99, - 0x06, - 0x0a, - 0xd9, - 0xba, - 0xab, - 0xc4, - 0x7f, - 0x8b, - 0x02, - 0xbb, - 0x6d, - 0x71, - 0xed, - } } }, - { 10, { 16, { - 0x00, - 0x11, - 0x0d, - 0xc3, - 0x78, - 0x14, - 0x69, - 0x56, - 0xc9, - 0x54, - 0x47, - 0xd3, - 0xf3, - 0xd0, - 0xfb, - 0xba, - } } }, - { 11, { 16, { - 0x01, - 0x51, - 0xc5, - 0x68, - 0x38, - 0x6b, - 0x66, - 0x77, - 0xa2, - 0xb4, - 0xdc, - 0x6f, - 0x81, - 0xe5, - 0xdc, - 0x18, - } } }, - { 12, { 16, { - 0xd6, - 0x26, - 0xb2, - 0x66, - 0x90, - 0x5e, - 0xf3, - 0x58, - 0x82, - 0x63, - 0x4d, - 0xf6, - 0x85, - 0x32, - 0xc1, - 0x25, - } } }, - { 13, { 16, { - 0x98, - 0x69, - 0xe2, - 0x47, - 0xe9, - 0xc0, - 0x8b, - 0x10, - 0xd0, - 0x29, - 0x93, - 0x4f, - 0xc4, - 0xb9, - 0x52, - 0xf7, - } } }, - { 14, { 16, { - 0x31, - 0xfc, - 0xef, - 0xac, - 0x66, - 0xd7, - 0xde, - 0x9c, - 0x7e, - 0xc7, - 0x48, - 0x5f, - 0xe4, - 0x49, - 0x49, - 0x02, - } } }, - { 15, { 16, { - 0x54, - 0x93, - 0xe9, - 0x99, - 0x33, - 0xb0, - 0xa8, - 0x11, - 0x7e, - 0x08, - 0xec, - 0x0f, - 0x97, - 0xcf, - 0xc3, - 0xd9, - } } }, - { 16, { 16, { - 0x6e, - 0xe2, - 0xa4, - 0xca, - 0x67, - 0xb0, - 0x54, - 0xbb, - 0xfd, - 0x33, - 0x15, - 0xbf, - 0x85, - 0x23, - 0x05, - 0x77, - } } }, - { 17, { 16, { - 0x47, - 0x3d, - 0x06, - 0xe8, - 0x73, - 0x8d, - 0xb8, - 0x98, - 0x54, - 0xc0, - 0x66, - 0xc4, - 0x7a, - 0xe4, - 0x77, - 0x40, - } } }, - { 18, { 16, { - 0xa4, - 0x26, - 0xe5, - 0xe4, - 0x23, - 0xbf, - 0x48, - 0x85, - 0x29, - 0x4d, - 0xa4, - 0x81, - 0xfe, - 0xae, - 0xf7, - 0x23, - } } }, - { 19, { 16, { - 0x78, - 0x01, - 0x77, - 0x31, - 0xcf, - 0x65, - 0xfa, - 0xb0, - 0x74, - 0xd5, - 0x20, - 0x89, - 0x52, - 0x51, - 0x2e, - 0xb1, - } } }, - { 20, { 16, { - 0x9e, - 0x25, - 0xfc, - 0x83, - 0x3f, - 0x22, - 0x90, - 0x73, - 0x3e, - 0x93, - 0x44, - 0xa5, - 0xe8, - 0x38, - 0x39, - 0xeb, - } } }, - { 21, { 16, { - 0x56, - 0x8e, - 0x49, - 0x5a, - 0xbe, - 0x52, - 0x5a, - 0x21, - 0x8a, - 0x22, - 0x14, - 0xcd, - 0x3e, - 0x07, - 0x1d, - 0x12, - } } }, - { 22, { 16, { - 0x4a, - 0x29, - 0xb5, - 0x45, - 0x52, - 0xd1, - 0x6b, - 0x9a, - 0x46, - 0x9c, - 0x10, - 0x52, - 0x8e, - 0xff, - 0x0a, - 0xae, - } } }, - { 23, { 16, { - 0xc9, - 0xd1, - 0x84, - 0xdd, - 0xd5, - 0xa9, - 0xf5, - 0xe0, - 0xcf, - 0x8c, - 0xe2, - 0x9a, - 0x9a, - 0xbf, - 0x69, - 0x1c, - } } }, - { 24, { 16, { - 0x2d, - 0xb4, - 0x79, - 0xae, - 0x78, - 0xbd, - 0x50, - 0xd8, - 0x88, - 0x2a, - 0x8a, - 0x17, - 0x8a, - 0x61, - 0x32, - 0xad, - } } }, - { 25, { 16, { - 0x8e, - 0xce, - 0x5f, - 0x04, - 0x2d, - 0x5e, - 0x44, - 0x7b, - 0x50, - 0x51, - 0xb9, - 0xea, - 0xcb, - 0x8d, - 0x8f, - 0x6f, - } } }, - { 26, { 16, { - 0x9c, - 0x0b, - 0x53, - 0xb4, - 0xb3, - 0xc3, - 0x07, - 0xe8, - 0x7e, - 0xae, - 0xe0, - 0x86, - 0x78, - 0x14, - 0x1f, - 0x66, - } } }, - { 27, { 16, { - 0xab, - 0xf2, - 0x48, - 0xaf, - 0x69, - 0xa6, - 0xea, - 0xe4, - 0xbf, - 0xd3, - 0xeb, - 0x2f, - 0x12, - 0x9e, - 0xeb, - 0x94, - } } }, - { 28, { 16, { - 0x06, - 0x64, - 0xda, - 0x16, - 0x68, - 0x57, - 0x4b, - 0x88, - 0xb9, - 0x35, - 0xf3, - 0x02, - 0x73, - 0x58, - 0xae, - 0xf4, - } } }, - { 29, { 16, { - 0xaa, - 0x4b, - 0x9d, - 0xc4, - 0xbf, - 0x33, - 0x7d, - 0xe9, - 0x0c, - 0xd4, - 0xfd, - 0x3c, - 0x46, - 0x7c, - 0x6a, - 0xb7, - } } }, - { 30, { 16, { - 0xea, - 0x5c, - 0x7f, - 0x47, - 0x1f, - 0xaf, - 0x6b, - 0xde, - 0x2b, - 0x1a, - 0xd7, - 0xd4, - 0x68, - 0x6d, - 0x22, - 0x87, - } } }, - { 31, { 16, { - 0x29, - 0x39, - 0xb0, - 0x18, - 0x32, - 0x23, - 0xfa, - 0xfc, - 0x17, - 0x23, - 0xde, - 0x4f, - 0x52, - 0xc4, - 0x3d, - 0x35, - } } }, - { 32, { 16, { - 0x7c, - 0x39, - 0x56, - 0xca, - 0x5e, - 0xea, - 0xfc, - 0x3e, - 0x36, - 0x3e, - 0x9d, - 0x55, - 0x65, - 0x46, - 0xeb, - 0x68, - } } }, - { 33, { 16, { - 0x77, - 0xc6, - 0x07, - 0x71, - 0x46, - 0xf0, - 0x1c, - 0x32, - 0xb6, - 0xb6, - 0x9d, - 0x5f, - 0x4e, - 0xa9, - 0xff, - 0xcf, - } } }, - { 34, { 16, { - 0x37, - 0xa6, - 0x98, - 0x6c, - 0xb8, - 0x84, - 0x7e, - 0xdf, - 0x09, - 0x25, - 0xf0, - 0xf1, - 0x30, - 0x9b, - 0x54, - 0xde, - } } }, - { 35, { 16, { - 0xa7, - 0x05, - 0xf0, - 0xe6, - 0x9d, - 0xa9, - 0xa8, - 0xf9, - 0x07, - 0x24, - 0x1a, - 0x2e, - 0x92, - 0x3c, - 0x8c, - 0xc8, - } } }, - { 36, { 16, { - 0x3d, - 0xc4, - 0x7d, - 0x1f, - 0x29, - 0xc4, - 0x48, - 0x46, - 0x1e, - 0x9e, - 0x76, - 0xed, - 0x90, - 0x4f, - 0x67, - 0x11, - } } }, - { 37, { 16, { - 0x0d, - 0x62, - 0xbf, - 0x01, - 0xe6, - 0xfc, - 0x0e, - 0x1a, - 0x0d, - 0x3c, - 0x47, - 0x51, - 0xc5, - 0xd3, - 0x69, - 0x2b, - } } }, - { 38, { 16, { - 0x8c, - 0x03, - 0x46, - 0x8b, - 0xca, - 0x7c, - 0x66, - 0x9e, - 0xe4, - 0xfd, - 0x5e, - 0x08, - 0x4b, - 0xbe, - 0xe7, - 0xb5, - } } }, - { 39, { 16, { - 0x52, - 0x8a, - 0x5b, - 0xb9, - 0x3b, - 0xaf, - 0x2c, - 0x9c, - 0x44, - 0x73, - 0xcc, - 0xe5, - 0xd0, - 0xd2, - 0x2b, - 0xd9, - } } }, - { 40, { 16, { - 0xdf, - 0x6a, - 0x30, - 0x1e, - 0x95, - 0xc9, - 0x5d, - 0xad, - 0x97, - 0xae, - 0x0c, - 0xc8, - 0xc6, - 0x91, - 0x3b, - 0xd8, - } } }, - { 41, { 16, { - 0x80, - 0x11, - 0x89, - 0x90, - 0x2c, - 0x85, - 0x7f, - 0x39, - 0xe7, - 0x35, - 0x91, - 0x28, - 0x5e, - 0x70, - 0xb6, - 0xdb, - } } }, - { 42, { 16, { - 0xe6, - 0x17, - 0x34, - 0x6a, - 0xc9, - 0xc2, - 0x31, - 0xbb, - 0x36, - 0x50, - 0xae, - 0x34, - 0xcc, - 0xca, - 0x0c, - 0x5b, - } } }, - { 43, { 16, { - 0x27, - 0xd9, - 0x34, - 0x37, - 0xef, - 0xb7, - 0x21, - 0xaa, - 0x40, - 0x18, - 0x21, - 0xdc, - 0xec, - 0x5a, - 0xdf, - 0x89, - } } }, - { 44, { 16, { - 0x89, - 0x23, - 0x7d, - 0x9d, - 0xed, - 0x9c, - 0x5e, - 0x78, - 0xd8, - 0xb1, - 0xc9, - 0xb1, - 0x66, - 0xcc, - 0x73, - 0x42, - } } }, - { 45, { 16, { - 0x4a, - 0x6d, - 0x80, - 0x91, - 0xbf, - 0x5e, - 0x7d, - 0x65, - 0x11, - 0x89, - 0xfa, - 0x94, - 0xa2, - 0x50, - 0xb1, - 0x4c, - } } }, - { 46, { 16, { - 0x0e, - 0x33, - 0xf9, - 0x60, - 0x55, - 0xe7, - 0xae, - 0x89, - 0x3f, - 0xfc, - 0x0e, - 0x3d, - 0xcf, - 0x49, - 0x29, - 0x02, - } } }, - { 47, { 16, { - 0xe6, - 0x1c, - 0x43, - 0x2b, - 0x72, - 0x0b, - 0x19, - 0xd1, - 0x8e, - 0xc8, - 0xd8, - 0x4b, - 0xdc, - 0x63, - 0x15, - 0x1b, - } } }, - { 48, { 16, { - 0xf7, - 0xe5, - 0xae, - 0xf5, - 0x49, - 0xf7, - 0x82, - 0xcf, - 0x37, - 0x90, - 0x55, - 0xa6, - 0x08, - 0x26, - 0x9b, - 0x16, - } } }, - { 49, { 16, { - 0x43, - 0x8d, - 0x03, - 0x0f, - 0xd0, - 0xb7, - 0xa5, - 0x4f, - 0xa8, - 0x37, - 0xf2, - 0xad, - 0x20, - 0x1a, - 0x64, - 0x03, - } } }, - { 50, { 16, { - 0xa5, - 0x90, - 0xd3, - 0xee, - 0x4f, - 0xbf, - 0x04, - 0xe3, - 0x24, - 0x7e, - 0x0d, - 0x27, - 0xf2, - 0x86, - 0x42, - 0x3f, - } } }, - { 51, { 16, { - 0x5f, - 0xe2, - 0xc1, - 0xa1, - 0x72, - 0xfe, - 0x93, - 0xc4, - 0xb1, - 0x5c, - 0xd3, - 0x7c, - 0xae, - 0xf9, - 0xf5, - 0x38, - } } }, - { 52, { 16, { - 0x2c, - 0x97, - 0x32, - 0x5c, - 0xbd, - 0x06, - 0xb3, - 0x6e, - 0xb2, - 0x13, - 0x3d, - 0xd0, - 0x8b, - 0x3a, - 0x01, - 0x7c, - } } }, - { 53, { 16, { - 0x92, - 0xc8, - 0x14, - 0x22, - 0x7a, - 0x6b, - 0xca, - 0x94, - 0x9f, - 0xf0, - 0x65, - 0x9f, - 0x00, - 0x2a, - 0xd3, - 0x9e, - } } }, - { 54, { 16, { - 0xdc, - 0xe8, - 0x50, - 0x11, - 0x0b, - 0xd8, - 0x32, - 0x8c, - 0xfb, - 0xd5, - 0x08, - 0x41, - 0xd6, - 0x91, - 0x1d, - 0x87, - } } }, - { 55, { 16, { - 0x67, - 0xf1, - 0x49, - 0x84, - 0xc7, - 0xda, - 0x79, - 0x12, - 0x48, - 0xe3, - 0x2b, - 0xb5, - 0x92, - 0x25, - 0x83, - 0xda, - } } }, - { 56, { 16, { - 0x19, - 0x38, - 0xf2, - 0xcf, - 0x72, - 0xd5, - 0x4e, - 0xe9, - 0x7e, - 0x94, - 0x16, - 0x6f, - 0xa9, - 0x1d, - 0x2a, - 0x36, - } } }, - { 57, { 16, { - 0x74, - 0x48, - 0x1e, - 0x96, - 0x46, - 0xed, - 0x49, - 0xfe, - 0x0f, - 0x62, - 0x24, - 0x30, - 0x16, - 0x04, - 0x69, - 0x8e, - } } }, - { 58, { 16, { - 0x57, - 0xfc, - 0xa5, - 0xde, - 0x98, - 0xa9, - 0xd6, - 0xd8, - 0x00, - 0x64, - 0x38, - 0xd0, - 0x58, - 0x3d, - 0x8a, - 0x1d, - } } }, - { 59, { 16, { - 0x9f, - 0xec, - 0xde, - 0x1c, - 0xef, - 0xdc, - 0x1c, - 0xbe, - 0xd4, - 0x76, - 0x36, - 0x74, - 0xd9, - 0x57, - 0x53, - 0x59, - } } }, - { 60, { 16, { - 0xe3, - 0x04, - 0x0c, - 0x00, - 0xeb, - 0x28, - 0xf1, - 0x53, - 0x66, - 0xca, - 0x73, - 0xcb, - 0xd8, - 0x72, - 0xe7, - 0x40, - } } }, - { 61, { 16, { - 0x76, - 0x97, - 0x00, - 0x9a, - 0x6a, - 0x83, - 0x1d, - 0xfe, - 0xcc, - 0xa9, - 0x1c, - 0x59, - 0x93, - 0x67, - 0x0f, - 0x7a, - } } }, - { 62, { 16, { - 0x58, - 0x53, - 0x54, - 0x23, - 0x21, - 0xf5, - 0x67, - 0xa0, - 0x05, - 0xd5, - 0x47, - 0xa4, - 0xf0, - 0x47, - 0x59, - 0xbd, - } } }, - { 63, { 16, { - 0x51, - 0x50, - 0xd1, - 0x77, - 0x2f, - 0x50, - 0x83, - 0x4a, - 0x50, - 0x3e, - 0x06, - 0x9a, - 0x97, - 0x3f, - 0xbd, - 0x7c, - } } } + { 0, { 8, { 0x31, 0x0e, 0x0e, 0xdd, 0x47, 0xdb, 0x6f, 0x72 } } }, + { 1, { 8, { 0xfd, 0x67, 0xdc, 0x93, 0xc5, 0x39, 0xf8, 0x74 } } }, + { 2, { 8, { 0x5a, 0x4f, 0xa9, 0xd9, 0x09, 0x80, 0x6c, 0x0d } } }, + { 3, { 8, { 0x2d, 0x7e, 0xfb, 0xd7, 0x96, 0x66, 0x67, 0x85 } } }, + { 4, { 8, { 0xb7, 0x87, 0x71, 0x27, 0xe0, 0x94, 0x27, 0xcf } } }, + { 5, { 8, { 0x8d, 0xa6, 0x99, 0xcd, 0x64, 0x55, 0x76, 0x18 } } }, + { 6, { 8, { 0xce, 0xe3, 0xfe, 0x58, 0x6e, 0x46, 0xc9, 0xcb } } }, + { 7, { 8, { 0x37, 0xd1, 0x01, 0x8b, 0xf5, 0x00, 0x02, 0xab } } }, + { 8, { 8, { 0x62, 0x24, 0x93, 0x9a, 0x79, 0xf5, 0xf5, 0x93 } } }, + { 9, { 8, { 0xb0, 0xe4, 0xa9, 0x0b, 0xdf, 0x82, 0x00, 0x9e } } }, + { 10, { 8, { 0xf3, 0xb9, 0xdd, 0x94, 0xc5, 0xbb, 0x5d, 0x7a } } }, + { 11, { 8, { 0xa7, 0xad, 0x6b, 0x22, 0x46, 0x2f, 0xb3, 0xf4 } } }, + { 12, { 8, { 0xfb, 0xe5, 0x0e, 0x86, 0xbc, 0x8f, 0x1e, 0x75 } } }, + { 13, { 8, { 0x90, 0x3d, 0x84, 0xc0, 0x27, 0x56, 0xea, 0x14 } } }, + { 14, { 8, { 0xee, 0xf2, 0x7a, 0x8e, 0x90, 0xca, 0x23, 0xf7 } } }, + { 15, { 8, { 0xe5, 0x45, 0xbe, 0x49, 0x61, 0xca, 0x29, 0xa1 } } }, + { 16, { 8, { 0xdb, 0x9b, 0xc2, 0x57, 0x7f, 0xcc, 0x2a, 0x3f } } }, + { 17, { 8, { 0x94, 0x47, 0xbe, 0x2c, 0xf5, 0xe9, 0x9a, 0x69 } } }, + { 18, { 8, { 0x9c, 0xd3, 0x8d, 0x96, 0xf0, 0xb3, 0xc1, 0x4b } } }, + { 19, { 8, { 0xbd, 0x61, 0x79, 0xa7, 0x1d, 0xc9, 0x6d, 0xbb } } }, + { 20, { 8, { 0x98, 0xee, 0xa2, 0x1a, 0xf2, 0x5c, 0xd6, 0xbe } } }, + { 21, { 8, { 0xc7, 0x67, 0x3b, 0x2e, 0xb0, 0xcb, 0xf2, 0xd0 } } }, + { 22, { 8, { 0x88, 0x3e, 0xa3, 0xe3, 0x95, 0x67, 0x53, 0x93 } } }, + { 23, { 8, { 0xc8, 0xce, 0x5c, 0xcd, 0x8c, 0x03, 0x0c, 0xa8 } } }, + { 24, { 8, { 0x94, 0xaf, 0x49, 0xf6, 0xc6, 0x50, 0xad, 0xb8 } } }, + { 25, { 8, { 0xea, 0xb8, 0x85, 0x8a, 0xde, 0x92, 0xe1, 0xbc } } }, + { 26, { 8, { 0xf3, 0x15, 0xbb, 0x5b, 0xb8, 0x35, 0xd8, 0x17 } } }, + { 27, { 8, { 0xad, 0xcf, 0x6b, 0x07, 0x63, 0x61, 0x2e, 0x2f } } }, + { 28, { 8, { 0xa5, 0xc9, 0x1d, 0xa7, 0xac, 0xaa, 0x4d, 0xde } } }, + { 29, { 8, { 0x71, 0x65, 0x95, 0x87, 0x66, 0x50, 0xa2, 0xa6 } } }, + { 30, { 8, { 0x28, 0xef, 0x49, 0x5c, 0x53, 0xa3, 0x87, 0xad } } }, + { 31, { 8, { 0x42, 0xc3, 0x41, 0xd8, 0xfa, 0x92, 0xd8, 0x32 } } }, + { 32, { 8, { 0xce, 0x7c, 0xf2, 0x72, 0x2f, 0x51, 0x27, 0x71 } } }, + { 33, { 8, { 0xe3, 0x78, 0x59, 0xf9, 0x46, 0x23, 0xf3, 0xa7 } } }, + { 34, { 8, { 0x38, 0x12, 0x05, 0xbb, 0x1a, 0xb0, 0xe0, 0x12 } } }, + { 35, { 8, { 0xae, 0x97, 0xa1, 0x0f, 0xd4, 0x34, 0xe0, 0x15 } } }, + { 36, { 8, { 0xb4, 0xa3, 0x15, 0x08, 0xbe, 0xff, 0x4d, 0x31 } } }, + { 37, { 8, { 0x81, 0x39, 0x62, 0x29, 0xf0, 0x90, 0x79, 0x02 } } }, + { 38, { 8, { 0x4d, 0x0c, 0xf4, 0x9e, 0xe5, 0xd4, 0xdc, 0xca } } }, + { 39, { 8, { 0x5c, 0x73, 0x33, 0x6a, 0x76, 0xd8, 0xbf, 0x9a } } }, + { 40, { 8, { 0xd0, 0xa7, 0x04, 0x53, 0x6b, 0xa9, 0x3e, 0x0e } } }, + { 41, { 8, { 0x92, 0x59, 0x58, 0xfc, 0xd6, 0x42, 0x0c, 0xad } } }, + { 42, { 8, { 0xa9, 0x15, 0xc2, 0x9b, 0xc8, 0x06, 0x73, 0x18 } } }, + { 43, { 8, { 0x95, 0x2b, 0x79, 0xf3, 0xbc, 0x0a, 0xa6, 0xd4 } } }, + { 44, { 8, { 0xf2, 0x1d, 0xf2, 0xe4, 0x1d, 0x45, 0x35, 0xf9 } } }, + { 45, { 8, { 0x87, 0x57, 0x75, 0x19, 0x04, 0x8f, 0x53, 0xa9 } } }, + { 46, { 8, { 0x10, 0xa5, 0x6c, 0xf5, 0xdf, 0xcd, 0x9a, 0xdb } } }, + { 47, { 8, { 0xeb, 0x75, 0x09, 0x5c, 0xcd, 0x98, 0x6c, 0xd0 } } }, + { 48, { 8, { 0x51, 0xa9, 0xcb, 0x9e, 0xcb, 0xa3, 0x12, 0xe6 } } }, + { 49, { 8, { 0x96, 0xaf, 0xad, 0xfc, 0x2c, 0xe6, 0x66, 0xc7 } } }, + { 50, { 8, { 0x72, 0xfe, 0x52, 0x97, 0x5a, 0x43, 0x64, 0xee } } }, + { 51, { 8, { 0x5a, 0x16, 0x45, 0xb2, 0x76, 0xd5, 0x92, 0xa1 } } }, + { 52, { 8, { 0xb2, 0x74, 0xcb, 0x8e, 0xbf, 0x87, 0x87, 0x0a } } }, + { 53, { 8, { 0x6f, 0x9b, 0xb4, 0x20, 0x3d, 0xe7, 0xb3, 0x81 } } }, + { 54, { 8, { 0xea, 0xec, 0xb2, 0xa3, 0x0b, 0x22, 0xa8, 0x7f } } }, + { 55, { 8, { 0x99, 0x24, 0xa4, 0x3c, 0xc1, 0x31, 0x57, 0x24 } } }, + { 56, { 8, { 0xbd, 0x83, 0x8d, 0x3a, 0xaf, 0xbf, 0x8d, 0xb7 } } }, + { 57, { 8, { 0x0b, 0x1a, 0x2a, 0x32, 0x65, 0xd5, 0x1a, 0xea } } }, + { 58, { 8, { 0x13, 0x50, 0x79, 0xa3, 0x23, 0x1c, 0xe6, 0x60 } } }, + { 59, { 8, { 0x93, 0x2b, 0x28, 0x46, 0xe4, 0xd7, 0x06, 0x66 } } }, + { 60, { 8, { 0xe1, 0x91, 0x5f, 0x5c, 0xb1, 0xec, 0xa4, 0x6c } } }, + { 61, { 8, { 0xf3, 0x25, 0x96, 0x5c, 0xa1, 0x6d, 0x62, 0x9f } } }, + { 62, { 8, { 0x57, 0x5f, 0xf2, 0x8e, 0x60, 0x38, 0x1b, 0xe5 } } }, + { 63, { 8, { 0x72, 0x45, 0x06, 0xeb, 0x4c, 0x32, 0x8a, 0x95 } } }, + { 0, { 16, { 0xa3, 0x81, 0x7f, 0x04, 0xba, 0x25, 0xa8, 0xe6, 0x6d, 0xf6, 0x72, 0x14, 0xc7, 0x55, 0x02, 0x93 } } }, + { 1, { 16, { 0xda, 0x87, 0xc1, 0xd8, 0x6b, 0x99, 0xaf, 0x44, 0x34, 0x76, 0x59, 0x11, 0x9b, 0x22, 0xfc, 0x45 } } }, + { 2, { 16, { 0x81, 0x77, 0x22, 0x8d, 0xa4, 0xa4, 0x5d, 0xc7, 0xfc, 0xa3, 0x8b, 0xde, 0xf6, 0x0a, 0xff, 0xe4 } } }, + { 3, { 16, { 0x9c, 0x70, 0xb6, 0x0c, 0x52, 0x67, 0xa9, 0x4e, 0x5f, 0x33, 0xb6, 0xb0, 0x29, 0x85, 0xed, 0x51 } } }, + { 4, { 16, { 0xf8, 0x81, 0x64, 0xc1, 0x2d, 0x9c, 0x8f, 0xaf, 0x7d, 0x0f, 0x6e, 0x7c, 0x7b, 0xcd, 0x55, 0x79 } } }, + { 5, { 16, { 0x13, 0x68, 0x87, 0x59, 0x80, 0x77, 0x6f, 0x88, 0x54, 0x52, 0x7a, 0x07, 0x69, 0x0e, 0x96, 0x27 } } }, + { 6, { 16, { 0x14, 0xee, 0xca, 0x33, 0x8b, 0x20, 0x86, 0x13, 0x48, 0x5e, 0xa0, 0x30, 0x8f, 0xd7, 0xa1, 0x5e } } }, + { 7, { 16, { 0xa1, 0xf1, 0xeb, 0xbe, 0xd8, 0xdb, 0xc1, 0x53, 0xc0, 0xb8, 0x4a, 0xa6, 0x1f, 0xf0, 0x82, 0x39 } } }, + { 8, { 16, { 0x3b, 0x62, 0xa9, 0xba, 0x62, 0x58, 0xf5, 0x61, 0x0f, 0x83, 0xe2, 0x64, 0xf3, 0x14, 0x97, 0xb4 } } }, + { 9, { 16, { 0x26, 0x44, 0x99, 0x06, 0x0a, 0xd9, 0xba, 0xab, 0xc4, 0x7f, 0x8b, 0x02, 0xbb, 0x6d, 0x71, 0xed } } }, + { 10, { 16, { 0x00, 0x11, 0x0d, 0xc3, 0x78, 0x14, 0x69, 0x56, 0xc9, 0x54, 0x47, 0xd3, 0xf3, 0xd0, 0xfb, 0xba } } }, + { 11, { 16, { 0x01, 0x51, 0xc5, 0x68, 0x38, 0x6b, 0x66, 0x77, 0xa2, 0xb4, 0xdc, 0x6f, 0x81, 0xe5, 0xdc, 0x18 } } }, + { 12, { 16, { 0xd6, 0x26, 0xb2, 0x66, 0x90, 0x5e, 0xf3, 0x58, 0x82, 0x63, 0x4d, 0xf6, 0x85, 0x32, 0xc1, 0x25 } } }, + { 13, { 16, { 0x98, 0x69, 0xe2, 0x47, 0xe9, 0xc0, 0x8b, 0x10, 0xd0, 0x29, 0x93, 0x4f, 0xc4, 0xb9, 0x52, 0xf7 } } }, + { 14, { 16, { 0x31, 0xfc, 0xef, 0xac, 0x66, 0xd7, 0xde, 0x9c, 0x7e, 0xc7, 0x48, 0x5f, 0xe4, 0x49, 0x49, 0x02 } } }, + { 15, { 16, { 0x54, 0x93, 0xe9, 0x99, 0x33, 0xb0, 0xa8, 0x11, 0x7e, 0x08, 0xec, 0x0f, 0x97, 0xcf, 0xc3, 0xd9 } } }, + { 16, { 16, { 0x6e, 0xe2, 0xa4, 0xca, 0x67, 0xb0, 0x54, 0xbb, 0xfd, 0x33, 0x15, 0xbf, 0x85, 0x23, 0x05, 0x77 } } }, + { 17, { 16, { 0x47, 0x3d, 0x06, 0xe8, 0x73, 0x8d, 0xb8, 0x98, 0x54, 0xc0, 0x66, 0xc4, 0x7a, 0xe4, 0x77, 0x40 } } }, + { 18, { 16, { 0xa4, 0x26, 0xe5, 0xe4, 0x23, 0xbf, 0x48, 0x85, 0x29, 0x4d, 0xa4, 0x81, 0xfe, 0xae, 0xf7, 0x23 } } }, + { 19, { 16, { 0x78, 0x01, 0x77, 0x31, 0xcf, 0x65, 0xfa, 0xb0, 0x74, 0xd5, 0x20, 0x89, 0x52, 0x51, 0x2e, 0xb1 } } }, + { 20, { 16, { 0x9e, 0x25, 0xfc, 0x83, 0x3f, 0x22, 0x90, 0x73, 0x3e, 0x93, 0x44, 0xa5, 0xe8, 0x38, 0x39, 0xeb } } }, + { 21, { 16, { 0x56, 0x8e, 0x49, 0x5a, 0xbe, 0x52, 0x5a, 0x21, 0x8a, 0x22, 0x14, 0xcd, 0x3e, 0x07, 0x1d, 0x12 } } }, + { 22, { 16, { 0x4a, 0x29, 0xb5, 0x45, 0x52, 0xd1, 0x6b, 0x9a, 0x46, 0x9c, 0x10, 0x52, 0x8e, 0xff, 0x0a, 0xae } } }, + { 23, { 16, { 0xc9, 0xd1, 0x84, 0xdd, 0xd5, 0xa9, 0xf5, 0xe0, 0xcf, 0x8c, 0xe2, 0x9a, 0x9a, 0xbf, 0x69, 0x1c } } }, + { 24, { 16, { 0x2d, 0xb4, 0x79, 0xae, 0x78, 0xbd, 0x50, 0xd8, 0x88, 0x2a, 0x8a, 0x17, 0x8a, 0x61, 0x32, 0xad } } }, + { 25, { 16, { 0x8e, 0xce, 0x5f, 0x04, 0x2d, 0x5e, 0x44, 0x7b, 0x50, 0x51, 0xb9, 0xea, 0xcb, 0x8d, 0x8f, 0x6f } } }, + { 26, { 16, { 0x9c, 0x0b, 0x53, 0xb4, 0xb3, 0xc3, 0x07, 0xe8, 0x7e, 0xae, 0xe0, 0x86, 0x78, 0x14, 0x1f, 0x66 } } }, + { 27, { 16, { 0xab, 0xf2, 0x48, 0xaf, 0x69, 0xa6, 0xea, 0xe4, 0xbf, 0xd3, 0xeb, 0x2f, 0x12, 0x9e, 0xeb, 0x94 } } }, + { 28, { 16, { 0x06, 0x64, 0xda, 0x16, 0x68, 0x57, 0x4b, 0x88, 0xb9, 0x35, 0xf3, 0x02, 0x73, 0x58, 0xae, 0xf4 } } }, + { 29, { 16, { 0xaa, 0x4b, 0x9d, 0xc4, 0xbf, 0x33, 0x7d, 0xe9, 0x0c, 0xd4, 0xfd, 0x3c, 0x46, 0x7c, 0x6a, 0xb7 } } }, + { 30, { 16, { 0xea, 0x5c, 0x7f, 0x47, 0x1f, 0xaf, 0x6b, 0xde, 0x2b, 0x1a, 0xd7, 0xd4, 0x68, 0x6d, 0x22, 0x87 } } }, + { 31, { 16, { 0x29, 0x39, 0xb0, 0x18, 0x32, 0x23, 0xfa, 0xfc, 0x17, 0x23, 0xde, 0x4f, 0x52, 0xc4, 0x3d, 0x35 } } }, + { 32, { 16, { 0x7c, 0x39, 0x56, 0xca, 0x5e, 0xea, 0xfc, 0x3e, 0x36, 0x3e, 0x9d, 0x55, 0x65, 0x46, 0xeb, 0x68 } } }, + { 33, { 16, { 0x77, 0xc6, 0x07, 0x71, 0x46, 0xf0, 0x1c, 0x32, 0xb6, 0xb6, 0x9d, 0x5f, 0x4e, 0xa9, 0xff, 0xcf } } }, + { 34, { 16, { 0x37, 0xa6, 0x98, 0x6c, 0xb8, 0x84, 0x7e, 0xdf, 0x09, 0x25, 0xf0, 0xf1, 0x30, 0x9b, 0x54, 0xde } } }, + { 35, { 16, { 0xa7, 0x05, 0xf0, 0xe6, 0x9d, 0xa9, 0xa8, 0xf9, 0x07, 0x24, 0x1a, 0x2e, 0x92, 0x3c, 0x8c, 0xc8 } } }, + { 36, { 16, { 0x3d, 0xc4, 0x7d, 0x1f, 0x29, 0xc4, 0x48, 0x46, 0x1e, 0x9e, 0x76, 0xed, 0x90, 0x4f, 0x67, 0x11 } } }, + { 37, { 16, { 0x0d, 0x62, 0xbf, 0x01, 0xe6, 0xfc, 0x0e, 0x1a, 0x0d, 0x3c, 0x47, 0x51, 0xc5, 0xd3, 0x69, 0x2b } } }, + { 38, { 16, { 0x8c, 0x03, 0x46, 0x8b, 0xca, 0x7c, 0x66, 0x9e, 0xe4, 0xfd, 0x5e, 0x08, 0x4b, 0xbe, 0xe7, 0xb5 } } }, + { 39, { 16, { 0x52, 0x8a, 0x5b, 0xb9, 0x3b, 0xaf, 0x2c, 0x9c, 0x44, 0x73, 0xcc, 0xe5, 0xd0, 0xd2, 0x2b, 0xd9 } } }, + { 40, { 16, { 0xdf, 0x6a, 0x30, 0x1e, 0x95, 0xc9, 0x5d, 0xad, 0x97, 0xae, 0x0c, 0xc8, 0xc6, 0x91, 0x3b, 0xd8 } } }, + { 41, { 16, { 0x80, 0x11, 0x89, 0x90, 0x2c, 0x85, 0x7f, 0x39, 0xe7, 0x35, 0x91, 0x28, 0x5e, 0x70, 0xb6, 0xdb } } }, + { 42, { 16, { 0xe6, 0x17, 0x34, 0x6a, 0xc9, 0xc2, 0x31, 0xbb, 0x36, 0x50, 0xae, 0x34, 0xcc, 0xca, 0x0c, 0x5b } } }, + { 43, { 16, { 0x27, 0xd9, 0x34, 0x37, 0xef, 0xb7, 0x21, 0xaa, 0x40, 0x18, 0x21, 0xdc, 0xec, 0x5a, 0xdf, 0x89 } } }, + { 44, { 16, { 0x89, 0x23, 0x7d, 0x9d, 0xed, 0x9c, 0x5e, 0x78, 0xd8, 0xb1, 0xc9, 0xb1, 0x66, 0xcc, 0x73, 0x42 } } }, + { 45, { 16, { 0x4a, 0x6d, 0x80, 0x91, 0xbf, 0x5e, 0x7d, 0x65, 0x11, 0x89, 0xfa, 0x94, 0xa2, 0x50, 0xb1, 0x4c } } }, + { 46, { 16, { 0x0e, 0x33, 0xf9, 0x60, 0x55, 0xe7, 0xae, 0x89, 0x3f, 0xfc, 0x0e, 0x3d, 0xcf, 0x49, 0x29, 0x02 } } }, + { 47, { 16, { 0xe6, 0x1c, 0x43, 0x2b, 0x72, 0x0b, 0x19, 0xd1, 0x8e, 0xc8, 0xd8, 0x4b, 0xdc, 0x63, 0x15, 0x1b } } }, + { 48, { 16, { 0xf7, 0xe5, 0xae, 0xf5, 0x49, 0xf7, 0x82, 0xcf, 0x37, 0x90, 0x55, 0xa6, 0x08, 0x26, 0x9b, 0x16 } } }, + { 49, { 16, { 0x43, 0x8d, 0x03, 0x0f, 0xd0, 0xb7, 0xa5, 0x4f, 0xa8, 0x37, 0xf2, 0xad, 0x20, 0x1a, 0x64, 0x03 } } }, + { 50, { 16, { 0xa5, 0x90, 0xd3, 0xee, 0x4f, 0xbf, 0x04, 0xe3, 0x24, 0x7e, 0x0d, 0x27, 0xf2, 0x86, 0x42, 0x3f } } }, + { 51, { 16, { 0x5f, 0xe2, 0xc1, 0xa1, 0x72, 0xfe, 0x93, 0xc4, 0xb1, 0x5c, 0xd3, 0x7c, 0xae, 0xf9, 0xf5, 0x38 } } }, + { 52, { 16, { 0x2c, 0x97, 0x32, 0x5c, 0xbd, 0x06, 0xb3, 0x6e, 0xb2, 0x13, 0x3d, 0xd0, 0x8b, 0x3a, 0x01, 0x7c } } }, + { 53, { 16, { 0x92, 0xc8, 0x14, 0x22, 0x7a, 0x6b, 0xca, 0x94, 0x9f, 0xf0, 0x65, 0x9f, 0x00, 0x2a, 0xd3, 0x9e } } }, + { 54, { 16, { 0xdc, 0xe8, 0x50, 0x11, 0x0b, 0xd8, 0x32, 0x8c, 0xfb, 0xd5, 0x08, 0x41, 0xd6, 0x91, 0x1d, 0x87 } } }, + { 55, { 16, { 0x67, 0xf1, 0x49, 0x84, 0xc7, 0xda, 0x79, 0x12, 0x48, 0xe3, 0x2b, 0xb5, 0x92, 0x25, 0x83, 0xda } } }, + { 56, { 16, { 0x19, 0x38, 0xf2, 0xcf, 0x72, 0xd5, 0x4e, 0xe9, 0x7e, 0x94, 0x16, 0x6f, 0xa9, 0x1d, 0x2a, 0x36 } } }, + { 57, { 16, { 0x74, 0x48, 0x1e, 0x96, 0x46, 0xed, 0x49, 0xfe, 0x0f, 0x62, 0x24, 0x30, 0x16, 0x04, 0x69, 0x8e } } }, + { 58, { 16, { 0x57, 0xfc, 0xa5, 0xde, 0x98, 0xa9, 0xd6, 0xd8, 0x00, 0x64, 0x38, 0xd0, 0x58, 0x3d, 0x8a, 0x1d } } }, + { 59, { 16, { 0x9f, 0xec, 0xde, 0x1c, 0xef, 0xdc, 0x1c, 0xbe, 0xd4, 0x76, 0x36, 0x74, 0xd9, 0x57, 0x53, 0x59 } } }, + { 60, { 16, { 0xe3, 0x04, 0x0c, 0x00, 0xeb, 0x28, 0xf1, 0x53, 0x66, 0xca, 0x73, 0xcb, 0xd8, 0x72, 0xe7, 0x40 } } }, + { 61, { 16, { 0x76, 0x97, 0x00, 0x9a, 0x6a, 0x83, 0x1d, 0xfe, 0xcc, 0xa9, 0x1c, 0x59, 0x93, 0x67, 0x0f, 0x7a } } }, + { 62, { 16, { 0x58, 0x53, 0x54, 0x23, 0x21, 0xf5, 0x67, 0xa0, 0x05, 0xd5, 0x47, 0xa4, 0xf0, 0x47, 0x59, 0xbd } } }, + { 63, { 16, { 0x51, 0x50, 0xd1, 0x77, 0x2f, 0x50, 0x83, 0x4a, 0x50, 0x3e, 0x06, 0x9a, 0x97, 0x3f, 0xbd, 0x7c } } } }; static int test_siphash(int idx) diff --git a/test/smime-eml/pkcs7-empty-digest-set.eml b/test/smime-eml/pkcs7-empty-digest-set.eml new file mode 100644 index 000000000000..a6db2c38adfa --- /dev/null +++ b/test/smime-eml/pkcs7-empty-digest-set.eml @@ -0,0 +1,45 @@ +MIME-Version: 1.0 +Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg="sha-256"; boundary="----E0314CC5D732C92AE2D7A3BACDCDCFCE" + +This is an S/MIME signed message + +------E0314CC5D732C92AE2D7A3BACDCDCFCE +This is the content to be signed. + +------E0314CC5D732C92AE2D7A3BACDCDCFCE +Content-Type: application/x-pkcs7-signature; name="smime.p7s" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; filename="smime.p7s" + +MIIFWgYJKoZIhvcNAQcCoIIFSzCCBUcCAQExADALBgkqhkiG9w0BBwGgggLuMIIC +6jCCAdKgAwIBAgIUL5E46FxyhsT7C3G1NS27OtR7XAowDQYJKoZIhvcNAQELBQAw +FTETMBEGA1UEAwwKUG9DIFNpZ25lcjAeFw0yNjA1MDgxMDIwNDhaFw0yNzA1MDgx +MDIwNDhaMBUxEzARBgNVBAMMClBvQyBTaWduZXIwggEiMA0GCSqGSIb3DQEBAQUA +A4IBDwAwggEKAoIBAQDSSu/gupmIlclvmTMHiqOrCqmB8NRTjAMoI//MPJrnFXYp +FjDPMk7Y/kCcHztudaIvADkowaFtOm4oMinQFhjwCNCo5K5WrrlAitnpcd5QH2nA +iVZXjjohQUJEd7n33AGqTwo5EGaCK+alAZL7tA7bdhNi/aZ33L3bUNYqoHbXiNsE +u1tj8frLfIjduOt0TMPSOrrFjjEsrL3T3tg+HmxpalDHz7E6o9zJu0wlk8bcR2Xk +mpX8RdYCu7K9m39N1F2WKa9WJh24NQLpWRfwD213jaIFK2EXy/XHePDUeiMYtVOV +oovCSmY7OqowupA7J+4dcsnRjFqgZECctHhAfk+PAgMBAAGjMjAwMB0GA1UdDgQW +BBRZlupXNYq4fny0SE76sr/CdQ2DUTAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3 +DQEBCwUAA4IBAQANOlttTWVz620JNTrPzhiR4x9+5UiF4GSqv8BRJQFj3Xh7fsUp ++3GDs9M27f4FVh3utJsjt7Sa9ZWLpBVdgjGBwGLAtPsoYMjhnUgZTUvwEk5+aXyv +zJxn4I7mMbDhlNCMHcVtGdtA+2UOEuvdGfuEilpzPsV8DzM1K3xU5bSWoo0BRFKK +srHkyEfxCFPAQOcX80ZbMO6zdcXeJjC6mQXGqy2aqeQob0vuSZJ7QHZBlRjY5YHR +wWlIqG8G3Eist16iTqdX2PQFZT1/QAEQ/LnXARTUUjUroccdci8YNASoeHDpcjRL +MBrN+QBNZVt5qLhDogwZb2ZwqKfZ8Aqg3oAkMYICPzCCAjsCAQEwLTAVMRMwEQYD +VQQDDApQb0MgU2lnbmVyAhQvkTjoXHKGxPsLcbU1Lbs61HtcCjANBglghkgBZQME +AgEFAKCB5DAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEP +Fw0yNjA1MDgxMDIwNDhaMC8GCSqGSIb3DQEJBDEiBCAvyoHfycLqb8UzVPizy1uA +o3h7tza3HebeiJaSnpIJHzB5BgkqhkiG9w0BCQ8xbDBqMAsGCWCGSAFlAwQBKjAL +BglghkgBZQMEARYwCwYJYIZIAWUDBAECMAoGCCqGSIb3DQMHMA4GCCqGSIb3DQMC +AgIAgDANBggqhkiG9w0DAgIBQDAHBgUrDgMCBzANBggqhkiG9w0DAgIBKDANBgkq +hkiG9w0BAQEFAASCAQBIpl7U2j4YiU1vdZHyx2dCK41ZahtTVOB4RVJcrmopgans +fICdkSTfb0dVqc13++bYn4i1b2R2os5YIkoGxdrM5aZB7KF9r1xwgrendTF4/BwP +gQq2khNtKebv9Yr0kOPynFIsgx5BHk99wrzfwidJUFuJJgQ9W0YOf7EGkbnZvPT+ +hV0aeLmJAb5jjWhbDciqUjR3O23JQhzVj4U3vo2TeN7VYmNJsX+fA4sZzIbYSei9 +ps7GZruiRcKgqgUj1l8HjIGMHqd9lccchk/BYyAGxAbgGisntvfJdPZO09wG8rHh +eS6FYkkXAKBO49WbhE9aVLJH0zgA6gTfyEvOOOS1 + +------E0314CC5D732C92AE2D7A3BACDCDCFCE-- + diff --git a/test/sslapitest.c b/test/sslapitest.c index 40922ce850e5..6d9d4eeb8fbd 100644 --- a/test/sslapitest.c +++ b/test/sslapitest.c @@ -8261,6 +8261,106 @@ end: } /* + * Callback that always returns ABORT for successfully decrypted tickets. + * Used by test_ticket_abort_session_leak to exercise the error path in + * tls_parse_ctos_psk() that previously leaked the SSL_SESSION. + */ +static SSL_TICKET_RETURN dec_tick_abort_cb(SSL *s, SSL_SESSION *ss, + const unsigned char *keyname, + size_t keyname_length, + SSL_TICKET_STATUS status, + void *arg) +{ + if (status == SSL_TICKET_SUCCESS || status == SSL_TICKET_SUCCESS_RENEW) + return SSL_TICKET_RETURN_ABORT; + + return SSL_TICKET_RETURN_IGNORE_RENEW; +} + +/* + * Test that returning SSL_TICKET_RETURN_ABORT from the decrypt ticket callback + * during TLS 1.3 resumption does not leak the SSL_SESSION allocated by + * tls_decrypt_ticket(). Before the fix, tls_parse_ctos_psk() would execute a + * bare "return 0" instead of "goto err", bypassing SSL_SESSION_free(sess). + * When run under LeakSanitizer the leaked session will be reported. + */ +static int test_ticket_abort_session_leak(void) +{ + SSL_CTX *cctx = NULL, *sctx = NULL; + SSL *clientssl = NULL, *serverssl = NULL; + SSL_SESSION *clntsess = NULL; + int testresult = 0; + +#ifdef OSSL_NO_USABLE_TLS1_3 + return 1; +#endif + + if (!TEST_true(create_ssl_ctx_pair(libctx, TLS_server_method(), + TLS_client_method(), + TLS1_3_VERSION, TLS1_3_VERSION, + &sctx, &cctx, cert, privkey))) + goto end; + + if (!TEST_true(SSL_CTX_set_session_cache_mode(sctx, SSL_SESS_CACHE_OFF))) + goto end; + + /* First handshake: use the normal gen/dec callbacks to get a ticket */ + if (!TEST_true(SSL_CTX_set_session_ticket_cb(sctx, gen_tick_cb, dec_tick_cb, + NULL))) + goto end; + + gen_tick_called = dec_tick_called = tick_key_cb_called = 0; + tick_dec_ret = SSL_TICKET_RETURN_USE_RENEW; + + if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, + NULL, NULL)) + || !TEST_true(create_ssl_connection(serverssl, clientssl, + SSL_ERROR_NONE))) + goto end; + + clntsess = SSL_get1_session(clientssl); + if (!TEST_ptr(clntsess)) + goto end; + + SSL_shutdown(clientssl); + SSL_shutdown(serverssl); + SSL_free(serverssl); + SSL_free(clientssl); + serverssl = clientssl = NULL; + + /* + * Second handshake (resumption): switch to the abort callback. + * The server will decrypt the ticket, allocate an SSL_SESSION, then the + * callback returns ABORT. The handshake must fail, and the session + * allocated inside tls_decrypt_ticket() must be freed (not leaked). + */ + if (!TEST_true(SSL_CTX_set_session_ticket_cb(sctx, gen_tick_cb, + dec_tick_abort_cb, NULL))) + goto end; + + if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, + NULL, NULL)) + || !TEST_true(SSL_set_session(clientssl, clntsess))) + goto end; + + /* Resumption should fail because the callback aborts */ + if (!TEST_false(create_ssl_connection(serverssl, clientssl, + SSL_ERROR_SSL))) + goto end; + + testresult = 1; + +end: + SSL_SESSION_free(clntsess); + SSL_free(serverssl); + SSL_free(clientssl); + SSL_CTX_free(sctx); + SSL_CTX_free(cctx); + + return testresult; +} + +/* * Test incorrect shutdown. * Test 0: client does not shutdown properly, * server does not set SSL_OP_IGNORE_UNEXPECTED_EOF, @@ -11474,6 +11574,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, 20); + ADD_TEST(test_ticket_abort_session_leak); ADD_ALL_TESTS(test_shutdown, 7); ADD_ALL_TESTS(test_incorrect_shutdown, 2); ADD_ALL_TESTS(test_cert_cb, 6); diff --git a/test/stack_test.c b/test/stack_test.c index 2175387c0844..7bea2a2b7f32 100644 --- a/test/stack_test.c +++ b/test/stack_test.c @@ -1,5 +1,5 @@ /* - * Copyright 2017-2021 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2017-2026 The OpenSSL Project Authors. All Rights Reserved. * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use @@ -29,17 +29,17 @@ typedef struct { int n; char c; -} SS; +} TST_SS; typedef union { int n; char c; -} SU; +} TST_SU; DEFINE_SPECIAL_STACK_OF(sint, int) DEFINE_SPECIAL_STACK_OF_CONST(uchar, unsigned char) -DEFINE_STACK_OF(SS) -DEFINE_STACK_OF_CONST(SU) +DEFINE_STACK_OF(TST_SS) +DEFINE_STACK_OF_CONST(TST_SU) static int int_compare(const int *const *a, const int *const *b) { @@ -255,25 +255,25 @@ end: return testresult; } -static SS *SS_copy(const SS *p) +static TST_SS *SS_copy(const TST_SS *p) { - SS *q = OPENSSL_malloc(sizeof(*q)); + TST_SS *q = OPENSSL_malloc(sizeof(*q)); if (q != NULL) memcpy(q, p, sizeof(*q)); return q; } -static void SS_free(SS *p) +static void SS_free(TST_SS *p) { OPENSSL_free(p); } static int test_SS_stack(void) { - STACK_OF(SS) *s = sk_SS_new_null(); - STACK_OF(SS) *r = NULL; - SS *v[10], *p; + STACK_OF(TST_SS) *s = sk_TST_SS_new_null(); + STACK_OF(TST_SS) *r = NULL; + TST_SS *v[10], *p; const int n = OSSL_NELEM(v); int i; int testresult = 0; @@ -286,25 +286,25 @@ static int test_SS_stack(void) goto end; v[i]->n = i; v[i]->c = 'A' + i; - if (!TEST_int_eq(sk_SS_num(s), i)) { + if (!TEST_int_eq(sk_TST_SS_num(s), i)) { TEST_info("SS stack size %d", i); goto end; } - sk_SS_push(s, v[i]); + sk_TST_SS_push(s, v[i]); } - if (!TEST_int_eq(sk_SS_num(s), n)) + if (!TEST_int_eq(sk_TST_SS_num(s), n)) goto end; /* deepcopy */ - r = sk_SS_deep_copy(NULL, &SS_copy, &SS_free); - if (sk_SS_num(r) != 0) + r = sk_TST_SS_deep_copy(NULL, &SS_copy, &SS_free); + if (sk_TST_SS_num(r) != 0) goto end; - sk_SS_free(r); - r = sk_SS_deep_copy(s, &SS_copy, &SS_free); + sk_TST_SS_free(r); + r = sk_TST_SS_deep_copy(s, &SS_copy, &SS_free); if (!TEST_ptr(r)) goto end; for (i = 0; i < n; i++) { - p = sk_SS_value(r, i); + p = sk_TST_SS_value(r, i); if (!TEST_ptr_ne(p, v[i])) { TEST_info("SS deepcopy non-copy %d", i); goto end; @@ -320,33 +320,33 @@ static int test_SS_stack(void) } /* pop_free - we rely on the malloc debug to catch the leak */ - sk_SS_pop_free(r, &SS_free); + sk_TST_SS_pop_free(r, &SS_free); r = NULL; /* delete_ptr */ - p = sk_SS_delete_ptr(s, v[3]); + p = sk_TST_SS_delete_ptr(s, v[3]); if (!TEST_ptr(p)) goto end; SS_free(p); - if (!TEST_int_eq(sk_SS_num(s), n - 1)) + if (!TEST_int_eq(sk_TST_SS_num(s), n - 1)) goto end; for (i = 0; i < n - 1; i++) - if (!TEST_ptr_eq(sk_SS_value(s, i), v[i < 3 ? i : 1 + i])) { + if (!TEST_ptr_eq(sk_TST_SS_value(s, i), v[i < 3 ? i : 1 + i])) { TEST_info("SS delete ptr item %d", i); goto end; } testresult = 1; end: - sk_SS_pop_free(r, &SS_free); - sk_SS_pop_free(s, &SS_free); + sk_TST_SS_pop_free(r, &SS_free); + sk_TST_SS_pop_free(s, &SS_free); return testresult; } static int test_SU_stack(void) { - STACK_OF(SU) *s = sk_SU_new_null(); - SU v[10]; + STACK_OF(TST_SU) *s = sk_TST_SU_new_null(); + TST_SU v[10]; const int n = OSSL_NELEM(v); int i; int testresult = 0; @@ -357,25 +357,25 @@ static int test_SU_stack(void) v[i].n = i; else v[i].c = 'A' + i; - if (!TEST_int_eq(sk_SU_num(s), i)) { + if (!TEST_int_eq(sk_TST_SU_num(s), i)) { TEST_info("SU stack size %d", i); goto end; } - sk_SU_push(s, v + i); + sk_TST_SU_push(s, v + i); } - if (!TEST_int_eq(sk_SU_num(s), n)) + if (!TEST_int_eq(sk_TST_SU_num(s), n)) goto end; /* check the pointers are correct */ for (i = 0; i < n; i++) - if (!TEST_ptr_eq(sk_SU_value(s, i), v + i)) { + if (!TEST_ptr_eq(sk_TST_SU_value(s, i), v + i)) { TEST_info("SU pointer check %d", i); goto end; } testresult = 1; end: - sk_SU_free(s); + sk_TST_SU_free(s); return testresult; } diff --git a/test/tls13tickettest.c b/test/tls13tickettest.c new file mode 100644 index 000000000000..9470f4169633 --- /dev/null +++ b/test/tls13tickettest.c @@ -0,0 +1,157 @@ +/* + * Copyright 2026 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 + */ + +#include <openssl/ssl.h> +#include "helpers/ssltestlib.h" +#include "testutil.h" + +struct stats { + unsigned int tickets; +}; + +static char *cert = NULL; +static char *pkey = NULL; +static int stats_idx = -1; + +static int stats_init(struct stats *stats) +{ + memset(stats, 0, sizeof(*stats)); + return 1; +} + +static int sess_new_cb(SSL *ssl, SSL_SESSION *session) +{ + struct stats *stats = SSL_get_ex_data(ssl, stats_idx); + if (stats == NULL) + return 0; + if (SSL_is_init_finished(ssl) == 0) + stats->tickets++; + return 0; +} + +static void handshake_finished(const SSL *ssl) +{ + const char *endpoint = SSL_is_server(ssl) ? "server" : "client"; + if (SSL_session_reused(ssl)) + TEST_info("%s: Abbreviated handshake finished", endpoint); + else + TEST_info("%s: Full handshake finished", endpoint); +} + +static void info_cb(const SSL *ssl, int type, int val) +{ + const char *endpoint = SSL_is_server(ssl) ? "server" : "client"; + + if (type & SSL_CB_ALERT) { + const char *dir = (type & SSL_CB_READ) ? "read" : "write"; + + TEST_info("%s: alert %s: %s : %s", endpoint, dir, + SSL_alert_type_string_long(val), + SSL_alert_desc_string_long(val)); + } + if (type & SSL_CB_HANDSHAKE_DONE) + handshake_finished(ssl); +} + +static int set_callbacks(SSL *ssl) +{ + SSL_set_info_callback(ssl, info_cb); + return 1; +} + +static int set_shutdown(SSL *c, SSL *s) +{ + SSL_set_shutdown(c, SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN); + SSL_set_shutdown(s, SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN); + return 1; +} + +static int enable_tickets(SSL_CTX *s, SSL_CTX *c) +{ + unsigned int cf = SSL_SESS_CACHE_CLIENT | SSL_SESS_CACHE_NO_INTERNAL_STORE; + unsigned int sf = SSL_SESS_CACHE_SERVER | SSL_SESS_CACHE_NO_INTERNAL_STORE; + + SSL_CTX_set_session_cache_mode(s, sf); + SSL_CTX_set_session_cache_mode(c, cf); + SSL_CTX_set_verify(c, SSL_VERIFY_NONE, NULL); + + SSL_CTX_sess_set_new_cb(s, sess_new_cb); + SSL_CTX_sess_set_new_cb(c, sess_new_cb); + + return 1; +} + +/* + * Verify ticket regeneration after fallback to a full handshake. If session + * resumption fails due to a ciphersuite mismatch, it falls back to a full + * handshake. In that case, ensure a new session ticket is issued reflecting the + * negotiated ciphersuite. + */ +static int test_tls13_ticket_ciphersuite_mismatch(void) +{ + struct stats stats1, stats2; + SSL_CTX *s_ctx = NULL, *c_ctx = NULL; + SSL *s_ssl = NULL, *c_ssl = NULL, *s = NULL, *c = NULL; + SSL_SESSION *sess = NULL; + int test; + + test = create_ssl_ctx_pair(NULL, TLS_server_method(), TLS_client_method(), + TLS1_3_VERSION, TLS1_3_VERSION, &s_ctx, &c_ctx, cert, pkey) + && TEST_true(SSL_CTX_set_ciphersuites(s_ctx, "TLS_AES_128_GCM_SHA256")) + && TEST_true(SSL_CTX_set_ciphersuites(c_ctx, "TLS_AES_128_GCM_SHA256")) + && TEST_true(enable_tickets(s_ctx, c_ctx)) + && TEST_true(create_ssl_objects(s_ctx, c_ctx, &s, &c, NULL, NULL)) + && TEST_true(set_callbacks(c)) + && TEST_true(set_callbacks(s)) + && TEST_true(stats_init(&stats1)) + && TEST_true(SSL_set_ex_data(c, stats_idx, &stats1)) + && TEST_true(create_ssl_connection(s, c, SSL_ERROR_NONE)) + && TEST_uint_eq(stats1.tickets, 2) + && TEST_true(set_shutdown(c, s)) + && TEST_ptr(sess = SSL_get1_session(c)) + && TEST_true(SSL_CTX_set_ciphersuites(s_ctx, "TLS_AES_256_GCM_SHA384")) + && TEST_true(SSL_CTX_set_ciphersuites(c_ctx, "TLS_AES_256_GCM_SHA384")) + && TEST_true(create_ssl_objects(s_ctx, c_ctx, &s_ssl, &c_ssl, NULL, NULL)) + && TEST_true(SSL_set_session(c_ssl, sess)) + && TEST_true(set_callbacks(c_ssl)) + && TEST_true(set_callbacks(s_ssl)) + && TEST_true(stats_init(&stats2)) + && TEST_true(SSL_set_ex_data(c_ssl, stats_idx, &stats2)) + && TEST_true(create_ssl_connection(s_ssl, c_ssl, SSL_ERROR_NONE)) + && TEST_false(SSL_session_reused(c_ssl)) + && TEST_uint_eq(stats2.tickets, 2); + + SSL_SESSION_free(sess); + SSL_free(s_ssl); + SSL_free(c_ssl); + SSL_free(s); + SSL_free(c); + SSL_CTX_free(s_ctx); + SSL_CTX_free(c_ctx); + return test; +} + +OPT_TEST_DECLARE_USAGE("\n") + +int setup_tests(void) +{ + if (!test_skip_common_options()) { + TEST_error("Error parsing test options\n"); + return 0; + } + + if (!TEST_ptr(cert = test_get_argument(0)) + || !TEST_ptr(pkey = test_get_argument(1))) + return 0; + + stats_idx = SSL_get_ex_new_index(0, NULL, NULL, NULL, NULL); + ADD_TEST(test_tls13_ticket_ciphersuite_mismatch); + + return 1; +} |
