mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-22 23:05:41 +01:00
1499027d02
This commit modifies the ClientHello writing routine ssl_write_client_hello in ssl_cli.c to switch between (a) listing all runtime configured ciphersuites (in case MBEDTLS_SSL_SINGLE_CIPHERSUITE is not defined) (b) listing just the single hardcoded ciphersuite (in case MBEDTLS_SSL_SINGLE_CIPHERSUITE is defined) The approach taken is to introduce a pair of helper macros MBEDTLS_SSL_BEGIN_FOR_EACH_CIPHERSUITE( ssl, ver, info ) MBEDTLS_SSL_END_FOR_EACH_CIPHERSUITE which when delimiting a block of code lead to that block of code being run once for each ciphersuite that's enabled in the context `ssl` and version `ver`, referenced through the (fresh) `info` variable. Internally, this is implemented either through a plain `for` loop traversing the runtime configured ciphersuite list (if MBEDTLS_SSL_SINGLE_CIPHERSUITE is disabled) or by just hardcoding `info` to the single enabled ciphersuite (if MBEDTLS_SSL_SINGLE_CIPHERSUITE is enabled). These helper macros will prove useful whereever previous code traversed the runtime configured ciphersuite list, but adaptations of those occasions outside ClientHello writing are left for later commits. |
||
---|---|---|
.. | ||
mbedtls | ||
tinycrypt | ||
.gitignore | ||
CMakeLists.txt |