Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,12 @@ Following is a list of all options, where each is described in detail:
| *NX_CRYPTO_MAX_RSA_MODULUS_SIZE*
| Defined, this option gives the maximum RSA modulus expected, in bits. The default value is 4096 for a 4096-bit modulus. Other values can be 3072, 2048, or 1024 (not recommended).

| *NX_SECURE_TLS_CERTIFICATE_VERIFY_SIGNATURE_SIZE*
| Defined, this option gives the size in bytes of the per-session buffer used to build and check the PKCS#1 encoded CertificateVerify signature. It must be at least as large as the largest RSA modulus in use, so the default of 600 covers the 4096-bit default of NX_CRYPTO_MAX_RSA_MODULUS_SIZE. Lower it to reduce the cryptographic metadata each TLS session needs when the largest certificate key in use is known to be smaller.

| *NX_SECURE_TLS_CERTIFICATE_VERIFY_PSS_SCRATCH_SIZE*
| Defined, this option gives the size in bytes of the per-session EMSA-PSS working area used when checking an RSA-PSS CertificateVerify signature in TLS 1.3. The default of 600 covers a 4096-bit modulus with SHA-512. It has no effect unless TLS 1.3 is enabled.

| *NX_SECURE_DTLS_COOKIE_LENGTH*
| Defined, this option gives the maximum length of DTLS cookie.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,12 @@ There are several configuration options for building NetX Duo Secure. Following
| *NX_CRYPTO_MAX_RSA_MODULUS_SIZE*
| Defined, this option gives the maximum RSA modulus expected, in bits. The default value is 4096 for a 4096-bit modulus. Other values can be 3072, 2048, or 1024 (not recommended).

| *NX_SECURE_TLS_CERTIFICATE_VERIFY_SIGNATURE_SIZE*
| Defined, this option gives the size in bytes of the per-session buffer used to build and check the PKCS#1 encoded CertificateVerify signature. It must be at least as large as the largest RSA modulus in use, so the default of 600 covers the 4096-bit default of NX_CRYPTO_MAX_RSA_MODULUS_SIZE. Lower it to reduce the cryptographic metadata each TLS session needs when the largest certificate key in use is known to be smaller.

| *NX_SECURE_TLS_CERTIFICATE_VERIFY_PSS_SCRATCH_SIZE*
| Defined, this option gives the size in bytes of the per-session EMSA-PSS working area used when checking an RSA-PSS CertificateVerify signature in TLS 1.3. The default of 600 covers a 4096-bit modulus with SHA-512. It has no effect unless TLS 1.3 is enabled.

| *NX_SECURE_ALLOW_SELF_SIGNED_CERTIFICATES*
| Defined, this option allows TLS to accept self-signed certificates from a remote host. By default, TLS will reject self-signed server certificates as a security precaution. If this macro is defined, self-signed certificates must still be added to the trusted store to be accepted.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1497,6 +1497,8 @@ Before the TLS session is created, the metadata buffer must be allocated. The bu

In order to make calculating the metadata buffer size easy, the service _nx_secure_metadata_size_calculate_ performs the same calculations as nx_secure_tls_session_create but simply returns the total required metadata buffer size in bytes.

The metadata buffer also holds the working buffers used to build and check the CertificateVerify signature. Those buffers hold one session's handshake hash and signature block, so they are reserved per session: two TLS sessions authenticating with a certificate at the same time would otherwise overwrite each other's data and produce or reject an incorrect signature. Their size is governed by NX_SECURE_TLS_CERTIFICATE_VERIFY_SIGNATURE_SIZE and, for TLS 1.3, NX_SECURE_TLS_CERTIFICATE_VERIFY_PSS_SCRATCH_SIZE. Because the required buffer size therefore depends on the configuration, always size the metadata buffer with nx_secure_tls_metadata_size_calculate rather than with a hard-coded value; a buffer that is too small makes nx_secure_tls_session_create return NX_INVALID_PARAMETERS. The buffers are not reserved when NX_SECURE_DISABLE_X509 is defined.

=== Initializing the TLS session

Once the NX_CRYPTO_METHOD and NX_SECURE_TLS_CRYPTO objects are created and the metadata area reserved, we can initialize a TLS session as follows (values taken from the above examples):
Expand Down