[openssl/openssl] e1febb: Port script10

"'Andrew Dinh' via openssl-commits" <[email protected]> Fri, 17 Jul 2026 01:03:38 -0700
Newsgroups gmane.comp.encryption.openssl.cvs
Message-ID <openssl/openssl/push/refs/heads/master/[email protected]>
  Branch: refs/heads/master
  Home:   https://github.com/openssl/openssl
  Commit: e1febbd01a416bc722cfda8fe89ce91608443f06
      https://github.com/openssl/openssl/commit/e1febbd01a416bc722cfda8fe89ce91608443f06
  Author: Andrew Dinh <[email protected]>
  Date:   2026-07-17 (Fri, 17 Jul 2026)

  Changed paths:
    M test/quic_multistream_test.c
    M test/radix/quic_tests.c

  Log Message:
  -----------
  Port script10

Assisted-by: Claude:claude-sonnet-4-6

Reviewed-by: Neil Horman <[email protected]>
Reviewed-by: Saša Nedvědický <[email protected]>
MergeDate: Fri Jul 17 08:02:00 2026
(Merged from https://github.com/openssl/openssl/pull/31821)


  Commit: c86b202ef4973e0e4d4dcc48d56db0c8b0a834c5
      https://github.com/openssl/openssl/commit/c86b202ef4973e0e4d4dcc48d56db0c8b0a834c5
  Author: Andrew Dinh <[email protected]>
  Date:   2026-07-17 (Fri, 17 Jul 2026)

  Changed paths:
    M test/quic_multistream_test.c
    M test/radix/quic_tests.c

  Log Message:
  -----------
  Port script11

Assisted-by: Claude:claude-sonnet-4-6

Reviewed-by: Neil Horman <[email protected]>
Reviewed-by: Saša Nedvědický <[email protected]>
MergeDate: Fri Jul 17 08:02:02 2026
(Merged from https://github.com/openssl/openssl/pull/31821)


  Commit: 4eab5e3bb2d17e44da2c9d22e56085b700841788
      https://github.com/openssl/openssl/commit/4eab5e3bb2d17e44da2c9d22e56085b700841788
  Author: Andrew Dinh <[email protected]>
  Date:   2026-07-17 (Fri, 17 Jul 2026)

  Changed paths:
    M test/quic_multistream_test.c
    M test/radix/quic_tests.c

  Log Message:
  -----------
  Port script12

Assisted-by: Claude:claude-sonnet-4-6

Reviewed-by: Neil Horman <[email protected]>
Reviewed-by: Saša Nedvědický <[email protected]>
MergeDate: Fri Jul 17 08:02:03 2026
(Merged from https://github.com/openssl/openssl/pull/31821)


  Commit: 98a726d3ca369960d676e2691ca734448ef1a672
      https://github.com/openssl/openssl/commit/98a726d3ca369960d676e2691ca734448ef1a672
  Author: Andrew Dinh <[email protected]>
  Date:   2026-07-17 (Fri, 17 Jul 2026)

  Changed paths:
    M test/radix/quic_bindings.c
    M test/radix/quic_ops.c
    M test/radix/quic_tests.c

  Log Message:
  -----------
  Introduce OP_BIND() to QUIC RADIX test framework

RADIX framework keeps objects needed by test scripts
in two places:
  - hash table bound to radix process (`RP()->objs`), all
  objects are stored there
  - slot which is an array bound to radix thread (`RT()->slot[]`)

The `slot` is an array which is used to pass arguments
to RADIX ops. The typically script is doing something
like this:
```
   OP_SELECT_SSL(0, C); /* places 'C' object to slot 0 in thread */
   OP_FUNC(print_ssl);  /* calls print_ssl function, which prints object */
```
All objects are managed by RADIX framework, scripts have very
limited options to control object's lifetime. The only way for
scripts to let object go is to use `OP_UNBIND()`. The operation
removes the object from hastable (`RP()->objs`) and frees the
object afterwards. This is good enough as long a all tests
are running in single thread. Currently `OP_UNBIND()` is
required when test needs to accept/create more than one stream.
The test has two options. It can use unique name for each
stream it creates/accepts:
```
   OP_ACCEPT_STREAM_WAIT(C, C0, 0);
   OP_ACCEPT_STREAM_WAIT(C, C1, 0);
   OP_ACCEPT_STREAM_WAIT(C, C2, 0);
```
Or script may re-use the same variable for stream,
in that case `OP_UNBIND()` is needed:
```
   OP_ACCEPT_STREAM_WAIT(C, C0, 0);
   OP_UNBIND(C0);
   OP_ACCEPT_STREAM_WAIT(C, C0, 0);
   OP_UNBIND(C0);
   OP_ACCEPT_STREAM_WAIT(C, C0, 0);
   OP_UNBIND(C0);
```
Unfortunately `OP_UNBIND()` can not be used when test
uses more than one thread due to missing locking of `RP()->objs`.

Introducing a locking scheme seems to be bit invasive change,
The OP_BIND()  here hopes to be sufficient and good enough for now.

The idea is as follows:
  - `OP_BIND()` allows  script to insert empty object
  into `RP()->objs` OP_BIND() is supposed to run before
  script spawns thread(s). No manipulation of `RP()->objs`
  is allowed after threads are spawned, operations
  OP_BIND()/OP_UNBIND() are not thread safe.

  - Introduce `OP_F_REPLACE_STREAM` flag which tells
  `OP_ACCEPT_STREAM_WAIT()`/`OP_NEW_STREAM()` to re-use
   existing id for stream. This `_REPLACE_` flag requires
   read-only access to `RP()->objs` hash table.

  - change introduces a per radix object mutex so object can
  be updated safely w.r.t. RADIX thread which ticks SSL object
  bound in radix object.

The guideline for tests which require more then one thread
is as follows:
   - the first thread creates complete set of empty objects
   for all threads.

   - each test thread gets its own set of variables, so it
   can populate them later during test with SSL objects

   - objects are not supposed to be shared between threads

This is a snippet of script executed by main thread before
additional threads are spawned:

```
   ...
   OP_BIND(C1);  /* stream id for child */
   OP_BIND(S1);  /* stream id for parent */

   OP_SPAWN_THREAD(child);
   for (i = 0; i < 10; i++) {
      OP_NEW_STREAM(S, S1, OP_F_REPLACE_STREAM);
      OP_WRITE_B(S1, "foo");
      OP_CONCLUDE(S1);
   }
```
This snippet comes from child:
```
   for (i = 0; i < 10; i++) {
      OP_ACCEPT_STREAM_WAIT(C, C1, OP_F_REPLACE_STREAM);
      OP_READ_EXPECT_B(C1, "foo");
      OP_EXPECT_FIN(C1);
   }
```
As you can see parent and child don't use OP_BIND()/OP_UNBIND()
after child thread is spawned.

Reviewed-by: Neil Horman <[email protected]>
Reviewed-by: Saša Nedvědický <[email protected]>
MergeDate: Fri Jul 17 08:02:04 2026
(Merged from https://github.com/openssl/openssl/pull/31821)


Compare: https://github.com/openssl/openssl/compare/e8a742176a23...98a726d3ca36

To unsubscribe from these emails, change your notification settings at https://github.com/openssl/openssl/settings/notifications

-- 
You received this message because you are subscribed to the Google Groups "openssl-commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/a/openssl.org/d/msgid/openssl-commits/openssl/openssl/push/refs/heads/master/e8a742-98a726%40github.com.