Skip to content

Commit d4c3ebb

Browse files
authored
(docs): Reordered and moved usage guide into an mdbook (#4300)
1 parent aae820d commit d4c3ebb

29 files changed

+1067
-1068
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ If you have any questions about submitting PRs, s2n-tls API usage, or something
4444

4545
## Documentation
4646

47-
s2n-tls uses [Doxygen](https://doxygen.nl/index.html) to document its public API. The latest s2n-tls documentation can be found on [GitHub pages](https://aws.github.io/s2n-tls/doxygen/). The [Usage Guide](docs/USAGE-GUIDE.md) explains how different TLS features can be configured and used.
47+
s2n-tls uses [Doxygen](https://doxygen.nl/index.html) to document its public API. The latest s2n-tls documentation can be found on [GitHub pages](https://aws.github.io/s2n-tls/doxygen/). The [Usage Guide](docs/usage-guide/) explains how different TLS features can be configured and used.
4848

4949
Documentation for older versions or branches of s2n-tls can be generated locally. To generate the documentation, install doxygen and run `doxygen docs/doxygen/Doxyfile`. The doxygen documentation can now be found at `docs/doxygen/output/html/index.html`.
5050

@@ -77,7 +77,7 @@ int bytes_written;
7777
bytes_written = s2n_send(conn, "Hello World", sizeof("Hello World"), &blocked);
7878
```
7979

80-
For details on building the s2n-tls library and how to use s2n-tls in an application you are developing, see the [usage guide](https://github.com/aws/s2n-tls/blob/main/docs/USAGE-GUIDE.md).
80+
For details on building the s2n-tls library and how to use s2n-tls in an application you are developing, see the [usage guide][Usage Guide](docs/usage-guide).
8181

8282
## s2n-tls features
8383

api/s2n.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ S2N_API extern int *s2n_errno_location(void);
142142
* error. To retrieve the type for a given error use `s2n_error_get_type()`. Applications should
143143
* perform any error handling logic using these high level types.
144144
*
145-
* See the [Error Handling](https://github.com/aws/s2n-tls/blob/main/docs/USAGE-GUIDE.md#error-handling) section for how the errors should be interpreted.
145+
* See the [Error Handling](https://github.com/aws/s2n-tls/blob/main/docs/usage-guide/topics/ch03-error-handling.md) section for how the errors should be interpreted.
146146
*/
147147
typedef enum {
148148
/** No error */
@@ -673,7 +673,7 @@ S2N_API extern int s2n_cert_chain_and_key_load_pem_bytes(struct s2n_cert_chain_a
673673
/**
674674
* Associates a public certificate chain with a `s2n_cert_chain_and_key` object. It does
675675
* NOT set a private key, so the connection will need to be configured to
676-
* [offload private key operations](https://github.com/aws/s2n-tls/blob/main/docs/USAGE-GUIDE.md#offloading-asynchronous-private-key-operations).
676+
* [offload private key operations](https://github.com/aws/s2n-tls/blob/main/docs/usage-guide/topics/ch12-private-key-ops.md).
677677
*
678678
* @param chain_and_key The certificate chain and private key handle
679679
* @param chain_pem A byte array of a PEM encoded certificate chain.
@@ -1043,7 +1043,7 @@ S2N_API extern int s2n_config_add_dhparams(struct s2n_config *config, const char
10431043
* Sets the security policy that includes the cipher/kem/signature/ecc preferences and
10441044
* protocol version.
10451045
*
1046-
* See the [USAGE-GUIDE.md](https://github.com/aws/s2n-tls/blob/main/docs/USAGE-GUIDE.md) for how to use security policies.
1046+
* See the [USAGE-GUIDE.md](https://github.com/aws/s2n-tls/blob/main/docs/usage-guide) for how to use security policies.
10471047
*/
10481048
S2N_API extern int s2n_config_set_cipher_preferences(struct s2n_config *config, const char *version);
10491049

@@ -3295,7 +3295,7 @@ S2N_API int s2n_connection_get_max_early_data_size(struct s2n_connection *conn,
32953295
/**
32963296
* Called by the client to begin negotiation and send early data.
32973297
*
3298-
* See https://github.com/aws/s2n-tls/blob/main/docs/USAGE-GUIDE.md#using-early-data--0rtt
3298+
* See https://github.com/aws/s2n-tls/blob/main/docs/usage-guide/topics/ch14-early-data.md
32993299
* for usage and examples. DO NOT USE unless you have considered the security issues and
33003300
* implemented mitigation for anti-replay attacks.
33013301
*
@@ -3312,7 +3312,7 @@ S2N_API int s2n_send_early_data(struct s2n_connection *conn, const uint8_t *data
33123312
/**
33133313
* Called by the server to begin negotiation and accept any early data the client sends.
33143314
*
3315-
* See https://github.com/aws/s2n-tls/blob/main/docs/USAGE-GUIDE.md#using-early-data--0rtt
3315+
* See https://github.com/aws/s2n-tls/blob/main/docs/usage-guide/topics/ch14-early-data.md
33163316
* for usage and examples. DO NOT USE unless you have considered the security issues and
33173317
* implemented mitigation for anti-replay attacks.
33183318
*

bin/s2nc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ void usage()
6161
fprintf(stderr, " Sets the application protocols supported by this client, as a comma separated list.\n");
6262
fprintf(stderr, " -c [version_string]\n");
6363
fprintf(stderr, " --ciphers [version_string]\n");
64-
fprintf(stderr, " Set the cipher preference version string. Defaults to \"default\". See USAGE-GUIDE.md\n");
64+
fprintf(stderr, " Set the cipher preference version string. Defaults to \"default\" \n");
6565
fprintf(stderr, " --enter-fips-mode\n");
6666
fprintf(stderr, " Enter libcrypto's FIPS mode. The linked version of OpenSSL must be built with the FIPS module.\n");
6767
fprintf(stderr, " -e,--echo\n");

bin/s2nd.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ void usage()
145145
fprintf(stderr, " Sets a single application protocol supported by this server.\n");
146146
fprintf(stderr, " -c [version_string]\n");
147147
fprintf(stderr, " --ciphers [version_string]\n");
148-
fprintf(stderr, " Set the cipher preference version string. Defaults to \"default\". See USAGE-GUIDE.md\n");
148+
fprintf(stderr, " Set the cipher preference version string. Defaults to \"default\" \n");
149149
fprintf(stderr, " --enter-fips-mode\n");
150150
fprintf(stderr, " Enter libcrypto's FIPS mode. The linked version of OpenSSL must be built with the FIPS module.\n");
151151
fprintf(stderr, " --cert\n");

docs/BUILD.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,21 @@ cmake --install build
6868

6969
Note that we currently do not support building on Windows. See https://github.com/aws/s2n-tls/issues/497 for more information.
7070

71-
See the [s2n-tls usage guide](USAGE-GUIDE.md#consuming-s2n-tls-via-cmake) for instructions on how to include s2n-tls in your CMake project.
71+
## Consuming s2n-tls via CMake
72+
73+
s2n-tls ships with modern CMake finder scripts if CMake is used for the build. To take advantage of this from your CMake script, all you need to do to compile and link against s2n-tls in your project is:
74+
75+
````bash
76+
find_package(s2n)
77+
78+
....
79+
80+
target_link_libraries(yourExecutableOrLibrary AWS::s2n)
81+
````
82+
83+
And when invoking CMake for your project, do one of two things:
84+
1. Set the `CMAKE_INSTALL_PREFIX` variable with the path to your s2n-tls build.
85+
2. If you have globally installed s2n-tls, do nothing, it will automatically be found.
7286

7387
## Configuring the s2n-tls build
7488

docs/DEVELOPMENT-GUIDE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
If you are curious about the internals of s2n-tls, or interested in contributing to
44
s2n-tls, this document is for you. If instead you are interested in using s2n-tls in an application
5-
that you are developing, please see the accompanying [Usage Guide](https://github.com/aws/s2n-tls/blob/main/docs/USAGE-GUIDE.md).
5+
that you are developing, please see the accompanying [Usage Guide](usage-guide).
66

77
## s2n-tls's development principles
88

docs/FAQ.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,23 @@ higher than "TLS1.2" for similar reasons.
1515
If the client does support TLS1.3, it will include that information in the ClientHello
1616
"supported_versions" extension instead of setting any of the legacy version fields.
1717

18-
s2n-tls offers [methods](USAGE-GUIDE/#protocol-version) to retrieve accurate protocol versions.
18+
s2n-tls offers [methods](usage-guide/topics/ch04-connection.md) to retrieve accurate protocol versions.
1919

2020
### Why isn't my connection using TLS1.3?
2121
There are several possible reasons:
22-
* Are you using a security policy that supports TLS1.3? See [security policies](USAGE-GUIDE.md/#security-policies).
22+
* Are you using a security policy that supports TLS1.3? See [security policies](usage-guide/topics/ch06-security-policies.md).
2323
* Are you verifying the connection version correctly? See [the previous question](FAQ.md#why-is-my-connection-using-tls10).
2424
* Are you using a libcrypto library that supports TLS1.3? Modern libcrypto libraries support the algorithms needed for TLS1.3, but older libraries like Openssl 1.0.2 do not. If s2n-tls is built with Openssl 1.0.2, TLS1.3 is unlikely to be negotiated.
2525
* Does your peer support TLS1.3? If your peer does not support TLS1.3, TLS1.3 will not be negotiated.
2626

2727
### Why is the TLS handshake failing on validating my peer's certificate?
28-
Have you already configure a trust store to be able to trust your peer's certificate? If so it may be necessary to implement `s2n_verify_host_fn` as the default behavior may not work for your use case. See the [certificates](USAGE-GUIDE.md/#certificates-and-authentication) section for detailed instructions on verifying a peer's certificate.
28+
Have you already configure a trust store to be able to trust your peer's certificate? If so it may be necessary to implement `s2n_verify_host_fn` as the default behavior may not work for your use case. See the [certificates](usage-guide/topics/ch09-certificates.md) section for detailed instructions on verifying a peer's certificate.
2929

3030
### Why is s2n hanging for so long before erroring?
31-
s2n-tls sleeps for a random period between 10 and 30 seconds after specific errors occur to avoid leaking any secret information via timing data. This technique is called blinding and it is utilized to prevent timing side-channel attacks. See [blinding](USAGE-GUIDE.md/#blinding).
31+
s2n-tls sleeps for a random period between 10 and 30 seconds after specific errors occur to avoid leaking any secret information via timing data. This technique is called blinding and it is utilized to prevent timing side-channel attacks. See [blinding](usage-guide/topics/ch03-error-handling.md#blinding).
3232

3333
### Which security policy should I use if I want to make sure that it will never be altered?
34-
Our numbered security policies are guaranteed to never change. We will not alter or update them based on changing cryptography standards. However, our named security policies (like “default” or “default_tls13”) change based on new cryptography standards that come out. See [security policies](USAGE-GUIDE.md/#security-policies).
34+
Our numbered security policies are guaranteed to never change. We will not alter or update them based on changing cryptography standards. However, our named security policies (like “default” or “default_tls13”) change based on new cryptography standards that come out. See [security policies](usage-guide/topics/ch06-security-policies.md).
3535

3636
### Why does s2n-tls have a dependency on OpenSSL? Isn't s2n-tls a replacement for OpenSSL?
3737
OpenSSL includes both a TLS library, called libssl, and a cryptography library, called libcrypto. s2n-tls implements a TLS library, but does not implement a cryptography library. Instead, s2n-tls links to a separate libcrypto in order to perform cryptographic operations. Libcryptos other than OpenSSL can be used, such as [AWS-LC](https://github.com/aws/aws-lc).

0 commit comments

Comments
 (0)