From: jsing Date: Mon, 22 Jul 2024 14:50:45 +0000 (+0000) Subject: Revise regress to match cipher suite values change. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=0fe48b23e0c03f7d0589a25dafecc90a3388d68d;p=openbsd Revise regress to match cipher suite values change. --- diff --git a/regress/lib/libssl/asn1/asn1test.c b/regress/lib/libssl/asn1/asn1test.c index 6e9362b3e59..a81c5026551 100644 --- a/regress/lib/libssl/asn1/asn1test.c +++ b/regress/lib/libssl/asn1/asn1test.c @@ -1,4 +1,4 @@ -/* $OpenBSD: asn1test.c,v 1.12 2022/11/26 16:08:56 tb Exp $ */ +/* $OpenBSD: asn1test.c,v 1.13 2024/07/22 14:50:45 jsing Exp $ */ /* * Copyright (c) 2014, 2016 Joel Sing * @@ -82,7 +82,7 @@ unsigned char tlsext_tick[] = { struct ssl_asn1_test ssl_asn1_tests[] = { { .session = { - .cipher_id = 0x03000000L | 1, + .cipher_value = 1, .ssl_version = TLS1_2_VERSION, }, .asn1 = { @@ -94,7 +94,7 @@ struct ssl_asn1_test ssl_asn1_tests[] = { }, { .session = { - .cipher_id = 0x03000000L | 1, + .cipher_value = 1, .ssl_version = TLS1_2_VERSION, .master_key_length = 26, .session_id = "0123456789", @@ -119,7 +119,7 @@ struct ssl_asn1_test ssl_asn1_tests[] = { }, { .session = { - .cipher_id = 0x03000000L | 1, + .cipher_value = 1, .ssl_version = TLS1_2_VERSION, .master_key_length = 26, .session_id = "0123456789", @@ -232,7 +232,7 @@ struct ssl_asn1_test ssl_asn1_tests[] = { }, { .session = { - .cipher_id = 0x03000000L | 1, + .cipher_value = 1, .ssl_version = TLS1_2_VERSION, .timeout = -1, }, @@ -243,7 +243,7 @@ struct ssl_asn1_test ssl_asn1_tests[] = { }, { .session = { - .cipher_id = 0x03000000L | 1, + .cipher_value = 1, .ssl_version = TLS1_2_VERSION, .time = -1, }, @@ -276,9 +276,9 @@ session_cmp(SSL_SESSION *s1, SSL_SESSION *s2) s1->ssl_version, s2->ssl_version); return (1); } - if (s1->cipher_id != s2->cipher_id) { - fprintf(stderr, "cipher_id differs: %ld != %ld\n", - s1->cipher_id, s2->cipher_id); + if (s1->cipher_value != s2->cipher_value) { + fprintf(stderr, "cipher_value differs: %d != %d\n", + s1->cipher_value, s2->cipher_value); return (1); } diff --git a/regress/lib/libssl/tlsext/tlsexttest.c b/regress/lib/libssl/tlsext/tlsexttest.c index 18e800031af..d5c8840e244 100644 --- a/regress/lib/libssl/tlsext/tlsexttest.c +++ b/regress/lib/libssl/tlsext/tlsexttest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tlsexttest.c,v 1.90 2024/03/30 09:53:41 tb Exp $ */ +/* $OpenBSD: tlsexttest.c,v 1.91 2024/07/22 14:50:45 jsing Exp $ */ /* * Copyright (c) 2017 Joel Sing * Copyright (c) 2017 Doug Hogan @@ -1151,9 +1151,7 @@ test_tlsext_ecpf_server(void) errx(1, "failed to create session"); /* Setup the state so we can call needs. */ - if ((ssl->s3->hs.cipher = - ssl3_get_cipher_by_id(TLS1_CK_ECDHE_ECDSA_CHACHA20_POLY1305)) - == NULL) { + if ((ssl->s3->hs.cipher = ssl3_get_cipher_by_value(0xcca9)) == NULL) { FAIL("server cannot find cipher\n"); goto err; } @@ -3362,8 +3360,7 @@ test_tlsext_serverhello_build(void) ssl->s3->hs.our_max_tls_version = TLS1_3_VERSION; ssl->s3->hs.negotiated_tls_version = TLS1_3_VERSION; - ssl->s3->hs.cipher = - ssl3_get_cipher_by_id(TLS1_CK_RSA_WITH_AES_128_SHA256); + ssl->s3->hs.cipher = ssl3_get_cipher_by_value(0x003c); if (!tlsext_server_build(ssl, SSL_TLSEXT_MSG_SH, &cbb)) { FAIL("failed to build serverhello extensions\n"); @@ -3397,8 +3394,7 @@ test_tlsext_serverhello_build(void) /* Turn a few things on so we get extensions... */ ssl->s3->send_connection_binding = 1; - ssl->s3->hs.cipher = - ssl3_get_cipher_by_id(TLS1_CK_ECDHE_RSA_WITH_AES_128_SHA256); + ssl->s3->hs.cipher = ssl3_get_cipher_by_value(0xc027); ssl->tlsext_status_expected = 1; ssl->tlsext_ticket_expected = 1; if ((ssl->session->tlsext_ecpointformatlist = malloc(1)) == NULL) {