Skip to content

Commit

Permalink
mbedTLS: Implemented CURLOPT_SSL_CIPHER_LIST option
Browse files Browse the repository at this point in the history
Use a lookup list to set the cipher suites, allowing the
ciphers to be set by either openssl or IANA names.

To keep the binary size of the lookup list down we compress
each entry in the cipher list down to 2 + 6 bytes using the
C preprocessor.
  • Loading branch information
jan2000 committed Apr 22, 2024
1 parent d1a8b35 commit b35aea9
Show file tree
Hide file tree
Showing 10 changed files with 1,476 additions and 16 deletions.
14 changes: 8 additions & 6 deletions docs/libcurl/opts/CURLOPT_PROXY_SSL_CIPHER_LIST.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ TLS-backend:
- Secure Transport
- wolfSSL
- GnuTLS
- mbedTLS
---

# NAME
Expand Down Expand Up @@ -49,12 +50,13 @@ set when you compile OpenSSL.
For WolfSSL, valid examples of cipher lists include **ECDHE-RSA-RC4-SHA**,
**AES256-SHA:AES256-SHA256**, etc.
For BearSSL, valid examples of cipher lists include
**ECDHE-RSA-CHACHA20-POLY1305:ECDHE-RSA-AES128-GCM-SHA256**, or when using IANA names
For mbedTLS and BearSSL, valid examples of cipher lists include
**ECDHE-RSA-CHACHA20-POLY1305:ECDHE-RSA-AES128-GCM-SHA256**, or when using
IANA names
**TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256:TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256**,
etc.
With BearSSL you do not add/remove ciphers. If one uses this option then all
known ciphers are disabled and only those passed in are enabled.
etc. With mbedTLS and BearSSL you do not add/remove ciphers. If one uses this
option then all known ciphers are disabled and only those passed in are
enabled.
Find more details about cipher lists on this URL:
Expand Down Expand Up @@ -86,7 +88,7 @@ int main(void)

# AVAILABILITY

Added in 7.52.0, in 7.83.0 for BearSSL
Added in 7.52.0, in 7.83.0 for BearSSL, in 8.8.0 for mbedTLS

If built TLS enabled.

Expand Down
10 changes: 6 additions & 4 deletions docs/libcurl/opts/CURLOPT_SSL_CIPHER_LIST.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ TLS-backend:
- Secure Transport
- wolfSSL
- GnuTLS
- mbedTLS
---

# NAME
Expand Down Expand Up @@ -48,12 +49,13 @@ you compile OpenSSL.
For WolfSSL, valid examples of cipher lists include **ECDHE-RSA-RC4-SHA**,
**AES256-SHA:AES256-SHA256**, etc.
For BearSSL, valid examples of cipher lists include
For mbedTLS and BearSSL, valid examples of cipher lists include
**ECDHE-RSA-CHACHA20-POLY1305:ECDHE-RSA-AES128-GCM-SHA256**, or when using
IANA names
**TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256:TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256**,
etc. With BearSSL you do not add/remove ciphers. If one uses this option then
all known ciphers are disabled and only those passed in are enabled.
etc. With mbedTLS and BearSSL you do not add/remove ciphers. If one uses this
option then all known ciphers are disabled and only those passed in are
enabled.
For Schannel, you can use this option to set algorithms but not specific
cipher suites. Refer to the ciphers lists document for algorithms.
Expand Down Expand Up @@ -87,7 +89,7 @@ int main(void)

# AVAILABILITY

Added in 7.9, in 7.83.0 for BearSSL
Added in 7.9, in 7.83.0 for BearSSL, in 8.8.0 for mbedTLS

If built TLS enabled.

Expand Down
2 changes: 2 additions & 0 deletions lib/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ LIB_VAUTH_HFILES = \

LIB_VTLS_CFILES = \
vtls/bearssl.c \
vtls/cipher_suite.c \
vtls/gtls.c \
vtls/hostcheck.c \
vtls/keylog.c \
Expand All @@ -60,6 +61,7 @@ LIB_VTLS_CFILES = \

LIB_VTLS_HFILES = \
vtls/bearssl.h \
vtls/cipher_suite.h \
vtls/gtls.h \
vtls/hostcheck.h \
vtls/keylog.h \
Expand Down
Loading

0 comments on commit b35aea9

Please sign in to comment.