Skip to content

Commit 112ea8a

Browse files
committed
Add TLS and RSA missing macros
1 parent ca33469 commit 112ea8a

1 file changed

Lines changed: 224 additions & 12 deletions

File tree

wolfSSL/src/chapter02.md

Lines changed: 224 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,90 @@ Removes support for the RSA algorithm.
428428
429429
Removes code for OAEP padding.
430430
431+
#### WOLFSSL_RSA_VERIFY_INLINE
432+
433+
Enables inline RSA verify, returning a pointer into the input buffer rather than copying the output. Reduces memory usage for RSA verify operations.
434+
435+
#### WC_RSA_DIRECT
436+
437+
Enables the direct RSA encrypt/decrypt API (`wc_RsaDirect`). Provides raw RSA operations without padding, useful for custom protocols.
438+
439+
#### WC_RSA_NO_PADDING
440+
441+
Enables the no-padding RSA mode. Allows RSA operations without any padding scheme applied. Use with caution - typically only for custom implementations.
442+
443+
#### WOLFSSL_RSA_KEY_CHECK
444+
445+
Enables RSA key pair consistency checking via `wc_CheckRsaKey()`. Validates that the public and private key components are mathematically consistent.
446+
447+
#### WOLFSSL_RSA_CHECK_D_ON_DECRYPT
448+
449+
Validates the RSA private exponent `d` before each decrypt operation. Provides additional security against fault injection attacks at the cost of performance.
450+
451+
#### WOLFSSL_RSA_DECRYPT_TO_0_LEN
452+
453+
Allows RSA decrypt operations to return a zero-length result (empty plaintext). By default, a zero-length decryption result is treated as an error.
454+
455+
#### NO_RSA_BOUNDS_CHECK
456+
457+
Disables bounds checking on RSA input data. By default, wolfSSL validates that the input value is less than the RSA modulus.
458+
459+
#### SHOW_GEN
460+
461+
Enables progress indicator (dots) during RSA key generation. Useful for user feedback during long key generation operations.
462+
463+
#### WOLFSSL_PSS_LONG_SALT
464+
465+
Allows RSA-PSS signatures to use a salt length longer than the hash output length. Some implementations use salt length equal to the key size minus overhead.
466+
467+
#### WOLFSSL_PSS_SALT_LEN_DISCOVER
468+
469+
Enables automatic discovery of the PSS salt length during RSA-PSS signature verification. Tries different salt lengths to find a match.
470+
471+
#### WC_RSA_NONBLOCK_TIME
472+
473+
Enables time-based non-blocking RSA operations. Allows RSA operations to yield after a configurable time period. Requires [`WC_RSA_NONBLOCK`](#wc_rsa_nonblock).
474+
475+
#### WOLFSSL_MP_INVMOD_CONSTANT_TIME
476+
477+
Uses constant-time modular inverse computation. Protects against timing side-channel attacks during RSA private key operations.
478+
479+
#### WC_RSA_NO_FERMAT_CHECK
480+
481+
Disables the Fermat factorization proximity check during RSA key generation. By default, wolfSSL verifies that `p` and `q` are not too close together, which would make the key vulnerable to Fermat's factorization method.
482+
483+
#### FP_MAX_BITS
484+
485+
Sets the maximum key size in bits when using fast math (`USE_FAST_MATH`). The value should be set to key size times 2. For example, for RSA 3072 set to 6144. Default is 4096 (supporting up to RSA 2048).
486+
487+
#### WOLFSSL_HAVE_SP_RSA
488+
489+
Enables Single Precision (SP) math optimizations for RSA operations. SP math provides significant performance improvements for common key sizes (2048, 3072, 4096).
490+
491+
#### WOLFSSL_SP_ASM
492+
493+
Enables assembly-optimized SP math routines. Provides maximum performance for RSA, ECC, and DH operations on supported platforms (x86_64, ARM, RISC-V).
494+
495+
#### WC_ASYNC_ENABLE_RSA
496+
497+
Enables asynchronous RSA operations via the wolfSSL async crypto framework. Allows RSA operations to be offloaded to hardware accelerators.
498+
499+
#### WOLFSSL_KCAPI_RSA
500+
501+
Enables RSA operations through the Linux kernel crypto API (AF_ALG). Offloads RSA to the kernel's crypto subsystem.
502+
503+
#### WOLFSSL_AFALG_XILINX_RSA
504+
505+
Enables RSA acceleration through AF_ALG on Xilinx platforms using Xilinx crypto hardware.
506+
507+
#### WOLFSSL_SE050_NO_RSA
508+
509+
Disables RSA through the NXP SE050 secure element. Other SE050 operations remain available.
510+
511+
#### WOLFSSL_XILINX_CRYPT
512+
513+
Enables Xilinx hardware crypto acceleration for RSA and other algorithms on Xilinx FPGA/SoC platforms.
514+
431515
#### NO_AES_CBC
432516
433517
Turns off AES-CBC algorithm support.
@@ -564,10 +648,6 @@ Define to exlude TLS 1.2.
564648

565649
Key and cert generation feature support for disabling PEM to DER.
566650

567-
#### NO_DEV_URANDOM
568-
569-
Disables the use of `/dev/urandom`
570-
571651
#### WOLFSSL_NO_SIGALG
572652

573653
Disables the signature algorithms extension
@@ -646,6 +726,102 @@ Allows loading DER-formatted CA certs into the wolfSSL context (`WOLFSSL_CTX`) u
646726

647727
Turns on the use of DTLS, or datagram TLS. This isn't widely supported or used.
648728
729+
#### WOLFSSL_DTLS_CID
730+
731+
Enables DTLS Connection ID support (RFC 9146). Allows DTLS connections to survive IP address changes by identifying connections with a CID rather than the transport address.
732+
733+
#### WOLFSSL_ALLOW_TLSV10
734+
735+
Allows TLS 1.0 connections. TLS 1.0 is disabled by default for security reasons. Only enable when legacy compatibility is required.
736+
737+
#### WOLFSSL_EITHER_SIDE
738+
739+
Allows the same `WOLFSSL_CTX` to be used for both client and server connections. By default, a context is configured for either client or server at creation time.
740+
741+
#### HAVE_SNI
742+
743+
Enables Server Name Indication (SNI) TLS extension support (RFC 6066). Allows clients to indicate which hostname they are connecting to, enabling virtual hosting over TLS.
744+
745+
#### WOLFSSL_ALWAYS_KEEP_SNI
746+
747+
Keeps the SNI value in the SSL session after the handshake completes. By default, the SNI data is freed after the handshake to save memory.
748+
749+
#### HAVE_TRUNCATED_HMAC
750+
751+
Enables the Truncated HMAC TLS extension (RFC 6066). Allows using 80-bit HMAC tags instead of the full size to reduce bandwidth.
752+
753+
#### HAVE_SECURE_RENEGOTIATION
754+
755+
Enables secure renegotiation support (RFC 5746). Allows TLS connections to renegotiate cipher suites and keys during an active session.
756+
757+
#### HAVE_SERVER_RENEGOTIATION_INFO
758+
759+
Enables the server-side renegotiation info extension. Indicates secure renegotiation support in server hello messages.
760+
761+
#### HAVE_SESSION_TICKET
762+
763+
Enables TLS session ticket support (RFC 5077). Allows the server to issue session tickets for faster resumption without server-side session state. Required for TLS 1.3 resumption.
764+
765+
#### HAVE_TRUSTED_CA
766+
767+
Enables the Trusted CA Indication TLS extension (RFC 4366). Allows the client to indicate which CA certificates it trusts, helping the server select the appropriate certificate chain.
768+
769+
#### HAVE_RPK
770+
771+
Enables Raw Public Key support (RFC 7250). Allows using raw public keys instead of X.509 certificates in TLS, reducing handshake overhead for constrained environments.
772+
773+
#### HAVE_ECH
774+
775+
Enables Encrypted Client Hello (ECH) support. Encrypts the ClientHello to protect sensitive fields like SNI from passive observers.
776+
777+
#### WOLFSSL_NO_CA_NAMES
778+
779+
Disables sending CA names in the CertificateRequest message. Reduces handshake message size when the server has many trusted CAs.
780+
781+
#### WOLFSSL_NO_SERVER_GROUPS_EXT
782+
783+
Prevents the server from sending its supported groups in a TLS extension when the server's top preference is not in the client's list.
784+
785+
#### HAVE_FFDHE
786+
787+
Enables Finite Field Diffie-Hellman Ephemeral (FFDHE) key exchange using standardized groups from RFC 7919.
788+
789+
#### HAVE_SECRET_CALLBACK
790+
791+
Enables the TLS secret callback, allowing applications to receive TLS key material during the handshake. Used for key logging, debugging, and integration with external tools.
792+
793+
#### HAVE_PK_CALLBACKS
794+
795+
Enables public key operation callbacks, allowing applications to override the default RSA, ECC, and DH operations with custom implementations (e.g., HSM or secure element integration).
796+
797+
#### WOLFSSL_SNIFFER
798+
799+
Enables TLS packet sniffing support. Allows decrypting and inspecting TLS traffic using the wolfSSL sniffer library with the private key.
800+
801+
#### HAVE_WEBSERVER
802+
803+
Enables web server-oriented features in wolfSSL, such as additional HTTP helper functions.
804+
805+
#### NO_CERTS
806+
807+
Disables all certificate processing in wolfSSL. Use for PSK-only configurations where no certificate handling is needed, significantly reducing code size.
808+
809+
#### WOLFSSL_HAVE_PRF
810+
811+
Enables access to the TLS Pseudo-Random Function (PRF). Allows applications to derive additional keying material using the TLS PRF.
812+
813+
#### WOLFSSL_REQUIRE_TCA
814+
815+
Requires that the client send the Trusted CA extension. If the extension is missing, the handshake will fail.
816+
817+
#### WOLFSSL_DH_EXTRA
818+
819+
Stores additional DH key information in the SSL object. Provides access to DH parameters and keys after the handshake.
820+
821+
#### WOLFSSL_CURVE25519_BLINDING
822+
823+
Enables blinding for Curve25519 operations during TLS key exchange. Protects against timing side-channel attacks.
824+
649825
#### WOLFSSL_KEY_GEN
650826
651827
Turns on wolfSSL’s RSA key generation functionality. See [Keys and Certificates](chapter07.md#keys-and-certificates) for more information.
@@ -912,10 +1088,6 @@ OpenSSL compatibility specific. Enable DH Extra for QT, OpenSSL all, OpenSSH, an
9121088

9131089
OpenSSL compatibility specific macro.
9141090

915-
#### WOLFSSL_ASN_TEMPLATE
916-
917-
Use newer ASN template asn.c code (default). Daul algo certificate features. Dual alg cert support requires the ASN.1 template feature.
918-
9191091
#### WOLFSSL_ASYNC_IO
9201092

9211093
Used in async cleanup.
@@ -1160,10 +1332,6 @@ Used for Certificate revocation as a cert status request feature.
11601332
11611333
Used for Certificate revocation as a cert status request feature.
11621334
1163-
#### HAVE_IO_TIMEOUT
1164-
1165-
Certificate revocation. IO options enable support for connect timeout, but the default is off.
1166-
11671335
#### HAVE_CURL
11681336
11691337
Used for building a subset of the wolfSSL library when linking with cURL.
@@ -1420,6 +1588,50 @@ Enable middlebox compatibility in the TLS 1.3 handshake. This includes sending C
14201588
14211589
Allow generation of SHA-512 digests in handshake - no ciphersuite requires SHA-512 at this time. This enables calculation of a SHA2-512 hash for the handshake messages even though its not used by TLS v1.3 yet.
14221590
1591+
#### WOLFSSL_TLS13_TICKET_BEFORE_FINISHED
1592+
1593+
Allows the server to send a NewSessionTicket message before receiving the client's Finished message. See TLS 1.3 specification, Section 4.6.1, Paragraph 4.
1594+
1595+
#### WOLFSSL_EARLY_DATA
1596+
1597+
Enables TLS 1.3 0-RTT (Zero Round Trip Time) early data support. Allows clients to send application data in the first flight of the handshake for faster connection establishment. Requires session resumption via PSK or session tickets.
1598+
1599+
#### WOLFSSL_EARLY_DATA_GROUP
1600+
1601+
Groups the early data message with the ClientHello when sending. Reduces the number of network round trips by combining messages.
1602+
1603+
#### WOLFSSL_CHECK_SIG_FAULTS
1604+
1605+
Verifies the ECC signature after signing to detect fault injection attacks. Useful in environments where hardware fault attacks are a concern.
1606+
1607+
#### WOLFSSL_PSK_ID_PROTECTION
1608+
1609+
Enables PSK identity protection in TLS 1.3. Encrypts the PSK identity to prevent passive observers from tracking clients by their PSK identity.
1610+
1611+
#### WOLFSSL_NO_CLIENT_CERT_ERROR
1612+
1613+
When enabled, the server requires the client to send a valid certificate. If the client does not provide one, the handshake fails with an error.
1614+
1615+
#### WOLFSSL_NONBLOCK_OCSP
1616+
1617+
Enables non-blocking OCSP stapling processing. Allows OCSP lookups to be performed asynchronously during the TLS handshake.
1618+
1619+
#### WOLFSSL_TLS_OCSP_MULTI
1620+
1621+
Enables support for multiple OCSP responses in TLS, allowing stapling of OCSP responses for intermediate certificates in addition to the end-entity certificate.
1622+
1623+
#### WOLFSSL_CERT_SETUP_CB
1624+
1625+
Enables a certificate setup callback that is invoked during the TLS 1.3 handshake. Allows dynamic certificate and key selection based on the ClientHello contents.
1626+
1627+
#### WOLFSSL_RW_THREADED
1628+
1629+
Enables read/write threading support, allowing separate threads to perform TLS read and write operations concurrently on the same SSL session.
1630+
1631+
#### WOLFSSL_PRIORITIZE_PSK
1632+
1633+
During a TLS 1.3 handshake, prioritizes PSK order instead of ciphersuite order when selecting a cipher suite. The PSK callback order determines preference.
1634+
14231635
#### WOLFSSL_UIP
14241636
14251637
When CONTIKI is defined, it is an implementation of UIP.

0 commit comments

Comments
 (0)